Exemplo n.º 1
0
	<?php 
if (!isset($details['switch'])) {
    $details['switch'] = "";
}
if (!isset($details['port'])) {
    $details['port'] = "";
}
# both are active
if (in_array('switch', $setFields)) {
    print '<tr>' . "\n";
    print '	<td>' . _('Device') . '</td>' . "\n";
    print '	<td>' . "\n";
    print '<select name="switch" class="ip_addr form-control input-sm input-w-auto" ' . $delete . '>' . "\n";
    print '<option disabled>' . _('Select device') . ':</option>' . "\n";
    print '<option value="0" selected>' . _('None') . '</option>' . "\n";
    $devices = getAllUniqueDevices();
    foreach ($devices as $device) {
        //check if permitted in this section!
        $sections = explode(";", $device['sections']);
        if (in_array($subnet2['sectionId'], $sections)) {
            //if same
            if ($device['id'] == $details['switch']) {
                print '<option value="' . $device['id'] . '" selected>' . $device['hostname'] . '</option>' . "\n";
            } else {
                print '<option value="' . $device['id'] . '">' . $device['hostname'] . '</option>' . "\n";
            }
        }
    }
    print '</select>' . "\n";
    print '	</td>' . "\n";
    print '</tr>' . "\n";
Exemplo n.º 2
0
    $sort['direction'] = $tmp[1];
    if ($sort['direction'] == "asc") {
        $sort['directionNext'] = "desc";
    } else {
        $sort['directionNext'] = "asc";
    }
}
/* filter */
if (isset($_POST['ffield'])) {
    $filter = true;
    /* get all unique devices */
    $devices = getAllUniqueDevicesFilter($_POST['ffield'], $_POST['fval'], $sort['field'], $sort['direction']);
} else {
    $filter = false;
    /* get all unique devices */
    $devices = getAllUniqueDevices($sort['field'], $sort['direction']);
}
/* get custom fields */
$custom = getCustomFields('devices');
/* get hidden fields */
if (!isset($settings)) {
    $settings = getAllSettings();
}
$ffields = json_decode($settings['hiddenCustomFields'], true);
if (is_array($ffields['devices'])) {
    $ffields = $ffields['devices'];
} else {
    $ffields = array();
}
//sort icons
if ($sort['direction'] == 'asc') {