示例#1
0
$status;
$keyHandlers = array();
$keyData = array();
$keyTitle = array();
//infoKey generates a set of key names to store the key values
$serviceKey = array();
//heading is the array of headlines in the table
$headings = array("Service ID", "Customer", "Service Name", "Service Type");
// Specify Service status
$status_array = array('Testing' => 'Testing', 'In Production' => 'In Production', 'Out of Service' => 'Out of Service');
//titles are the subcategories for each headline. In the array "heading" means make a room there for the headline
$titles = array();
//display the status for success and failures
switch (success) {
    case $_GET['update']:
        $serviceForm->success("Updated successfully");
        break;
    case $_GET['add']:
        $serviceForm->success("Added new data successfully");
        break;
    case $_GET['delete']:
        $serviceForm->success("Deleted data successfully");
        break;
}
//if the user is editting or viewing and ID, check if there is an update being made. If there are no updates then show them the service information form.
if ($_GET['action'] == edit && $_SESSION['access'] >= 50 || $_GET['action'] == showID) {
    //get the new service corresponding to the ID
    $services = new Service($_GET['ID']);
    //checks to see if this is a valid ID or not
    if ($services->get_service_id() == "") {
        $link = $_SERVER['PHP_SELF'] . "?action=showID&ID=" . $_GET['ID'];