本文整理汇总了PHP中pourcentage函数的典型用法代码示例。如果您正苦于以下问题:PHP pourcentage函数的具体用法?PHP pourcentage怎么用?PHP pourcentage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pourcentage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stats_var_spool
function stats_var_spool()
{
$sock = new sockets();
$array = unserialize(base64_decode($sock->getFrameWork("postfix.php?stats-var-spool=yes")));
if (!is_array($array)) {
return;
}
$html = "\n\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t<td class=legend style='font-size:14px'>{size}:</td>\n\t\t<td>" . pourcentage($array["POURC"], "{$array["DISP"]}/{$array["SIZE"]}") . "</td>\n\t\t<td class=legend style='font-size:14px'>{$array["DISP"]}/{$array["SIZE"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:14px'>Inodes:</td>\n\t\t<td>" . pourcentage($array["IPOURC"]) . "</td>\n\t\t<td class=legend style='font-size:14px'>{$array["IDISP"]}/{$array["INODES"]}</td>\n\t\t</tr>\t\t\t\t\n\t</table>\t\n\t";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例2: popup
function popup()
{
$sock = new sockets();
$tpl = new templates();
$page = CurrentPageName();
$dev = $_GET["dev"];
$devenc = base64_encode($dev);
$array = unserialize(base64_decode($sock->getFrameWork("system.php?tune2fs-values={$devenc}")));
$t = time();
$LAST_MOUNTED_ON = $array["LAST_MOUNTED_ON"];
$WARNING_LOOSE_DATA = $tpl->javascript_parse_text("{WARNING_LOOSE_DATA}");
$INODES_SIZEZ[128] = 128;
$INODES_SIZEZ[256] = 256;
$INODES_SIZEZ[1024] = 1024;
$html = "\n\t<div id='{$t}'></div>\t\t\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{used}:</td>\t\t\n\t\t<td style='font-size:16px;font-weight:bold'>{$array["INODES_USED"]} {files}</td>\n\t\t<td style='font-size:16px;font-weight:bold'>" . pourcentage($array["INODES_POURC"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{inode_size}:</td>\t\t\n\t\t<td style='font-size:16px;font-weight:bold'>" . Field_array_Hash($INODES_SIZEZ, "INODE_SIZE", $array["INODE_SIZE"], null, '', 0, "font-size:16px") . "</td>\n\t\t<td style='font-size:16px;font-weight:bold'></td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>Max:</td>\t\t\n\t\t<td style='font-size:16px;font-weight:bold'>" . Field_text("INODES_MAX", $array["INODES_MAX"], "font-size:16px;width:100px") . " {files}</td>\n\t\t<td style='font-size:16px;font-weight:bold'></td>\n\t</tr>\n\t<tr><td colspan=3 align='right'><hr>" . button("{apply}", "Save{$t}()", 18) . "</td></tr>\n\t\n\t</table>\t\n\n\t\t\t\t\n\t\t\t\t\n\t<script>\n\n\t\tfunction check{$t}(){\n\t\t\tvar LAST_MOUNTED_ON='{$LAST_MOUNTED_ON}';\n\t\t\tif(LAST_MOUNTED_ON=='/'){\n\t\t\t\tdocument.getElementById('INODES_MAX').disabled=true;\n\t\t\t\tdocument.getElementById('INODE_SIZE').disabled=true;\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tvar x_save{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>5){alert(results);}\n\t\t\tLoadjs('{$page}?dev={$dev}');\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfunction Save{$t}(){\n\t\t\tvar LAST_MOUNTED_ON='{$LAST_MOUNTED_ON}';\n\t\t\tif(LAST_MOUNTED_ON=='/'){return;}\n\t\t\tif(confirm('{$WARNING_LOOSE_DATA}')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('dev','{$devenc}');\n\t\t\t\tXHR.appendData('INODES_MAX',document.getElementById('INODES_MAX').value);\n\t\t\t\tXHR.appendData('INODE_SIZE',document.getElementById('INODE_SIZE').value);\n\t\t\t\tAnimateDiv('{$t}');\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_save{$t});\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t\n\tcheck{$t}();";
echo $tpl->_ENGINE_parse_body($html);
}
示例3: squid_booster_smp
function squid_booster_smp($encoded)
{
$sock = new sockets();
$array = unserialize(base64_decode($encoded));
if (!is_array($array)) {
return;
}
if (count($array) == 0) {
return;
}
$html[] = "\n\t\t\t<div style='min-height:115px'>\n\t\t\t<table>\n\t\t\t<tr><td colspan=2 style='font-size:14px;font-weight:bold'>Cache(s) Booster</td></tr>\n\t\t\t";
while (list($proc, $pourc) = each($array)) {
$html[] = "<tr>\n\t\t<td width=1% nowrap style='font-size:13px;font-weight:bold'>Proc #{$proc}</td><td width=1% nowrap>" . pourcentage($pourc) . "</td></tr>";
}
$html[] = "</table></div>";
return RoundedLightGreen(@implode("\n", $html));
}
示例4: mem_status
function mem_status()
{
$tpl = new templates();
$sock = new sockets();
$datas = unserialize(base64_decode($sock->getFrameWork("cmd.php?postfix-mem-disk-status={$_GET["hostname"]}")));
$MOUTED = $datas["MOUTED"];
$TOTAL_MEMORY_MB = $datas["TOTAL_MEMORY_MB"];
$TOTAL_MEMORY_MB_FREE = $datas["TOTAL_MEMORY_MB_FREE"];
$pourc = round($TOTAL_MEMORY_MB_FREE / $TOTAL_MEMORY_MB * 100);
$pourc_used = pourcentage($pourc);
if ($MOUTED > 0) {
$pourc = round($MOUTED / $TOTAL_MEMORY_MB_FREE * 100);
$purc_mounted = pourcentage($pourc);
}
$html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td style='font-size:11px'>{free}: </td>\n\t</tr>\n\t<td valign='top'>{$pourc_used}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' align='right'><i>{$TOTAL_MEMORY_MB_FREE}MB/{$TOTAL_MEMORY_MB}MB</i></td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2><hr></td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:11px'>{postfix_tmpfs}:</td>\n\t</tr>\n\t\t<td valign='top'>{$purc_mounted}</td>\n\t</tr>\n\t</tr>\n\t\t<td valign='top' align='right'><i>{$MOUTED}MB/{$TOTAL_MEMORY_MB_FREE}MB</td>\n\t</tr>\t\n\t</table>\n\t\t<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "mem_status()") . "</div>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例5: squid_cache_status
function squid_cache_status()
{
$page = CurrentPageName();
$squid = new squidnodes($_GET["nodeid"]);
$tpl = new templates();
$q = new mysql_blackbox();
$t = $_GET["t"];
$sql = "SELECT * FROM cachestatus WHERE nodeid='{$_GET["nodeid"]}'";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo "<H3>Error: {$q->mysql_error}</H3>";
return;
}
//$squid->
$tr[] = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/parameters2-64.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top><strong style='font-size:14px'>\n\t\t\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('nodes.squid.caches32.parms.php?hostid={$_GET["hostid"]}&nodeid={$_GET["nodeid"]}');\"\n\t\t\t\t\t\t\tstyle='font-size:14px;text-decoration:underline;font-weight:bold'>\n\t\t\t\t\t\t\t{caches_parameters}</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><span style='font-size:14px'>{cache_parameters_node_explain}</span></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$tr[] = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/disk-64.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top><strong style='font-size:14px'>" . basename($ligne["cachedir"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>" . FormatBytes($ligne["currentsize"]) . "/" . FormatBytes($ligne["maxsize"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'>" . pourcentage($ligne["pourc"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
}
$html = CompileTr2($tr);
$html = $html . "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-caches-status{$t}','{$page}?squid-caches-status=yes&nodeid={$_GET["nodeid"]}');") . "</div>";
echo $tpl->_ENGINE_parse_body($html);
}
示例6: popup_events
function popup_events()
{
$sock = new sockets();
$tpl = new templates();
$datas = unserialize(base64_decode($sock->getFrameWork("cmd.php?smtp-import-events=yes&ou={$_GET["ou"]}")));
if (!is_array($datas)) {
echo $tpl->_ENGINE_parse_body("<center><H3>{please_wait}</H3></center>");
return;
}
$pourcent = $datas["POURC"];
$html_pource = pourcentage($pourcent);
krsort($datas["EVENTS"]);
while (list($num, $line) = each($datas["EVENTS"])) {
if ($classtr == "oddRow") {
$classtr = null;
} else {
$classtr = "oddRow";
}
$tr = $tr . "\n\t\t<tr class={$classtr}>\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td width=99% style='font-size:13px'>{$line}</td>\n\t\t</tr>\n\t\t";
}
$html = $html . "<hr>\n{$html_pource}\n<hr>\n<div style='height:350px;overflow:auto'>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView'>\n<thead class='thead'>\n\t<tr>\n\t<th colspan=2>{events}</th>\n\t\n\t</tr>\n</thead>\n<tbody class='tbody'>{$tr}</tbody></table></div>";
echo $tpl->_ENGINE_parse_body($html);
}
示例7: popup
function popup()
{
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$t = $_GET["t"];
$cachefile = "/usr/share/artica-postfix/ressources/logs/web/squidlogs.stats";
$array = unserialize(@file_get_contents($cachefile));
if (!isset($array["squidlogs"])) {
@unlink($cachefile);
}
$array = unserialize(@file_get_contents($cachefile));
if (!is_array($array)) {
$sock = new sockets();
$sock->getFrameWork("squid.php?squidlogs-stats=yes");
$tt = time();
$html = "<center>\n\t\t\t\t<p style='font-size:18px;font-weight:bold'>{please_wait_while_calculate_informations}</p>\n\t\t\t\t<p>squidlogs.stats no such file...</p>\n\t\t\t\t<img src='img/wait_verybig_mini_red.gif'></center>\n\t\t\t</center>\n\t\t\t\t<script>\n\t\t\t\t\tfunction Wait{$tt}(){\n\t\t\t\t\t\tLoadAjax('main-{$t}','{$page}?popup=yes&t={$t}');\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(\" Wait{$tt}()\",5000);\n\t\t\t\t</script>\n\t\t";
echo $tpl->_ENGINE_parse_body($html);
return;
}
$array = unserialize(@file_get_contents("ressources/logs/web/squidlogs.stats"));
$html = "\n\t<div class=explain style='font-size:14px'>{squidlogs_explain}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td>\n\t\t\t<table style='width:100%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'>{hard_drive}:</td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>{$array["squidlogs"]["DEV"]} </td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'>{hard_drive_status}:</td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>{$array["squidlogs"]["OC"]}/{$array["squidlogs"]["SIZE"]}</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'></td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>" . pourcentage($array["squidlogs"]["POURC"]) . "</td>\n\t\t\t</tr>\t\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'>{database_size}:</td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>{$array["squidlogs"]["REALPATH"]}:<span style='text-align:right'><i>" . FormatBytes($array["squidlogs"]["PATHSIZE"] / 1024) . "</span></td>\n\t\t\t</tr>\t\n\t\t\t</table>\n\t\t</td>\n\t\t<td>\n\t\n\t\t</td>\n\t\t</tr>\n\t</table>\n\t<div class=explain style='font-size:14px'>{syslogstore_explain}</div>\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td>\n\t\t\t<table style='width:100%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'>{hard_drive}:</td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>{$array["syslogstore"]["DEV"]} </td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'>{hard_drive_status}:</td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>{$array["syslogstore"]["OC"]}/{$array["syslogstore"]["SIZE"]}</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'></td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>" . pourcentage($array["syslogstore"]["POURC"]) . "</td>\n\t\t\t</tr>\t\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:14px' valign='top'>{database_size}:</td>\n\t\t\t\t<td><strong style='font-size:14px;font-weight:bold'>{$array["syslogstore"]["REALPATH"]}:<span style='text-align:right'><i>" . FormatBytes($array["syslogstore"]["PATHSIZE"] / 1024) . "</span></td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t\t\t<td valign='top'>\n\t\n\t\t\t</td>\n\t\t</tr>\n\t</table>\t\t\t\t\t\t\t\t\t\t\t\t\t\n";
echo $tpl->_ENGINE_parse_body($html);
}
示例8: progress_build
function progress_build()
{
$tpl = new templates();
echo "<center>";
echo pourcentage($_GET["progress"]);
echo "</center>";
if ($_GET["progress"] == 100) {
$tpl = new templates();
echo $tpl->_ENGINE_parse_body("<center><hr><strong style='font-size:16px;color:#d32d2d;margin:15px'>{success}</strong><hr></center>");
$_SESSION["WIZINSTANCE"] = array();
}
}
示例9: SafeBoxInfos
function SafeBoxInfos($mapper)
{
$sock = new sockets();
$array = unserialize(base64_decode($sock->getFrameWork("cmd.php?DiskInfos={$mapper}")));
$html = "<table style='width:100%'>\n\t<tr>\n\t\t<td>" . pourcentage($array["POURC"]) . "</td>\n\t</tr>\n\t<tr>\n\t<td align='left'>{free}:{$array["FREE"]} | {size}:{$array["SIZE"]} | {used}:{$array["USED"]}<br>\n\t<code>{$array["MOUNTED"]}</td>\n\t</tr>\n\t</table>\t\n\t\n\t";
return $html;
}
示例10: pourcentage
echo pourcentage($nombre['npai'], $nombre['fait']);
?>
%;"><span>Adresse erronée : <?php
echo floor(pourcentage($nombre['npai'], $nombre['fait']));
?>
%</span></div><!--
--></div>
<?php
}
?>
<h4>Statistiques</h4>
<ul class="statistiquesMission">
<li>Mission réalisée à <strong><?php
echo ceil(pourcentage($nombre['fait'], $nombre['total']));
?>
</strong> %.</li>
<li><strong><?php
echo number_format($nombre['total'], 0, ',', ' ');
?>
</strong> <?php
echo $data->get('mission_type') == 'porte' ? 'électeurs' : 'immeubles';
?>
concernés par cette mission.</li>
<li>Il reste <strong><?php
echo number_format($nombre['attente'], 0, ',', ' ');
?>
</strong> <?php
echo $data->get('mission_type') == 'porte' ? 'électeurs' : 'immeubles';
?>
示例11: squid_cache_status
function squid_cache_status()
{
$sock = new sockets();
$DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
if (!is_numeric($DisableAnyCache)) {
$DisableAnyCache = 0;
}
if ($DisableAnyCache == 1) {
return;
}
$page = CurrentPageName();
$squid = new squidbee();
$tpl = new templates();
$t = time();
$q = new mysql_squid_builder();
$sql = "SELECT * FROM cachestatus WHERE uuid='{$_GET["uuid"]}'";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo "<H3>Error: {$this->mysql_error}</H3>";
return;
}
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$strong = "<strong style='font-size:14px'>";
if (basename($ligne["cachedir"]) == "cache_booster") {
$strong = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.booster.php')\" style='font-size:14px;text-decoration:underline;font-weight:bold'>";
}
$delete = imgtootltip("disk-64-delete.png", "{delete_cache}", "squid32DeleteCache('" . base64_encode($ligne["cachedir"]) . "')");
$NICKEL[$ligne["cachedir"]] = true;
if ($ligne["cachedir"] == $squid->CACHE_PATH) {
$cache_type = $squid->CACHE_TYPE;
$delete = imgtootltip("disk-64-config.png", "{apply}", "Loadjs('{$page}?add-new-disk-js=yes&chdef=yes')");
} else {
$cache_type = $squid->cache_list[$ligne["cachedir"]]["cache_type"];
}
if ($ligne["cachedir"] != $squid->CACHE_PATH) {
if (!isset($squid->cache_list[$ligne["cachedir"]])) {
$delete = "<img src='img/disk-64-hide.png'>";
}
}
$html = $html . "\n\t\t\t\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%>{$delete}</td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top>{$strong}" . basename($ligne["cachedir"]) . " ({$cache_type})</strong></a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>" . FormatBytes($ligne["currentsize"]) . "/" . FormatBytes($ligne["maxsize"]) . "</strong><div>{$ligne["cachedir"]}</div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'>" . pourcentage($ligne["pourc"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
}
while (list($path, $array) = each($squid->cache_list)) {
if (isset($NICKEL[$path])) {
continue;
}
$unit = " MB";
$maxcachesize = null;
if ($array["cache_type"] == "rock") {
$maxcachesize = " ({max_objects_size} {$array["cache_maxsize"]}{$unit})";
}
if (is_numeric($array["cache_size"])) {
if ($array["cache_size"] > 1000) {
$array["cache_size"] = $array["cache_size"] / 1000;
$unit = " GB";
}
}
if ($array["cache_type"] == "rock") {
continue;
}
$html = $html . "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/disk-64-hide.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top>{$strong}" . basename($path) . " ({$array["cache_type"]})</strong></a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>{$array["cache_size"]}{$unit}/{$maxcachesize}</strong><div>{$path}</div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'> </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
}
$html = $html . "\n\t<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-caches-status','{$page}?squid-caches-status=yes&uuid={$_GET["uuid"]}');") . "</div>\n\t\n\t<script>\n\t\tfunction Squid32RefreshCacheStatusAuto{$t}(){\n\t\t\tif(document.getElementById('squid-caches-status')){\n\t\t\t\tLoadAjax('squid-caches-status','{$page}?squid-caches-status=yes&uuid={$_GET["uuid"]}');\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\tsetTimeout('Squid32RefreshCacheStatusAuto{$t}',10000);\n\t\t\n\t</script>\n\t\n\n\t\t\n\t\n\t";
$sock = new sockets();
$sock->getFrameWork("squid.php?refresh-caches-infos=yes");
echo $tpl->_ENGINE_parse_body($html);
}
示例12: ptx_status
function ptx_status()
{
$tpl = new templates();
$sock = new sockets();
$SquidBoosterMem = $sock->GET_INFO("SquidBoosterMem");
if (!is_numeric($SquidBoosterMem)) {
$SquidBoosterMem = 0;
}
$ptxt = "<a href=\"javascript:blur();\" \n\t\tOnClick=\"javascript:Loadjs('squid.booster.php');\" \n\t\tstyle='font-size:12px;text-decoration:underline'>{squid_booster}</a>";
if ($SquidBoosterMem > 0) {
$pourc = $sock->getFrameWork("squid.php?boosterpourc=yes");
$ptxt = "\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td>{$ptxt}</td>\n\t\t\t\t<td>" . pourcentage($pourc) . "</td>\n\t\t\t</tr>\n\t\t</table>";
}
echo $tpl->_ENGINE_parse_body($ptxt);
}
示例13: categories_details_list
function categories_details_list()
{
$tpl = new templates();
$page = CurrentPageName();
$sql = "SELECT * FROM updates_categories WHERE filesize>0 AND categories='{$_GET["category-details-md"]}' ORDER BY progress";
$q = new mysql();
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo "<H2>Fatal error {$sql}</H2>";
}
$num = mysql_num_rows($results);
$html = "<center style='width:100%;height:450px;overflow:auto'>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshCategoryDetails()") . "</th>\n\t\t<th>{database}</th>\n\t\t<th>{filesize}</th>\n\t\t<th colspan=2>{status}</th>\n\t\t\n\t</tr>\n</thead>\n<tbody class='tbody'>";
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
if ($classtr == "oddRow") {
$classtr = null;
} else {
$classtr = "oddRow";
}
$color = "black";
$filesize = FormatBytes($ligne["filesize"] / 1024);
$purc = pourcentage(round($ligne["progress"]));
$html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%><img src=img/Database32.png></td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}'>{$ligne["filename"]}</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}'>{$filesize}</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}'>{$purc}</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}'>{$ligne["subject"]}</td>\t\n\t\t</tr>";
}
$html = $html . "</table>\n\t\n\t<script>\n\t\tRefreshCategoryDetailsTitle();\n\t</script>";
echo $tpl->_ENGINE_parse_body($html);
}
示例14: main_cache_list
function main_cache_list()
{
$squid = new squidbee();
$usermenus = new usersMenus();
$page = CurrentPageName();
$tpl = new templates();
$sock = new sockets();
$cacheinfo = unserialize(base64_decode($sock->getFrameWork("cmd.php?squid-cache-infos=yes")));
$stats = "<table style=width:100%>";
if (is_array($cacheinfo)) {
while (list($path, $array) = each($cacheinfo)) {
$pourc = pourcentage($array["POURC"]);
$currentsize = FormatBytes($array["CURRENT"]);
$max = FormatBytes($array["MAX"]);
$stats = $stats . "\n\t\t\t<tr>\n\t\t\t\t<td valign='top' style='font-size:11px;font-weight:bold' nowrap>{$path} ({$max})</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td valign='top'>{$pourc}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td valign='top' style='font-size:10px' align='right'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align='right'><i>{used}:{$currentsize}</i> </td>\n\t\t\t\t\t<td width=1%>" . imgtootltip("ed_delete.gif", "{delete}", "DeleteCache('{$path}')") . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td valign='top'><hr></td>\n\t\t\t</tr>\n\t\t\t";
}
}
$stats = $stats . "\n\t\t<tr>\n\t\t\t<td align='right' colspan=2>" . imgtootltip("database-48-add.png", "{add_cache_dir}", "AddCache('');") . "</td>\n\t\t</tr>\t\t\n\t\t</table>";
echo $tpl->_ENGINE_parse_body($stats);
}
示例15: main_artica_apt_config
function main_artica_apt_config()
{
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql();
$packagesNumber = $q->COUNT_ROWS("syspackages_updt", "artica_backup");
$updatenowtext = $tpl->javascript_parse_text("{update_now}");
if (!$q->ok) {
echo "<H2>{$q->mysql_error}</H2>";
return;
}
if ($packagesNumber == 0) {
echo $tpl->_ENGINE_parse_body("<table style='width:100%'><tr><td width=1%><img src='img/ok64.png'></td><td><H2>{system_is_uptodate}</H2></td></tr></table>");
return;
}
$html = "<div style='font-size:16px'>{$packagesNumber} {system_packages_can_be_upgraded}</div>";
$q = new mysql();
$sql = "SELECT COUNT(*) as tcount FROM syspackages_updt WHERE upgrade=1";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
$coche = $ligne["tcount"];
if ($coche == $packagesNumber) {
$coche = 1;
} else {
$coche = 0;
}
$refresh = imgtootltip('refresh-24.png', "{refresh}", "RefreshTab('main_config_artica_update');");
$sql = "SELECT AVG(progress) AS tcount FROM syspackages_updt WHERE upgrade=1";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
$global_progress = $ligne["tcount"];
$html = "<center>\n<div id='sys-update-button' style='text-align:center;margin:5px'></div>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>" . Field_checkbox("EnableDisableAllUpgradePackage", 1, $coche, "EnableDisableAllUpgradePackage()") . "</th>\n\t\t<th colspan=2>{packages}</th>\n\t\t<th style='background-color:white;margin:0;padding:0;border:1px solid black'>" . pourcentage(round($global_progress)) . "</th>\n\t\t<th width=1% align='center'>{$refresh}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
$q = new mysql();
$sql = "SELECT * FROM syspackages_updt ORDER BY package";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo "<H2>{$q->mysql_error}</H2>";
}
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$progress = " ";
if ($classtr == "oddRow") {
$classtr = null;
} else {
$classtr = "oddRow";
}
$md = md5($ligne["package"]);
$select = Field_checkbox("{$md}", 1, $ligne["upgrade"], "EnableDisableUpgradePackage('{$md}','{$ligne["package"]}')");
if ($ligne["upgrade"] == 1) {
$progress = pourcentage($ligne["progress"]);
}
$color = "black";
$html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%>{$select}</td>\n\t\t\t<td style='font-size:16px;font-weight:bold;color:{$color}' width=99%>{$ligne["package"]}</td>\n\t\t\t<td width=1% colspan=3>{$progress}</td>\n\t\t</tr>\n\t\t";
}
$html = $html . "</tbody></table>\n\t\n\t<script>\n\t\n\tvar x_EnableDisableAllUpgradePackage= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshTab('main_config_artica_update');\n\t\t\t}\n\tvar x_EnableDisableUpgradePackage= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tsysbutton();\n\t\t\t}\t\t\t\t\t\t\n\t\n\t\n\tfunction EnableDisableAllUpgradePackage(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('EnableDisableAllUpgradePackage').checked){XHR.appendData('EnableDisableAllUpgradePackage',1);}else{XHR.appendData('EnableDisableAllUpgradePackage',0);}\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableAllUpgradePackage);\n \t}\n \t\n function sysbutton(){\n \tLoadAjaxTiny('sys-update-button','{$page}?sys-update-button=yes');\n \n }\n \n function EnableDisableUpgradePackage(id,pkg){\n \tvar XHR = new XHRConnection();\n \tif(document.getElementById(id).checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n \tXHR.appendData('pkg',pkg);\n \tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableUpgradePackage);\n }\n \n function SysUpdateNow(){\n \tif(confirm('{$updatenowtext} ?')){\n \t\tvar XHR = new XHRConnection();\n \t\tXHR.appendData('pkg-upgrade','yes');\n \t\tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableAllUpgradePackage); \t\n \t}\n }\n\t\t\t\t\n\tsysbutton();\n\t</script>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}