本文整理汇总了PHP中Zone::GetZonesByDC方法的典型用法代码示例。如果您正苦于以下问题:PHP Zone::GetZonesByDC方法的具体用法?PHP Zone::GetZonesByDC怎么用?PHP Zone::GetZonesByDC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::GetZonesByDC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
} 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'];
$zone = new Zone();
$zone->DataCenterID = $cab->DataCenterID;
$payload = array('cab' => $cab->ListCabinetsByDC(true), 'zone' => $zone->GetZonesByDC(true));
} else {
$dc->DataCenterID = $_POST['dc'];
$dc->GetDataCenterByID();
$payload = $dc->GetOverview();
}
header('Content-Type: application/json');
echo json_encode($payload);
exit;
}
if (!isset($_GET["dc"])) {
// No soup for you.
header('Location: ' . redirect());
exit;
}
$dc->DataCenterID = $_GET["dc"];
示例2: AddDCToTree
function AddDCToTree($lev = 0)
{
$dept = new Department();
$zone = new Zone();
$classType = "liClosed";
$tree = str_repeat(" ", $lev + 1) . "<li class=\"{$classType}\" id=\"dc{$this->DataCenterID}\"><a class=\"DC\" href=\"dc_stats.php?dc=" . "{$this->DataCenterID}\">{$this->Name}</a>\n";
$tree .= str_repeat(" ", $lev + 2) . "<ul>\n";
$zone->DataCenterID = $this->DataCenterID;
$zoneList = $zone->GetZonesByDC();
while (list($zoneNum, $myzone) = each($zoneList)) {
$tree .= str_repeat(" ", $lev + 3) . "<li class=\"liClosed\" id=\"zone{$myzone->ZoneID}\"><a class=\"ZONE\" href=\"zone_stats.php?zone=" . "{$myzone->ZoneID}\">{$myzone->Description}</a>\n";
$tree .= str_repeat(" ", $lev + 4) . "<ul>\n";
//Rows
$sql = "SELECT CabRowID, Name AS Fila FROM fac_CabRow WHERE \n\t\t\t\tZoneID={$myzone->ZoneID} ORDER BY Fila;";
foreach ($this->query($sql) as $filaRow) {
$tree .= str_repeat(" ", $lev + 5) . "<li class=\"liClosed\">" . "<a class=\"CABROW\" href=\"rowview.php?row={$filaRow['CabRowID']}\">" . __("Row ") . "{$filaRow['Fila']}</a>\n";
$tree .= str_repeat(" ", $lev + 6) . "<ul>\n";
// DataCenterID and ZoneID are redundant if fac_cabrow is defined and is CabrowID set in fac_cabinet
$cabsql = "SELECT * FROM fac_Cabinet WHERE DataCenterID={$this->DataCenterID} \n\t\t\t\t\tAND ZoneID={$myzone->ZoneID} AND CabRowID={$filaRow['CabRowID']} ORDER \n\t\t\t\t\tBY Location REGEXP '^[A-Za-z]+\$', CAST(Location as SIGNED INTEGER),\n\t\t\t\t\tLocation;";
foreach ($this->query($cabsql) as $cabRow) {
$tree .= str_repeat(" ", $lev + 7) . "<li id=\"cab{$cabRow['CabinetID']}\"><a class=\"RACK\" href=\"cabnavigator.php?cabinetid={$cabRow['CabinetID']}\">{$cabRow['Location']}</a></li>\n";
}
$tree .= str_repeat(" ", $lev + 6) . "</ul>\n";
$tree .= str_repeat(" ", $lev + 5) . "</li>\n";
}
//Cabinets without CabRowID
$cabsql = "SELECT * FROM fac_Cabinet WHERE DataCenterID={$this->DataCenterID} AND \n\t\t\t\tZoneID={$myzone->ZoneID} AND CabRowID=0 ORDER BY Location ASC;";
foreach ($this->query($cabsql) as $cabRow) {
$tree .= str_repeat(" ", $lev + 5) . "<li id=\"cab{$cabRow['CabinetID']}\"><a class=\"RACK\" href=\"cabnavigator.php?cabinetid={$cabRow['CabinetID']}\">{$cabRow['Location']}</a></li>\n";
}
$tree .= str_repeat(" ", $lev + 4) . "</ul>\n";
$tree .= str_repeat(" ", $lev + 3) . "</li>\n";
}
//zone
//Cabinets without ZoneID
$cabsql = "SELECT * FROM fac_Cabinet WHERE DataCenterID={$this->DataCenterID} AND \n\t\t\tZoneID=0 ORDER BY Location ASC;";
foreach ($this->query($cabsql) as $cabRow) {
$tree .= str_repeat(" ", $lev + 3) . "<li id=\"cab{$cabRow['CabinetID']}\"><a class=\"RACK\" href=\"cabnavigator.php?cabinetid={$cabRow['CabinetID']}\">{$cabRow['Location']}</a></li>\n";
}
//StorageRoom for this DC
$tree .= str_repeat(" ", $lev + 3) . "<li id=\"sr-{$this->DataCenterID}\"><a href=\"storageroom.php?dc={$this->DataCenterID}\">" . __("Storage Room") . "</a></li>\n";
$tree .= str_repeat(" ", $lev + 2) . "</ul>\n";
$tree .= str_repeat(" ", $lev + 1) . "</li>\n";
return $tree;
}