if (empty($content)) { return ""; } else { global $webpath; $textdir = direction(); $t = new Template(APP_ROOT . '/templates/' . TEMPLATE_SET); $t->set_file(array('box' => 'box.tpl')); $t->set_var('title', $title); $t->set_var('content', $content); $t->set_var('webpath', $webpath); $t->set_var('text_dir', $textdir['direction']); return $t->parse('out', 'box'); } } // Fire off the XPath class require_once APP_ROOT . '/includes/XPath.class.php'; $XPath = new XPath(); $XPath->importFromString($xml); $tpl->set_var('hardware', makebox($text['hardware'], html_hardware())); if ($error->ErrorsExist() && isset($showerrors) && $showerrors) { $tpl->set_var('errors', makebox("ERRORS", $error->ErrorsAsHTML())); } // parse our the template $tpl->pfp('out', 'form'); // finally our print our footer // if (PHPGROUPWARE == 1) { // $phpgw->common->phpgw_footer(); // } else { //require_once(APP_ROOT . '/includes/system_footer.php'); // } }
// along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: table_filesystems.php,v 1.1.1.1 2001/06/17 17:56:53 lkneschke Exp $ $scale_factor = 2; $_text = '<table width="100%" align="center">' . '<tr><td align="left">' . $f_body_open . '<b>' . $text['mount'] . '</b>' . $f_body_close . '</td>' . '<td align="left">' . $f_body_open . '<b>' . $text['type'] . '</b>' . $f_body_close . '</td>' . '<td align="left">' . $f_body_open . '<b>' . $text['partition'] . '</b>' . $f_body_close . '</td>' . '<td align="left">' . $f_body_open . '<b>' . $text['percent'] . '</b>' . $f_body_close . '</td>' . '<td align="right">' . $f_body_open . '<b>' . $text['free'] . '</b>' . $f_body_close . '</td>' . '<td align="right">' . $f_body_open . '<b>' . $text['used'] . '</b>' . $f_body_close . '</td>' . '<td align="right">' . $f_body_open . '<b>' . $text['size'] . '</b>' . $f_body_close . '</td></tr>'; $fs = sys_fsinfo(); for ($i = 0; $i < sizeof($fs); $i++) { $sum['size'] += $fs[$i]['size']; $sum['used'] += $fs[$i]['used']; $sum['free'] += $fs[$i]['free']; $_text .= "\t<tr>\n"; $_text .= "\t\t<td align=\"left\">{$f_body_open}" . $fs[$i]['mount'] . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"left\">{$f_body_open}" . $fs[$i]['fstype'] . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"left\">{$f_body_open}" . $fs[$i]['disk'] . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"left\">{$f_body_open}"; $_text .= create_bargraph($fs[$i]['percent'], $fs[$i]['percent'], $scale_factor); $_text .= " " . $fs[$i]['percent'] . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"right\">{$f_body_open}" . format_bytesize($fs[$i]['free']) . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"right\">{$f_body_open}" . format_bytesize($fs[$i]['used']) . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"right\">{$f_body_open}" . format_bytesize($fs[$i]['size']) . "{$f_body_close}</td>\n"; $_text .= "\t</tr>\n"; } $_text .= '<tr><td colspan="3" align="right">' . $f_body_open . '<i>' . $text['totals'] . ' : </i>' . $f_body_close . '</td>'; $_text .= "\t\t<td align=\"left\">{$f_body_open}"; $sum_percent = round($sum['used'] * 100 / $sum['size']); $_text .= create_bargraph($sum_percent, $sum_percent, $scale_factor); $_text .= " " . $sum_percent . "%" . $f_body_close . "</td>\n"; $_text .= '<td align="right">' . $f_body_open . format_bytesize($sum['free']) . $f_body_close . '</td>' . '<td align="right">' . $f_body_open . format_bytesize($sum['used']) . $f_body_close . '</td>' . '<td align="right">' . $f_body_open . format_bytesize($sum['size']) . $f_body_close . '</td></tr>' . '</table>'; $tpl->set_var('filesystems', makebox($text['fs'], $_text, '100%'));
<?php // // phpSysInfo - A PHP System Information Script // http://phpsysinfo.sourceforge.net/ // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: table_memory.php,v 1.1.1.1 2001/06/17 17:56:53 lkneschke Exp $ $scale_factor = 2; $mem = sys_meminfo(); $ram .= create_bargraph($mem['ram']['percent'], $mem['ram']['percent'], $scale_factor); $ram .= ' ' . $mem['ram']['percent'] . '% '; $swap .= create_bargraph($mem['swap']['percent'], $mem['swap']['percent'], $scale_factor); $swap .= ' ' . $mem['swap']['percent'] . '% '; $_text = '<table width="100%" align="center">' . '<tr><td align="left"><b><font size="-1">' . $text['type'] . '</font></b></td>' . '<td align="left"><b><font size="-1">' . $text['percent'] . '</font></b></td>' . '<td align="right"><b><font size="-1">' . $text['free'] . '</font></b></td>' . '<td align="right"><b><font size="-1">' . $text['used'] . '</font></b></td>' . '<td align="right"><b><font size="-1">' . $text['size'] . '</font></b></td></tr>' . '<tr><td align="left"><font size="-1">' . $text['phymem'] . '</font></td>' . '<td align="left"><font size="-1">' . $ram . '</font></td>' . '<td align="right"><font size="-1">' . format_bytesize($mem['ram']['t_free']) . '</font></td>' . '<td align="right"><font size="-1">' . format_bytesize($mem['ram']['t_used']) . '</font></td>' . '<td align="right"><font size="-1">' . format_bytesize($mem['ram']['total']) . '</font></td>' . '<tr><td align="left"><font size="-1">' . $text['swap'] . '</font></td>' . '<td align="left"><font size="-1">' . $swap . '</font></td>' . '<td align="right"><font size="-1">' . format_bytesize($mem['swap']['free']) . '</font></td>' . '<td align="right"><font size="-1">' . format_bytesize($mem['swap']['used']) . '</font></td>' . '<td align="right"><font size="-1">' . format_bytesize($mem['swap']['total']) . '</font></td>' . '</table>'; $tpl->set_var('memory', makebox($text['memusage'], $_text, '100%'));
// Fire off the XPath class require './includes/XPath.class.php'; $XPath = new XPath(); $XPath->importFromString($xml); // let the page begin. require './includes/system_header.php'; $tpl->set_var('title', $text['title'] . ': ' . $XPath->getData('/phpsysinfo/Vitals/Hostname') . ' (' . $XPath->getData('/phpsysinfo/Vitals/IPAddr') . ')'); $tpl->set_var('vitals', makebox($text['vitals'], html_vitals(), '100%')); $tpl->set_var('network', makebox($text['netusage'], html_network(), '100%')); $tpl->set_var('hardware', makebox($text['hardware'], html_hardware(), '100%')); $tpl->set_var('memory', makebox($text['memusage'], html_memory(), '100%')); $tpl->set_var('filesystems', makebox($text['fs'], html_filesystems(), '100%')); if (!empty($sensor_program)) { $tpl->set_var('mbtemp', makebox($text['temperature'], html_mbtemp(), '100%')); $tpl->set_var('mbfans', makebox($text['fans'], html_mbfans(), '100%')); $tpl->set_var('mbvoltage', makebox($text['voltage'], html_mbvoltage(), '100%')); } else { $tpl->set_var('mbtemp', ''); $tpl->set_var('mbfans', ''); $tpl->set_var('mbvoltage', ''); } // parse our the template $tpl->pparse('out', 'form'); // finally our print our footer if (PHPGROUPWARE == 1) { $phpgw->common->phpgw_footer(); } else { require './includes/system_footer.php'; } if (isset($GO_CONFIG)) { require $GO_THEME->theme_path . 'footer.inc';
} else { setcookie("template", $template, time() + 2592000); } // fire up the template engine $tpl = new Template(dirname(__FILE__) . '/templates/' . TEMPLATE_SET); $tpl->set_file(array('form' => 'form.tpl')); // print out a box of information function makebox($title, $content) { $t = new Template(dirname(__FILE__) . '/templates/' . TEMPLATE_SET); $t->set_file(array('box' => 'box.tpl')); $t->set_var('title', $title); $t->set_var('content', $content); return $t->parse('out', 'box'); } // Fire off the XPath class require './includes/XPath.class.php'; $XPath = new XPath(); $XPath->importFromString($xml); // let the page begin. //require('./includes/system_header.php'); $tpl->set_var('title', $text['title'] . ': ' . $XPath->getData('/phpsysinfo/Vitals/Hostname') . ' (' . $XPath->getData('/phpsysinfo/Vitals/IPAddr') . ')'); $tpl->set_var('vitals', makebox($text['vitals'], html_vitals(), '100%')); $tpl->set_var('network', makebox($text['netusage'], html_network(), '100%')); $tpl->set_var('hardware', makebox($text['hardware'], html_hardware(), '100%')); $tpl->set_var('memory', makebox($text['memusage'], html_memory(), '100%')); $tpl->set_var('filesystems', makebox($text['fs'], html_filesystems(), '100%')); // parse our the template $tpl->pparse('out', 'form'); // finally our print our footer $phpgw->common->phpgw_footer();
if ($XPath->match("/phpsysinfo/MBinfo/Temperature/Item")) { $html_temp = html_mbtemp(); } if ($XPath->match("/phpsysinfo/MBinfo/Fans/Item")) { $tpl->set_var('mbfans', makebox($text['fans'], html_mbfans())); } else { $tpl->set_var('mbfans', ''); } if ($XPath->match("/phpsysinfo/MBinfo/Voltage/Item")) { $tpl->set_var('mbvoltage', makebox($text['voltage'], html_mbvoltage())); } else { $tpl->set_var('mbvoltage', ''); } } if (isset($hddtemp_avail) && $hddtemp_avail) { if ($XPath->match("/phpsysinfo/HDDTemp/Item")) { $html_temp .= html_hddtemp(); } } if (strlen($html_temp) > 0) { $tpl->set_var('mbtemp', makebox($text['temperature'], "\n<table width=\"100%\">\n" . $html_temp . "</table>\n")); } // parse our the template $tpl->pfp('out', 'form'); // finally our print our footer if (PHPGROUPWARE == 1) { $phpgw->common->phpgw_footer(); } else { require_once APP_ROOT . '/includes/system_footer.php'; } }
// // phpSysInfo - A PHP System Information Script // http://phpsysinfo.sourceforge.net/ // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: table_vitals.php,v 1.1.1.1 2001/06/17 17:56:54 lkneschke Exp $ $ar_buf = sys_loadavg(); for ($i = 0; $i < 3; $i++) { if ($ar_buf[$i] > 2) { $load_avg .= '<font color="#ff0000">' . $ar_buf[$i] . '</font>'; } else { $load_avg .= $ar_buf[$i]; } $load_avg .= ' '; } $_text = '<table border="0" width="90%" align="center">' . '<tr><td><font size="-1">' . $text['hostname'] . '</font></td><td><font size="-1">' . sys_chostname() . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['ip'] . '</font></td><td><font size="-1">' . sys_ip_addr() . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['kversion'] . '</font></td><td><font size="-1">' . sys_kernel() . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['uptime'] . '</font></td><td><font size="-1">' . sys_uptime() . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['users'] . '</font></td><td><font size="-1">' . sys_users() . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['loadavg'] . '</font></td><td><font size="-1">' . $load_avg . '</font></td></tr>' . '</table>'; $tpl->set_var('vitals', makebox($text['vitals'], $_text, '100%'));
// phpSysInfo - A PHP System Information Script // http://phpsysinfo.sourceforge.net/ // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // $Id: table_network.php,v 1.1.1.1 2001/06/17 17:56:48 lkneschke Exp $ $net = sys_netdevs(); $_text = '<table width="100%" align="center">' . '<tr><td align="left"><b><font size="-1">' . $text['device'] . '</font></b></td>' . '<td align="left"><b><font size="-1">' . $text['received'] . '</font></b></td>' . '<td align="right"><b><font size="-1">' . $text['sent'] . '</font></b></td>' . '<td align="right"><b><font size="-1">' . $text['errors'] . '</font></b></td>'; while (list($dev, $stats) = each($net)) { $_text .= "\t<tr>\n"; $_text .= "\t\t<td align=\"left\">{$f_body_open}" . $dev . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"left\">{$f_body_open}" . format_bytesize($stats['rx_bytes'] / 1024) . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"right\">{$f_body_open}" . format_bytesize($stats['tx_bytes'] / 1024) . "{$f_body_close}</td>\n"; $_text .= "\t\t<td align=\"right\">{$f_body_open}" . $stats['errs'] . '/' . $stats['drop'] . "{$f_body_close}</td>\n"; $_text .= "\t</tr>\n"; } $_text .= '</table>'; $tpl->set_var('network', makebox($text['netusage'], $_text, '100%'));
function sysinfo_generarinfo() { // phpSysInfo - A PHP System Information Script // http://phpsysinfo.sourceforge.net/ // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // $Id: index.php 2 2004-08-20 14:21:01Z root $ // our version number global $sysinfo; global $XPath; global $text; $VERSION = "2.3-cvs"; define('APP_ROOT', dirname(__FILE__)); set_magic_quotes_runtime(0); if (!file_exists(APP_ROOT . '/config.php')) { echo '<center><b>Error: config.php does not exist.</b></center>'; exit; } require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/config.php'; // get the config file if (!extension_loaded('xml')) { echo '<center><b>Error: phpsysinfo requires xml module.</b></center>'; exit; } // reassign HTTP variables (incase register_globals is off) if (!empty($HTTP_GET_VARS)) { while (list($name, $value) = each($HTTP_GET_VARS)) { ${$name} = $value; } } if (!empty($HTTP_POST_VARS)) { while (list($name, $value) = each($HTTP_POST_VARS)) { ${$name} = $value; } } // Check to see if where running inside of phpGroupWare if (isset($sessionid) && $sessionid && $kp3 && $domain) { define('PHPGROUPWARE', 1); $phpgw_info['flags'] = array('currentapp' => 'phpsysinfo-dev'); include '../header.inc.php'; } else { define('PHPGROUPWARE', 0); } if (!isset($template)) { $template = $_COOKIE['template']; } if (!isset($template)) { $template = 'classic'; } // check to see if we have a random template first if ($template == 'random') { $dir = opendir('templates/'); while (($file = readdir($dir)) != false) { if ($file != 'CVS' && $file != '.' && $file != '..') { $buf[] = $file; } } $template = $buf[array_rand($buf, 1)]; $random = true; } if ($template != 'xml') { $template = basename(APP_ROOT . '/templates/' . $template); // figure out if we got a template passed in the url if (!file_exists(APP_ROOT . "/templates/{$template}")) { // default template we should use if we don't get a argument. $template = 'classic'; } } define('TEMPLATE_SET', $template); // get our current language // default to english, but this is negotiable. if (!isset($lng)) { $lng = $_COOKIE['lng']; } if (!isset($lng)) { $lng = 'es'; } $lng = basename(APP_ROOT . '/includes/lang/' . $lng . '.php', '.php'); if (!file_exists(APP_ROOT . '/includes/lang/' . $lng . '.php')) { // see if the browser knows the right languange. if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $plng = split(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (count($plng) > 0) { while (list($k, $v) = each($plng)) { $k = split(';', $v, 1); $k = split('-', $k[0]); if (file_exists(APP_ROOT . '/includes/lang/' . $k[0] . '.php')) { $lng = $k[0]; break; } } } } } require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/lang/' . $lng . '.php'; // get our language include // Figure out which OS where running on, and detect support if (file_exists(APP_ROOT . '/includes/os/class.' . PHP_OS . '.inc.php')) { require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/os/class.' . PHP_OS . '.inc.php'; $sysinfo = new sysinfo(); } else { echo '<center><b>Error: ' . PHP_OS . ' is not currently supported</b></center>'; exit; } if (!empty($sensor_program)) { if (file_exists(APP_ROOT . '/includes/mb/class.' . $sensor_program . '.inc.php')) { require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/mb/class.' . $sensor_program . '.inc.php'; $mbinfo = new mbinfo(); } else { echo '<center><b>Error: ' . $sensor_program . ' is not currently supported</b></center>'; exit; } } require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/common_functions.php'; // Set of common functions used through out the app require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/xml/vitals.php'; require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/xml/network.php'; require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/xml/hardware.php'; require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/xml/memory.php'; require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/xml/filesystems.php'; require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/xml/mbinfo.php'; $xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"; $xml .= "<!DOCTYPE phpsysinfo SYSTEM \"" . _CFG_INTERFACE_DIRMODULES . "mod_sysinfo/phpsysinfo.dtd\">\n\n"; $xml .= created_by(); $xml .= "<phpsysinfo>\n"; $xml .= " <Generation version=\"{$VERSION}\" timestamp=\"" . time() . "\"/>\n"; $xml .= xml_vitals(); $xml .= xml_network(); $xml .= xml_hardware(); $xml .= xml_memory(); $xml .= xml_filesystems(); if (!empty($sensor_program)) { $xml .= xml_mbtemp(); $xml .= xml_mbfans(); $xml .= xml_mbvoltage(); } $xml .= "</phpsysinfo>"; if ($template == 'xml') { // just printout the XML and exit Header("Content-Type: text/xml\n\n"); print $xml; } else { // If they have GD complied into PHP, find out the height of the image to make this cleaner if (function_exists('getimagesize') && $template != 'xml') { $image_prop = getimagesize(APP_ROOT . '/templates/' . TEMPLATE_SET . '/images/bar_middle.gif'); define('BAR_HEIGHT', $image_prop[1]); unset($image_prop); } else { // Until they complie GD into PHP, this could look ugly define('BAR_HEIGHT', 16); } // Store the current template name in a cookie, set expire date to one month later // Store 'random' if we want a random template if ($random) { setcookie("template", 'random', time() + 60 * 60 * 24 * 30); } else { setcookie("template", $template, time() + 60 * 60 * 24 * 30); } // Store the current language selection in a cookie setcookie("lng", $lng, time() + 60 * 60 * 24 * 30); if (PHPGROUPWARE != 1) { require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/class.Template.inc.php'; // template library } // fire up the template engine $tpl = new Template(dirname(__FILE__) . '/templates/' . TEMPLATE_SET); $tpl->set_file(array('form' => 'form.tpl')); // print out a box of information function makebox($title, $content, $percent) { $t = new Template(dirname(__FILE__) . '/templates/' . TEMPLATE_SET); $t->set_file(array('box' => 'box.tpl')); $t->set_var('title', $title); $t->set_var('content', $content); if (empty($content)) { return ''; } else { return $t->parse('out', 'box'); } } // Fire off the XPath class require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/XPath.class.php'; $XPath = new XPath(); $XPath->importFromString($xml); // let the page begin. require _CFG_INTERFACE_DIRMODULES . 'mod_sysinfo/includes/system_header.php'; $tpl->set_var('title', $text['title'] . ': ' . $XPath->getData('/phpsysinfo/Vitals/Hostname') . ' (' . $XPath->getData('/phpsysinfo/Vitals/IPAddr') . ')'); $tpl->set_var('vitals', makebox($text['vitals'], html_vitals(), '100%')); $tpl->set_var('network', makebox($text['netusage'], html_network(), '100%')); $tpl->set_var('hardware', makebox($text['hardware'], html_hardware(), '100%')); $tpl->set_var('memory', makebox($text['memusage'], html_memory(), '100%')); $tpl->set_var('filesystems', makebox($text['fs'], html_filesystems(), '100%')); if (!empty($sensor_program)) { $tpl->set_var('mbtemp', makebox($text['temperature'], html_mbtemp(), '100%')); $tpl->set_var('mbfans', makebox($text['fans'], html_mbfans(), '100%')); $tpl->set_var('mbvoltage', makebox($text['voltage'], html_mbvoltage(), '100%')); } else { $tpl->set_var('mbtemp', ''); $tpl->set_var('mbfans', ''); $tpl->set_var('mbvoltage', ''); } // parse our the template return $tpl->pparse('out', 'form'); // finally our print our footer /* if (PHPGROUPWARE == 1) { $phpgw->common->phpgw_footer(); } else { require(_CFG_INTERFACE_DIRMODULES.'mod_sysinfo/includes/system_footer.php'); } */ } }
if (count($ar_buf)) { for ($i = 0; $i < sizeof($ar_buf); $i++) { $pci_devices .= $ar_buf[$i] . '<br>'; } } else { $pci_devices .= '<i>' . $text['none'] . '</i>'; } $ar_buf = sys_idebus(); ksort($ar_buf); if (count($ar_buf)) { while (list($key, $value) = each($ar_buf)) { $ide_devices .= $key . ': ' . $ar_buf[$key]['model']; if (isset($ar_buf[$key]['capacity'])) { $ide_devices .= ' (Capacity: ' . sprintf('%.2f', $ar_buf[$key]['capacity'] / (1024 * 1024 * 2)) . ' GB )'; } $ide_devices .= '<br>'; } } else { $ide_devices .= '<i>' . $text['none'] . '</i>'; } $ar_buf = sys_scsibus(); if (count($ar_buf)) { for ($i = 0; $i < sizeof($ar_buf); $i++) { $scsi_devices .= $ar_buf[$i] . '<br>'; } } else { $scsi_devices .= '<i>' . $text['none'] . '</i>'; } $_text = '<table border="0" width="90%" align="center">' . '<tr><td><font size="-1">' . $text['numcpu'] . '</font></td><td><font size="-1">' . $sys['cpus'] . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['cpumodel'] . '</font></td><td><font size="-1">' . $sys['model'] . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['mhz'] . '</font></td><td><font size="-1">' . $sys['mhz'] . ' MHz</font></td></tr>' . '<tr><td><font size="-1">' . $text['cache'] . '</font></td><td><font size="-1">' . $sys['cache'] . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['bogomips'] . '</font></td><td><font size="-1">' . $sys['bogomips'] . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['pci'] . '</font></td><td><font size="-1">' . $pci_devices . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['ide'] . '</font></td><td><font size="-1">' . $ide_devices . '</font></td></tr>' . '<tr><td><font size="-1">' . $text['scsi'] . '</font></td><td><font size="-1">' . $scsi_devices . '</font></td></tr>' . '</table>'; $tpl->set_var('hardware', makebox($text['hardware'], $_text, '100%'));