echoResponse(200, $response); }); // // URL: /api/v1/manufacturer // Method: GET // Params: none // Returns: All defined manufacturers // $app->get('/manufacturer', function () use($app) { $man = new Manufacturer(); $response['error'] = false; $response['errorcode'] = 200; foreach ($app->request->get() as $prop => $val) { $man->{$prop} = $val; } $response['manufacturer'] = $man->GetManufacturerList(); echoResponse(200, $response); }); // // URL: /api/v1/zone // Method: GET // Params: none // Returns: All zones for which the user's rights have access to view // $app->get('/zone', function () use($app) { $zone = new Zone(); $response['error'] = false; $response['errorcode'] = 200; foreach ($app->request->get() as $prop => $val) { $zone->{$prop} = $val; }
$status = UpdateCustomValues($template, $status); } if ($status == __("Updated")) { $status = updatecdu($template, $status); $status = updatesensor($template, $status); } if ($status == __("Updated")) { $status = $template->ExportTemplate() ? __("Exported") : __("Error"); } break; default: // do nothing if the value isn't one we expect } } $templateList = $template->GetTemplateList(); $ManufacturerList = $manufacturer->GetManufacturerList(); $ManufacturerListByID = $manufacturer->GetManufacturerList(true); $mtList = MediaTypes::GetMediaTypeList(); $ccList = ColorCoding::GetCodeList(); $dcaList = DeviceCustomAttribute::GetDeviceCustomAttributeList(); $imageselect = '<div id="preview"></div><div id="filelist">'; $path = './pictures'; $dir = scandir($path); foreach ($dir as $i => $f) { if (is_file($path . DIRECTORY_SEPARATOR . $f)) { // Suppress the getimagesize because it will error out on non-image files @($imageinfo = getimagesize($path . DIRECTORY_SEPARATOR . $f)); if (preg_match('/^image/i', $imageinfo['mime'])) { $imageselect .= "<span>{$f}</span>\n"; } }
$template->OID3 = $_REQUEST['oid3']; $template->ATSStatusOID = $_REQUEST['atsstatusoid']; $template->ATSDesiredResult = $_REQUEST['atsdesiredresult']; $template->ProcessingProfile = $_REQUEST['processingprofile']; $template->Voltage = $_REQUEST["voltage"]; $template->Amperage = $_REQUEST["amperage"]; $template->NumOutlets = $_REQUEST["numoutlets"]; if ($_REQUEST['action'] == 'Create') { $template->CreateTemplate(); } else { $status = __("Updated"); $template->UpdateTemplate(); } } $templateList = $template->GetTemplateList(); $ManufacturerList = $manufacturer->GetManufacturerList(); $managed = $template->Managed ? " checked" : ""; $ats = $template->ATS ? " checked" : ""; ?> <!doctype html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE"> <meta http-equiv="EXPIRES" content="Mon, 01 Jan 1997 01:00:00 GMT"> <meta http-equiv="PRAGMA" content="NO-CACHE"> <title>openDCIM Cabinet Distribution Unit Templates</title> <link rel="stylesheet" href="css/inventory.php" type="text/css"> <link rel="stylesheet" href="css/jquery-ui.css" type="text/css">
<?php require_once "db.inc.php"; require_once "facilities.inc.php"; $subheader = __("Data Center Manufacturer Listing"); if (!$person->SiteAdmin) { // No soup for you. header('Location: ' . redirect()); exit; } $mfg = new Manufacturer(); // AJAX Start if (isset($_GET['getManufacturers'])) { header('Content-Type: application/json'); echo json_encode($mfg->GetManufacturerList()); exit; } if (isset($_GET['getTemplateCount']) && isset($_GET['ManufacturerID'])) { $temp = new DeviceTemplate(); $temp->ManufacturerID = $_GET['ManufacturerID']; header('Content-Type: application/json'); echo json_encode($temp->GetTemplateListByManufacturer()); exit; } if (isset($_POST['setManufacturer'])) { $mfg->ManufacturerID = $_POST['ManufacturerID']; $mfg->GetManufacturerByID(); $mfg->GlobalID = $_POST['GlobalID']; $mfg->Name = $_POST['Name']; $mfg->SubscribeToUpdates = isset($_POST['SubscribeToUpdates']) ? 1 : 0; if ($mfg->ManufacturerID == "") {
if ($mfg->Name != null && $mfg->Name != "") { if ($_POST["action"] == "Create") { if ($mfg->CreateManufacturer()) { header('Location: ' . redirect("device_manufacturers.php?ManufacturerID={$mfg->ManufacturerID}")); } else { $status = __("Error adding new manufacturer"); } } else { $status = __("Updated"); $mfg->UpdateManufacturer(); } } //We either just created a manufacturer or updated it so reload from the db $mfg->GetManufacturerByID(); } $mfgList = $mfg->GetManufacturerList(); ?> <!doctype html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>openDCIM Device Class Templates</title> <link rel="stylesheet" href="css/inventory.php" type="text/css"> <link rel="stylesheet" href="css/jquery-ui.css" type="text/css"> <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"> <!--[if lt IE 9]> <link rel="stylesheet" href="css/ie.css" type="text/css"> <![endif]--> <script type="text/javascript" src="scripts/jquery.min.js"></script>