-
Notifications
You must be signed in to change notification settings - Fork 0
/
employee_index.php
45 lines (43 loc) · 1.34 KB
/
employee_index.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
<?php include ('includes/header.php'); ?>
<?php include ("includes/employee_connection.php"); ?>
<?php
// Get all Employee
$a = new EmployeeConnection;
$employees = $a->getEmployees();
?>
<div class="container">
<div class="row">
<div class="page-header" style="margin: 0px;">
<h1>Employee <small>Add / Remove the employee</small></h1>
</div>
</div>
</br>
</div>
<div class="container">
<div class="row">
<?php
if (is_array($employees) || is_object($employees))
{
echo "<table class='table table-bordered'>";
echo "<tr><th>SSN</th><th>Name (TH)</th><th>Birth Date</th><th>Address</th><th>Sex</th><th>Salary</th><th>Manager</th><th>Department</th></tr>";
foreach ($employees as $result) {
echo "<tr typeid='".$result['SSN']."'><td><a href='employee_show.php?ssn=".$result['SSN']."'>".$result['SSN']."</a></td>";
echo "<td>".$result['FNAME']."</td>";
echo "<td>".$result['BDATE']."</td>";
echo "<td>".$result['ADDRESS']."</td>";
echo "<td>".$result['SEX']."</td>";
echo "<td>".$result['SALARY']."</td>";
echo "<td>";
echo $a->getEmployee($result['SUPER_SSN'])["FNAME"];
echo "</td>";
echo "<td>";
echo $a->getDepartment($result['DNO'])["DNAME"];
echo "</td>";
echo "</tr>";
}
echo "</table>";
}
?>
</div>
</div>
<?php include ('includes/footer.php'); ?>