0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_student.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Student delete | OFMSP</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="../style.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="../images/icon.ico" /> <style type="text/css"> <!-- #apDiv2 { position:absolute; width:66px; height:36px; z-index:1; left: 708px; top: 300px; } .style6 { color: #660000; font-weight: bold; } --> </style> </head> <body> <p><?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; //MySql connection //require_once BASE_DIR."/Proposels/imagePath.php"; require_once BASE_DIR."/Proposels/imagePath.php"; ?> <!--<div id="headerbg"> <div id="headerblank">--> <?php include("include/first_userheader.php"); $id=$_GET['id ']; if(isset($_POST['Delete'])) { $u_id=@$_SESSION['user_id']; $p_id=@$_SESSION['project_id']; $Emp_id=$_POST['txtempid']; $Emp_name = $_POST['txtempname']; $sql="select * from student where user_id='$u_id' and s_id ='$Emp_id'"; $sql=mysql_query($sql); while($row=mysql_fetch_array($sql)) { $empdb_photo = $row['file']; } $DelFilePath = ROOT_DIR . $empdb_photo; if (file_exists($DelFilePath)) { unlink ($DelFilePath); } //---delete from employee------ $sql="delete from student where user_id='$u_id' and s_id ='$Emp_id'"; mysql_query($sql); $message="Delete successfully.."; $url=$server_ip."/USER/search_student.php?message=$message"; echo "<script>window.location='$url'</script>"; } ?> </div> </div> </p> <form action="delete_student.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <div align="center" class="style6">Delete Employee Details</div> <p align="center"> </p> <div id="apDiv1"><a href="search_emp.php"></a></div> <table width="415" align="center"> <tr> <td width="106"><div align="right" class="projectboldtxt"> <div align="left" class="projectboldtxt">Student ID</div> </div></td> <td width="339"><label> <input type="text" name="txtempid" id="txtempid" value="<?php echo $_GET['id'];?>" readonly="readonly"/> </label></td> </tr> <tr> <td class="projectboldtxt">Student name</td> <td><input type="text" name="txtempname" id="txtempname" value="<?php echo $_GET['name'];?>" readonly="readonly"/></td> </tr> </table> <p> </p> <table width="435" align="center"> <tr> <td width="212" class="projectboldtxt"> Do you want to delete the file...?</td> <td width="233"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_student.php" class="projectboldtxt style2">Back</a></label></td> </tr> </table></form> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </div> <?php include "include/footer.php"; ?> </p> </body> </html>