Beispiel #1
0
    $makes = $equip->listMakes();
    $employees = $equip->listEmployees();
    $departments = $equip->listDepartments();
    $listStatus = $equip->listStatus();
    $allBuildings = $equip->listAllBuildings();
    $render = true;
    $l10nFile = 'l10n/cpu.php';
    $viewFile = 'views/cpu.php';
} elseif ($_GET['page'] === "fetch") {
    //Fetch specific computer information
    $editdata = $equip->fetchItem($_POST['cpu_id']);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($editdata);
    exit;
} elseif ($_GET['page'] === "add") {
    $data = $equip->addItem($_POST);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($data);
} elseif ($_GET['page'] === 'edit') {
    $data = $equip->editItem($_POST);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($data);
} elseif ($_GET['page'] === 'check-ip') {
    $result = $equip->doesIPAddressExist($_POST['cpu_ip_addr']);
    echo $result[0]["count"];
} elseif ($_GET['page'] === 'csv') {
    require_once FS_PHP . '/csv.php';
    if (!isset($_GET['status'])) {
        $_GET["status"] = 0;
    }
    $data = $equip->listItems($SESSION->department, $_GET["status"]);