-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_teacher.php
111 lines (91 loc) · 3.12 KB
/
delete_teacher.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
include 'db_conn.php';
include 'search.php';
if(isset($_POST['delete'])){
$query = "DELETE FROM teacherlogin where ID = $_POST[id]";
if(mysqli_query($con, $query)){
echo '<script type ="text/javascript">
alert("Data deleted successfully");
</script>';
}
else{
echo '<script type ="text/javascript">
alert("Failed to delete data");
</script>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="dashboard.css">
<!---------Bootstrap-------------->
<!-- Font Awesome -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
rel="stylesheet"
/>
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
rel="stylesheet"
/>
<!-- MDB -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.10.2/mdb.min.css"
rel="stylesheet"
/>
<!-- MDB -->
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.10.2/mdb.min.js"
></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
</head>
</head>
<body>
<!-----------sidenav------------------>
<section>
<body>
<div class="sidebar">
<a href="a_dashboard.php" >Home</a>
<a href="department.php">Departments</a>
<a href="add_teacher.php">Add Teacher</a>
<a href="view_teacher.php">View Teachers</a>
<!-- <a href="edit_teacher.php">Edit Teacher</a> -->
<a class="active" href="delete_teacher.php">Delete Teacher</a>
<a href="addressleave.php">Grant Leave</a>
<a href="index.php">Logout</a>
</div>
<div class="content">
<!----------Search------------>
<form method="POST" action="#">
<h2>Admin Dashboard</h2>
<div class="input-group rounded">
<input type="search" class="form-control rounded" placeholder="Search" aria-label="Search" aria-describedby="search-addon" />
<button name="bsearch" type="submit" class="input-group-text border-0" id="search-addon">
<i class="fas fa-search"></i>
</button>
</div><br>
<h5>Enter Teacher ID:</h5><br>
<div class="id">
<input name="id"
type="number"
class="form-control"
placeholder="ID"
aria-label="ID"
aria-describedby="basic-addon2"
/></div><br>
<button type="submit" name="delete" class="btn btn-danger">Delete</button>
</form>
</div>
</div>
</section>
</body>
</html>