• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP format_bytesize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中format_bytesize函数的典型用法代码示例。如果您正苦于以下问题:PHP format_bytesize函数的具体用法?PHP format_bytesize怎么用?PHP format_bytesize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了format_bytesize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:32,代码来源:filesystems.php


示例2: html_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 border="0" width="90%" 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;
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:12,代码来源:memory.php


示例3: wml_network

function wml_network()
{
    global $XPath;
    global $text;
    $_text = "<card id=\"network\" title=\"" . $text['network'] . "\">\n";
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Network")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Network/NetDevice[{$i}]/Name")) {
            $_text .= "<p>" . $text['device'] . ": " . $XPath->getData("/phpsysinfo/Network/NetDevice[{$i}]/Name") . "<br/>" . "- U: " . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[{$i}]/TxBytes") / 1024) . "<br/>" . "- D: " . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[{$i}]/RxBytes") / 1024) . "<br/>" . "- E: " . $XPath->getData("/phpsysinfo/Network/NetDevice[{$i}]/Errors") . '/' . $XPath->getData("/phpsysinfo/Network/NetDevice[{$i}]/Drops") . "</p>\n";
        }
    }
    $_text .= "</card>\n";
    return $_text;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:13,代码来源:network.php


示例4: 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;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:18,代码来源:network.php


示例5: xml_hardware

