phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpsysinfo/includes/xml filesystems.php, NONE, 1.1.2.


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] phpsysinfo/includes/xml filesystems.php, NONE, 1.1.2.1 hardware.php, NONE, 1.1.2.1 memory.php, NONE, 1.1.2.1 network.php, NONE, 1.1.2.1 vitals.php, NONE, 1.1.2.1
Date: Sat, 01 Nov 2003 22:08:30 +0000

Update of /cvsroot/phpgroupware/phpsysinfo/includes/xml
In directory subversions:/tmp/cvs-serv22972/includes/xml

Added Files:
      Tag: Version-0_9_16-branch
        filesystems.php hardware.php memory.php network.php vitals.php 
Log Message:
upstream update with a few little mods


--- NEW FILE: hardware.php ---
<?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: hardware.php,v 1.1.2.1 2003/11/01 22:08:28 skwashd Exp $
//
// xml_hardware()
//
function xml_hardware () {
    global $sysinfo;
    global $text;

    $sys = $sysinfo->cpu_info();

    $ar_buf = $sysinfo->pci(); 

    if (count($ar_buf)) {
        for ($i=0;$i<sizeof($ar_buf);$i++) {
            if ($ar_buf[$i]) {
                $pci_devices .= "      <Device>" . chop($ar_buf[$i]) . 
"</Device>\n";
            }
        }
    }

    $ar_buf = $sysinfo->ide(); 

    ksort($ar_buf);

    if (count($ar_buf)) {
        while (list($key, $value) = each($ar_buf)) {
            $ide_devices .= "      <Device>" . $key . ': ' . 
$ar_buf[$key]['model'];
            if (isset($ar_buf[$key]['capacity'])) {
                $ide_devices .= ' (' . $text['capacity'] . ': ' . 
format_bytesize($ar_buf[$key]['capacity']/2).')';
            }
            $ide_devices .= "</Device>\n";
        }
    }

    $ar_buf = $sysinfo->scsi(); 

    if (count($ar_buf)) {
        for ($i=0;$i<sizeof($ar_buf);$i++) {
            $scsi_devices .= "      <Device>" . $ar_buf[$i] . "</Device>\n";
        }
    }

    $_text = "  <Hardware>\n";
    $_text .= "    <CPU>\n";
    if ($sys['cpus']) {
        $_text .= "      <Number>" . $sys['cpus'] . "</Number>\n";
    }
    if ($sys['model']) {
        $_text .= "      <Model>" . $sys['model'] . "</Model>\n";
    }
    if ($sys['mhz']) {
        $_text .= "      <Mhz>" . $sys['mhz'] . "</Mhz>\n";
    }
    if ($sys['cache']) {
        $_text .= "      <Cache>" . $sys['cache'] . "</Cache>\n";
    }
    if ($sys['bogomips']) {
        $_text .= "      <Bogomips>" . $sys['bogomips'] . "</Bogomips>\n";
    }
    $_text .= "    </CPU>\n";


    $_text .= "    <PCI>\n";
    if ($pci_devices) {
        $_text .= $pci_devices;
    }
    $_text .= "    </PCI>\n";


    $_text .= "    <IDE>\n";
    if ($ide_devices) {
        $_text.= $ide_devices;
    }
    $_text .= "    </IDE>\n";

    $_text .= "    <SCSI>\n";
    if ($scsi_devices) {
        $_text .= $scsi_devices;
    }
    $_text .= "    </SCSI>\n";
    $_text .= "  </Hardware>\n";

    return $_text;
}


//
// html_hardware()
//
function html_hardware () {
    global $XPath;
    global $text;

    for ($i=1; $i<sizeof($XPath->getDataParts('/phpsysinfo/Hardware/PCI')); 
$i++) {
        if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[$i]")) {
            $pci_devices .= 
$XPath->getData("/phpsysinfo/Hardware/PCI/Device[$i]") . '<br>';
        }
    }

    for ($i=1; $i<sizeof($XPath->getDataParts('/phpsysinfo/Hardware/IDE')); 
$i++) {
        if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]")) {
            $ide_devices .= 
$XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]") . '<br>';
        }
    }

    for ($i=1; $i<sizeof($XPath->getDataParts('/phpsysinfo/Hardware/SCSI')); 
$i++) {
        if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]")) {
            $scsi_devices .= 
$XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]") . '<br>';
        }
    }

    $_text = '<table border="0" width="90%" align="center">';

    if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
        $_text .= '<tr><td valign="top"><font size="-1">'. $text['numcpu'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData("/phpsysinfo/Hardware/CPU/Number") . '</font></td></tr>';
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
        $_text .= '<tr><td valign="top"><font size="-1">'. $text['cpumodel'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData("/phpsysinfo/Hardware/CPU/Model") . '</font></td></tr>';
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Mhz")) {
        $_text .= '<tr><td valign="top"><font size="-1">'. $text['mhz'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData("/phpsysinfo/Hardware/CPU/Mhz") . '</font></td></tr>';
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) {
        $_text .= '<tr><td valign="top"><font size="-1">'. $text['cache'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData("/phpsysinfo/Hardware/CPU/Cache") . '</font></td></tr>';
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) {
        $_text .= '<tr><td valign="top"><font size="-1">'. $text['bogomips'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . '</font></td></tr>';
    }

    $_text .= '<tr><td valign="top"><font size="-1">'. $text['pci'] 
.'</font></td><td><font size="-1">';
    if ($pci_devices) {
        $_text .= $pci_devices;
    } else {
        $_text .= '<i>' . $text['none'] . '</i>';
    }
    $_text .= '</font></td></tr>';

    $_text .= '<tr><td valign="top"><font size="-1">'. $text['ide'] 
.'</font></td><td><font size="-1">';
    if ($ide_devices) {
        $_text .= $ide_devices;
    } else {
        $_text .= '<i>' . $text['none'] . '</i>';
    }
    $_text .= '</font></td></tr>';

    $_text .= '<tr><td valign="top"><font size="-1">'. $text['scsi'] 
.'</font></td><td><font size="-1">';
    if ($scsi_devices) {
        $_text .= $scsi_devices;
    } else {
        $_text .= '<i>' . $text['none'] . '</i>';
    }
    $_text .= '</font></td></tr>';
    $_text .= '</table>';

    return $_text;
}

?>

--- NEW FILE: vitals.php ---
<?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: vitals.php,v 1.1.2.1 2003/11/01 22:08:28 skwashd Exp $

//
// xml_vitals()
//
function xml_vitals () {
    global $sysinfo;
    $ar_buf = $sysinfo->loadavg(); 

    for ($i=0;$i<3;$i++) {
        if ($ar_buf[$i] > 2) {
            $load_avg .= ' ';
        } else {
            $load_avg .= $ar_buf[$i] . ' ';
        }
    }

    $_text = "  <Vitals>\n"
           . "    <Hostname>" . $sysinfo->chostname() . "</Hostname>\n"
           . "    <IPAddr>" . $sysinfo->ip_addr() . "</IPAddr>\n"
           . "    <Kernel>" . $sysinfo->kernel() . "</Kernel>\n"
           . "    <Uptime>" . $sysinfo->uptime() . "</Uptime>\n"
           . "    <Users>" . $sysinfo->users() . "</Users>\n"
           . "    <LoadAvg>" . trim($load_avg) . "</LoadAvg>\n"
           . "  </Vitals>\n";
    return $_text;
}

//
// html_vitals()
//
function html_vitals () {
    global $XPath;
    global $text;

    $_text = '<table border="0" width="90%" align="center">'
           . '<tr><td valign="top"><font size="-1">'. $text['hostname'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData('/phpsysinfo/Vitals/Hostname') . '</font></td></tr>'
           . '<tr><td valign="top"><font size="-1">'. $text['ip'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData('/phpsysinfo/Vitals/IPAddr') . '</font></td></tr>'

           . '<tr><td valign="top"><font size="-1">'. $text['kversion'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData('/phpsysinfo/Vitals/Kernel') . '</font></td></tr>'
           . '<tr><td valign="top"><font size="-1">'. $text['uptime'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData('/phpsysinfo/Vitals/Uptime') . '</font></td></tr>'
           . '<tr><td valign="top"><font size="-1">'. $text['users'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData('/phpsysinfo/Vitals/Users') . '</font></td></tr>'
           . '<tr><td valign="top"><font size="-1">'. $text['loadavg'] 
.'</font></td><td><font size="-1">' . 
$XPath->getData('/phpsysinfo/Vitals/LoadAvg') . '</font></td></tr>'
           . '</table>';

    return $_text;
}

?>

--- NEW FILE: memory.php ---
<?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: memory.php,v 1.1.2.1 2003/11/01 22:08:28 skwashd Exp $

//
// xml_memory()
//
function xml_memory () {
    global $sysinfo;
    $mem = $sysinfo->memory();

    $_text = "  <Memory>\n"
           . "    <Free>" . $mem['ram']['t_free'] . "</Free>\n"
           . "    <Used>" . $mem['ram']['t_used'] . "</Used>\n"
           . "    <Total>" . $mem['ram']['total'] . "</Total>\n"
           . "    <Percent>" . $mem['ram']['percent'] . "</Percent>\n"
           . "  </Memory>\n"
           . "  <Swap>\n"
           . "    <Free>" . $mem['swap']['free'] . "</Free>\n"
           . "    <Used>" . $mem['swap']['used'] . "</Used>\n"
           . "    <Total>" . $mem['swap']['total'] . "</Total>\n"
           . "    <Percent>" . $mem['swap']['percent'] . "</Percent>\n"
           . "  </Swap>\n";

    return $_text;
}

//
// xml_memory()
//
function html_memory () {
    global $XPath;
    global $text;

    $scale_factor = 2;

    $ram .= create_bargraph($XPath->getData('/phpsysinfo/Memory/Percent'), 
$XPath->getData('/phpsysinfo/Memory/Percent'), $scale_factor);
    $ram .= '&nbsp;&nbsp;' . $XPath->getData('/phpsysinfo/Memory/Percent') . '% 
';

    $swap .= create_bargraph($XPath->getData('/phpsysinfo/Swap/Percent'), 
$XPath->getData('/phpsysinfo/Swap/Percent'), $scale_factor);

    $swap .= '&nbsp;&nbsp;' . $XPath->getData('/phpsysinfo/Swap/Percent') . '% 
';


    $_text = '<table width="100%" align="center">'
           . '<tr><td align="left" valign="top"><font size="-1"><b>' . 
$text['type'] . '</b></font></td>'
           . '<td align="left" valign="top"><font size="-1"><b>' . 
$text['percent'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['free'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['used'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['size'] . '</b></font></td></tr>'
           . '<tr><td align="left" valign="top"><font size="-1">' . 
$text['phymem'] . '</font></td>'

           . '<td align="left" valign="top"><font size="-1">' . $ram . 
'</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($XPath->getData('/phpsysinfo/Memory/Free')) . '</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($XPath->getData('/phpsysinfo/Memory/Used')) . '</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($XPath->getData('/phpsysinfo/Memory/Total')) . '</font></td>'

           . '<tr><td align="left" valign="top"><font size="-1">' . 
$text['swap'] . '</font></td>'
           . '<td align="left" valign="top"><font size="-1">' . $swap . 
'</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($XPath->getData('/phpsysinfo/Swap/Free')) . '</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($XPath->getData('/phpsysinfo/Swap/Used')) . '</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($XPath->getData('/phpsysinfo/Swap/Total')) . '</font></td>'

           . '</table>';

    return $_text;
}

?>

--- NEW FILE: network.php ---
<?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: network.php,v 1.1.2.1 2003/11/01 22:08:28 skwashd Exp $

//
// xml_network()
//
function xml_network () {
    global $sysinfo;
    $net = $sysinfo->network();

    $_text = "  <Network>\n";
    while (list($dev, $stats) = each($net)) {
        $_text .= "    <NetDevice>\n"
               .  "      <Name>" . trim($dev) . "</Name>\n"
               .  "      <RxBytes>" . $stats['rx_bytes'] . "</RxBytes>\n"
               .  "      <TxBytes>" . $stats['tx_bytes'] . "</TxBytes>\n"
               .  "      <Errors>" . $stats['errs'] . "</Errors>\n"
               .  "      <Drops>" . $stats['drop'] . "</Drops>\n"
               .  "    </NetDevice>\n";
    }
    $_text .= "  </Network>\n";

    return $_text;
}

//
// html_network()
//
function html_network () {
    global $XPath;
    global $text;

    $_text = '<table width="100%" align="center">'
           . '<tr><td align="left" valign="top"><font size="-1"><b>' . 
$text['device'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['received'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['sent'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['errors'] . '</b></font></td>';

    for ($i=1; $i<sizeof($XPath->getDataParts('/phpsysinfo/Network')); $i++) {
        if ($XPath->match("/phpsysinfo/Network/NetDevice[$i]/Name")) {
            $_text .= "\t<tr>\n";
            $_text .= "\t\t<td align=\"left\" valign=\"top\"><font 
size=\"-1\">" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Name") . 
"</font></td>\n";
            $_text .= "\t\t<td align=\"right\" valign=\"top\"><font 
size=\"-1\">" . 
format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/RxBytes") / 
1024) . "</font></td>\n";
            $_text .= "\t\t<td align=\"right\" valign=\"top\"><font 
size=\"-1\">" . 
format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/TxBytes") / 
1024) . "</font></td>\n";
            $_text .= "\t\t<td align=\"right\" valign=\"top\"><font 
size=\"-1\">" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Errors") . 
'/' . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Drops") . 
"</font></td>\n";
            $_text .= "\t</tr>\n";
        }

    }
    $_text .= '</table>';

    return $_text;
}

?>

--- NEW FILE: filesystems.php ---
<?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: filesystems.php,v 1.1.2.1 2003/11/01 22:08:28 skwashd Exp $

//
// xml_filesystems()
//
function xml_filesystems () {
    global $sysinfo;
    $fs = $sysinfo->filesystems();

    $_text = "  <FileSystem>\n";
    for ($i=0; $i<sizeof($fs); $i++) {
        $sum['size'] += $fs[$i]['size'];
        $sum['used'] += $fs[$i]['used'];
        $sum['free'] += $fs[$i]['free']; 
        $_text .="    <Mount>\n"
               . "      <MountPoint>" . $fs[$i]['mount'] . "</MountPoint>\n"
               . "      <Type>" . $fs[$i]['fstype'] . "</Type>\n"
               . "      <Device>" . $fs[$i]['disk'] . "</Device>\n"
               . "      <Percent>" . $fs[$i]['percent'] . "</Percent>\n"
               . "      <Free>" . $fs[$i]['free'] . "</Free>\n"
               . "      <Used>" . $fs[$i]['used'] . "</Used>\n"
               . "      <Size>" . $fs[$i]['size'] . "</Size>\n"
               . "    </Mount>\n";
    }
    $_text .= "  </FileSystem>\n";
    return $_text;
}

//
// html_filesystems()
//
function html_filesystems () {
    global $XPath;
    global $text;

    $scale_factor = 2;

    $_text = '<table width="100%" align="center">'
           . '<tr><td align="left" valign="top"><font size="-1"><b>' . 
$text['mount'] . '</b></font></td>'
           . '<td align="left" valign="top"><font size="-1"><b>' . 
$text['type'] . '</b></font></td>'
           . '<td align="left" valign="top"><font size="-1"><b>' . 
$text['partition'] . '</b></font></td>'
           . '<td align="left" valign="top"><font size="-1"><b>' . 
$text['percent'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['free'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['used'] . '</b></font></td>'
           . '<td align="right" valign="top"><font size="-1"><b>' . 
$text['size'] . '</b></font></td></tr>';

    for ($i=1; $i<sizeof($XPath->getDataParts('/phpsysinfo/FileSystem')); $i++) 
{
        if ($XPath->match("/phpsysinfo/FileSystem/Mount[$i]/MountPoint")) {
            $sum['size'] += 
$XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Size");
            $sum['used'] += 
$XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Used");
            $sum['free'] += 
$XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Free");

            $_text .= "\t<tr>\n";
            $_text .= "\t\t<td align=\"left\" valign=\"top\"><font 
size=\"-1\">" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/MountPoint") 
. "</font></td>\n";
            $_text .= "\t\t<td align=\"left\" valign=\"top\"><font 
size=\"-1\">" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Type") . 
"</font></td>\n";
            $_text .= "\t\t<td align=\"left\" valign=\"top\"><font 
size=\"-1\">" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Device") . 
"</font></td>\n";
            $_text .= "\t\t<td align=\"left\" valign=\"top\"><font 
size=\"-1\">";

            $_text .= 
create_bargraph($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Percent"), 
$XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Percent"), $scale_factor, 
$XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Type"));

            $_text .= "&nbsp;" . 
$XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Percent") . "</font></td>\n";
            $_text .= "\t\t<td align=\"right\" valign=\"top\"><font 
size=\"-1\">" . 
format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Free")) . 
"</font></td>\n";
            $_text .= "\t\t<td align=\"right\" valign=\"top\"><font 
size=\"-1\">" . 
format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Used")) . 
"</font></td>\n";
            $_text .= "\t\t<td align=\"right\" valign=\"top\"><font 
size=\"-1\">" . 
format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Size")) . 
"</font></td>\n";
            $_text .= "\t</tr>\n";
        }
    }

    $_text .= '<tr><td colspan="3" align="right" valign="top"><font 
size="-1"><i>' . $text['totals'] . ' :&nbsp;&nbsp;</i></font></td>';
    $_text .= "\t\t<td align=\"left\" valign=\"top\"><font size=\"-1\">";

    $sum_percent = round(($sum['used'] * 100) / $sum['size']);
    $_text .= create_bargraph($sum_percent, $sum_percent, $scale_factor);

    $_text .= "&nbsp;" . $sum_percent . "%" .  "</font></td>\n";

    $_text .= '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($sum['free']) . '</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($sum['used']) . '</font></td>'
           . '<td align="right" valign="top"><font size="-1">' . 
format_bytesize($sum['size']) . '</font></td></tr>'
           . '</table>';

    return $_text;
}
?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]