-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewadmin.php
110 lines (61 loc) · 1.8 KB
/
viewadmin.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
<?php
session_start();
if(!isset($_SESSION['name'])) {
header("location: login.php");
}
else {
?>
<?php include("header.php"); ?>
<?php
if(isset($_GET['view_admin'])) {
?>
<div class="container-fluid" style="background-color:lavenderblush";>
<h1 class="h1_index text-center">Admin Details</h1>
<br>
<a class="a_color" href="admin.php"><button type="button" class="btn btn-primary btn-lg">Admin Dashboard</button></a>
<br>
<div class="col-sm-10">
<h4>Note: Password is confidential hence can not be viewed.</h4>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
<th>Username</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
//make connection
$con = mysqli_connect('localhost','root','','eattendance');
if ($con->connect_error){
die("connection error");
}
else{
echo "";
}
//select database
$sql="SELECT * FROM `admin` ";
$record = mysqli_query($con,$sql);
while($post=mysqli_fetch_assoc($record)) {
?>
<tr>
<td><?php echo $post['id']; ?></td>
<td><?php echo $post['name']; ?></td>
<td><?php echo $post['email']; ?></td>
<td><?php echo $post['username']; ?></td>
<td><a href="editadmin.php?edit=<?php echo $post['id']; ?>">edit</a></td>
<td><a href="deleteadmin.php?delete=<?php echo $post['id']; ?>">delete</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php } ?>
<!-- details end -->
<?php } ?>
<?php include("footer.php"); ?>