function xml_hardware()
{
    global $sysinfo;
    global $text;
    $sys = $sysinfo->cpu_info();
    $ar_buf = $sysinfo->pci();
    if (count($ar_buf)) {
        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $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();
    ksort($ar_buf);
    if (count($ar_buf)) {
        while (list($key, $value) = each($ar_buf)) {
            if ($key >= '0' && $key <= '9') {
                $scsi_devices .= "      <Device>" . $ar_buf[$key]['model'];
            } else {
                $scsi_devices .= "      <Device>" . $key . ': ' . $ar_buf[$key]['model'];
            }
            if (isset($ar_buf[$key]['capacity'])) {
                $scsi_devices .= ' (' . $text['capacity'] . ': ' . format_bytesize($ar_buf[$key]['capacity'] / 2) . ')';
            }
            $scsi_devices .= "</Device>\n";
        }
    }
    $ar_buf = $sysinfo->usb();
    if (count($ar_buf)) {
        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
            if ($ar_buf[$i]) {
                $usb_devices .= "      <Device>" . chop($ar_buf[$i]) . "</Device>\n";
            }
        }
    }
    $ar_buf = $sysinfo->sbus();
    if (count($ar_buf)) {
        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
            if ($ar_buf[$i]) {
                $sbus_devices .= "      <Device>" . chop($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 .= "    <USB>\n";
    if ($usb_devices) {
        $_text .= $usb_devices;
    }
    $_text .= "    </USB>\n";
    $_text .= "    <SBUS>\n";
    if ($sbus_devices) {
        $_text .= $sbus_devices;
    }
    $_text .= "    </SBUS>\n";
    $_text .= "  </Hardware>\n";
    return $_text;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:baifox-svn,代码行数:101,代码来源:hardware.php


示例6: while

    while (list($number, $row) = each($mount_points)) {
        if (($number + 1) % 2 == 0) {
            $tpl->assign(array('ITEM_CLASS' => 'content'));
        } else {
            $tpl->assign(array('ITEM_CLASS' => 'content2'));
        }
        $tpl->assign(array('MOUNT' => $row['mount'], 'TYPE' => $row['fstype'], 'PARTITION' => $row['disk'], 'PERCENT' => $row['percent'], 'FREE' => make_hr($row['free'] * 1014), 'USED' => make_hr($row['used'] * 1024), 'SIZE' => make_hr($row['size'] * 1024)));
        $tpl->parse('DISK_LIST_ITEM', '.disk_list_item');
    }
    $tpl->parse('DISK_LIST', 'disk_list');
}
/*
 *
 * static page messages.
 *
 */
gen_admin_menu($tpl);
gen_mount_point($tpl);
$kernel = kernel();
$uptime = uptime();
$load = loadavg();
$cpu = cpu_info();
$mem = memory();
$tpl->assign(array('TR_SYSTEM_INFO_TITLE' => tr('System info'), 'TR_SYSTEM_INFO' => tr('Vital system info'), 'TR_CPU_SYSTEM_INFO' => tr('CPU system Info'), 'TR_CPU_MODEL' => tr('CPU model'), 'TR_CPU_MHZ' => tr('CPU MHz'), 'TR_CPU_CACHE' => tr('CPU cache'), 'TR_CPU_BOGOMIPS' => tr('CPU bogomips'), 'CPU_MODEL' => $cpu['model'], 'CPU_MHZ' => $cpu['mhz'], 'CPU_CACHE' => $cpu['cache'], 'CPU_BOGOMIPS' => $cpu['bogomips'], 'TR_MEMRY_SYSTEM_INFO' => tr('Memory system info'), 'TR_RAM' => tr('RAM'), 'TR_TOTAL' => tr('Total'), 'TR_USED' => tr('Used'), 'TR_FREE' => tr('Free'), 'TR_SWAP' => tr('Swap'), 'TR_UPTIME' => tr('Up time'), 'UPTIME' => $uptime, 'TR_KERNEL' => tr('Kernel'), 'KERNEL' => $kernel, 'TR_LOAD' => tr('Load'), 'LOAD' => $load[0] . ' ' . $load[1] . '  ' . $load[0], 'RAM' => tr('RAM'), 'RAM_TOTAL' => format_bytesize($mem['ram']['total']), 'RAM_USED' => format_bytesize($mem['ram']['used']), 'RAM_FREE' => format_bytesize($mem['ram']['free']), 'SWAP_TOTAL' => format_bytesize($mem['swap']['total']), 'SWAP_USED' => format_bytesize($mem['swap']['used']), 'SWAP_FREE' => format_bytesize($mem['swap']['free']), 'TR_FILE_SYSTEM_INFO' => tr('Filesystem system Info'), 'TR_MOUNT' => tr('Mount'), 'TR_TYPE' => tr('Type'), 'TR_PARTITION' => tr('Partition'), 'TR_PERCENT' => tr('Percent'), 'TR_SIZE' => tr('Size')));
gen_page_message($tpl);
$tpl->parse('PAGE', 'page');
$tpl->prnt();
if (isset($cfg['DUMP_GUI_DEBUG'])) {
    dump_gui_debug();
}
unset_messages();
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:sysinfo-Kernel-2.6.php


示例7: sys_meminfo

<?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 .= '&nbsp;&nbsp;' . $mem['ram']['percent'] . '% ';
$swap .= create_bargraph($mem['swap']['percent'], $mem['swap']['percent'], $scale_factor);
$swap .= '&nbsp;&nbsp;' . $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%'));
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:29,代码来源:table_memory.php


示例8: wml_memory

function wml_memory()
{
    global $XPath;
    global $text;
    $_text = "<card id=\"memory\" title=\"" . $text['memusage'] . "\">\n" . "<p>" . $text['phymem'] . ":<br/>\n" . "- " . $text['free'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Free")) . "<br/>\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Used")) . "<br/>\n" . "- " . $text['size'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Total")) . "</p>\n";
    if ($XPath->match("/phpsysinfo/Memory/App")) {
        $_text .= "<p>" . $text['app'] . ":<br/>\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/App")) . "</p>\n";
    }
    if ($XPath->match("/phpsysinfo/Memory/Cached")) {
        $_text .= "<p>" . $text['cached'] . ":<br/>\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Cached")) . "</p>\n";
    }
    if ($XPath->match("/phpsysinfo/Memory/Buffers")) {
        $_text .= "<p>" . $text['buffers'] . ":<br/>\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Memory/Buffers")) . "</p>\n";
    }
    $_text .= "<p><br/>" . $text['swap'] . ":<br/>\n" . "- " . $text['free'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Swap/Free")) . "<br/>\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Swap/Used")) . "<br/>\n" . "- " . $text['size'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Swap/Total")) . "</p>\n";
    $_text .= "</card>\n";
    return $_text;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:18,代码来源:memory.php


示例9: wml_filesystem

