-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathd_delete.php
executable file
·79 lines (69 loc) · 1.76 KB
/
d_delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="includes/main.css" type="text/css" />
<title>E-Learning: Delete Department</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<div id="top">
<div id="inner_top">
<img src="images/logo_dktes.gif"/>
</div>
</div>
<div id="line">
</div>
<?php include ('includes\admin_main_menu.php'); ?>
<div id="mid">
<img src="images/Ichalkarnji.jpg"/>
</div>
<div id="text">
<b>Delete Department</b>
<?php session_start();
if(!empty($_SESSION['message']))
echo $_SESSION['message'];
$_SESSION['message'] = "";
?>
<form action="d_delete.php" method="post">
<table>
<tr>
<td>Department: </td>
<td>
<select name="branch">
<?php
include "dbconnection.php";
$query = "SELECT * FROM department";
$result = mysql_query($query,$con) or die();
while($row = mysql_fetch_array($result))
{
echo '<option>'.$row['branch'] .'</option>';
}
?>
</select>
</td>
<td colspan="2" align="center"><input type="submit" name="submit" value="Delete">
</td>
</tr>
</table>
</form>
</div>
<?php
include "dbconnection.php";
if($_POST)
{
$ql = 'DELETE FROM department WHERE branch='.'"'.$_POST['branch'].'"';
mysql_query($ql, $con) or die();
echo '<html><head><script type="text/javascript">alert("Deleted.");</script></head></html>';
}
mysql_close($con);
?>
<div id="line">
</div>
<?php include ("includes/bottom_line.php"); ?>
</body>
</html>