}

                if ($value == '' and isset($system[0]->$key) and $system[0]->$key > '') {
                    echo "<p><label for='$key'>".__($text).": </label><span id='$key'>".$system[0]->$key."</span></p>\n";
                }

                if ($value == 'text') {
                    echo "<p><label for='$key'>".__($text).": </label><span id='$key' $edit>".print_something($system[0]->$key)."</span>$edit_icon</p>\n";
                }

                if ($value == 'select') {
                    echo "<p><label for='".$key."_select'>".__($text).": </label>\n";
                    if ($access_level > 7) {
                        echo "<span id='".$key."_select' style='color:blue;'><span onclick='display_$key();'>".print_something($system[0]->$key)."</span></span>$edit_icon</p>\n";
                    } else {
                        echo "<span id='".$key."_select'>".print_something($system[0]->$key)."</span></p>\n";
                    }
                }

                if ((string)$value == 'icon') {
                    $icon = htmlentities($system[0]->icon);
                    echo "<p><label for='icon'>" . __('Icon') . ": </label><span id='icon'><img src='" . base_url() . "theme-tango/tango-images/16_" . $icon . ".png' alt='' /></span></p>";
                }
            }
            echo "</div>\n";
            ?>
        </div>
        <?php echo display_custom_field('system', $additional_fields, $edit); ?>
    </fieldset>
