예제 #1
0
파일: software.php 프로젝트: hughnguy/php
        $equip->showDiscarded = true;
    }
    $data = $equip->listItems($SESSION->department);
    foreach ($data as $key => $d) {
        $data[$key]['tag'] = $equip->listTags($data[$key]['soft_id']);
    }
    $allTags = $equip->listAllTags();
    $licenses = $equip->listLicenses();
    $departments = $equip->listDepartments();
    $cpulist = $equip->listcpu();
    $render = true;
    $l10nFile = 'l10n/software.php';
    $viewFile = 'views/software.php';
} elseif ($_GET['page'] === "fetch") {
    //Fetch specific software information
    $editdata = $equip->fetchItem($_POST['soft_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'] === 'csv') {
    require_once FS_PHP . '/csv.php';
    if (!isset($_GET['status'])) {
        $_GET["status"] = 0;