예제 #1
0
function insert_mass_update_host_form()
{
    //$elements_array_name){
    global $USER_DETAILS;
    $visible = get_request('visible', array());
    $groups = get_request('groups', array());
    $newgroup = get_request('newgroup', '');
    $host = get_request('host', '');
    $port = get_request('port', get_profile('HOST_PORT', 10050));
    $status = get_request('status', HOST_STATUS_MONITORED);
    $useip = get_request('useip', 0);
    $dns = get_request('dns', '');
    $ip = get_request('ip', '0.0.0.0');
    $proxy_hostid = get_request('proxy_hostid', '');
    $useipmi = get_request('useipmi', 'no');
    $ipmi_ip = get_request('ipmi_ip', '');
    $ipmi_port = get_request('ipmi_port', 623);
    $ipmi_authtype = get_request('ipmi_authtype', -1);
    $ipmi_privilege = get_request('ipmi_privilege', 2);
    $ipmi_username = get_request('ipmi_username', '');
    $ipmi_password = get_request('ipmi_password', '');
    $useprofile = get_request('useprofile', 'no');
    $devicetype = get_request('devicetype', '');
    $name = get_request('name', '');
    $os = get_request('os', '');
    $serialno = get_request('serialno', '');
    $tag = get_request('tag', '');
    $macaddress = get_request('macaddress', '');
    $hardware = get_request('hardware', '');
    $software = get_request('software', '');
    $contact = get_request('contact', '');
    $location = get_request('location', '');
    $notes = get_request('notes', '');
    // BEGIN: HOSTS PROFILE EXTENDED Section
    $useprofile_ext = get_request('useprofile_ext', 'no');
    $ext_host_profiles = get_request('ext_host_profiles', array());
    $ext_profiles_fields = array('device_alias', 'device_type', 'device_chassis', 'device_os', 'device_os_short', 'device_hw_arch', 'device_serial', 'device_model', 'device_tag', 'device_vendor', 'device_contract', 'device_who', 'device_status', 'device_app_01', 'device_app_02', 'device_app_03', 'device_app_04', 'device_app_05', 'device_url_1', 'device_url_2', 'device_url_3', 'device_networks', 'device_notes', 'device_hardware', 'device_software', 'ip_subnet_mask', 'ip_router', 'ip_macaddress', 'oob_ip', 'oob_subnet_mask', 'oob_router', 'date_hw_buy', 'date_hw_install', 'date_hw_expiry', 'date_hw_decomm', 'site_street_1', 'site_street_2', 'site_street_3', 'site_city', 'site_state', 'site_country', 'site_zip', 'site_rack', 'site_notes', 'poc_1_name', 'poc_1_email', 'poc_1_phone_1', 'poc_1_phone_2', 'poc_1_cell', 'poc_1_screen', 'poc_1_notes', 'poc_2_name', 'poc_2_email', 'poc_2_phone_1', 'poc_2_phone_2', 'poc_2_cell', 'poc_2_screen', 'poc_2_notes');
    foreach ($ext_profiles_fields as $field) {
        if (!isset($ext_host_profiles[$field])) {
            $ext_host_profiles[$field] = '';
        }
    }
    // END:   HOSTS PROFILE EXTENDED Section
    $templates = get_request('templates', array());
    $clear_templates = get_request('clear_templates', array());
    $frm_title = S_HOST . SPACE . S_MASS_UPDATE;
    $original_templates = array();
    $clear_templates = array_intersect($clear_templates, array_keys($original_templates));
    $clear_templates = array_diff($clear_templates, array_keys($templates));
    asort($templates);
    $frmHost = new CFormTable($frm_title, 'hosts.php');
    $frmHost->SetHelp('web.hosts.host.php');
    $frmHost->addVar('config', get_request('config', 0));
    $frmHost->addVar('massupdate', get_request('massupdate', 1));
    $hosts = $_REQUEST['hosts'];
    foreach ($hosts as $id => $hostid) {
        $frmHost->addVar('hosts[' . $hostid . ']', $hostid);
    }
    $frmHost->addVar('clear_templates', $clear_templates);
    //		$frmItem->addRow(array( new CVisibilityBox('visible[type]', isset($visible['type']), 'type', S_ORIGINAL),S_TYPE), $cmbType);
    $frmHost->addRow(S_NAME, S_ORIGINAL);
    $available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_LIST);
    $grp_tb = new CTweenBox($frmHost, 'groups', $groups, 6);
    $db_groups = DBselect('SELECT DISTINCT groupid,name ' . ' FROM groups ' . ' WHERE ' . DBcondition('groupid', $available_groups) . ' ORDER BY name');
    while ($db_group = DBfetch($db_groups)) {
        $grp_tb->addItem($db_group['groupid'], $db_group['name']);
    }
    $frmHost->addRow(array(new CVisibilityBox('visible[groups]', isset($visible['groups']), $grp_tb->GetName(), S_ORIGINAL), S_GROUPS), $grp_tb->Get(S_IN . SPACE . S_GROUPS, S_OTHER . SPACE . S_GROUPS));
    $frmHost->addRow(array(new CVisibilityBox('visible[newgroup]', isset($visible['newgroup']), 'newgroup', S_ORIGINAL), S_NEW_GROUP), new CTextBox('newgroup', $newgroup), 'new');
    // onchange does not work on some browsers: MacOS, KDE browser
    $frmHost->addRow(array(new CVisibilityBox('visible[dns]', isset($visible['dns']), 'dns', S_ORIGINAL), S_DNS_NAME), new CTextBox('dns', $dns, '40'));
    $frmHost->addRow(array(new CVisibilityBox('visible[ip]', isset($visible['ip']), 'ip', S_ORIGINAL), S_IP_ADDRESS), new CTextBox('ip', $ip, defined('ZBX_HAVE_IPV6') ? 39 : 15));
    $cmbConnectBy = new CComboBox('useip', $useip);
    $cmbConnectBy->addItem(0, S_DNS_NAME);
    $cmbConnectBy->addItem(1, S_IP_ADDRESS);
    $frmHost->addRow(array(new CVisibilityBox('visible[useip]', isset($visible['useip']), 'useip', S_ORIGINAL), S_CONNECT_TO), $cmbConnectBy);
    $frmHost->AddRow(array(new CVisibilityBox('visible[port]', isset($visible['port']), 'port', S_ORIGINAL), S_AGENT_PORT), new CNumericBox('port', $port, 5));
    //Proxy
    $cmbProxy = new CComboBox('proxy_hostid', $proxy_hostid);
    $cmbProxy->addItem(0, S_NO_PROXY);
    $sql = 'SELECT hostid,host ' . ' FROM hosts ' . ' WHERE status IN (' . HOST_STATUS_PROXY . ') ' . ' AND ' . DBin_node('hostid') . ' ORDER BY host';
    $db_proxies = DBselect($sql);
    while ($db_proxy = DBfetch($db_proxies)) {
        $cmbProxy->addItem($db_proxy['hostid'], $db_proxy['host']);
    }
    $frmHost->addRow(array(new CVisibilityBox('visible[proxy_hostid]', isset($visible['proxy_hostid']), 'proxy_hostid', S_ORIGINAL), S_MONITORED_BY_PROXY), $cmbProxy);
    //----------
    $cmbStatus = new CComboBox('status', $status);
    $cmbStatus->addItem(HOST_STATUS_MONITORED, S_MONITORED);
    $cmbStatus->addItem(HOST_STATUS_NOT_MONITORED, S_NOT_MONITORED);
    $frmHost->addRow(array(new CVisibilityBox('visible[status]', isset($visible['status']), 'status', S_ORIGINAL), S_STATUS), $cmbStatus);
    $template_table = new CTable();
    $template_table->addOption('name', 'template_table');
    $template_table->addOption('id', 'template_table');
    $template_table->SetCellPadding(0);
    $template_table->SetCellSpacing(0);
    //		$template_table->addOption('style','border: 1px black solid;');
    foreach ($templates as $id => $temp_name) {
        $frmHost->addVar('templates[' . $id . ']', $temp_name);
        $template_table->addRow(array($temp_name, new CButton('unlink[' . $id . ']', S_UNLINK), isset($original_templates[$id]) ? new CButton('unlink_and_clear[' . $id . ']', S_UNLINK_AND_CLEAR) : SPACE));
    }
    $template_table->addRow(new CButton('add_template', S_ADD, "return PopUp('popup.php?dstfrm=" . $frmHost->GetName() . "&dstfld1=new_template&srctbl=templates&srcfld1=hostid&srcfld2=host" . url_param($templates, false, 'existed_templates') . "',450,450)"));
    $frmHost->addRow(array(new CVisibilityBox('visible[template_table]', isset($visible['template_table']), 'template_table', S_ORIGINAL), S_LINK_WITH_TEMPLATE), $template_table, 'T');
    $frmHost->addRow(array(new CVisibilityBox('visible[useipmi]', isset($visible['useipmi']), 'useipmi', S_ORIGINAL), S_USEIPMI), new CCheckBox("useipmi", $useipmi, "submit()"));
    if ($useipmi == 'yes') {
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_ip]', isset($visible['ipmi_ip']), 'ipmi_ip', S_ORIGINAL), S_IPMI_IP_ADDRESS), new CTextBox('ipmi_ip', $ipmi_ip, defined('ZBX_HAVE_IPV6') ? 39 : 15));
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_port]', isset($visible['ipmi_port']), 'ipmi_port', S_ORIGINAL), S_IPMI_PORT), new CNumericBox('ipmi_port', $ipmi_port, 15));
        $cmbIPMIAuthtype = new CComboBox('ipmi_authtype', $ipmi_authtype);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_DEFAULT, S_AUTHTYPE_DEFAULT);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_NONE, S_AUTHTYPE_NONE);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_MD2, S_AUTHTYPE_MD2);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_MD5, S_AUTHTYPE_MD5);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_STRAIGHT, S_AUTHTYPE_STRAIGHT);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_OEM, S_AUTHTYPE_OEM);
        $cmbIPMIAuthtype->addItem(IPMI_AUTHTYPE_RMCP_PLUS, S_AUTHTYPE_RMCP_PLUS);
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_authtype]', isset($visible['ipmi_authtype']), 'ipmi_authtype', S_ORIGINAL), S_IPMI_AUTHTYPE), $cmbIPMIAuthtype);
        $cmbIPMIPrivilege = new CComboBox('ipmi_privilege', $ipmi_privilege);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_CALLBACK, S_PRIVILEGE_CALLBACK);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_USER, S_PRIVILEGE_USER);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_OPERATOR, S_PRIVILEGE_OPERATOR);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_ADMIN, S_PRIVILEGE_ADMIN);
        $cmbIPMIPrivilege->addItem(IPMI_PRIVILEGE_OEM, S_PRIVILEGE_OEM);
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_privilege]', isset($visible['ipmi_privilege']), 'ipmi_privilege', S_ORIGINAL), S_IPMI_PRIVILEGE), $cmbIPMIPrivilege);
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_username]', isset($visible['ipmi_username']), 'ipmi_username', S_ORIGINAL), S_IPMI_USERNAME), new CTextBox('ipmi_username', $ipmi_username, 16));
        $frmHost->addRow(array(new CVisibilityBox('visible[ipmi_password]', isset($visible['ipmi_password']), 'ipmi_password', S_ORIGINAL), S_IPMI_PASSWORD), new CTextBox('ipmi_password', $ipmi_password, 20));
    }
    $frmHost->addRow(array(new CVisibilityBox('visible[useprofile]', isset($visible['useprofile']), 'useprofile', S_ORIGINAL), S_USE_PROFILE), new CCheckBox("useprofile", $useprofile, "submit()"));
    // BEGIN: HOSTS PROFILE EXTENDED Section
    $frmHost->addRow(array(new CVisibilityBox('visible[useprofile_ext]', isset($visible['useprofile_ext']), 'useprofile_ext', S_ORIGINAL), S_USE_EXTENDED_PROFILE), new CCheckBox("useprofile_ext", $useprofile_ext, "submit()"));
    // END:   HOSTS PROFILE EXTENDED Section
    if ($useprofile == "yes") {
        $frmHost->addRow(array(new CVisibilityBox('visible[devicetype]', isset($visible['devicetype']), 'devicetype', S_ORIGINAL), S_DEVICE_TYPE), new CTextBox("devicetype", $devicetype, 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[name]', isset($visible['name']), 'name', S_ORIGINAL), S_NAME), new CTextBox("name", $name, 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[os]', isset($visible['os']), 'os', S_ORIGINAL), S_OS), new CTextBox("os", $os, 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[serialno]', isset($visible['serialno']), 'serialno', S_ORIGINAL), S_SERIALNO), new CTextBox("serialno", $serialno, 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[tag]', isset($visible['tag']), 'tag', S_ORIGINAL), S_TAG), new CTextBox("tag", $tag, 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[macaddress]', isset($visible['macaddress']), 'macaddress', S_ORIGINAL), S_MACADDRESS), new CTextBox("macaddress", $macaddress, 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[hardware]', isset($visible['hardware']), 'hardware', S_ORIGINAL), S_HARDWARE), new CTextArea("hardware", $hardware, 60, 4));
        $frmHost->addRow(array(new CVisibilityBox('visible[software]', isset($visible['software']), 'software', S_ORIGINAL), S_SOFTWARE), new CTextArea("software", $software, 60, 4));
        $frmHost->addRow(array(new CVisibilityBox('visible[contact]', isset($visible['contact']), 'contact', S_ORIGINAL), S_CONTACT), new CTextArea("contact", $contact, 60, 4));
        $frmHost->addRow(array(new CVisibilityBox('visible[location]', isset($visible['location']), 'location', S_ORIGINAL), S_LOCATION), new CTextArea("location", $location, 60, 4));
        $frmHost->addRow(array(new CVisibilityBox('visible[notes]', isset($visible['notes']), 'notes', S_ORIGINAL), S_NOTES), new CTextArea("notes", $notes, 60, 4));
    } else {
        $frmHost->addVar("devicetype", $devicetype);
        $frmHost->addVar("name", $name);
        $frmHost->addVar("os", $os);
        $frmHost->addVar("serialno", $serialno);
        $frmHost->addVar("tag", $tag);
        $frmHost->addVar("macaddress", $macaddress);
        $frmHost->addVar("hardware", $hardware);
        $frmHost->addVar("software", $software);
        $frmHost->addVar("contact", $contact);
        $frmHost->addVar("location", $location);
        $frmHost->addVar("notes", $notes);
    }
    // BEGIN: HOSTS PROFILE EXTENDED Section
    if ($useprofile_ext == "yes") {
        $frmHost->addRow(array(new CVisibilityBox('visible[device_alias]', isset($visible['device_alias']), 'ext_host_profiles[device_alias]', S_ORIGINAL), S_DEVICE_ALIAS), new CTextBox('ext_host_profiles[device_alias]', $ext_host_profiles['device_alias'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_type]', isset($visible['device_type']), 'ext_host_profiles[device_type]', S_ORIGINAL), S_DEVICE_TYPE), new CTextBox('ext_host_profiles[device_type]', $ext_host_profiles['device_type'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_chassis]', isset($visible['device_chassis']), 'ext_host_profiles[device_chassis]', S_ORIGINAL), S_DEVICE_CHASSIS), new CTextBox('ext_host_profiles[device_chassis]', $ext_host_profiles['device_chassis'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_os]', isset($visible['device_os']), 'ext_host_profiles[device_os]', S_ORIGINAL), S_DEVICE_OS), new CTextBox('ext_host_profiles[device_os]', $ext_host_profiles['device_os'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_os_short]', isset($visible['device_os_short']), 'ext_host_profiles[device_os_short]', S_ORIGINAL), S_DEVICE_OS_SHORT), new CTextBox('ext_host_profiles[device_os_short]', $ext_host_profiles['device_os_short'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_hw_arch]', isset($visible['device_hw_arch']), 'ext_host_profiles[device_hw_arch]', S_ORIGINAL), S_DEVICE_HW_ARCH), new CTextBox('ext_host_profiles[device_hw_arch]', $ext_host_profiles['device_hw_arch'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_serial]', isset($visible['device_serial']), 'ext_host_profiles[device_serial]', S_ORIGINAL), S_DEVICE_SERIAL), new CTextBox('ext_host_profiles[device_serial]', $ext_host_profiles['device_serial'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_model]', isset($visible['device_model']), 'ext_host_profiles[device_model]', S_ORIGINAL), S_DEVICE_MODEL), new CTextBox('ext_host_profiles[device_model]', $ext_host_profiles['device_model'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_tag]', isset($visible['device_tag']), 'ext_host_profiles[device_tag]', S_ORIGINAL), S_DEVICE_TAG), new CTextBox('ext_host_profiles[device_tag]', $ext_host_profiles['device_tag'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_vendor]', isset($visible['device_vendor']), 'ext_host_profiles[device_vendor]', S_ORIGINAL), S_DEVICE_VENDOR), new CTextBox('ext_host_profiles[device_vendor]', $ext_host_profiles['device_vendor'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_contract]', isset($visible['device_contract']), 'ext_host_profiles[device_contract]', S_ORIGINAL), S_DEVICE_CONTRACT), new CTextBox('ext_host_profiles[device_contract]', $ext_host_profiles['device_contract'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_who]', isset($visible['device_who']), 'ext_host_profiles[device_who]', S_ORIGINAL), S_DEVICE_WHO), new CTextBox('ext_host_profiles[device_who]', $ext_host_profiles['device_who'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_status]', isset($visible['device_status']), 'ext_host_profiles[device_status]', S_ORIGINAL), S_DEVICE_STATUS), new CTextBox('ext_host_profiles[device_status]', $ext_host_profiles['device_status'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_app_01]', isset($visible['device_app_01']), 'ext_host_profiles[device_app_01]', S_ORIGINAL), S_DEVICE_APP_01), new CTextBox('ext_host_profiles[device_app_01]', $ext_host_profiles['device_app_01'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_app_02]', isset($visible['device_app_02']), 'ext_host_profiles[device_app_02]', S_ORIGINAL), S_DEVICE_APP_02), new CTextBox('ext_host_profiles[device_app_02]', $ext_host_profiles['device_app_02'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_app_03]', isset($visible['device_app_03']), 'ext_host_profiles[device_app_03]', S_ORIGINAL), S_DEVICE_APP_03), new CTextBox('ext_host_profiles[device_app_03]', $ext_host_profiles['device_app_03'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_app_04]', isset($visible['device_app_04']), 'ext_host_profiles[device_app_04]', S_ORIGINAL), S_DEVICE_APP_04), new CTextBox('ext_host_profiles[device_app_04]', $ext_host_profiles['device_app_04'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_app_05]', isset($visible['device_app_05']), 'ext_host_profiles[device_app_05]', S_ORIGINAL), S_DEVICE_APP_05), new CTextBox('ext_host_profiles[device_app_05]', $ext_host_profiles['device_app_05'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_url_1]', isset($visible['device_url_1']), 'ext_host_profiles[device_url_1]', S_ORIGINAL), S_DEVICE_URL_1), new CTextBox('ext_host_profiles[device_url_1]', $ext_host_profiles['device_url_1'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_url_2]', isset($visible['device_url_2']), 'ext_host_profiles[device_url_2]', S_ORIGINAL), S_DEVICE_URL_2), new CTextBox('ext_host_profiles[device_url_2]', $ext_host_profiles['device_url_2'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_url_3]', isset($visible['device_url_3']), 'ext_host_profiles[device_url_3]', S_ORIGINAL), S_DEVICE_URL_3), new CTextBox('ext_host_profiles[device_url_3]', $ext_host_profiles['device_url_3'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_networks]', isset($visible['device_networks']), 'ext_host_profiles[device_networks]', S_ORIGINAL), S_DEVICE_NETWORKS), new CTextArea('ext_host_profiles[device_networks]', $ext_host_profiles['device_networks'], 50, 5));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_notes]', isset($visible['device_notes']), 'ext_host_profiles[device_notes]', S_ORIGINAL), S_DEVICE_NOTES), new CTextArea('ext_host_profiles[device_notes]', $ext_host_profiles['device_notes'], 50, 5));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_hardware]', isset($visible['device_hardware']), 'ext_host_profiles[device_hardware]', S_ORIGINAL), S_DEVICE_HARDWARE), new CTextArea('ext_host_profiles[device_hardware]', $ext_host_profiles['device_hardware'], 50, 5));
        $frmHost->addRow(array(new CVisibilityBox('visible[device_software]', isset($visible['device_software']), 'ext_host_profiles[device_software]', S_ORIGINAL), S_DEVICE_SOFTWARE), new CTextArea('ext_host_profiles[device_software]', $ext_host_profiles['device_software'], 50, 5));
        $frmHost->addRow(array(new CVisibilityBox('visible[ip_subnet_mask]', isset($visible['ip_subnet_mask']), 'ext_host_profiles[ip_subnet_mask]', S_ORIGINAL), S_IP_SUBNET_MASK), new CTextBox('ext_host_profiles[ip_subnet_mask]', $ext_host_profiles['ip_subnet_mask'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[ip_router]', isset($visible['ip_router']), 'ext_host_profiles[ip_router]', S_ORIGINAL), S_IP_ROUTER), new CTextBox('ext_host_profiles[ip_router]', $ext_host_profiles['ip_router'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[ip_macaddress]', isset($visible['ip_macaddress']), 'ext_host_profiles[ip_macaddress]', S_ORIGINAL), S_IP_MACADDRESS), new CTextBox('ext_host_profiles[ip_macaddress]', $ext_host_profiles['ip_macaddress'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[oob_ip]', isset($visible['oob_ip']), 'ext_host_profiles[oob_ip]', S_ORIGINAL), S_OOB_IP), new CTextBox('ext_host_profiles[oob_ip]', $ext_host_profiles['oob_ip'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[oob_subnet_mask]', isset($visible['oob_subnet_mask']), 'ext_host_profiles[oob_subnet_mask]', S_ORIGINAL), S_OOB_SUBNET_MASK), new CTextBox('ext_host_profiles[oob_subnet_mask]', $ext_host_profiles['oob_subnet_mask'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[oob_router]', isset($visible['oob_router']), 'ext_host_profiles[oob_router]', S_ORIGINAL), S_OOB_ROUTER), new CTextBox('ext_host_profiles[oob_router]', $ext_host_profiles['oob_router'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[date_hw_buy]', isset($visible['date_hw_buy']), 'ext_host_profiles[date_hw_buy]', S_ORIGINAL), S_DATE_HW_BUY), new CTextBox('ext_host_profiles[date_hw_buy]', $ext_host_profiles['date_hw_buy'], 15));
        $frmHost->addRow(array(new CVisibilityBox('visible[date_hw_install]', isset($visible['date_hw_install']), 'ext_host_profiles[date_hw_install]', S_ORIGINAL), S_DATE_HW_INSTALL), new CTextBox('ext_host_profiles[date_hw_install]', $ext_host_profiles['date_hw_install'], 15));
        $frmHost->addRow(array(new CVisibilityBox('visible[date_hw_expiry]', isset($visible['date_hw_expiry']), 'ext_host_profiles[date_hw_expiry]', S_ORIGINAL), S_DATE_HW_EXPIRY), new CTextBox('ext_host_profiles[date_hw_expiry]', $ext_host_profiles['date_hw_expiry'], 15));
        $frmHost->addRow(array(new CVisibilityBox('visible[date_hw_decomm]', isset($visible['date_hw_decomm']), 'ext_host_profiles[date_hw_decomm]', S_ORIGINAL), S_DATE_HW_DECOMM), new CTextBox('ext_host_profiles[date_hw_decomm]', $ext_host_profiles['date_hw_decomm'], 15));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_street_1]', isset($visible['site_street_1']), 'ext_host_profiles[site_street_1]', S_ORIGINAL), S_SITE_STREET_1), new CTextBox('ext_host_profiles[site_street_1]', $ext_host_profiles['site_street_1'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_street_2]', isset($visible['site_street_2']), 'ext_host_profiles[site_street_2]', S_ORIGINAL), S_SITE_STREET_2), new CTextBox('ext_host_profiles[site_street_2]', $ext_host_profiles['site_street_2'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_street_3]', isset($visible['site_street_3']), 'ext_host_profiles[site_street_3]', S_ORIGINAL), S_SITE_STREET_3), new CTextBox('ext_host_profiles[site_street_3]', $ext_host_profiles['site_street_3'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_city]', isset($visible['site_city']), 'ext_host_profiles[site_city]', S_ORIGINAL), S_SITE_CITY), new CTextBox('ext_host_profiles[site_city]', $ext_host_profiles['site_city'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_state]', isset($visible['site_state']), 'ext_host_profiles[site_state]', S_ORIGINAL), S_SITE_STATE), new CTextBox('ext_host_profiles[site_state]', $ext_host_profiles['site_state'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_country]', isset($visible['site_country']), 'ext_host_profiles[site_country]', S_ORIGINAL), S_SITE_COUNTRY), new CTextBox('ext_host_profiles[site_country]', $ext_host_profiles['site_country'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_zip]', isset($visible['site_zip']), 'ext_host_profiles[site_zip]', S_ORIGINAL), S_SITE_ZIP), new CTextBox('ext_host_profiles[site_zip]', $ext_host_profiles['site_zip'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_rack]', isset($visible['site_rack']), 'ext_host_profiles[site_rack]', S_ORIGINAL), S_SITE_RACK), new CTextBox('ext_host_profiles[site_rack]', $ext_host_profiles['site_rack'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[site_notes]', isset($visible['site_notes']), 'ext_host_profiles[site_notes]', S_ORIGINAL), S_SITE_NOTES), new CTextArea('ext_host_profiles[site_notes]', $ext_host_profiles['site_notes'], 50, 5));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_name]', isset($visible['poc_1_name']), 'ext_host_profiles[poc_1_name]', S_ORIGINAL), S_POC_1_NAME), new CTextBox('ext_host_profiles[poc_1_name]', $ext_host_profiles['poc_1_name'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_email]', isset($visible['poc_1_email']), 'ext_host_profiles[poc_1_email]', S_ORIGINAL), S_POC_1_EMAIL), new CTextBox('ext_host_profiles[poc_1_email]', $ext_host_profiles['poc_1_email'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_phone_1]', isset($visible['poc_1_phone_1']), 'ext_host_profiles[poc_1_phone_1]', S_ORIGINAL), S_POC_1_PHONE_1), new CTextBox('ext_host_profiles[poc_1_phone_1]', $ext_host_profiles['poc_1_phone_1'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_phone_2]', isset($visible['poc_1_phone_2']), 'ext_host_profiles[poc_1_phone_2]', S_ORIGINAL), S_POC_1_PHONE_2), new CTextBox('ext_host_profiles[poc_1_phone_2]', $ext_host_profiles['poc_1_phone_2'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_cell]', isset($visible['poc_1_cell']), 'ext_host_profiles[poc_1_cell]', S_ORIGINAL), S_POC_1_CELL), new CTextBox('ext_host_profiles[poc_1_cell]', $ext_host_profiles['poc_1_cell'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_screen]', isset($visible['poc_1_screen']), 'ext_host_profiles[poc_1_screen]', S_ORIGINAL), S_POC_1_SCREEN), new CTextBox('ext_host_profiles[poc_1_screen]', $ext_host_profiles['poc_1_screen'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_1_notes]', isset($visible['poc_1_notes']), 'ext_host_profiles[poc_1_notes]', S_ORIGINAL), S_POC_1_NOTES), new CTextArea('ext_host_profiles[poc_1_notes]', $ext_host_profiles['poc_1_notes'], 50, 5));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_name]', isset($visible['poc_2_name']), 'ext_host_profiles[poc_2_name]', S_ORIGINAL), S_POC_2_NAME), new CTextBox('ext_host_profiles[poc_2_name]', $ext_host_profiles['poc_2_name'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_email]', isset($visible['poc_2_email']), 'ext_host_profiles[poc_2_email]', S_ORIGINAL), S_POC_2_EMAIL), new CTextBox('ext_host_profiles[poc_2_email]', $ext_host_profiles['poc_2_email'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_phone_1]', isset($visible['poc_2_phone_1']), 'ext_host_profiles[poc_2_phone_1]', S_ORIGINAL), S_POC_2_PHONE_1), new CTextBox('ext_host_profiles[poc_2_phone_1]', $ext_host_profiles['poc_2_phone_1'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_phone_2]', isset($visible['poc_2_phone_2']), 'ext_host_profiles[poc_2_phone_2]', S_ORIGINAL), S_POC_2_PHONE_2), new CTextBox('ext_host_profiles[poc_2_phone_2]', $ext_host_profiles['poc_2_phone_2'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_cell]', isset($visible['poc_2_cell']), 'ext_host_profiles[poc_2_cell]', S_ORIGINAL), S_POC_2_CELL), new CTextBox('ext_host_profiles[poc_2_cell]', $ext_host_profiles['poc_2_cell'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_screen]', isset($visible['poc_2_screen']), 'ext_host_profiles[poc_2_screen]', S_ORIGINAL), S_POC_2_SCREEN), new CTextBox('ext_host_profiles[poc_2_screen]', $ext_host_profiles['poc_2_screen'], 61));
        $frmHost->addRow(array(new CVisibilityBox('visible[poc_2_notes]', isset($visible['poc_2_notes']), 'ext_host_profiles[poc_2_notes]', S_ORIGINAL), S_POC_2_NOTES), new CTextArea('ext_host_profiles[poc_2_notes]', $ext_host_profiles['poc_2_notes'], 50, 5));
    } else {
        $frmHost->addVar('ext_host_profiles[device_alias]', $ext_host_profiles['device_alias']);
        $frmHost->addVar('ext_host_profiles[device_type]', $ext_host_profiles['device_type']);
        $frmHost->addVar('ext_host_profiles[device_chassis]', $ext_host_profiles['device_chassis']);
        $frmHost->addVar('ext_host_profiles[device_os]', $ext_host_profiles['device_os']);
        $frmHost->addVar('ext_host_profiles[device_os_short]', $ext_host_profiles['device_os_short']);
        $frmHost->addVar('ext_host_profiles[device_hw_arch]', $ext_host_profiles['device_hw_arch']);
        $frmHost->addVar('ext_host_profiles[device_serial]', $ext_host_profiles['device_serial']);
        $frmHost->addVar('ext_host_profiles[device_model]', $ext_host_profiles['device_model']);
        $frmHost->addVar('ext_host_profiles[device_tag]', $ext_host_profiles['device_tag']);
        $frmHost->addVar('ext_host_profiles[device_vendor]', $ext_host_profiles['device_vendor']);
        $frmHost->addVar('ext_host_profiles[device_contract]', $ext_host_profiles['device_contract']);
        $frmHost->addVar('ext_host_profiles[device_who]', $ext_host_profiles['device_who']);
        $frmHost->addVar('ext_host_profiles[device_status]', $ext_host_profiles['device_status']);
        $frmHost->addVar('ext_host_profiles[device_app_01]', $ext_host_profiles['device_app_01']);
        $frmHost->addVar('ext_host_profiles[device_app_02]', $ext_host_profiles['device_app_02']);
        $frmHost->addVar('ext_host_profiles[device_app_03]', $ext_host_profiles['device_app_03']);
        $frmHost->addVar('ext_host_profiles[device_app_04]', $ext_host_profiles['device_app_04']);
        $frmHost->addVar('ext_host_profiles[device_app_05]', $ext_host_profiles['device_app_05']);
        $frmHost->addVar('ext_host_profiles[device_url_1]', $ext_host_profiles['device_url_1']);
        $frmHost->addVar('ext_host_profiles[device_url_2]', $ext_host_profiles['device_url_2']);
        $frmHost->addVar('ext_host_profiles[device_url_3]', $ext_host_profiles['device_url_3']);
        $frmHost->addVar('ext_host_profiles[device_networks]', $ext_host_profiles['device_networks']);
        $frmHost->addVar('ext_host_profiles[device_notes]', $ext_host_profiles['device_notes']);
        $frmHost->addVar('ext_host_profiles[device_hardware]', $ext_host_profiles['device_hardware']);
        $frmHost->addVar('ext_host_profiles[device_software]', $ext_host_profiles['device_software']);
        $frmHost->addVar('ext_host_profiles[ip_subnet_mask]', $ext_host_profiles['ip_subnet_mask']);
        $frmHost->addVar('ext_host_profiles[ip_router]', $ext_host_profiles['ip_router']);
        $frmHost->addVar('ext_host_profiles[ip_macaddress]', $ext_host_profiles['ip_macaddress']);
        $frmHost->addVar('ext_host_profiles[oob_ip]', $ext_host_profiles['oob_ip']);
        $frmHost->addVar('ext_host_profiles[oob_subnet_mask]', $ext_host_profiles['oob_subnet_mask']);
        $frmHost->addVar('ext_host_profiles[oob_router]', $ext_host_profiles['oob_router']);
        $frmHost->addVar('ext_host_profiles[date_hw_buy]', $ext_host_profiles['date_hw_buy']);
        $frmHost->addVar('ext_host_profiles[date_hw_install]', $ext_host_profiles['date_hw_install']);
        $frmHost->addVar('ext_host_profiles[date_hw_expiry]', $ext_host_profiles['date_hw_expiry']);
        $frmHost->addVar('ext_host_profiles[date_hw_decomm]', $ext_host_profiles['date_hw_decomm']);
        $frmHost->addVar('ext_host_profiles[site_street_1]', $ext_host_profiles['site_street_1']);
        $frmHost->addVar('ext_host_profiles[site_street_2]', $ext_host_profiles['site_street_2']);
        $frmHost->addVar('ext_host_profiles[site_street_3]', $ext_host_profiles['site_street_3']);
        $frmHost->addVar('ext_host_profiles[site_city]', $ext_host_profiles['site_city']);
        $frmHost->addVar('ext_host_profiles[site_state]', $ext_host_profiles['site_state']);
        $frmHost->addVar('ext_host_profiles[site_country]', $ext_host_profiles['site_country']);
        $frmHost->addVar('ext_host_profiles[site_zip]', $ext_host_profiles['site_zip']);
        $frmHost->addVar('ext_host_profiles[site_rack]', $ext_host_profiles['site_rack']);
        $frmHost->addVar('ext_host_profiles[site_notes]', $ext_host_profiles['site_notes']);
        $frmHost->addVar('ext_host_profiles[poc_1_name]', $ext_host_profiles['poc_1_name']);
        $frmHost->addVar('ext_host_profiles[poc_1_email]', $ext_host_profiles['poc_1_email']);
        $frmHost->addVar('ext_host_profiles[poc_1_phone_1]', $ext_host_profiles['poc_1_phone_1']);
        $frmHost->addVar('ext_host_profiles[poc_1_phone_2]', $ext_host_profiles['poc_1_phone_2']);
        $frmHost->addVar('ext_host_profiles[poc_1_cell]', $ext_host_profiles['poc_1_cell']);
        $frmHost->addVar('ext_host_profiles[poc_1_screen]', $ext_host_profiles['poc_1_screen']);
        $frmHost->addVar('ext_host_profiles[poc_1_notes]', $ext_host_profiles['poc_1_notes']);
        $frmHost->addVar('ext_host_profiles[poc_2_name]', $ext_host_profiles['poc_2_name']);
        $frmHost->addVar('ext_host_profiles[poc_2_email]', $ext_host_profiles['poc_2_email']);
        $frmHost->addVar('ext_host_profiles[poc_2_phone_1]', $ext_host_profiles['poc_2_phone_1']);
        $frmHost->addVar('ext_host_profiles[poc_2_phone_2]', $ext_host_profiles['poc_2_phone_2']);
        $frmHost->addVar('ext_host_profiles[poc_2_cell]', $ext_host_profiles['poc_2_cell']);
        $frmHost->addVar('ext_host_profiles[poc_2_screen]', $ext_host_profiles['poc_2_screen']);
        $frmHost->addVar('ext_host_profiles[poc_2_notes]', $ext_host_profiles['poc_2_notes']);
    }
    // END:   HOSTS PROFILE EXTENDED Section
    $frmHost->addItemToBottomRow(new CButton("save", S_SAVE));
    $frmHost->addItemToBottomRow(SPACE);
    $frmHost->addItemToBottomRow(new CButtonCancel(url_param("config") . url_param('groupid')));
    $frmHost->Show();
}