-
Notifications
You must be signed in to change notification settings - Fork 2
/
view_teacher.php
142 lines (122 loc) · 3.92 KB
/
view_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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<html>
<head>
<title>MANAGE ACCOUNTS PORTAL for HOD</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
</head>
<body>
<!-- Wrapper -->
<div id="wrapper">
<!-- Main -->
<div id="main">
<div class="inner">
<!-- Header -->
<header id="header">
<a href="index.html" class="logo"><strong>Geo Attendance</strong> by Govt. Polytechnic</a>
</header>
<br>
<h3>VIEW Teacher</h3>
<div class="table-wrapper">
<form action="view_teacher.php" method="get">
<table>
<thead>
<tr>
<th>USERNAME</th>
<th>NAME</th>
<th>DEPARTMENT</th>
</tr>
</thead>
<tbody>
<?php
include 'DB.php';
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if(!empty($_GET['check_list'])) {
foreach($_GET['check_list'] as $check) {
$sql = "DELETE FROM `TEACHER` WHERE `TEACHER`.`ID` = '".$check."'";
mysqli_query($conn, $sql);
$sql = "DELETE FROM `TIME_TABLE` WHERE TEACHER_ID` = '".$check."'";
mysqli_query($conn, $sql);
}
}
$sql = "SELECT * FROM TEACHER WHERE ID NOT IN (SELECT HOD_ID FROM DEPARTMENT) ORDER BY `NAME`, `DEPARTMENT_ID`";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
$rows = array();
while($row = mysqli_fetch_assoc($result)) {
echo'
<tr>
<td>'.$row['USERNAME'].'</td>
<td>'.$row['NAME'].'</td>
<td>'.$row['DEPARTMENT_ID'].'</td>
</tr>';
}
} else {
}
mysqli_close($conn);
?>
</tbody>
</table>
</form>
</div>
<!-- Sidebar -->
<div id="sidebar">
<div class="inner">
<!-- Menu -->
<nav id="menu">
<header class="major">
<h2>Menu</h2>
</header>
<ul>
<li>
<span class="opener">Teacher</span>
<ul>
<li><a href="CREATE_TEACHER.php">Create</a></li>
<li><a href="DELETE_TEACHER.php">Delete</a></li>
<li><a href="view_teacher.php">VIEW</a></li>
</ul>
</li>
<!-- <li>
<span class="opener">HOD</span>
<ul>
<li><a href="CREATE_HOD.php">Create</a></li>
<li><a href="DELETE_HOD.php">Delete</a></li>
</ul>
</li> -->
<li>
<span class="opener">CR</span>
<ul>
<li><a href="CREATE_CR.php">Create</a></li>
<li><a href="DELETE_CR.php">Delete</a></li>
<li><a href="view_cr.php">VIEW</a></li>
</ul>
</li>
</ul>
</nav>
<!-- Section -->
<section>
<header class="major">
<h2>Get in touch</h2>
</header>
<ul class="contact">
<li class="fa-envelope-o"><a href="#">principal@gpmumbai.ac.in</a></li>
<li class="fa-phone">090290 01925</li>
<li class="fa-home">49, Kherwadi, A.Y.Jung Marg, Bandra (East), Mumbai, Maharashtra 400051 </li>
</ul>
</section>
</div>
</div>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>