-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditstaff.php
90 lines (85 loc) · 2.36 KB
/
editstaff.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
<?php
include_once 'logincheck.php';
?>
<?php
function getData(){
include_once 'master_db.php';
$db = new DB();
$res = $db->getAllStaff();
if($res->num_rows >0){
while($row = $res->fetch_assoc()){
$sid = $row['staffID'];
$name = $row['staffName'];
$phone = checkEmpty($row['staffPhone']);
$address = checkEmpty($row['staffAddress']);
$email = checkEmpty($row['staffEmail']); ?>
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $phone; ?></td>
<td><?php echo $address; ?></td>
<td><?php echo $email; ?></td>
<td id="option"><a href="editstaffdata.php?id=<?php echo $sid; ?>"> <img id="icon" src="icon/edit.png"></a></td>
</tr> <?php
}
}
else{ ?>
<tr>
<td colspan = "8">NO DATA FOUND</td>
</tr><?php
}
}
function checkEmpty($data){
if (empty($data)) {
$data = "NOT GIVEN";
}
return $data;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Customer Edit</title>
<link rel="stylesheet" href="css/style-body.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<?php include_once 'navbarresource.php'; ?>
<style>
#option{
color: #16A085;
}
a{
text-decoration: none;
}
#icon{
height: 20px;
width: 20px;
}
table{
font-size: 15px;
}
</style>
</head>
<body id="body">
<?php include 'navigationbar.php'; ?>
<section class="py-5">
<div class="container">
</div>
</section>
<table class= 'table table-striped' style= 'text-align: center;'>
<center><div style='color:#239B56; font-size: 25px; margin-bottom: 20px;'>STAFF INFORMATION</div></center>
<thead>
<tr>
<th>Name</th>
<th>Phone</th>
<th>Address</th>
<th>Email</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
<?php getData(); ?>
</tbody>
</table>
</body>
</html>