network(); $_text = " \n"; while (list($dev, $stats) = each($net)) { $_text .= " \n" . " " . htmlspecialchars(trim($dev), ENT_QUOTES) . "\n" . " " . htmlspecialchars($stats['rx_bytes'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($stats['tx_bytes'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($stats['errs'], ENT_QUOTES) . "\n" . " " . htmlspecialchars($stats['drop'], ENT_QUOTES) . "\n" . " \n"; } $_text .= " \n"; return $_text; } // // html_network() // function html_network () { global $XPath; global $text; $textdir = direction(); $_text = "\n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; for ($i=1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Network")); $i < $max; $i++) { if ($XPath->match("/phpsysinfo/Network/NetDevice[$i]/Name")) { $_text .= " \n"; $_text .= " \n"; $_text .= " \n"; $_text .= " \n"; $_text .= " \n"; $_text .= " \n"; } } $_text .= "
" . $text['device'] . "" . $text['received'] . "" . $text['sent'] . "" . $text['errors'] . "
" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Name") . "" . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/RxBytes") / 1024) . "" . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/TxBytes") / 1024) . "" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Errors") . '/' . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Drops") . "
"; return $_text; } function wml_network() { global $XPath; global $text; $_text = "\n"; for ($i=1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Network")); $i < $max; $i++) { if ($XPath->match("/phpsysinfo/Network/NetDevice[$i]/Name")) { $_text .= "

" . $text['device'] . ": " . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Name") . "
" . "- U: " . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/TxBytes") / 1024) . "
" . "- D: " . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/RxBytes") / 1024) . "
" . "- E: " . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Errors") . '/' . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Drops") . "

\n"; } } $_text .= "
\n"; return $_text; } ?>