forked from Pavani23Wasana/ProjectSalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adm_staff_List.php
99 lines (87 loc) · 3.62 KB
/
adm_staff_List.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
<?php
include 'adm_staff_action.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewpoint" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Staff Details</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/x.css">
<link rel="stylesheet" type="text/css" href="css/fontawesome.css">
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-12">
<hr>
<?php if(isset($_SESSION['response'])){ ?>
<div class="alert alert-<?= $_SESSION['res_type']; ?> alert-dismissible text-center">
<?php header("refresh:4, url = adm_staff_list.php");?>
<button type="button" class="close" data-dismiss="alert" >×</button>
<b><?= $_SESSION['response']; ?></b>
</div>
<?php } unset($_SESSION['response']); ?>
</div>
</div>
<div class="row" style="background: #e6e6ff; margin-bottom:22px;">
<div class="col-md-9">
<h2 class="text-center text-info" style="margin-top: 12px;" > Employee Details</h2>
</div>
<div class="col-md-3">
<div class= "form-group">
<a href="adm_staff_add.php">
<input type="submit" name="add" class="btn btn-primary btn-block" style="margin-top: 12px; margin-bottom: 12px;" value="Add Employee"></a>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10 mx-auto">
<!-- To pass the data to the displaying table -->
<?php
$query="SELECT * FROM staff";
$stmt=$conn->prepare($query);
$stmt->execute();
$result=$stmt->get_result();
?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th>Image</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Role</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<!-- To pass the data to the displaying table -->
<?php while($row=$result->fetch_assoc()){ ?>
<tr>
<td><?= $row['id']; ?></td>
<td><img src="<?= $row['photo']; ?>" alt="" width="25"></td>
<td><?= $row['name']; ?></td>
<td><?= $row['email']; ?></td>
<td><?= $row['phone']; ?></td>
<td><?= $row['role']; ?></td>
<td>
<a href="adm_staff_details.php?details=<?= $row['id']; ?>" class="badge badge-primary p-2">Details</a> |
<a href="adm_staff_action.php?delete=<?= $row['id']; ?>" class="badge badge-danger p-2" onclick="return confirm('Do you want to delete this record?');">Delete</a> |
<a href="adm_staff_add.php?edit=<?= $row['id']; ?>" class="badge badge-success p-2">Edit</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>