</form>
</div>
function display_custom_field($field_placement, $additional_fields, $edit)
{
    foreach ($additional_fields as $field) {
        if ($field->field_placement == $field_placement) {
            $data_id = "field_" . $field->field_type;
            $data_id = $field->{$data_id};
            $data_value = "field_" . $field->field_type;
            $data_value = $field->{$data_value};
            $width = "120";
            if ($field_placement == 'view_summary_windows') {
                $width = '160';
            }
            # TODO - fix this string output hack with real html entities
            echo "<div style=\"float: left; width: 90%; \">\n";
            echo "<label for=\"custom_" . $field->field_type . "_" . str_replace(" ", "_", str_replace("#", "", $data_id)) . "_" . $field->field_id . "_placement\" >" . __($field->field_name) . ": </label>";
            echo "<span id=\"custom_" . $field->field_type . "_" . str_replace(" ", "_", str_replace("#", "", $data_id)) . "_" . $field->field_id . "_placement\"" . $edit . ">" . print_something($data_value) . "</span>\n";
            echo "</div>\n";
        }
    }
}
Beispiel #3
0
			<?php } ?>
			<th align='center'><?php echo __('Reports')?></th>
		</tr>
	</thead>
	<tbody>
		<?php $i = 0; ?>
		<?php foreach ($query as $key): ?>
		<?php if ($key->group_category == 'network') {
            if ($i < $group_limit) { $i++; ?>
        		<tr>
        			<td align='center'><img src="<?php echo $oa_theme_images; ?>/16_<?php echo htmlentities($key->group_icon)?>.png" alt="<?php echo htmlentities($key->group_category)?>" title="<?php echo htmlentities($key->group_category)?>" style='border-width:0px;' /></td>
        			<td align='center'><?php echo intval($key->total)?></td>
        			<?php if ($key->group_padded_name > "") { ?>
        				<td><span style="display: none;"><?php echo htmlentities($key->group_padded_name)?></span><a href="<?php echo base_url()?>index.php/main/list_devices/<?php echo intval($key->group_id)?>"><?php echo print_something($key->group_name)?></a></td>
        			<?php } else { ?>
        				<td><a href="<?php echo base_url()?>index.php/main/list_devices/<?php echo intval($key->group_id)?>"><?php echo print_something($key->group_name)?></a></td>
        			<?php } ?>
        			<td><?php echo htmlentities($key->group_description)?></td>
        			<?php if (($this->config->config['non_admin_search'] == 'y') or ($this->user->admin == 'y')) { ?>
        			<td align='center'><a class="SearchPopupTrigger" rel="<?php echo intval($key->group_id)?>" href="#" ><img src="<?php echo $oa_theme_images; ?>/16_find.png"  style="border-width:0px;" title="" alt="" /></a></td>
        			<?php } ?>
        			<td align='center'><a class="ReportPopupTrigger" rel="<?php echo intval($key->group_id)?>" href="#" ><img src="<?php echo $oa_theme_images; ?>/16_csv.png"  style="border-width:0px;" title="" alt="" /></a></td>
        		</tr>
            <?php } // end of group_limit ?>
        <?php } // end of network group category ?>
		<?php endforeach; // end of all groups loop ?>
		<?php if ($i == 0) { ?>
    		<?php if (($this->config->config['non_admin_search'] == 'y') or ($this->user->admin == 'y')) { ?>
    		<tr>
    			<td></td><td></td><td></td><td></td><td></td><td></td>
    		</tr>
function display_custom_field($field_placement, $additional_fields, $edit)
{
    foreach ($additional_fields as $field) {
        if ($field->field_placement == $field_placement) {
            $data_id = "field_" . $field->field_type;
            $data_id = $field->{$data_id};
            $data_value = "field_" . $field->field_type;
            $data_value = $field->{$data_value};
            switch ($field->field_type) {
                case 'varchar':
                    $data = $field->field_varchar;
                    echo "<div style=\"float: left; width: 90%; \">\n";
                    echo "<label for=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" >" . __($field->field_name) . ": </label>";
                    echo "<span id=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" " . $edit . ">" . print_something($data_value) . "</span><br />&nbsp;\n";
                    echo "</div>\n";
                    break;
                    /*				case 'bool':
                    					echo "<div style=\"float: left; width: 90%; \">\n";
                    					echo "<label for=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" >" . __($field->field_name) . ": </label>";
                    					if ($field->field_varchar == 'true') {$checked = 'checked';} else {$checked = '';}
                    					if ($edit > '') {$disabled = '';} else {$disabled = 'disabled';}
                    					echo "	<input type=\"checkbox\" id=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" $checked $disabled />";
                    					echo "</div>\n";
                    					break;*/
                /*				case 'bool':
                					echo "<div style=\"float: left; width: 90%; \">\n";
                					echo "<label for=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" >" . __($field->field_name) . ": </label>";
                					if ($field->field_varchar == 'true') {$checked = 'checked';} else {$checked = '';}
                					if ($edit > '') {$disabled = '';} else {$disabled = 'disabled';}
                					echo "	<input type=\"checkbox\" id=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" $checked $disabled />";
                					echo "</div>\n";
                					break;*/
                default:
                    # code...
                    break;
            }
        }
    }
}
function display_custom_field($field_placement, $additional_fields, $edit)
{
    foreach ($additional_fields as $field) {
        if ($field->placement == $field_placement) {
            $width = "120";
            if ($field_placement == 'view_summary_windows') {
                $width = '160';
            }
            # TODO: fix this string output hack with real html entities
            echo "<div style=\"float: left; width: 90%; \">\n";
            echo "<label for=\"".htmlentities($field->type)."_".@htmlentities($field->id)."_".@htmlentities($field->{'additional_field.id'})."_outer\" >".htmlentities(__($field->name)).": </label>";
            echo "<span id=\"".htmlentities($field->type)."_".@htmlentities($field->{'additional_field.id'})."_".@htmlentities($field->id)."\" >".@print_something($field->value)."</span>";
            echo "<span> * Please use /devices/ to edit this field.</span>";
            echo "<br />&nbsp;\n";
            echo "</div>\n";
        }
    }
}
Beispiel #6
0
    ?>
	<label for="submit">&nbsp;</label><input type="submit" name="submit" id="submit" value="<?php echo __('Submit'); ?>" />
</fieldset>
</form>
<br /><br />
<fieldset id="alert_details" class='niceforms'>
	<legend><span style='font-size: 12pt;'>&nbsp;<?php echo __('Alert Details')?></span></legend>
	<table cellspacing="1" class="tablesorter">
		<thead>
			<tr>
				<th width="130"><?php echo __('Timestamp')?></th>
				<th width="100"><?php echo __('IP address')?></th>
				<th width="110"><?php echo __('System Name')?></th>
				<th width="140"><?php echo __('System Description')?></th>
				<th><?php echo __('Details')?></th>
			</tr>
		</thead>
		<tbody>
			<?php foreach ($query as $key): ?>
			<tr>
				<td><?php echo $key->timestamp?></td>
				<td><span style="display: none;"><?php echo print_something($key->ip)?></span><?php echo ip_address_from_db(print_something($key->ip))?></td>
				<td><a class="SystemPopupTrigger" rel="<?php echo $key->id;?>" href="<?php echo base_url()?>index.php/main/system_display/<?php echo $key->id?>"><?php echo print_something($key->name)?></a></td>
				<td><?php echo print_something($key->description)?></td>
				<td><?php echo print_something($key->details)?></td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
</fieldset>
function display_custom_field($field_placement, $additional_fields, $edit)
{
    foreach ($additional_fields as $field) {
        if ($field->field_placement == $field_placement) {
            $data_id = "field_" . $field->field_type;
            $data_id = $field->{$data_id};
            $data_value = "field_" . $field->field_type;
            $data_value = $field->{$data_value};
            switch ($field->field_type) {
                case 'varchar':
                    $data = $field->field_varchar;
                    echo "<div style=\"float: left; width: 90%; \">\n";
                    echo "<label for=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" >" . __($field->field_name) . ": </label>";
                    echo "<span id=\"custom_" . $field->field_type . "_" . $field->field_details_id . "_" . $field->field_id . "\" " . $edit . ">" . print_something($data_value) . "</span><br />&nbsp;\n";
                    echo "</div>\n";
                    break;
                default:
                    # code...
                    break;
            }
        }
    }
}
Beispiel #8
0
	<img class='section_image' src='<?php echo $oa_theme_images;?>/48_network.png' alt='' title='' />
	<p><label for='data[id]'><?php echo __("ID")?>: </label><span id='data[id]' name='data[id]' tabindex='1' title='ID'><?php echo print_something($item->id); ?></span></p>
	<p><label for='data[name]'><?php echo __("Name")?>: </label><span id='data[name]' name='data[name]' tabindex='2' title='Name'><?php echo print_something($item->attributes->name); ?></span></p>
	<p><label for='data[description]'><?php echo __("Description")?>: </label><span id='data[description]' name='data[description]' tabindex='3' title='Description'><?php echo print_something($item->attributes->description); ?></span></p>
	<p><label for='data[based_on]'><?php echo __("Based On")?>: </label><span id='data[based_on]' name='data[based_on]' tabindex='3' title='Based On'><?php echo print_something($item->attributes->based_on); ?></span></p>
	<p><label for='data[edited_by]'><?php echo __("Edited By")?>: </label><span id='data[edited_by]' name='data[edited_by]' tabindex='4' title='Edited By'><?php echo print_something($item->attributes->edited_by); ?></span></p>
	<p><label for='data[edited_date]'><?php echo __("Edited Date")?>: </label><span id='data[edited_date]' name='data[edited_date]' tabindex='5' title='Edited Date'><?php echo print_something($item->attributes->edited_date); ?></span></p>
</fieldset>
<br />
<fieldset id="options" class='niceforms'>
<legend><span style="font-size: 12pt;">&nbsp;<?php echo __('Options')?></span></legend>
<?php
	foreach ($options as $key => $value) {
		if ($key != 'files') {
?>
	<p><label for='<?php echo $key; ?>'><?php echo __($key)?>: </label><span id='<?php echo $key; ?>' name='<?php echo $key; ?>' tabindex='1' title='<?php echo $key; ?>'><?php echo print_something($value); ?></span></p>
<?php
	} }
	if (!empty($options->files) and count($options->files) > 0) {
		foreach ($options->files as $key => $value) {
			echo '<p><label for="files_' . $key . '">Files: </label><span id="files_' . $key . '">' . $value . '</span></p>';
		}
	}
?>
</fieldset>
<br /><br />

</form>

</div>
</div>
function show_software($type, $software) {
    global $oa_theme_images;
    echo "<div id='view_$type' style='float: left; width: 100%;'>\n";
    if (count($software) > 0) {
        echo "<br />\n";
        echo "<br />\n";
        echo "<form action='#' method='post' class='niceforms'>\n";
        echo "  <fieldset id='software_$type' class='niceforms'>\n";
        echo "      <legend><span style='font-size: 12pt;'>&nbsp;" . __('Installed '.ucfirst($type)) . "</span></legend>\n";
        echo "      <table cellspacing='1' class='tablesorter' style=\"width:100%;\">\n";
        echo "      <thead>\n";
        echo "          <tr>\n";
        echo "              <th style='width:470px;' align='left'>" . __('Package Name') . "</th>\n";
        echo "              <th style='width:70px;'  align='center'>" . __('Contact') . "&nbsp;&nbsp;&nbsp;</th>\n";
        echo "              <th style='width:60px;'  align='center'>" . __('Version') . "</th>\n";
        echo "              <th style='width:150px;' align='center'>" . __('Publisher') . "</th>\n";
        echo "              <th style='width:150px;' align='center'>" . __('Date Detected') . "</th>\n";
        echo "              <th style='width:150px;' align='center'>" . __('Installed On') . "</th>\n";
        echo "              <th style='width:150px;' align='center'>" . __('Installed By') . "</th>\n";
        echo "          </tr>\n";
        echo "      </thead>\n";
        echo "      <tbody>\n";
        if ($type == 'software') {
            $type = '';
        }
        if ($type == 'odbc') {
            $type = 'odbc driver';
        }
        $count = 0;
        foreach ($software as $item) {
            $key = $item->attributes;
            if ($key->type == $type) {
                if (mb_strlen($key->version) > 18) {
                    $key->version = mb_substr("$key->version", 0, 15).'...';
                }
                $software_link = '';
                if (($key->url != '') and ($key->url != ' ')) {
                    $software_link = "<a href='" . clean_url($key->url) . "'><img style='border-width:0px;' src='" . $GLOBALS['oa_theme_images'] . "/16_browser.png' alt='' /></a>";
                }
                if (($key->email != '') and ($key->email != ' ')) {
                    $software_link = "<a href='mailto://" . $key->email . "'><img style='border-width:0px;' src='" . $GLOBALS['oa_theme_images'] . "/16_email.png' alt='' /></a>";
                }
                if ($key->installed_on == '0000-00-00 00:00:00') {
                    $key->installed_on = '';
                }
                echo "          <tr>\n";
                #echo "              <td>" . print_something($software_name) . "</td>\n";
                echo "              <td>" . print_something($key->name) . "</td>\n";
                echo "              <td align='center'>" . $software_link . "</td>\n";
                echo "              <td align='center'>" . print_something($key->version) . "</td>\n";
                echo "              <td align='center'>" . print_something($key->publisher) . "</td>\n";
                echo "              <td align='center'>" . print_something($key->first_seen) . "</td>\n";
                echo "              <td align='center'>" . print_something($key->installed_on) . "</td>\n";
                echo "              <td align='center'>" . print_something($key->installed_by) . "</td>\n";
                echo "          </tr>\n";
                $count = 1;
            }
        }
        if ($count != 1) {
            echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>";
        }
        echo "      </tbody>\n";
        echo "      </table>\n";
        echo "  </fieldset>\n";
        echo "</form>\n";
    }
    echo "</div>\n";
}
    data = "name=location_id&value="+encodeURIComponent(table_text)+"&system_id="+formVars;
    http.open("POST", "<?php echo base_url();?>index.php/ajax/update_system_man", true);
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.send(data);
    http.onreadystatechange = receive_location;
}

function receive_location() {
	if(http.readyState == 4 && http.status == 200){
		// Text returned FROM the PHP script
		if(http.responseText) {
			// UPDATE ajaxTest content
			//update="<span onclick='display_location();'>"+http.responseText+"<\/span>";
			//document.getElementById("location_container").innerHTML = update;
			document.getElementById("location_container").innerHTML = http.responseText;
			//update=http.responseText+"<p><label for='location_rack'><?php echo __('Rack')?>: <\/label><span id='location_rack' <?php echo str_replace('"', "'", $edit)?>><?php echo print_something($location_rack)?><\/span><\/p><p><label for='location_rack_position'><?php echo __('Rack Position')?>: <\/label><span id='location_rack_position' <?php echo str_replace('"', "'", $edit)?>><?php echo print_something($location_rack_position)?><\/p>";
			document.getElementById("location_container").innerHTML = update;
		}
	}
}

function display_org() {
	<?php
    $org_form = "<option value=' '>".__("Choose an Org")."<\/option>";
    foreach ($orgs as $org) {
        $org_form .= "<option value='".intval($org->id)."'>".htmlentities($org->name)."<\/option>";
    }
    if ($org_id != "") {
        $org_form = "<select id='org_id' onchange='send_org();'>".$org_form."<\/select>";
    } else {
        $org_form = "<select id='org_id' onchange='send_org();'><option value=' '>".__("Choose an Org")."<\/option>".$org_form."<\/select>";
                <div style="width: 90%; float:left;">
                <table cellspacing="1" class="tablesorter" width="100%">
                    <thead>
                        <tr>
                            <th><?php echo __('IP')?></th>
                            <th><?php echo __('Name')?></th>
                            <th><?php echo __('FQDN')?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($dns as $item): ?>
                        <?php $key = $item->attributes; ?>
                        <tr>
                            <td><span style="display:none;"><?php echo print_something($key->ip)?></span><?php echo print_something(ip_address_from_db($key->ip))?></td>
                            <td><?php echo print_something($key->name)?>&nbsp;</td>
                            <td><?php echo print_something($key->fqdn)?>&nbsp;</td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                </div>
            </fieldset>
        </form>
    <?php } ?>
    </div>

    <div id="view_summary_san" style="float: left; width: 100%;">
    <?php if (count($san) > 0) { ?>
        <br />
        <br />
        <form action="#" method="post" class='niceforms'>
Beispiel #12
0
 * @version 1.12.8
 *
 * @copyright Copyright (c) 2014, Opmantek
 * @license http://www.gnu.org/licenses/agpl-3.0.html aGPL v3
 */
?>
<form>
<fieldset id="network" class='niceforms'>
	<legend><span style="font-size: 12pt;">&nbsp;<?php echo __('Network Details')?></span></legend>
	<img class='section_image' src='<?php echo $oa_theme_images;?>/48_network.png' alt='' title='' />
	<?php $item = $this->response->data[0]; ?>
	<p><label for='data[id]'><?php echo __("ID")?>: </label><span id='data[id]' name='data[id]' tabindex='1' title='ID'><?php echo print_something($item->id); ?></span></p>
	<p><label for='data[name]'><?php echo __("Name")?>: </label><span id='data[name]' name='data[name]' tabindex='2' title='Name'><?php echo print_something($item->name); ?></span></p>
	<p><label for='data[description]'><?php echo __("Description")?>: </label><span id='data[description]' name='data[description]' tabindex='3' title='Level'><?php echo print_something($item->description); ?></span></p>
	<p><label for='data[edited_by]'><?php echo __("Edited By")?>: </label><span id='data[edited_by]' name='data[edited_by]' tabindex='4' title='Edited By'><?php echo print_something($item->edited_by); ?></span></p>
	<p><label for='data[edited_date]'><?php echo __("Edited Date")?>: </label><span id='data[edited_date]' name='data[edited_date]' tabindex='5' title='Edited Date'><?php echo print_something($item->edited_date); ?></span></p>
	<?php if (empty($this->response->data['devices'])) { ?>
	<p><label></label><button><a href="<?php echo current_url() . '?sub_resource=devices&' . $this->response->meta->query_string; ?>">Show Devices</a></button>
	<?php } else { ?>
	<p><label></label><button><a href="<?php echo current_url() . '?' . str_replace('sub_resource=devices', '', $this->response->meta->query_string); ?>">Hide Devices</a></button>
	<?php } ?>
</fieldset>

<br /><br />

<?php if (!empty($this->response->included)) { ?>
<fieldset id="devices" class='niceforms'>
	<legend><span style='font-size: 12pt;'>&nbsp;<?php echo __('Devices')?></span></legend>
	<table cellpadding = "0" cellspacing="0" width="100%" class="tablesorter">
	<thead>
		<tr>
Beispiel #13
0
    ?>
	<table style='width:780px' cellpadding='0' cellspacing='0'>
		<tr>
			<td style='width:50%'>
				<p><label for='name'><?php echo __("Name")?>: </label><input type='text' id='name' name='name' tabindex='1' title='Location Name' value="<?php echo print_something($key->name); ?>"/><?php echo $error_message; ?></p>
				<p><label for='type'><?php echo __("Type")?>: </label><input type='text' id='type' name='type' tabindex='2' title='Type'  value="<?php echo print_something($key->type); ?>"/></p>
				<p><label for='level'><?php echo __("Level")?>: </label><input type='text' id='level' name='level' tabindex='3' title='Level'  value="<?php echo print_something($key->level); ?>"/></p>
				<p><label for='suite'><?php echo __("Suite")?>: </label><input type='text' id='suite' name='suite' tabindex='4' title='Suite'  value="<?php echo print_something($key->suite); ?>"/></p>
				<p><label for='room'><?php echo __("Room")?>: </label><input type='text' id='room' name='room' tabindex='5' title='Room'  value="<?php echo print_something($key->room); ?>"/></p>
				<p><label for='address'><?php echo __("Street Address")?>: </label><input type='text' id='address' name='address' tabindex='6' title='Street Address'  value="<?php echo print_something($key->address); ?>"/></p>
				<p><label for='city'><?php echo __("City")?>: </label><input type='text' id='city' name='city' tabindex='7' title='City'  value="<?php echo print_something($key->city); ?>"/></p>
			</td>
			<td width="50%">
				<p><label for='state'><?php echo __("State")?>: </label><input type='text' id='state' name='state' tabindex='8' title='State'  value="<?php echo print_something($key->state); ?>"/></p>
				<p><label for='country'><?php echo __("Country")?>: </label><input type='text' id='country' name='country' tabindex='9' title='Country'  value="<?php echo print_something($key->country); ?>"/></p>
				<!-- <p><label for='picture'><?php echo __("Picture")?>: </label><input type='text' id='picture' name='picture' tabindex='9' title='Picture'  value="<?php echo print_something($key->picture); ?>"/></p> -->
				<p><label for='latitude'><?php echo __("Latitude")?>: </label><input type='text' id='latitude' name='latitude' tabindex='10' title='Latitude'  value="<?php echo print_something($key->latitude); ?>"/></p>
				<p><label for='longitude'><?php echo __("Longitude")?>: </label><input type='text' id='longitude' name='longitude' tabindex='11' title='Longitude'  value="<?php echo print_something($key->longitude); ?>"/></p>
				<p><label for='submit'>&nbsp;</label><?php echo form_submit(array('id' => 'submit', 'name' => 'submit'), __('Submit') ); ?></p>
			</td>
		</tr>
	</table>
	<p><?php echo $this->session->flashdata('message');
    ?></p>
	<?php } ?>
	<input type="hidden" value="<?php echo print_something($key->id); ?>" name='id' id='id' />
</fieldset>
<?php echo form_close(); ?>
</div>
</div>