Пример #1
0
    $dcn_id = 0;
    $sts_id = 0;
    $rck_id = 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo F_select_datacenter($dcn_id);
echo F_select_suite($dcn_id, $sts_id, $suite_data);
echo F_select_rack($dcn_id, $sts_id, $rck_id, $rack_data, $rack_pos, $rack_name);
echo '<div class="row" style="margin-bottom:10px;"><hr /></div>' . K_NEWLINE;
// *** MAP OF OBJECTS ON SELECTED RACK
if (isset($rack_data)) {
    $rackobjs = '<div class="row">' . K_NEWLINE;
    $rackobjs .= getRackStack($dcn_id, $sts_id, $rck_id, $rack_data);
    $rackobjs .= '</div>' . K_NEWLINE;
    echo $rackobjs;
    // create guest and capacity list
    $guestlist = '';
    $capacitylist = '';
    foreach ($rack_data['rackstack'] as $rckobj) {
        // capacity (report free ports)
        if (isset($rckobj['capacity']) and !empty($rckobj['capacity'])) {
            foreach ($rckobj['capacity'] as $ck => $cv) {
                if ($cv['free'] > 0) {
                    $capacitylist .= '<tr>';
                    $capacitylist .= sprintf('<td style="text-align:center;">%02d - %02d</td>', $rckobj['loc_row_top'], $rckobj['loc_row_bottom']);
                    $capacitylist .= '<td><a href="tce_view_object.php?dcn_id=' . $dcn_id . '&amp;sts_id=' . $sts_id . '&amp;rck_id=' . $rck_id . '&amp;obj_id=' . $rckobj['obj_id'] . '#object" title="' . $l['w_show_details'] . '">' . $rckobj['obj_name'] . ' - ' . $rckobj['obj_label'] . ' - ' . $rckobj['obj_tag'] . '</a></td>';
                    $capacitylist .= '<td style="text-align:center;">' . $ck . '</td>';
                    $capacitylist .= '<td style="text-align:right;">' . $cv['total'] . '</td>';
Пример #2
0
 if ($m['sts_id'] != $prev_sts_id) {
     $sts_perm = F_getUserPermission($user_id, K_TABLE_SUITE_GROUPS, $m['sts_id']);
     if (($dcn_perm & 1) > 0 and ($sts_perm & 1) > 0) {
         $data['asset']['datacenter']['DCN' . $m['dcn_id']]['suite']['STS' . $m['sts_id']] = array('sts_id' => $m['sts_id'], 'sts_dcn_id' => $m['sts_dcn_id'], 'sts_name' => $m['sts_name'], 'sts_description' => $m['sts_description'], 'sts_floor' => $m['sts_floor'], 'sts_width' => $m['sts_width'], 'sts_height' => $m['sts_height'], 'rack' => array());
         if ($userlevel >= K_AUTH_ADMINISTRATOR) {
             $data['asset']['datacenter']['DCN' . $m['dcn_id']]['suite']['STS' . $m['sts_id']]['sts_permissions'] = F_getGroupsPermsDesc(F_getGroupsPermissions(K_TABLE_SUITE_GROUPS, $m['sts_id']));
         }
     }
     $prev_sts_id = $m['sts_id'];
 }
 // rack data
 if ($m['rck_id'] != $prev_rck_id) {
     $rck_perm = F_getUserPermission($user_id, K_TABLE_RACK_GROUPS, $m['rck_id']);
     if (($dcn_perm & 1) > 0 and ($sts_perm & 1) > 0 and ($rck_perm & 1) > 0) {
         $rck_value = $m;
         $data['asset']['datacenter']['DCN' . $m['dcn_id']]['suite']['STS' . $m['sts_id']]['rack']['RCK' . $m['rck_id']] = array('rck_id' => $m['rck_id'], 'rck_sts_id' => $m['rck_sts_id'], 'rck_name' => $m['rck_name'], 'rck_description' => $m['rck_description'], 'rck_label' => $m['rck_label'], 'rck_tag' => $m['rck_tag'], 'rck_height' => $m['rck_height'], 'rck_position_x' => $m['rck_position_x'], 'rck_position_y' => $m['rck_position_y'], 'rck_table' => getRackStack($m['dcn_id'], $m['sts_id'], $m['rck_id'], $rck_value), 'rck_rackstack' => $rck_value['rackstack'], 'rck_free_slots' => $rck_value['free_slots'], 'object' => array());
         if ($userlevel >= K_AUTH_ADMINISTRATOR) {
             $data['asset']['datacenter']['DCN' . $m['dcn_id']]['suite']['STS' . $m['sts_id']]['rack']['RCK' . $m['rck_id']]['rck_permissions'] = F_getGroupsPermsDesc(F_getGroupsPermissions(K_TABLE_RACK_GROUPS, $m['rck_id']));
         }
     }
     $prev_rck_id = $m['rck_id'];
 }
 $obj_perm = F_getUserPermission($user_id, K_TABLE_OBJECT_GROUPS, $m['obj_id']);
 if (($obj_perm & 1) > 0) {
     // object data
     $objdata = F_get_object_data_array($m['obj_id'], $ilo, $capacity);
     if (isset($capacity) and !empty($capacity)) {
         $objdata['capacity'] = $capacity;
     }
     // get all groups IDs
     $perm_groups = array_merge($perm_groups, array_keys($objdata['permissions']));