-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewadmin.php
75 lines (70 loc) · 2.14 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
<?php
include("header.php");
if(!isset($_SESSION['adminid']))
{
echo "<script>window.location='adminlogin.php';</script>";
}
if(isset($_GET['delid']))
{
$sqldel = "DELETE FROM admin WHERE adminid='" . $_GET['delid'] . "'";
$qsqldel = mysqli_query($con,$sqldel);
echo mysqli_error($con);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Admin Record deleted successfully..');</script>";
echo "<script>window.location='viewadmin.php';</script>";
}
}
?>
<main id="main">
<!-- ======= Breadcrumbs ======= -->
<section class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>View Admin</h2>
<ol>
<li><a href="index.php">Home</a></li>
<li>View Admin</li>
</ol>
</div>
</div>
</section><!-- End Breadcrumbs -->
<section class="inner-page pt-4">
<div class="container">
<a href="#" class="back" onclick="window.history.back()" >« Back</a>
<p>
<h4 style="text-align:right;">Search Records Here<i class="fa fa-down" aria-hidden="true"></i></i></h4>
<table id="datatableplugin" class="table table-bordered" align=center>
<thead align=center>
<tr>
<th>Admin Name</th>
<th>Email ID</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql ="SELECT * FROM admin";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
while($rs = mysqli_fetch_array($qsql))
{
echo "
<tr align=center>
<td>" . $rs['adminname'] . "</td>
<td>" . $rs['emailid'] . "</td>
<td><a href='admin.php?editid=$rs[adminid]' class='btn btn-success' style='width:30%;background-color:#0dcaf0'>Edit</a> <a href='viewadmin.php?delid=$rs[adminid]' class='btn btn-danger' style='width:30%;' onclick='return confirmdel()' >Delete</a></td>
</tr>
";
}
?>
</tbody>
</table>
<div class="text-center">
<a href='admin.php' name="btnsubmit" class="btn btn-success btn-lg" style="background-color: #71c55d;">Add Admin</a>
</div>
</p>
</div>
</section>
</main><!-- End #main -->
<?php include("footer.php"); ?>