<?php
 
include_once('EmployeeDAL.php');
 
$employeeDal = new EmployeeDAL();
 
 
if(isset($_GET['delete'])){
 
    $employeeDal->deleteEmployee($_GET['delete']);
 
    header("Status: 200");
 
    header("Location: EmployeeDAL.php");
 
}
 
?>
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 
        "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
 
<head>
 
    <title>List Employee</title>
 
    <link rel="stylesheet" type="text/css" href="style.css">
 
</head>
 
<body>
 
<div id="container">
 
    <h1>List All Employee</h1>
 
 
    <table width="100%" class="listing_table">
 
        <thead>
 
        <tr>
 
            <th>Name</th>
 
            <th>Edit</th>
 
            <th>Delete</th>
 
        </tr>
 
        </thead>
 
        <tbody>
 
        <?php
 
    $get_all_employee = $employeeDal->getEmployee();
 
    foreach ($get_all_employee as $result)
 
    {
 
 
        ?>
 
        <tr>
 
            <td><?php echo $result['Name'];?></td>
 
            <td>
 
                <a href="employee_detail.php?id=<?php echo $result['EmployeeID'];?>">Edit</a>
 
            </td>
 
            <td>
 
                <a href="index.php?delete=<?php echo $result['EmployeeID']; ?>">Delete</a>
 
            </td>
 
        </tr>
 
        <?php
 
 
 
    }
 
    ?>
 
    <tr>
 
            <td colspan="3"><a href="employee_detail.php">Add New Employee</a> </td>
 
        </tr>
 
</tbody>
 
</table>
 
</div>
 
</body>
 
</html>
 
 |