><?php echo print_something($key->man_form_factor); ?> </span></p> <p><label for='st_memory'><?php echo __('Memory'); ?> : </label><span id='st_memory' class="form_field"><?php echo number_format(intval($key->pc_memory / 1024)); ?> MiB </span></p> <p><label for='st_uptime'><?php echo __('Uptime'); ?> : </label><span id='st_uptime' class="form_field"><?php echo print_something(strTime($key->uptime)); ?> </span></p> <p><label for="man_location_name"><?php echo __('Location Name'); ?> : </label><span id="man_location_name"><?php echo print_something($location_name); ?> </span></p> <p><label for="man_function"><?php echo __('Function'); ?> : </label><span id="man_function" <?php echo $edit; ?>
if ($system[0]->type == 'computer') { include "v_display_inc_menu.php"; } ?> </ul> </div> </fieldset> </form> </div> <div id="content_column" style="margin-left: 200px;"> <?php # special case formatting $system[0]->ip = ip_address_from_db($system[0]->ip); $system[0]->uptime = strTime($system[0]->uptime); # create the individual summary sections $summary_attributes = array('name' => 'text', 'hostname' => 'text' , 'sysName' => 'text', 'ip' => 'text', 'domain' => 'text', 'fqdn' => 'text', 'type' => 'select', 'environment' => 'select', 'status' => 'select', 'description' => 'text', '----' => '----', 'manufacturer' => 'text', 'model' => 'text',
function export_csv() { session_start(); if (!isset($_SESSION['username']) || !isset($_SESSION['password'])) { header("Location:login.php"); } $ini_array = parse_ini_file("config/cmdb.conf"); $dbhost = $ini_array['db_host']; $dbport = $ini_array['db_port']; $dbuser = $ini_array['db_user']; $dbpass = $ini_array['db_pass']; $dbname = $ini_array['db_name']; $conn = mysql_connect("{$dbhost}:{$dbport}", $dbuser, $dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname); include_once 'classes/Check.php'; $file_name = trim($_GET['name']) . ".csv"; header("Content-type:text/octect-stream"); header("Content-Disposition:attachment;filename=\"{$file_name}\""); $heading = array("Name", "Uptime %", "From", "To", "Ok", "Warning", "Critical", "Unknown", "No Data", "Ok (secs)", "Warning (secs)", "Critical (secs)", "Unknown (secs)", "No Data (secs)"); $content = implode(",", $heading); $content .= "\n"; $reports = Report::get_reports_by_name($_GET[name]); foreach ($reports as $report_id => $profile_id) { $data = array(); $report = new Report($report_id); $profile = new CheckReportProfile($profile_id); array_push($data, $profile->get_name(), $report->get_up_percentage(), $report->get_start_time(), $report->get_end_time(), strTime($report->get_ok_secs()), strTime($report->get_warning_secs()), strTime($report->get_critical_secs()), strTime($report->get_unknown_secs()), strTime($report->get_no_data_secs()), $report->get_ok_secs(), $report->get_warning_secs(), $report->get_critical_secs(), $report->get_unknown_secs(), $report->get_no_data_secs()); $content .= stripslashes(implode(",", $data)); $content .= "\n"; } print $content; }