/**
 * Render cabinet properties into this view.
 *
 * The cabinet properties zone, row, model, maximum weight and installation date
 * are rendered to be for this page. It checks if the user is allowed to see the
 * content of the cabinet and only if the user does the information is provided.
 *
 * @param Cabinet $cab
 * @param CabinetAudit $audit
 * @param string $AuditorName
 */
function renderCabinetProps($cab, $audit, $AuditorName)
{
    $tmpDC = new DataCenter();
    $tmpDC->DataCenterID = $cab->DataCenterID;
    $tmpDC->GetDataCenter();
    $AuditorName = $AuditorName != '' ? "<br>{$AuditorName}" : "";
    $renderedHTML = "\t\t<table id=\"cabprop\">\n\t\t\t<tr><td>" . __("Last Audit") . ":</td><td id=\"lastaudit\">{$audit->AuditStamp}{$AuditorName}</td></tr>\n\t\t\t<tr><td>" . __("Model") . ":</td><td>{$cab->Model}</td></tr>\n\t\t\t<tr><td>" . __("Data Center") . ":</td><td>{$tmpDC->Name}</td></tr>\n\t\t\t<tr><td>" . __("Install Date") . ":</td><td>{$cab->InstallationDate}</td></tr>\n";
    if ($cab->ZoneID) {
        $zone = new Zone();
        $zone->ZoneID = $cab->ZoneID;
        $zone->GetZone();
        $renderedHTML .= "\t\t\t<tr><td>" . __("Zone") . ":</td><td>{$zone->Description}</td></tr>\n";
    }
    if ($cab->CabRowID) {
        $cabrow = new CabRow();
        $cabrow->CabRowID = $cab->CabRowID;
        $cabrow->GetCabRow();
        $renderedHTML .= "\t\t\t<tr><td>" . __("Row") . ":</td><td>{$cabrow->Name}</td></tr>\n";
    }
    $renderedHTML .= "\t\t\t<tr><td>" . __("Tags") . ":</td><td>" . renderTagsToString($cab) . "</td></tr>\n";
    //   This is out of context here and makes the information confusing.
    //    $renderedHTML .= '			<tr><td class="left">' . __('Front Edge') . ':</td>';
    //    $renderedHTML .= "<td class=\"right\">$cab->FrontEdge </td></tr>\n";
    $renderedHTML .= "\t\t</table>\n";
    return $renderedHTML;
}
Example #2
0
function builddclist($id = null)
{
    $dc = new DataCenter();
    $dcList = $dc->GetDCList();
    $idnum = '';
    if (!is_null($id)) {
        if ($id == "dc-front") {
            $idnum = 1;
        } elseif ($id == "dc-rear") {
            $idnum = 2;
        }
        $id = " name=\"{$id}\" id=\"{$id}\"";
    }
    $dcpicklist = "<select{$id}><option value=0>&nbsp;</option>";
    foreach ($dcList as $d) {
        $dcpicklist .= "<option value={$d->DataCenterID}>{$d->Name}</option>";
    }
    $dcpicklist .= '</select>';
    return $dcpicklist;
}
Example #3
0
    function _putresources()
    {
        parent::_putresources();
        $this->_putbookmarks();
    }
    function _putcatalog()
    {
        parent::_putcatalog();
        if (count($this->outlines) > 0) {
            $this->_out('/Outlines ' . $this->OutlineRoot . ' 0 R');
            $this->_out('/PageMode /UseOutlines');
        }
    }
}
if (!isset($_REQUEST['action'])) {
    $dc = new DataCenter();
    $dcList = $dc->GetDCList();
    ?>
<!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 Inventory Reporting</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">
Example #4
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("XML Output for CFD Simulation");
$datacenter = new DataCenter();
$dcList = $datacenter->GetDCList();
if (!isset($_REQUEST['datacenterid'])) {
    ?>
<!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 Data Center Inventory</title>
  <link rel="stylesheet" href="css/inventory.php" type="text/css">
  <link rel="stylesheet" href="css/jquery-ui.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>
  <script type="text/javascript" src="scripts/jquery-ui.min.js"></script>

  <script type="text/javascript">
	$(document).ready(function(){
		$('#generate').hide();
Example #5
0
        fclose($fh);
        print "<p>Anything shown here is just a notice.  It is not necessarily an error.  We will occasionally have to repeat database modifications that will fail and will show here. <b>This is behavior is to be expected</b>. Take note of any errors displayed in red then press F5 to reload this page until it goes to the configuration screen.</p>";
    } else {
        echo '<p class="success">All is well.  Please remove install.php to return to normal functionality</p>';
    }
    ?>
</body>
</html>


<?php 
    exit;
}
require_once "facilities.inc.php";
$dept = new Department();
$dc = new DataCenter();
$cab = new Cabinet();
function BuildFileList()
{
    $imageselect = '<div id="preview"></div><div id="filelist">';
    $path = './images';
    $dir = scandir($path);
    foreach ($dir as $i => $f) {
        if (is_file($path . DIRECTORY_SEPARATOR . $f) && round(filesize($path . DIRECTORY_SEPARATOR . $f) / 1024, 2) >= 4 && $f != "serverrack.png" && $f != "gradient.png") {
            $imageinfo = getimagesize($path . DIRECTORY_SEPARATOR . $f);
            if (preg_match('/^image/i', $imageinfo['mime'])) {
                $imageselect .= "<span>{$f}</span>\n";
            }
        }
    }
    $imageselect .= "</div>";
Example #6
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Data Center Cabinet Inventory");
// Get the list of departments that this user is a member of
$viewList = $person->isMemberOf();
$cab = new Cabinet();
$head = $legend = $zeroheight = $body = $deptcolor = "";
$deptswithcolor = array();
$dev = new Device();
$templ = new DeviceTemplate();
$tempDept = new Department();
$dc = new DataCenter();
$cabrow = new CabRow();
$cabrow->CabRowID = $_REQUEST['row'];
$cabrow->GetCabRow();
$cab->CabRowID = $cabrow->CabRowID;
$cabinets = $cab->GetCabinetsByRow();
$frontedge = $cabrow->GetCabRowFrontEdge();
if (isset($_GET["rear"])) {
    //opposite view
    $cabinets = array_reverse($cabinets);
}
//start loop to parse all cabinets in the row
foreach ($cabinets as $index => $cabinet) {
    $currentHeight = $cabinet->CabinetHeight;
    if ($config->ParameterArray["ReservedColor"] != "#FFFFFF" || $config->ParameterArray["FreeSpaceColor"] != "#FFFFFF") {
        $head .= "\t\t<style type=\"text/css\">\n\t\t\t.reserved{background-color: {$config->ParameterArray['ReservedColor']};}\n\t\t\t.freespace{background-color: {$config->ParameterArray['FreeSpaceColor']};}\n";
    }
    $side = null;
Example #7
0
 static function RowToObject($dbRow, $filterrights = true)
 {
     /*
      * Generic function that will take any row returned from the fac_Cabinet
      * table and convert it to an object for use in array or other
      */
     $cab = new Cabinet();
     $cab->CabinetID = $dbRow["CabinetID"];
     $cab->DataCenterID = $dbRow["DataCenterID"];
     $cab->Location = $dbRow["Location"];
     $cab->LocationSortable = $dbRow["LocationSortable"];
     $cab->AssignedTo = $dbRow["AssignedTo"];
     $cab->ZoneID = $dbRow["ZoneID"];
     $cab->CabRowID = $dbRow["CabRowID"];
     $cab->CabinetHeight = $dbRow["CabinetHeight"];
     $cab->Model = $dbRow["Model"];
     $cab->Keylock = $dbRow["Keylock"];
     $cab->MaxKW = $dbRow["MaxKW"];
     $cab->MaxWeight = $dbRow["MaxWeight"];
     $cab->InstallationDate = $dbRow["InstallationDate"];
     $cab->SensorIPAddress = $dbRow["SensorIPAddress"];
     $cab->SensorCommunity = $dbRow["SensorCommunity"];
     $cab->SensorTemplateID = $dbRow["SensorTemplateID"];
     $cab->MapX1 = $dbRow["MapX1"];
     $cab->MapY1 = $dbRow["MapY1"];
     $cab->MapX2 = $dbRow["MapX2"];
     $cab->MapY2 = $dbRow["MapY2"];
     $cab->FrontEdge = $dbRow["FrontEdge"];
     $cab->Notes = $dbRow["Notes"];
     $cab->U1Position = $dbRow["U1Position"];
     if ($filterrights) {
         $cab->FilterRights();
     }
     if ($cab->U1Position == "Default") {
         $dc = new DataCenter();
         $dc->DataCenterID = $cab->DataCenterID;
         $dc->GetDataCenter();
         if ($dc->U1Position == "Default") {
             global $config;
             $cab->U1Position = $config->ParameterArray["U1Position"];
         } else {
             $cab->U1Position = $dc->U1Position;
         }
     }
     return $cab;
 }
Example #8
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Data Center Statistics");
$cab = new Cabinet();
$dc = new DataCenter();
$dc->DataCenterID = $_REQUEST["dc"];
$dcStats = $dc->GetDCStatistics();
$height = 0;
$width = 0;
$ie8fix = "";
if (strlen($dc->DrawingFileName) > 0) {
    $mapfile = "drawings/{$dc->DrawingFileName}";
    if (file_exists($mapfile)) {
        list($width, $height, $type, $attr) = getimagesize($mapfile);
        // There is a bug in the excanvas shim that can set the width of the canvas to 10x the width of the image
        $ie8fix = "\n<script type=\"text/javascript\">\n\tfunction uselessie(){\n\t\tdocument.getElementById(\\'mapCanvas\\').className = \"mapCanvasiefix\";\n\t}\n</script>\n<style type=\"text/css\">\n.mapCanvasiefix {\n\t    width: {$width}px !important;\n}\n</style>";
    }
}
// If no mapfile is set then we don't need the buttons to control drawing the map.  Adjust the CSS to hide them and make the heading centered
if (strlen($dc->DrawingFileName) < 1 || !file_exists("drawings/{$dc->DrawingFileName}")) {
    $screenadjustment = "<style type=\"text/css\">.dcstats .heading > div { width: 100% !important;} .dcstats .heading > div + div { display: none; }</style>";
}
if ($config->ParameterArray["mUnits"] == "english") {
    $vol = __("Square Feet");
    $density = __("Watts per Square Foot");
} else {
    $vol = __("Square Meters");
    $density = __("Watts per Square Meter");
}
Example #9
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Data Center Statistics");
$cab = new Cabinet();
$dc = new DataCenter();
$dev = new Device();
//setting airflow
if (isset($_POST["cabinetid"]) && isset($_POST["airflow"]) && $person->SiteAdmin) {
    $cab->CabinetID = $_POST["cabinetid"];
    if ($cab->GetCabinet()) {
        if ($cab->CabRowID > 0 && isset($_POST["row"]) && $_POST["row"] == "true") {
            //update all row
            $cabinets = $cab->GetCabinetsByRow();
            foreach ($cabinets as $index => $cabinet) {
                $cabinet->FrontEdge = $_POST["airflow"];
                $cabinet->UpdateCabinet();
            }
        } else {
            //update cabinet
            $cab->FrontEdge = $_POST["airflow"];
            $cab->UpdateCabinet();
        }
    }
    exit;
}
if (isset($_POST['dc']) && (isset($_POST['getobjects']) || isset($_POST['getoverview']))) {
    $payload = array();
    if (isset($_POST['getobjects'])) {
        $cab->DataCenterID = $_POST['dc'];
Example #10
0
<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
$searchKey = $_REQUEST['key'];
//Remove control characters tab, enter, etc
$searchTerm = preg_replace("/[[:cntrl:]]/", "", $_REQUEST['search']);
//Remove any extra quotes that could get passed in from some funky js or something
$searchTerm = str_replace(array("'", '"'), "", $searchTerm);
$dc = new DataCenter();
$dcList = $dc->GetDCList();
$dev = new Device();
$esx = new ESX();
$cab = new Cabinet();
$pdu = new PowerDistribution();
$dept = new Department();
$resultcount = 0;
$title = __("Search Results");
if ($searchKey == 'serial') {
    $dev->SerialNo = $searchTerm;
    $devList = $dev->SearchDevicebySerialNo();
    $resultcount = count($devList);
    $title = __("Serial number search results for") . " &quot;{$searchTerm}&quot;";
} elseif ($searchKey == 'ip') {
    $dev->PrimaryIP = $searchTerm;
    $devList = $dev->SearchDevicebyIP();
    $resultcount = count($devList);
    $title = __("PrimaryIP search results for") . " &quot;{$searchTerm}&quot;";
} elseif ($searchKey == 'label') {
    $dev->Label = $searchTerm;
    $devList = $dev->SearchDevicebyLabel();
/**
 * Compute the full inventory on devices in the data centers and return the data
 *   center summary statistics
 *
 * @param PHPExcel_Worksheet $worksheet
 * @param array $DProps properties defined for the Excel document
 * @return (array|array|array|boolean)[]
 *      statistics array, device inventory, cabinet inventory
 */
function computeSheetBodyDCInventory($DProps)
{
    global $person;
    global $sessID;
    $dc = new DataCenter();
    $cab = new Cabinet();
    $device = new Device();
    $invData = array();
    $invCab = array();
    $sheetColumns = $DProps['DC Inventory']['Columns'];
    $cabinetColumns = $DProps['Rack Inventory']['Columns'];
    $devTemplates = DeviceTemplate::getTemplateListIndexedbyID();
    $deptList = Department::GetDepartmentListIndexedbyID();
    $contactList = $person->GetUserList('indexed');
    $limitedUser = false;
    $dcList = $dc->GetDCList();
    $Stats = array();
    // A little code to update the counter
    $percentDone = 0;
    $sectionMaxPercent = 40;
    $incrementalPercent = 1 / sizeof($dcList) * $sectionMaxPercent;
    foreach ($dcList as $dc) {
        $dcContainerList = $dc->getContainerList();
        $dcStats = array();
        $cab->DataCenterID = $dc->DataCenterID;
        $dcStats['Fl_Spc'] = $dc->SquareFootage;
        $dcStats['DesignPower'] = $dc->MaxkW;
        $dcStats['Watts'] = 0;
        $dcStats['Rk_Num'] = 0;
        $dcStats['Rk_UtT'] = 0;
        $dcStats['Rk_UtU'] = 0;
        $dcStats['Rk_UtE'] = 0;
        $dcStats['Rk_Res'] = 0;
        $cabList = $cab->ListCabinetsByDC();
        if (count($cabList) == 0) {
            // empty data center room
            $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
            $devSpec['DC Name'] = $dc->Name;
            $invData[] = $devSpec;
        } else {
            foreach ($cabList as $cab) {
                if (!$person->ReadAccess and $cab->AssignedTo == 0 or $cab->AssignedTo > 0 and !$person->canRead($cab->AssignedTo)) {
                    // User is not allowed to see anything in here
                    $limitedUser = true;
                    continue;
                }
                $zoneName = getZoneName($cab);
                $rowName = getRowName($cab);
                addRackStat($invCab, $cab, $cabinetColumns, $dc, $dcContainerList);
                $cab_height = $cab->CabinetHeight;
                if (mb_strtoupper($cab->Model) == 'RESERVED') {
                    $dcStats['Rk_Res']++;
                } else {
                    $dcStats['Rk_Num']++;
                }
                $dcStats['Rk_UtT'] += $cab_height;
                $device->Cabinet = $cab->CabinetID;
                $device_list = $device->ViewDevicesByCabinet();
                // empty cabinet
                if (count($device_list) == 0 && $cab->CabinetHeight > 0) {
                    $dcStats['Rk_UtE'] += $cab_height;
                    $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                    $devSpec['Zone'] = $zoneName;
                    $devSpec['Row'] = $rowName;
                    $devSpec['DC Name'] = $dc->Name;
                    $devSpec['Cabinet'] = $cab->Location;
                    $devSpec['Position'] = 1;
                    $devSpec['Height'] = $cab->CabinetHeight;
                    $devSpec['Device'] = '__EMPTY';
                    $invData[] = $devSpec;
                } else {
                    usort($device_list, 'cmpDevPos');
                    $low_idx = 1;
                    foreach ($device_list as $dev) {
                        if ($low_idx < $dev->Position) {
                            // range of empty slots
                            if ($dev->Position <= $cab_height) {
                                $height = $dev->Position - $low_idx;
                            } else {
                                $height = $cab_height - $low_idx + 1;
                            }
                            if ($height > 0) {
                                $dcStats['Rk_UtE'] += $height;
                                $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                                ${$devSpec}['Zone'] = $zoneName;
                                $devSpec['Row'] = $rowName;
                                $devSpec['DC Name'] = $dc->Name;
                                $devSpec['Cabinet'] = $cab->Location;
                                $devSpec['Position'] = $low_idx;
                                $devSpec['Height'] = $height;
                                $devSpec['Device'] = '__EMPTY';
                                $invData[] = $devSpec;
                            }
                            $low_idx = $dev->Position;
                        }
                        // device in cabinet
                        $reserved = $dev->Reservation ? 'reserved' : null;
                        list($manufacturer, $model) = getDeviceTemplateName($devTemplates, $dev);
                        $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                        $devSpec['DevID'] = $dev->DeviceID;
                        $devSpec['Zone'] = $zoneName;
                        $devSpec['Row'] = $rowName;
                        $devSpec['DC Name'] = $dc->Name;
                        $devSpec['Cabinet'] = $cab->Location;
                        $devSpec['Position'] = $dev->Position;
                        $devSpec['Half Depth'] = getDeviceDepthPos($dev);
                        $devSpec['Height'] = $dev->Height;
                        $devSpec['Device'] = $dev->Label;
                        $devSpec['Parent Device'] = null;
                        $devSpec['Manufacturer'] = $manufacturer;
                        $devSpec['Model'] = $model;
                        $devSpec['Device Type'] = $dev->DeviceType;
                        $devSpec['Asset Number'] = $dev->AssetTag;
                        $devSpec['Serial No.'] = $dev->SerialNo;
                        $devSpec['Install Date'] = $dev->InstallDate;
                        $devSpec['Warranty End'] = $dev->WarrantyExpire;
                        $devSpec['Owner'] = getOwnerName($dev, $deptList);
                        $devSpec['Power (W)'] = $dev->NominalWatts;
                        $devSpec['Reservation'] = $reserved;
                        $devSpec['Contact'] = getContactName($contactList, $dev->PrimaryContact);
                        $devSpec['Tags'] = getTagsString($dev);
                        $devSpec['Notes'] = html_entity_decode(strip_tags($dev->Notes), ENT_COMPAT, 'UTF-8');
                        $invData[] = $devSpec;
                        $dcStats['Watts'] += $dev->NominalWatts;
                        // devices can be installed at the same position and
                        // could be of different height; count only the free
                        // rack units which are not covered by any device
                        if ($low_idx == $dev->Position) {
                            $low_idx += $dev->Height;
                            $dcStats['Rk_UtU'] += $dev->Height;
                        } else {
                            $rest_height = $dev->Position + $dev->Height - $low_idx;
                            $rest_height = $rest_height > 0 ? $rest_height : 0;
                            $low_idx += $rest_height;
                            $dcStats['Rk_UtU'] += $rest_height;
                        }
                        if ($dev->DeviceType == 'Chassis') {
                            list($watts, $invData) = computeDeviceChildren($sheetColumns, $invData, $dev, $dc->Name, $cab, $devTemplates, $deptList, $contactList, $dcContainerList);
                            $dcStats['Watts'] += $watts;
                        }
                    }
                    if ($low_idx <= $cab->CabinetHeight) {
                        // empty range at the top of the cabinet, $low_idx is
                        // the potentially free location
                        $height = $cab->CabinetHeight - $low_idx + 1;
                        $dcStats['Rk_UtE'] += $height;
                        $devSpec = makeEmptySpec($sheetColumns, $dcContainerList);
                        $devSpec['Zone'] = $zoneName;
                        $devSpec['Row'] = $rowName;
                        $devSpec['DC Name'] = $dc->Name;
                        $devSpec['Cabinet'] = $cab->Location;
                        $devSpec['Position'] = $low_idx;
                        $devSpec['Height'] = $height;
                        $devSpec['Device'] = '__EMPTY';
                        $invData[] = $devSpec;
                    }
                }
            }
        }
        assignStatsVal($Stats, $dc, $dcStats);
        $percentDone += $incrementalPercent;
        JobQueue::updatePercentage($sessID, $percentDone);
    }
    return array($Stats, $invData, $invCab, $limitedUser);
}
Example #12
0
<?php

require_once 'db.inc.php';
require_once 'facilities.inc.php';
$subheader = __("Data Center Detail");
if (!$person->SiteAdmin) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
$status = "";
$dc = new DataCenter();
// AJAX Action
if (isset($_POST['confirmdelete']) && isset($_POST['datacenterid'])) {
    // About the nuke this place from orbit
    $junkremoval = $_POST['junkremoval'] == 'delete' ? true : false;
    $dc->DataCenterID = $_POST['datacenterid'];
    if ($dc->DeleteDataCenter($junkremoval)) {
        echo 'ok';
    } else {
        echo 'no';
    }
    exit;
}
if (isset($_POST['action']) && ($_POST['action'] == 'Create' || $_POST['action'] == 'Update')) {
    $dc->DataCenterID = $_POST['datacenterid'];
    $dc->Name = trim($_POST['name']);
    $dc->SquareFootage = $_POST['squarefootage'];
    $dc->DeliveryAddress = $_POST['deliveryaddress'];
    $dc->Administrator = $_POST['administrator'];
    $dc->DrawingFileName = $_POST['drawingfilename'];
Example #13
0
 function GetChildDCList()
 {
     $this->MakeSafe();
     $sql = "SELECT * FROM fac_DataCenter WHERE ContainerID={$this->ContainerID} \n\t\t\tORDER BY Name ASC;";
     $datacenterList = array();
     foreach ($this->query($sql) as $row) {
         $datacenterList[$row["DataCenterID"]] = DataCenter::RowToObject($row);
     }
     return $datacenterList;
 }
Example #14
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Rows of Cabinets");
if (!$person->SiteAdmin) {
    // No soup for you.
    header('Location: ' . redirect());
    exit;
}
$cabrow = new CabRow();
$zone = new Zone();
$DC = new DataCenter();
$zoneList = $zone->GetZoneList();
$formpatch = "";
$status = "";
if (isset($_POST['action']) && $_POST['action'] == 'Delete') {
    $cabrow->CabRowID = $_POST['cabrowid'];
    $cabrow->DeleteCabRow();
    header('Location: cabrow.php');
    exit;
}
if (isset($_REQUEST["cabrowid"])) {
    $cabrow->CabRowID = isset($_POST['cabrowid']) ? $_POST['cabrowid'] : $_GET['cabrowid'];
    $cabrow->GetCabRow();
    if (isset($_POST["action"]) && ($_POST["action"] == "Create" || $_POST["action"] == "Update")) {
        $cabrow->Name = $_POST["name"];
        $cabrow->DataCenterID = $_POST["datacenterid"];
        $cabrow->ZoneID = $_POST["zoneid"];
        if ($_POST["action"] == "Create") {
            $cabrow->CreateCabRow();
Example #15
0
<?php
	require_once("db.inc.php");
	require_once("facilities.inc.php");

	$subheader=__("Zone Statistics");

	$cab=new Cabinet();
	$zone=new Zone();
	$dc=new DataCenter();
	$dev=new Device();
	
	//setting airflow
	if(isset($_POST["cabinetid"]) && isset($_POST["airflow"]) && $person->SiteAdmin){
		$cab->CabinetID=$_POST["cabinetid"];
		if ($cab->GetCabinet()){
			if ($cab->CabRowID>0 && isset($_POST["row"]) && $_POST["row"]=="true"){
				//update all row
				$cabinets=$cab->GetCabinetsByRow();
				foreach($cabinets as $index => $cabinet){
					$cabinet->FrontEdge=$_POST["airflow"];
					$cabinet->UpdateCabinet();
				}
			}else{
				//update cabinet
				$cab->FrontEdge=$_POST["airflow"];
				$cab->UpdateCabinet();
			}
		}
		exit;
	}
Example #16
0
        }
    }
    $data_array = array();
    if (isset($_POST['ListUnique'])) {
        $data_array = $log->ListUnique($_POST['ListUnique']);
    }
    if (isset($_POST['BuildTable'])) {
        echo BuildDataTable($log);
        exit;
    }
    header('Content-Type: application/json');
    echo json_encode($data_array);
    exit;
}
$subversion = __("Logging View/Export");
$datacenter = new DataCenter();
$dcList = $datacenter->GetDCList();
$templ = new DeviceTemplate();
$dept = new Department();
$dev = new Device();
$log = new LogActions();
function BuildDataTable($log_object)
{
    $limit = isset($_REQUEST['Limit']) ? $_REQUEST['Limit'] : 1000;
    $result = $log_object->Search($limit);
    // Left these expanded in case we need to add or remove columns.  Otherwise I would have just collapsed entirely.
    $body = "<table id=\"export\" class=\"display\">\n\t<thead>\n\t\t<tr>\n\n\t\t\t\t<th>" . __("Time") . "</th>\n\t\t\t\t<th>" . __("UserID") . "</th>\n\t\t\t\t<th>" . __("Class") . "</th>\n\t\t\t\t<th>" . __("ObjectID") . "</th>\n\t\t\t\t<th>" . __("ChildID") . "</th>\n\t\t\t\t<th>" . __("Action") . "</th>\n\t\t\t\t<th>" . __("Property") . "</th>\n\t\t\t\t<th>" . __("Old Value") . "</th>\n\t\t\t\t<th>" . __("New Value") . "</th>\n\t\t\t</tr>\n\t</thead>\n\t<tbody>\n";
    // suppressing errors for when there is a fake data set in place
    foreach ($result as $logitem) {
        switch ($logitem->Action) {
            case 1:
Example #17
0
<?php

require_once "db.inc.php";
require_once "facilities.inc.php";
$subheader = __("Map Selector");
if (!$person->SiteAdmin) {
    // No soup for you.
    header("Location: " . redirect());
    exit;
}
$dc = new DataCenter();
$cab = new Cabinet();
$cab->CabinetID = $_REQUEST["cabinetid"];
$cab->GetCabinet();
$dc->DataCenterID = $cab->DataCenterID;
$dc->GetDataCenter();
if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "Submit") {
    $cab->MapX1 = intval($_REQUEST["x1"]);
    $cab->MapX2 = intval($_REQUEST["x2"]);
    $cab->MapY1 = intval($_REQUEST["y1"]);
    $cab->MapY2 = intval($_REQUEST["y2"]);
    $cab->FrontEdge = $_REQUEST["frontedge"];
    $cab->UpdateCabinet();
    $url = redirect("cabnavigator.php?cabinetid={$cab->CabinetID}");
    header("Location: {$url}");
}
$height = 0;
$width = 0;
if (strlen($dc->DrawingFileName) > 0) {
    $mapfile = "drawings/{$dc->DrawingFileName}";
    if (file_exists($mapfile)) {
Example #18
0
 public function initWeibo()
 {
     $this->weibo = DataCenter::getWeiboClient();
 }