-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathread_employee.php
66 lines (61 loc) · 2.15 KB
/
read_employee.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
<?php include('connections.php');
include('header.php');
error_reporting(0); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1 class="text-center text-primary">Read Employee</h1>
<?php
$sql="select * from employee";
$result=mysqli_query($conn,$sql);
if(mysqli_num_rows($result)>0){
?>
<table class="table table-bordered border-primary">
<tr class="text-center">
<th>ID</th>
<th>FIRST NAME</th>
<th>LAST NAME</th>
<th>GENDER</th>
<th>EMAIL</th>
<th>DESIGNATION</th>
<th>CONTACT</th>
<th>CNIC</th>
<th>DATE OF BIRTH</th>
<th>ACTIONS</th>
</tr>
<?php
while($data=mysqli_fetch_array($result)){
?>
<tr class="text-center">
<td><?php echo $data['EMPID']; ?></td>
<td><?php echo $data['EMP_FNAME']; ?></td>
<td><?php echo $data['EMP_LNAME']; ?></td>
<td><?php echo $data['GENDER']; ?></td>
<td><?php echo $data['EMP_EMAIL']; ?></td>
<td><?php echo $data['DESIGNATION']; ?></td>
<td><?php echo $data['EMP_CONTACT']; ?></td>
<td><?php echo $data['EMP_CNIC']; ?></td>
<td><?php echo $data['DOB']; ?></td>
<td>
<a class="btn btn-outline-primary" href="update_employee.php?id=<?php echo $data['EMPID']; ?>">Update</a>
<a class="btn btn-outline-danger" onClick="javascript: return confirm('Please confirm deletion');" href="delete_employee.php?id=<?php echo $data['EMPID']; ?>">Delete</a>
<a class="btn btn-outline-primary" href="create_dependents.php?id=<?php echo $data['EMPID']; ?>">Add Dependents</a>
</td>
</tr>
<?php } ?>
</table>
<?php }
else
{
echo '<h1 class="text-center text-danger">No Record found :(</h1>';
}
mysqli_close($conn);
?>
</body>
</html>