} } else { $sts_id = 0; $rck_id = 0; } } } else { $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'])) {
$userlevel = intval($_SESSION['session_user_level']); // selected or default datacenter $user_permissions = 0; if (isset($_REQUEST['dcn_id'])) { $dcn_id = intval($_REQUEST['dcn_id']); $user_permissions = F_getUserPermission($user_id, K_TABLE_DATACENTER_GROUPS, $dcn_id); if ($user_permissions == 0) { F_print_error('ERROR', $l['m_not_authorized_to_view']); $dcn_id = 0; } } else { $dcn_id = 0; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - echo '<div class="container">' . K_NEWLINE; echo F_select_datacenter($dcn_id, $data, false); echo '<div class="tceformbox">' . K_NEWLINE; if (isset($data['dcn_name'])) { echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE; echo '<div class="row" style="margin-bottom:10px;"><hr /></div>' . K_NEWLINE; echo getFormDescriptionLine($l['w_name'], $l['h_datacenter_name'], '<strong>' . htmlspecialchars($data['dcn_name'], ENT_COMPAT, $l['a_meta_charset']) . '</strong>'); echo getFormDescriptionLine($l['w_website'], $l['h_website_url'], '<a href="' . htmlspecialchars($data['dcn_website_url'], ENT_COMPAT, $l['a_meta_charset']) . '" onclick="pdfWindow=window.open(\'' . htmlspecialchars($data['dcn_website_url'], ENT_COMPAT, $l['a_meta_charset']) . '\',\'pdfWindow\',\'dependent,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes\'); return false;" title="' . htmlspecialchars($data['dcn_name'], ENT_COMPAT, $l['a_meta_charset']) . '">' . htmlspecialchars($data['dcn_website_url'], ENT_COMPAT, $l['a_meta_charset']) . '</a>'); echo getFormDescriptionLine($l['w_map'], $l['w_map'], '<a href="' . htmlspecialchars($data['dcn_map_url'], ENT_COMPAT, $l['a_meta_charset']) . '"onclick="pdfWindow=window.open(\'' . htmlspecialchars($data['dcn_map_url'], ENT_COMPAT, $l['a_meta_charset']) . '\',\'pdfWindow\',\'dependent,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes\'); return false;" title="' . htmlspecialchars($l['w_map'], ENT_COMPAT, $l['a_meta_charset']) . '">' . htmlspecialchars($data['dcn_map_url'], ENT_COMPAT, $l['a_meta_charset']) . '</a>'); echo getFormDescriptionLine($l['w_description'], $l['h_datacenter_description'], str_replace("\n", '<br />', htmlspecialchars($data['dcn_description'], ENT_COMPAT, $l['a_meta_charset']))); // list of suites echo '<div class="row">' . K_NEWLINE; echo '<span class="label">' . $l['w_suites'] . '</span>' . K_NEWLINE; echo '<br /><div class="value">' . K_NEWLINE; $sql = 'SELECT * FROM ' . K_TABLE_SUITES . ' WHERE sts_dcn_id=' . $dcn_id . ' ORDER BY sts_name ASC'; if ($r = F_db_query($sql, $db)) { echo '<ul>' . K_NEWLINE;
/** * Return an HTML code containing form fields to filter data * @param $dcn_id (int) Datacenter ID. * @param $sts_id (int) Suite ID. * @param $rck_id (int) Rack ID. * @param $obt_id (int) Object ID. * @param $obj_owner_id (int) Owner ID. * @param $obj_tenant_id (int) Tenant ID. * @param $keywords (string) Keywords. * @return html code */ function F_getDataFilter($dcn_id = 0, $sts_id = 0, $rck_id = 0, $obt_id = 0, $obj_owner_id = 0, $obj_tenant_id = 0, $keywords = 0) { global $l, $db; require_once '../config/tce_config.php'; require_once 'tce_functions_user_select.php'; $out = ''; $out .= '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE; $out .= '<legend>' . $l['w_selection filter'] . '</legend>' . K_NEWLINE; $out .= F_select_datacenter($dcn_id, $datacenter_data, true); $out .= F_select_suite($dcn_id, $sts_id, $suite_data, true); $out .= F_select_rack($dcn_id, $sts_id, $rck_id, $rack_data, $rack_pos, $rack_name, true); $out .= F_select_object_type($obt_id, true); $out .= F_get_user_selectbox($l['w_owner'], $obj_owner_id, 'obj_owner_id'); $out .= F_get_user_selectbox($l['w_tenant'], $obj_tenant_id, 'obj_tenant_id'); $out .= getFormRowTextInput('keywords', $l['w_keywords'], $l['w_search_keywords'], '', $keywords, '', 255, false, false, false, ''); // generate button $out .= '<div class="row">'; $out .= '<input type="submit" name="filter" id="filter" value="' . $l['w_filter'] . '" title="' . $l['h_filter_objects'] . '" />'; $out .= '</div>' . K_NEWLINE; $out .= '</fieldset>' . K_NEWLINE; return $out; }
} else { $dcn_name = ''; $dcn_description = ''; $dcn_website_url = ''; $dcn_map_url = ''; } } else { F_display_db_error(); } } } } 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, $data, true); echo '<div class="row"><hr /></div>' . K_NEWLINE; echo getFormRowTextInput('dcn_name', $l['w_name'], $l['h_datacenter_name'], '', $dcn_name, '', 255, false, false, false, ''); echo getFormRowTextBox('dcn_description', $l['w_description'], $l['h_datacenter_description'], $dcn_description, false, ''); echo getFormRowTextInput('dcn_website_url', $l['w_website'], $l['h_website_url'], '', $dcn_website_url, '', 255, false, false, false, ''); echo getFormRowTextInput('dcn_map_url', $l['w_map_url'], $l['h_map_url'], '', $dcn_map_url, '', 255, false, false, false, ''); // ----------------------------------------------------------------------------- // group permissions echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE; echo '<legend>' . $l['t_permissions'] . '</legend>' . K_NEWLINE; echo F_groupsPermsSelector($perms, false); echo '</fieldset>' . K_NEWLINE; // ----------------------------------------------------------------------------- echo '<div class="row">' . K_NEWLINE; // show buttons by case if (isset($dcn_id) and $dcn_id > 0) {