当前位置: 首页>>代码示例>>PHP>>正文


PHP DataCenter::GetDCList方法代码示例

本文整理汇总了PHP中DataCenter::GetDCList方法的典型用法代码示例。如果您正苦于以下问题:PHP DataCenter::GetDCList方法的具体用法?PHP DataCenter::GetDCList怎么用?PHP DataCenter::GetDCList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataCenter的用法示例。


在下文中一共展示了DataCenter::GetDCList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: builddclist

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;
}
开发者ID:ghasedak,项目名称:openDCIM,代码行数:20,代码来源:paths.php

示例2: BuildDataTable

    }
    $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:
                $logitem->Action = __("Create");
开发者ID:sengkoil,项目名称:openDCIM,代码行数:31,代码来源:report_logging.php

示例3: computeSheetBodyDCInventory

/**
 * 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';
//.........这里部分代码省略.........
开发者ID:dc-admin,项目名称:openDCIM,代码行数:101,代码来源:report_asset_Excel-new.php

示例4: echoResponse

        $response['error'] = false;
        $response['errorcode'] = 200;
    }
    $response['department'] = $depts;
    echoResponse(200, $response);
});
//
//	URL:	/api/v1/datacenter
//	Method: GET
//	Params:  none
//	Returns: List of all data centers in the database
//
$app->get('/datacenter', function () {
    // Don't have to worry about rights, other than basic connection, to get data center list
    $dc = new DataCenter();
    $dcList = $dc->GetDCList();
    $response['error'] = false;
    $response['errorcode'] = 200;
    $response['datacenter'] = array();
    foreach ($dcList as $d) {
        $tmp = array();
        foreach ($d as $prop => $value) {
            $tmp[$prop] = $value;
        }
        array_push($response['datacenter'], $tmp);
    }
    echoResponse(200, $response);
});
//
//	URL:	/api/v1/datacenter/:id
//  Method: GET
开发者ID:mnibbelink,项目名称:openDCIM,代码行数:31,代码来源:index.php

示例5:

    $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();
        } else {
            if ($cabrow->UpdateCabRow()) {
                $status = __("Updated");
            }
        }
    }
    $formpatch = "?cabrowid={$_REQUEST['cabrowid']}";
}
$dcList = $DC->GetDCList();
$idcList = $DC->GetDCList(true);
//indexed by id
$izoneList = $zone->GetZoneList(true);
//indexed by id
$cabrowList = $cabrow->GetCabRowList();
?>
<!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 Rows of Cabinets</title>

  <link rel="stylesheet" href="css/inventory.php" type="text/css">
开发者ID:ghasedak,项目名称:openDCIM,代码行数:31,代码来源:cabrow.php


注:本文中的DataCenter::GetDCList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。