} $data = $equip->listItems($SESSION->department, $_GET["status"]); if (count($data) != 0) { $output = new CSV($data); $output->generate(); } } elseif ($_GET['page'] === 'export-selected') { require_once FS_PHP . '/csv.php'; $data = $equip->listItemscsv(explode(',', $_GET['ids'])); $output = new CSV($data); $output->generate(); } elseif ($_GET['page'] === 'scanlabel' && !empty($_GET['no'])) { header("Location: cpu.php?focus=" . $_GET['no']); exit; } elseif ($_GET['page'] === 'getroom') { $data = $equip->listAllRooms($_POST['building_id']); header('Content-Type: application/json; charset=utf-8'); echo json_encode($data); exit; } elseif ($_GET['page'] === 'insertroom') { $data = $equip->insertRoom($_POST); header('Content-Type: application/json; charset=utf-8'); echo json_encode($data); exit; } else { require_once FS_PHP . '/error.php'; } //============================================================================================ // View //============================================================================================ $actions = array('add', 'edit', 'check-ip', 'csv', 'export-selected', 'export-selected-label', 'cpulabel');