-
Notifications
You must be signed in to change notification settings - Fork 2
/
display_lib.php
75 lines (71 loc) · 1.72 KB
/
display_lib.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
<?PHP
session_start();
$state = $_SESSION['state'];
$slevel = $_SESSION['slevel'];
if(!($state="logged in" && ($slevel==1||$slevel==2)))
{
session_destroy();
header('location:login.php?code=1');
}
else
{
if(isset($_POST['return']))
header('location:admin_home.php');
}
?>
<html>
<head>
<title>
Teacher List
</title>
<link rel="stylesheet" type="text/css" href="style/common.css">
<link rel="stylesheet" type="text/css" href="style/display_lists.css">
</head>
<body>
<div class="main_div">
<center>
<table class="large">
<tr>
<th> Librarian ID </th>
<th> Name </th>
<th> Address </th>
<th> Phone </th>
<th> E-Mail </th>
<th> Account Username </th>
<th> Account Password </th>
<th></th>
</tr>
<?PHP
$con = new mysqli("localhost","root","","lib_man");
$com = "select * from librarians;";
$res = mysqli_query($con,$com);
while($row= mysqli_fetch_array($res))
{
?>
<tr>
<td> <?PHP echo $row[0] ?> </td>
<td> <?PHP echo $row[1] ?> </td>
<td> <?PHP echo $row[2] ?> </td>
<td> <?PHP echo $row[3] ?> </td>
<td> <?PHP echo $row[4] ?> </td>
<td> <?PHP $com2 = "select cid from credentials where lid=$row[0];";
$res2= mysqli_query($con,$com2);
$row2 = mysqli_fetch_array($res2);
echo $row2[0]; ?> </td>
<td></td>
<td style="background-color:rgba(200,0,0,0.7);"> <a href="edit_lib_details.php?id=<?PHP echo $row[0]?>"> Edit Details </a></td>
</tr>
<?PHP
}
?>
</table>
<br><br>
<div class="hr"></div>
<form method="post">
<input type="submit" name="return" value="Return to Menu">
<div class="hr"></div>
</form>
</center>
</div>
</body>
</html>