cpu_info(); $ar_buf = finddups($sysinfo->pci()); if (count($ar_buf)) { for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) { if ($ar_buf[$i]) { $pci_devices .= " " . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "\n"; } } } $ar_buf = $sysinfo->ide(); ksort($ar_buf); if (count($ar_buf)) { while (list($key, $value) = each($ar_buf)) { $ide_devices .= " \n" . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "\n"; if (isset($ar_buf[$key]['capacity'])) { $ide_devices .= '' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . ''; } $hddtemp_devices[] = $key; $ide_devices .= "\n"; } } $ar_buf = $sysinfo->scsi(); ksort($ar_buf); if (count($ar_buf)) { while (list($key, $value) = each($ar_buf)) { $scsi_devices .= "\n"; if ($key >= '0' && $key <= '9') { $scsi_devices .= " " . htmlspecialchars($ar_buf[$key]['model'], ENT_QUOTES) . "\n"; } else { $scsi_devices .= " " . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "\n"; } if (isset($ar_buf[$key]['capacity'])) { $scsi_devices .= '' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . ''; } $scsi_devices .= "\n"; } } $ar_buf = finddups( $sysinfo->usb() ); if (count($ar_buf)) { for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) { if ($ar_buf[$i]) { $usb_devices .= " " . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "\n"; } } } /* disabled since we output this information $ar_buf = $sysinfo->sbus(); if (count($ar_buf)) { for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) { if ($ar_buf[$i]) { $sbus_devices .= " " . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "\n"; } } } */ $_text = " \n"; $_text .= " \n"; if (isset($sys['cpus'])) { $_text .= " " . htmlspecialchars($sys['cpus'], ENT_QUOTES) . "\n"; } if (isset($sys['model'])) { $_text .= " " . htmlspecialchars($sys['model'], ENT_QUOTES) . "\n"; } if (isset($sys['cpuspeed'])) { $_text .= " " . htmlspecialchars($sys['cpuspeed'], ENT_QUOTES) . "\n"; } if (isset($sys['busspeed'])) { $_text .= " " . htmlspecialchars($sys['busspeed'], ENT_QUOTES) . "\n"; } if (isset($sys['cache'])) { $_text .= " " . htmlspecialchars($sys['cache'], ENT_QUOTES) . "\n"; } if (isset($sys['bogomips'])) { $_text .= " " . htmlspecialchars($sys['bogomips'], ENT_QUOTES) . "\n"; } $_text .= " \n"; $_text .= " \n"; if ($pci_devices) { $_text .= $pci_devices; } $_text .= " \n"; $_text .= " \n"; if ($ide_devices) { $_text .= $ide_devices; } $_text .= " \n"; $_text .= " \n"; if ($scsi_devices) { $_text .= $scsi_devices; } $_text .= " \n"; $_text .= " \n"; if ($usb_devices) { $_text .= $usb_devices; } $_text .= " \n"; /* $_text .= " \n"; if ($sbus_devices) { $_text .= $sbus_devices; } $_text .= " \n"; */ $_text .= " \n"; return $_text; } function html_hardware () { global $XPath; global $text; $pci_devices = ""; $ide_devices = ""; $usb_devices = ""; $scsi_devices = ""; $textdir = direction(); for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/PCI')); $i < $max; $i++) { if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[$i]/Name")) { $pci_devices .= "-" . $XPath->getData("/phpsysinfo/Hardware/PCI/Device[$i]/Name") . ""; } } for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/IDE')); $i < $max; $i++) { if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]")) { $ide_devices .= "-" . $XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Name"); if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity")) { $ide_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity") / 2) . ")"; } $ide_devices .= ""; } } for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/SCSI')); $i < $max; $i++) { if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]")) { $scsi_devices .= "-" . $XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Name"); if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity")) { $scsi_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity") / 2) . ")"; } $scsi_devices .= ""; } } for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/USB')); $i < $max; $i++) { if ($XPath->match("/phpsysinfo/Hardware/USB/Device[$i]/Name")) { $usb_devices .= "-" . $XPath->getData("/phpsysinfo/Hardware/USB/Device[$i]/Name") . ""; } } $_text = "\n"; if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) { $_text .= " \n \n \n \n"; } if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) { $_text .= " \n \n \n \n"; } if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) { $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Cpuspeed"); if ($tmp_speed < 1000) { $_text .= " \n \n \n \n"; } else { $_text .= " \n \n \n \n"; } } if ($XPath->match("/phpsysinfo/Hardware/CPU/Busspeed")) { $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Busspeed"); if ($tmp_speed < 1000) { $_text .= " \n \n \n \n"; } else { $_text .= " \n \n \n \n"; } } if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) { $_text .= " \n \n \n \n"; } if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) { $_text .= " \n \n \n \n"; } $_text .= " \n \n \n \n"; $_text .= " \n \n \n \n"; if ($scsi_devices) { $_text .= " \n \n \n "; } if ($usb_devices) { $_text .= " \n \n \n "; } $_text .= "
" . $text['numcpu'] . "" . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . "
" . $text['cpumodel'] . "" . $XPath->getData("/phpsysinfo/Hardware/CPU/Model") . "
" . $text['cpuspeed'] . "" . $tmp_speed . " MHz
" . $text['cpuspeed'] . "" . round($tmp_speed / 1000, 2) . " GHz
" . $text['busspeed'] . "" . $tmp_speed . " MHz
" . $text['busspeed'] . "" . round($tmp_speed / 1000, 2) . " GHz
" . $text['cache'] . "" . $XPath->getData("/phpsysinfo/Hardware/CPU/Cache") . "
" . $text['bogomips'] . "" . $XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . "
" . $text['pci'] . ""; if ($pci_devices) { $_text .= "" . $pci_devices . "
"; } else { $_text .= "" . $text['none'] . ""; } $_text .= "
" . $text['ide'] . ""; if ($ide_devices) { $_text .= "" . $ide_devices . "
"; } else { $_text .= "" . $text['none'] . ""; } $_text .= "
" . $text['scsi'] . "" . $scsi_devices . "
" . $text['usb'] . "" . $usb_devices . "
"; return $_text; } ?>