function wml_filesystem()
{
    global $XPath;
    global $text;
    global $show_mount_point;
    $_text = "<card id=\"filesystem\" title=\"" . $text['fs'] . "\">\n";
    for ($i = 1; $i < sizeof($XPath->getDataParts('/phpsysinfo/FileSystem')); $i++) {
        if ($XPath->match("/phpsysinfo/FileSystem/Mount[{$i}]/MountPointID")) {
            $_text .= "<p>\n";
            if ($show_mount_point) {
                $_text .= $XPath->getData("/phpsysinfo/FileSystem/Mount[{$i}]/MountPoint") . "<br/>\n";
            } else {
                $_text .= $XPath->getData("/phpsysinfo/FileSystem/Mount[{$i}]/Device/Name") . "<br/>\n";
            }
            $_text .= "- " . $text['free'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[{$i}]/Free")) . "<br/>\n" . "- " . $text['used'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[{$i}]/Used")) . "<br/>\n" . "- " . $text['size'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[{$i}]/Size")) . "<br/>\n" . "</p>\n";
        }
    }
    $_text .= "</card>\n";
    return $_text;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:20,代码来源:filesystems.php


示例10: sys_fsinfo

// 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_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 .= "&nbsp;" . $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'] . ' :&nbsp;&nbsp;</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 .= "&nbsp;" . $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%'));
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:table_filesystems.php


示例11: html_hardware

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 .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/PCI/Device[{$i}]/Name") . "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/IDE')); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[{$i}]")) {
            $ide_devices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $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 .= "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/SCSI')); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[{$i}]")) {
            $scsi_devices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $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 .= "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/USB')); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/USB/Device[{$i}]/Name")) {
            $usb_devices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/USB/Device[{$i}]/Name") . "</font></td></tr>";
        }
    }
    $_text = "<table cellspacing=0 cellpadding=5 border=\"0\" width=\"100%\" align=\"center\">\n";
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
        $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['numcpu'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
        $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['cpumodel'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Model") . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) {
        $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Cpuspeed");
        if ($tmp_speed < 1000) {
            $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . $tmp_speed . " MHz</font></td>\n  </tr>\n";
        } else {
            $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . round($tmp_speed / 1000, 2) . " GHz</font></td>\n  </tr>\n";
        }
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Busspeed")) {
        $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Busspeed");
        if ($tmp_speed < 1000) {
            $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . $tmp_speed . " MHz</font></td>\n  </tr>\n";
        } else {
            $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . round($tmp_speed / 1000, 2) . " GHz</font></td>\n  </tr>\n";
        }
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) {
        $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['cache'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Cache") . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) {
        $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['bogomips'] . "</font></td>\n    <td class=\"cellText small\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . "</font></td>\n  </tr>\n";
    }
    $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['pci'] . "</font></td>\n    <td class=\"cellText small\">";
    if ($pci_devices) {
        $_text .= "<table border=0 cellspacing=0 cellpadding=2>" . $pci_devices . "</table>";
    } else {
        $_text .= "<font size=\"-1\"><i>" . $text['none'] . "</i></font>";
    }
    $_text .= "</td>\n  </tr>\n";
    $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['ide'] . "</font></td>\n    <td class=\"cellText small\">";
    if ($ide_devices) {
        $_text .= "<table>" . $ide_devices . "</table>";
    } else {
        $_text .= "<font size=\"-1\"><i>" . $text['none'] . "</i></font>";
    }
    $_text .= "</td>\n  </tr>\n";
    if ($scsi_devices) {
        $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['scsi'] . "</font></td>\n    <td class=\"cellText small\"><table>" . $scsi_devices . "</table></td>\n  </tr>";
    }
    if ($usb_devices) {
        $_text .= "  <tr>\n    <td class=\"cellLabel small\" align=right valign=\"top\"><font size=\"-1\">" . $text['usb'] . "</font></td>\n    <td class=\"cellText small\"><table>" . $usb_devices . "</table></td>\n  </tr>";
    }
    $_text .= "</table>";
    return $_text;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:89,代码来源:hardware.php


示例12: showquota

/**
 * @brief A page that shows a table with statistic data and a gauge bar
 * @global type $langQuotaUsed
 * @global type $langQuotaPercentage
 * @global type $langQuotaTotal
 * @global type $langBack
 * @global type $langQuotaBar
 * @global type $course_code
 * @global type $subsystem
 * @global type $group_id
 * @global type $ebook_id
 * @param type $quota
 * @param type $used
 * @return string
 */
function showquota($quota, $used)
{
    global $langQuotaUsed, $langQuotaPercentage, $langQuotaTotal, $langBack, $langQuotaBar, $course_code, $subsystem, $group_id, $ebook_id, $pageName;
    $retstring = '';
    // pososto xrhsimopoioumenou xorou se %
    $diskUsedPercentage = round($used / $quota * 100) . "%";
    // morfopoihsh tou synolikou diathesimou megethous tou quota
    $quota = format_bytesize($quota / 1024);
    // morfopoihsh tou synolikou megethous pou xrhsimopoieitai
    $used = format_bytesize($used / 1024);
    // telos diamorfwshs ths grafikh mparas kai twn arithmitikwn statistikwn stoixeiwn
    // ektypwsh pinaka me arithmitika stoixeia + thn grafikh bara
    if ($subsystem == GROUP) {
        $link = "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;group_id={$group_id}";
    } elseif ($subsystem == EBOOK) {
        $link = "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;ebook_id={$ebook_id}";
    } else {
        $link = "{$_SERVER['SCRIPT_NAME']}?course={$course_code}";
    }
    $pageName = $langQuotaBar;
    $retstring .= action_bar(array(array('title' => $langBack, 'url' => $link, 'icon' => 'fa-reply', 'level' => 'primary-label')));
    $retstring .= "\n    <div class='row'><div class='col-sm-12'>\n    <div class='form-wrapper'>\n    <form class='form-horizontal' role='form'>\n      <div class='form-group'>\n        <label class='col-sm-2'>{$langQuotaUsed}:</label>\n        <div class='col-sm-10'>\n          <p class='form-control-static'>{$used}</p>\n        </div>\n      </div>\n      <div class='form-group'>\n        <label class='col-sm-2'>{$langQuotaPercentage}:</label>\n        <div class='col-sm-10'>\n            <div class='progress'>\n              <p class='progress-bar progress-bar-striped active from-control-static' role='progressbar' aria-valuenow='" . str_replace('%', '', $diskUsedPercentage) . "' aria-valuemin='0' aria-valuemax='100' style='width: {$diskUsedPercentage};'>\n                {$diskUsedPercentage}\n              </p>\n            </div>\n        </div>\n      </div>\n      <div class='form-group'>\n        <label class='col-sm-2'>{$langQuotaTotal}:</label>\n        <div class='col-sm-10'>\n              <p class='form-control-static'>{$quota}</p>\n        </div>\n      </div>  \n    </form>\n    </div></div></div>";
    $tmp_cwd = getcwd();
    return $retstring;
}
开发者ID:kostastzo,项目名称:openeclass,代码行数:40,代码来源:fileUploadLib.inc.php


示例13: html_hardware

function html_hardware()
{
    global $XPath;
    global $text;
    $strPcidevices = "";
    $strIdedevices = "";
    $strUsbdevices = "";
    $strScsidevices = "";
    $textdir = direction();
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/PCI")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[" . $i . "]/Name")) {
            $strPcidevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/PCI/Device[" . $i . "]/Name") . "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/IDE")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[" . $i . "]")) {
            $strIdedevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/IDE/Device[" . $i . "]/Name");
            if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[" . $i . "]/Capacity")) {
                $strIdedevices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/IDE/Device[" . $i . "]/Capacity") / 2) . ")";
            }
            $strIdedevices .= "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/SCSI")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]")) {
            $strScsidevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]/Name");
            if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]/Capacity")) {
                $strScsidevices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/SCSI/Device[" . $i . "]/Capacity") / 2) . ")";
            }
            $strScsidevices .= "</font></td></tr>";
        }
    }
    for ($i = 1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Hardware/USB")); $i < $max; $i++) {
        if ($XPath->match("/phpsysinfo/Hardware/USB/Device[" . $i . "]/Name")) {
            $strUsbdevices .= "<tr><td valign=\"top\"><font size=\"-1\">-</font></td><td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/USB/Device[" . $i . "]/Name") . "</font></td></tr>";
        }
    }
    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n";
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['numcpu'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpumodel'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Model");
        if ($XPath->match("/phpsysinfo/Hardware/CPU/Cputemp")) {
            $_text .= "&nbsp;@&nbsp;" . temperature($XPath->getData("/phpsysinfo/Hardware/CPU/Cputemp"));
        }
        $_text .= "</font></td>\n  </tr>\n";
    }
    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) {
        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td><font size=\"-1\">" . format_speed 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP format_code_lang函数代码示例发布时间:2022-05-15
下一篇:
PHP format_bytes_billing函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap