本文整理匯總了PHP中Bar函數的典型用法代碼示例。如果您正苦於以下問題:PHP Bar函數的具體用法?PHP Bar怎麽用?PHP Bar使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Bar函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DbFreeResult
}
if (!strpos($fmt, 'g')) {
echo "</td></tr>\n";
}
DbFreeResult($res);
} else {
print DbError($link);
}
} else {
$query = GenQuery('events', 's', 'count(*)', '', '', array('time', 'time', $in[0]), array('>=', '<', $op[0]), array($istart, $iend, $st[0]), array('AND', 'AND'), 'LEFT JOIN devices USING (device)');
$res = DbQuery($query, $link);
if ($res) {
$m = DbFetchRow($res);
if ($m[0]) {
if (!strpos($fmt, 'g')) {
echo Bar($m[0], 0, $fmt) . " {$m['0']}";
}
}
$dsval[$alllbl][$row] = $m[0];
if (!strpos($fmt, 'g')) {
echo " </td></tr>\n";
}
$tmsg += $m[0];
DbFreeResult($res);
} else {
print DbError($link);
}
}
$istart = $iend;
$row++;
flush();
示例2: GenQuery
$row = 0;
$nno = 0;
$query = GenQuery('nodes','s','*',$ord);
$res = @DbQuery($query,$link);
while( ($n = @DbFetchRow($res)) ){
if($macs["$n[6];;$n[7]"] > 1 or $all){
$m = substr($n[2],0,8);
if(in_array("$m", $wlap,1) ){
if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
$row++;
$name = preg_replace("/^(.*?)\.(.*)/","$1", $n[0]);
$ip = long2ip($n[1]);
$img = Nimg("$n[2];$n[3]");
$fs = date("j.M G:i",$n[4]);
$ls = date("j.M G:i",$n[5]);
$pbar = Bar($macs[$n[6]][$n[7]],5);
$ud = rawurlencode($n[6]);
list($fc,$lc) = Agecol($n[4],$n[5],$row);
echo "<tr class=\"$bg\"><th class=\"$bi\">\n";
echo "<a href=Nodes-Status.php?mac=$n[2]><img src=\"img/oui/$img\" title=\"$n[3] ($n[2])\"></a></th>\n";
echo "<td>$name</td><td>$ip</td><td>$m</td><td>$n[6]</td><td><a href=Nodes-List.php?ina=device&opa==&sta=$ud&cop=AND&inb=ifname&opb==&stb=$n[7]&>$n[7]</a></td><td>$pbar".$macs["$n[6];;$n[7]"]."</td>\n";
echo "<td bgcolor=#$fc>$fs</td><td bgcolor=#$lc>$ls</td>";
echo "</tr>\n";
}
}
$nno++;
}
?>
</table>
<table class="content">
<tr class="<?php
示例3: while
?>
>
<th width=40><img src=img/16/info.png><br>Level</th>
<th><img src=img/16/say.png><br>Messages</th>
<?php
$row = 0;
while ($msg = @DbFetchRow($res)) {
if ($row % 2) {
$bg = $bgb;
$bi = $bib;
} else {
$bg = $bga;
$bi = $bia;
}
$row++;
$mbar = Bar($msg[1], 0, 1);
echo "<tr bgcolor=#{$bg}>\n";
echo "<th bgcolor=#{$bi}><a href=Monitoring-Messages.php?lvl={$msg['0']}><img src=img/16/" . $mico[$msg[0]] . ".png border=0 title=" . $mlvl[$msg[0]] . "></a></th><td>{$mbar} {$msg['1']}</td></tr>\n";
}
echo "</table>\n";
} else {
echo '<p><h5>No Messages</h5>';
}
@DbFreeResult($res);
} else {
print @DbError($link);
}
?>
</th><td></td><th width=77% valign=top>
<h2>Recent Vital Messages</h2>
<table bgcolor=#666666 <?php
示例4: StatusSlow
function StatusSlow($slow)
{
global $latw, $tgtlbl, $latlbl, $modgroup, $self;
if (count($slow)) {
?>
<p>
<table class="content"><tr class="<?php
echo $modgroup[$self];
?>
2">
<th><img src="img/16/trgt.png"><br><?php
echo $tgtlbl;
?>
</th><th><img src="img/16/clock.png"><br><?php
echo $latlbl;
?>
</th>
<?php
$row = 0;
foreach (array_keys($slow) as $t) {
if ($row % 2) {
$bg = "txta";
$bi = "imga";
} else {
$bg = "txtb";
$bi = "imgb";
}
$row++;
echo "<tr>";
if ($_SESSION['gsiz'] != 6) {
echo "<th class=\"{$bi}\"><a href=\"Monitoring-Setup.php?in[]=name&op[]=%3D&st[]=" . urlencode($t) . "\"><img src=\"img/16/bino.png\"></a></th>\n";
}
echo "<td class=\"{$bg}\">" . substr($t, 0, $_SESSION['lsiz']) . "</td><td>" . Bar($slow[$t]['st'], $latw, 'si') . " " . $slow[$t]['st'] . "ms</td></tr>\n";
}
?>
</table>
<?php
}
}
示例5: isset
$bg = $bga;
$bi = $bia;
} else {
$bg = $bgb;
$bi = $bib;
}
$row++;
$devup[$d]['fs'] = isset($devup[$d]['fs']) ? $devup[$d]['fs'] : 0;
$devup[$d]['ls'] = isset($devup[$d]['ls']) ? $devup[$d]['ls'] : 0;
if (!$devup[$d]['fs']) {
$devup[$d]['fs'] = 0;
}
if (!$devup[$d]['ls']) {
$devup[$d]['ls'] = 0;
}
$fbar = Bar($devup[$d]['fs'], 100000);
$lbar = Bar($devup[$d]['ls'], 1);
$fd = rawurlencode(date("m/d/Y H:i:s", $d));
echo "<tr bgcolor=#{$bg}>\n";
echo "<th bgcolor=#{$bg1}>" . date($datfmt, $d) . "</th>\n";
echo "<td>{$fbar} <a href=Devices-List.php?ina=firstseen&opa==&sta={$fd}>" . $devup[$d]['fs'] . "</a> first seen<br>\n";
echo "{$lbar} <a href=Devices-List.php?ina=lastseen&opa==&sta={$fd}>" . $devup[$d]['ls'] . "</a> last seen</td></tr>\n";
if ($row == $lim) {
break;
}
}
echo "</table><table bgcolor=#666666 {$tabtag}>\n";
echo "<tr bgcolor=#{$bg2}><td>{$row} updates from {$ndev} devices in total</td></tr></table>\n";
}
}
include_once "inc/footer.php";
示例6: isset
if ($row % 2) {
$bg = $bga;
$bi = $bia;
} else {
$bg = $bgb;
$bi = $bib;
}
$row++;
$nodup[$d]['fs'] = isset($nodup[$d]['fs']) ? $nodup[$d]['fs'] : 0;
$nodup[$d]['ls'] = isset($nodup[$d]['ls']) ? $nodup[$d]['ls'] : 0;
$nodup[$d]['iu'] = isset($nodup[$d]['iu']) ? $nodup[$d]['iu'] : 0;
$nodup[$d]['au'] = isset($nodup[$d]['au']) ? $nodup[$d]['au'] : 0;
$fbar = Bar($nodup[$d]['fs'], 100000);
$lbar = Bar($nodup[$d]['ls'], 1);
$ibar = Bar($nodup[$d]['iu'], 0);
$abar = Bar($nodup[$d]['au'], 0);
$fd = rawurlencode(date("m/d/Y H:i:s", $d));
echo "<tr bgcolor=#{$bg}>\n";
echo "<th bgcolor=#{$bg1}>" . date("j.M G:i:s", $d) . "\n";
echo "<td>{$fbar} <a href=Nodes-List.php?ina=firstseen&opa==&sta=" . $fd . ">" . $nodup[$d]['fs'] . "</a> first seen<br>\n";
echo "{$lbar} <a href=Nodes-List.php?ina=lastseen&opa==&sta=" . $fd . ">" . $nodup[$d]['ls'] . "</a> last seen <br>\n";
echo "{$abar} <a href=Nodes-List.php?ina=ipupdate&opa==&sta=" . $fd . ">" . $nodup[$d]['au'] . "</a> IP Updates<br>\n";
echo "{$ibar} <a href=Nodes-List.php?ina=ifupdate&opa==&sta=" . $fd . ">" . $nodup[$d]['iu'] . "</a> IF Updates</td></tr>\n";
if ($row == $lim) {
break;
}
}
echo "</table><table bgcolor=#666666 {$tabtag} >\n";
echo "<tr bgcolor=#{$bg2}><td>{$row} updates from {$tnod} nodes in total</td></tr></table>\n";
}
include_once "inc/footer.php";
示例7: TblCell
if (in_array("firstdis", $col)) {
TblCell(date($datfmt, $v[4]), "?in[]=firstdis&op[]==&st[]={$v['4']}", "bgcolor=\"#{$fc}\"");
}
if (in_array("lastdis", $col)) {
TblCell(date($datfmt, $v[5]), "?in[]=lastdis&op[]==&st[]={$v['5']}", "bgcolor=\"#{$lc}\"");
}
if (in_array("location", $col)) {
TblCell($v[6], "?in[]=location&op[]==&st[]=" . urlencode($v[6]));
}
if (in_array("contact", $col)) {
TblCell($v[7], "?in[]=contact&op[]==&st[]=" . urlencode($v[7]));
}
if (in_array("poNS", $col)) {
$pop = NodPop(array('device', 'vlanid'), array('=', '='), array($v[0], $v[1]), array('AND'));
if ($pop) {
TblCell($pop, "Nodes-List.php?in[]=device&in[]=vlanid&op[]==&op[]==&st[]={$ud}&st[]={$v['1']}&co[]=AND", '', Bar($pop, 100, 'si'), 'td-img');
} else {
TblCell();
}
}
echo "</tr>\n";
}
DbFreeResult($res);
} else {
print DbError($link);
}
?>
</table>
<table class="content">
<tr class="<?php
echo $modgroup[$self];
示例8: while
>
<th width=80><img src=img/32/impt.png><br>Level</th>
<th><img src=img/32/eyes.png><br>Events</th>
<?php
$row = 0;
while ($msg = @DbFetchRow($res)) {
if ($row == "1") {
$row = "0";
$bg = $bga;
$bi = $bia;
} else {
$row = "1";
$bg = $bgb;
$bi = $bib;
}
$mbar = Bar($msg[1], 0);
echo "<tr bgcolor=#{$bg}>\n";
echo "<th bgcolor=#{$bi}><a href=Monitoring-Messages.php?lvl={$msg['0']}><img src=img/32/" . $mico[$msg[0]] . ".png border=0 title=" . $mlvl[$msg[0]] . "></a></th><td>{$mbar} {$msg['1']}</td></tr>\n";
}
echo "<tr bgcolor=#{$bg2}><td colspan=2>{$nlev} Levels ({$query})</td></tr></table>\n";
} else {
echo '<h5>No Messages</h5>';
}
@DbFreeResult($res);
} else {
print @DbError($link);
}
echo '</td></tr></table>';
if ($cpos !== false and !$cty) {
Cities();
} elseif ($bpos !== false and !$bld) {
示例9: GenQuery
if (in_array("device", $col)) {
echo "<td><a href=Devices-Status.php?dev={$ud}>{$v['0']}</a></td>\n";
}
if (in_array("vlanid", $col)) {
echo "<td>{$v['1']}</td>";
}
if (in_array("vlanname", $col)) {
echo "<td>{$v['2']}</td>";
}
if (in_array("pop", $col)) {
$nquery = GenQuery('nodes', 'g', 'vlanid', '', '', array('device', 'vlanid'), array('=', '='), array($v[0], $v[1]), array('AND'));
$np = @DbQuery($nquery, $link);
$nnp = @DbNumRows($np);
if ($nnp == 1) {
$vpop = @DbFetchRow($np);
$pbar = Bar($vpop[1], 110);
echo "<td>{$pbar} <a href=Nodes-List.php?ina=device&opa==&sta={$v['0']}&inb=vlanid&opb==&stb={$v['1']}&cop=AND>{$vpop['1']}</td>";
} else {
echo "<td></td>";
}
@DbFreeResult($np);
}
echo "</tr>\n";
}
@DbFreeResult($res);
} else {
print @DbError($link);
}
echo "</table><table bgcolor=#666666 {$tabtag} >\n";
echo "<tr bgcolor=#{$bg2}><td>{$row} Vlans ({$query})</td></tr></table>\n";
}
示例10: round
foreach ($log as $t => $v){
if($pt){
$d = round(($t-$pt)/86400);
if($d){
echo Bar( $d,0,'mi',"$d $tim[d]");
}
}
$pt = $t;
$lb = explode(";", $v);
echo " <img src=\"img/16/$lb[0].png\" title=\"$lb[1] ".date($datfmt,$t)."\">";
}
echo "</td>\n";
}
if( in_array("iiNS",$col) ){
$ii = IfFree($dev[0]);
TblCell($ii,"Devices-Interfaces.php?in[]=device&op[]==&st[]=$ud&co[]=AND&in[]=ifstat&op[]=<&st[]=3&co[]=AND&in[]=iftype&op[]=~&st[]=^(6|7|117)$&col[]=imBL&col[]=ifname&col[]=device&col[]=linktype&col[]=ifdesc&col[]=alias&col[]=lastchg&col[]=inoct&col[]=outoct&ord=lastchg",'',Bar($ii,-5,'si').' ','td-img');
}
if( in_array("stpNS",$col) and !isset($_GET['xls']) ){
if($dev[14] and $dev[5] > time() - $rrdstep*2){
$stppri = str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.2.0") );
if( preg_match("/^No Such|^$/",$stppri) ){
TblCell("?");
}else{
$numchg = str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.4.0") );
if( preg_match("/^No Such|^$/",$numchg) ){
TblCell("TC:?");
}else{
$laschg = str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.3.0") );
sscanf($laschg, "%d:%d:%0d:%0d.%d",$tcd,$tch,$tcm,$tcs,$ticks);
$tcstr = sprintf("%dD-%d:%02d:%02d",$tcd,$tch,$tcm,$tcs);
$rport = str_replace('"','', Get($ip, $dev[14] & 3, $dev[15], "1.3.6.1.2.1.17.2.7.0") );
示例11: Bar
<h2>Least Used Devices</h2><p>
<table class="content"><tr class="<?php
echo $modgroup[$self];
?>
2">
<th colspan=2 width=25%><img src="img/32/dev.png"><br>Device</th>
<th><img src="img/32/dumy.png"><br>Total Interfaces</th>
<th><img src="img/32/cnic.png"><br>Used Interfaces</th>
<?
asort($ainorm);
$row = 0;
foreach ($ainorm as $dv => $up){
if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
$row++;
$ubar = Bar($up,48);
$ud = rawurlencode($dv);
echo "<tr class=\"$bg\"><th class=\"$bi\">\n";
echo "$row</th><td><a href=Devices-Status.php?dev=$ud&shp=on>$dv</a></td>\n";
echo "<td align=center>".$numif[$dv]."</td><td>$ubar $up % (".$nactif[$dv].")</td></tr>\n";
if($row == $lim){break;}
}
?>
</table>
<table class="content" >
<tr class="<?php
echo $modgroup[$self];
?>
2"><td><?php
echo $row;
?>
示例12: TopoLoc
echo "<td>{$l['8']}</td>";
}
if (in_array("dvNS", $col)) {
$lor = TopoLoc($l[1], $l[2], $l[3]);
$pop = DevPop(array('location'), array('like'), array($lor));
if ($pop) {
TblCell($pop, "Devices-List.php?in[]=location&op[]=like&st[]=" . urlencode($lor), '', Bar($pop, 100, 'si'), 'td-img');
} else {
TblCell();
}
}
if (in_array("poNS", $col)) {
$lor = TopoLoc($l[1], $l[2], $l[3]);
$pop = NodPop(array('location'), array('like'), array($lor), array());
if ($pop) {
TblCell($pop, "Nodes-List.php?in[]=location&op[]=like&st[]=" . urlencode($lor), '', Bar($pop, 100, 'si'), 'td-img');
} else {
TblCell();
}
}
if (in_array("filNS", $col)) {
echo "<td>";
$fp = 'topo';
if ($l[1]) {
$fp .= '/' . preg_replace('/\\W/', '', $l[1]);
}
if ($l[2]) {
$fp .= '/' . preg_replace('/\\W/', '', $l[2]);
}
if ($l[3]) {
$fp .= '/' . preg_replace('/\\W/', '', $l[3]);
示例13: while
?>
</th>
<?php
$row = 0;
while ($r = DbFetchRow($res)) {
if ($row % 2) {
$bg = "txta";
$bi = "imga";
} else {
$bg = "txtb";
$bi = "imgb";
}
$row++;
$s = substr($r[0], 0, $_SESSION['lsiz']);
# Shorten labels
$mbar = Bar($r[2], 0, 'si');
echo "<tr class=\"{$bg}\"><th class=\"{$bi}\" nowrap><a href=\"Devices-Status.php?dev=" . urlencode($r[0]) . "\">{$s}</th>\n";
echo "<td nowrap>{$mbar} <a href=\"{$r['1']}://" . urlencode($r[0]) . "/Monitoring-Events.php?in[]=level&op[]=>&st[]=150&co[]=AND&in[]=time&op[]=>&st[]={$firstmsg}\">{$r['2']}</a></td>\n";
echo "<th nowrap>\n";
echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Monitoring-Health.php\"><img src=\"img/16/hlth.png\" title=\"{$r['0']} Health\"></a>\n";
echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Monitoring-Setup.php\"><img src=\"img/16/bino.png\" title=\"{$r['0']} {$monlbl} {$cfglbl}\"></a>\n";
echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Reports-Combination.php?in[]=&op[]=~&st[]=&rep=mon\"><img src=\"img/16/chrt.png\" title=\"{$r['0']} {$inclbl} {$sumlbl}\"></a>\n";
echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/Reports-Monitoring.php?rep[]=lat&rep[]=evt\"><img src=\"img/16/dbin.png\" title=\"{$r['0']} {$monlbl} {$stslbl}\"></a>\n";
echo "<a href=\"{$r['1']}://" . urlencode($r[0]) . "/System-Services.php\"><img src=\"img/16/cog.png\" title=\"{$r['0']} {$srvlbl}\"></a>\n";
echo "</th></tr>\n";
}
echo "</table>\n";
} else {
echo "<p><h5>{$nonlbl}</h5>";
}
DbFreeResult($res);
示例14: arsort
} else {
arsort($aginc);
}
$row = 0;
foreach ($aginc as $na => $nainc) {
if ($row % 2) {
$bg = $bga;
$bi = $bia;
} else {
$bg = $bgb;
$bi = $bib;
}
$row++;
$ibar = Bar($nainc);
$adly = intval($agdly[$na] / $nainc / 3600);
$dbar = Bar($adly, 24);
echo "<tr bgcolor=#{$bg}>";
echo "<th bgcolor=#{$bi}><img src=" . Smilie($na) . " title=\"Hello I'm {$na}\"'><p>{$na}</th>\n";
echo "<td>{$ibar} {$nainc}</td><td>{$dbar} {$adly} hours</td></tr>\n";
if ($row == $lim) {
break;
}
}
echo "</table><table bgcolor=#666666 {$tabtag} >\n";
echo "<tr bgcolor=#{$bg2}><td>{$row} of {$tdev} devices with incidents shown</td></tr></table>\n";
}
if (in_array("cal", $rep)) {
$heuer = $now['year'];
if ($lim == 20) {
$heuer -= 1;
} elseif ($lim == 50) {
示例15: NodSum
function NodSum($ina, $opa, $sta, $lim, $ord)
{
global $link, $modgroup, $self, $rrdstep, $stco, $sumlbl, $srtlbl, $venlbl, $qtylbl, $alllbl, $chglbl, $totlbl, $deslbl, $fislbl, $laslbl, $emplbl, $namlbl, $metlbl, $nonlbl, $loslbl, $qutlbl, $faslbl, $vallbl, $mullbl;
$lasdis = time() - $rrdstep * 2;
$query = GenQuery('nodes', 's', "count(*),sum(case when nodip = 0 then 1 else 0 end),sum(case when name = '' then 1 else 0 end),sum(case when firstseen = lastseen then 1 else 0 end),sum(case when iplost > 0 then 1 else 0 end),sum(case when ifmetric < 256 then 1 else 0 end),sum(case when firstseen > {$lasdis} then 1 else 0 end),sum(case when lastseen > {$lasdis} then 1 else 0 end),sum(case when ipchanges > 0 then 1 else 0 end),sum(case when ifchanges > 0 then 1 else 0 end),sum(case when arpval > 1 then 1 else 0 end)", '', '', array($ina), array($opa), array($sta), array(), 'LEFT JOIN devices USING (device)');
$res = DbQuery($query, $link);
if ($res) {
$r = DbFetchRow($res);
} else {
print DbError($link);
die;
}
?>
<table class="full fixed"><tr><td class="helper">
<h2>Node <?php
echo $sumlbl;
?>
</h2>
<table class="content"><tr class="<?php
echo $modgroup[$self];
?>
2">
<th width="33%" colspan="2"><img src="img/16/find.png" title="Nodes <?php
echo $stslbl;
?>
">
<br><?php
echo $deslbl;
?>
</th><th><img src="img/16/nods.png"><br>Nodes</th>
<tr class="txtb"><th class="imgb"><img src="img/16/add.png" title="<?php
echo $fislbl;
?>
> <?php
echo date($_SESSION['date'], $lasdis);
?>
"></th><td><b><?php
echo $stco['10'];
?>
</b></td><td><?php
echo Bar($r[6], 0, 'mi');
?>
<a href="Nodes-List.php?in[]=firstseen&op[]=>&st[]=<?php
echo $lasdis;
?>
&ord=nodip"><?php
echo $r[6];
?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/exit.png" title="<?php
echo $laslbl;
?>
> <?php
echo date($_SESSION['date'], $lasdis);
?>
"></th><td><b><?php
echo $stco['100'];
?>
</b></td><td><?php
echo Bar($r[7], 0, 'mi');
?>
<a href="Nodes-List.php?in[]=lastseen&op[]=>&st[]=<?php
echo $lasdis;
?>
&ord=nodip"><?php
echo $r[7];
?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/wlan.png" title="IF <?php
echo $metlbl;
?>
< 256"></th><td><b>Wlan</th></b><td><?php
echo Bar($r[5], 0, 'mi');
?>
<a href="Nodes-List.php?in[]=ifmetric&op[]=<&st[]=256&ord=ifmetric+desc"> <?php
echo $r[5];
?>
</a></td></tr>
<tr class="txta"><th class="imga"><img src="img/16/calc.png" title="IP <?php
echo $chglbl;
?>
> 0"></th><td><b>IP <?php
echo $chglbl;
?>
</b></td><td><?php
echo Bar($r[8], 0, 'mi');
?>
<a href="Nodes-List.php?in[]=ipchanges&op[]=>&st[]=0&ord=ipchanges+desc"><?php
echo $r[8];
?>
</a></td></tr>
<tr class="txtb"><th class="imgb"><img src="img/16/walk.png" title="IF <?php
echo $chglbl;
?>
> 0"></th><td><b>IF <?php
echo $chglbl;
?>
</b></td><td><?php
echo Bar($r[9], 0, 'mi');
//.........這裏部分代碼省略.........