Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Shibly  >  Simple DAL  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: sample file
Class: Simple DAL
Simple MySQL database abstraction layer
Author: By
Last change: code updated
Date: 2012-02-11 17:14
Size: 1,413 bytes
 

Contents

Class file image Download
<?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>