-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewAdmin.php
70 lines (60 loc) · 1.74 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
<?php
//error_reporting(0);
include'functions/conect.php';
?>
<h1>Administrators</h1>
<table border="1" cellspacing="0" cellpadding="5px" class="table table-bordered table-striped table-condensed">
<tr>
<td><b>First Name</b></td>
<td><b>Last Name</b></td>
<td><b>Email Address</b></td>
<td><b>Branch</b></td>
<td><b>Gender</b></td>
<td><b>Action</b></td>
</tr>
<?php
//pagination
$pag = "SELECT id,fName,lName,email,branch,sex,accesslevel FROM chiefadministrator WHERE companyid = $comp";
$pagresult = $mysqli->query($pag);
$total = $pagresult->num_rows;
$page = ceil($total/$limit);
$sql = "SELECT id,fName,lName,email,branch,sex,accesslevel FROM chiefadministrator WHERE companyid = $comp order by id DESC limit $start,$limit";
$result = $mysqli->query($sql);
if($result->num_rows >0){
while($row = $result->fetch_assoc()){
if($row['accesslevel'] == 2){
?>
<tr class="success">
<td><?=$row['fName']?></td>
<td><?=$row['lName']?></td>
<td><?=$row['email']?></td>
<td><?=$row['branch']?></td>
<td><?=$row['sex']?></td>
<td>
<a href="deleteadmin.php?id=<?=$row['id']?>" class="btn btn-danger btn-flat">Delete</a>
</td>
</tr>
<?php
}
}
}else{
?>
<p><b style="color:red">No entries found!</b> please select add administrator to add new entries</p>
<?php
}
?>
</table>
<a href="chiefadmindash.php?con=regadministrator" class="btn btn-success btn-flat pull-right">Add Administrator</a>
<ul class="pagination">
<?php
if($id > 1){
?>
<li><a href="chiefadmindash.php?id=<?php echo ($id-1); ?>">Previous</a></li>
<?php } ?>
<?php for($i=1;$i<$page;$i++){ ?>
<li><a href="?id=<?php echo $i; ?>"><?php echo $i; ?></a></li>
<?php } ?>
<?php if($id != $page){ ?>
<li><a href="chiefadmindash.php?id=<?php echo ($id+1); ?>">Next</a></li>
<?php } ?>
</ul>