コード例 #1
0
ファイル: librep.php プロジェクト: pl0o0f/nedi-puppet
function DevGroup($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $self, $grplbl, $srtlbl, $qtylbl, $lstlbl, $totlbl;
    ?>
<table class="full fixed"><tr><td class="helper">

<h2>Device <?php 
    echo $grplbl;
    ?>
</h2>

<canvas id="grppie" style="display: block;margin: 0 auto;padding: 10px;" width="400" height="300"></canvas>

<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th width="33%"><img src="img/16/ugrp.png"><br><?php 
    echo $grplbl;
    ?>
</th>
<th><img src="img/16/dev.png"><br>Devices</th>
</tr>
<?php 
    if ($ord) {
        $ocol = 'devgroup';
        $srt = "{$srtlbl}: {$grplbl}";
    } else {
        $ocol = 'cnt desc';
        $srt = "{$srtlbl}: {$qtylbl}";
    }
    $query = GenQuery('devices', 'g', 'devgroup', $ocol, $lim, array($ina), array($opa), array($sta));
    $res = DbQuery($query, $link);
    if ($res) {
        $row = 0;
        $chd = array();
        while ($r = DbFetchRow($res)) {
            if ($row % 2) {
                $bg = "txta";
                $bi = "imga";
            } else {
                $bg = "txtb";
                $bi = "imgb";
            }
            $row++;
            $op = "=";
            if (!$r[0]) {
                $r[0] = "^\$";
                $op = "~";
            }
            $chd[] = array('value' => $r[1], 'color' => GetCol('brc', $row, 1));
            echo "<tr class=\"{$bg}\">\n";
            echo "<td><b>{$r['0']}</b></td><td>" . Bar($r[1], GetCol('brc', $row, 1), 'ls') . " <a href=\"Devices-List.php?in[]=devgroup&op[]={$op}&st[]=" . urlencode($r[0]) . "\" title=\"Device {$lstlbl}\">{$r['1']}</a></td></tr>\n";
        }
        DbFreeResult($res);
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 <?php 
    echo $grplbl;
    ?>
, <?php 
    echo $srt;
    ?>
</td></tr>
</table>

<script language="javascript">
var data = <?php 
    echo json_encode($chd, JSON_NUMERIC_CHECK);
    ?>

var ctx = document.getElementById("grppie").getContext("2d");
var myNewChart = new Chart(ctx).Pie(data);
</script>

</td><td class="helper">

<h2>Device Mode</h2>

<canvas id="modpie" style="display: block;margin: 0 auto;padding: 10px;" width="400" height="300"></canvas>

<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th width="33%"><img src="img/16/abc.png"><br>Mode</th>
<th><img src="img/16/dev.png"><br>Devices</th>
</tr>
<?php 
    if ($ord) {
        $ocol = 'devmode';
        $srt = "{$srtlbl}: Mode";
    } else {
        $ocol = 'cnt desc';
        $srt = "{$srtlbl}: {$qtylbl}";
    }
    $query = GenQuery('devices', 'g', 'devmode', $ocol, $lim, array($ina), array($opa), array($sta));
    $res = DbQuery($query, $link);
    if ($res) {
        $row = 0;
        $chd = array();
        while ($r = DbFetchRow($res)) {
            if ($row % 2) {
                $bg = "txta";
                $bi = "imga";
            } else {
                $bg = "txtb";
                $bi = "imgb";
            }
            $row++;
            $chd[] = array('value' => $r[1], 'color' => GetCol('215', $row, 1));
            echo "<tr class=\"{$bg}\">\n";
            echo "<td><b>" . DevMode($r[0]) . "</b></td><td>" . Bar($r[1], GetCol('215', $row, 1), 'ls') . " <a href=\"Devices-List.php?in[]=devmode&op[]==&st[]={$r['0']}\">{$r['1']}</a></td></tr>\n";
        }
        DbFreeResult($res);
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 Modes, <?php 
    echo $srt;
    ?>
</td></tr>
</table>

<script language="javascript">
var data = <?php 
    echo json_encode($chd, JSON_NUMERIC_CHECK);
    ?>

var ctx = document.getElementById("modpie").getContext("2d");
var myNewChart = new Chart(ctx).Pie(data);
</script>

</td></tr></table>
<p>
<?php 
}
コード例 #2
0
ファイル: Devices-Status.php プロジェクト: pl0o0f/nedi-puppet
<div style="float:right">
<a href="Devices-List.php?in[]=contact&op[]==&st[]=<?= urlencode($dev[11]) ?>">
<img src="img/16/dev.png" title="<?= $dev[11] ?> Device <?= $lstlbl ?>">
</a></div>
<form method="get">
<input type="hidden" name="dev" value="<?= $dev[0] ?>">
<input type="text" name="cco" size="<?= $_SESSION['lsiz'] * 2 ?>" value="<?= $dev[11] ?>" onkeypress="if(event.keyCode==13)this.form.submit()">
</form>
</td></tr>
<?php
	}else{
		echo "$dev[11]</td></tr>\n";
	}
?>
<tr><th class="<?= $modgroup[$self] ?>2"><?= $grplbl ?></th><td class="txtb">
<a href="Devices-List.php?in[]=devgroup&op[]==&st[]=<?= $ug ?>"><?= $dev[12] ?></a> <?= $modlbl ?>: <a href="Devices-List.php?in[]=devmode&op[]==&st[]=<?= $dev[13] ?>"><?= DevMode($dev[13]) ?></a>
</td></tr>

<?php if($rver) { ?>
<tr><th class="<?= $modgroup[$self] ?>2">SNMP</th>	<td class="txta">

<?php if($isadmin) { ?>
<div style="float:right;margin:2px 2px">
<form method="post" name="nedi" action="System-NeDi.php">
<input type="hidden" name="mde" value="d">
<input type="hidden" name="sed" value="a">
<input type="hidden" name="vrb" value="v">
<input type="hidden" name="opt" value="<?=$ip?>">
<input type="image" src="img/16/radr.png" value="Submit" title="<?= (($verb1)?"$dsclbl $tim[n]":"$tim[n] $dsclbl") ?>">
</form>
</div>
コード例 #3
0
ファイル: Devices-List.php プロジェクト: pl0o0f/nedi-puppet
					TblCell( $dev[8],"?in[]=devos&op[]==&st[]=".urlencode($dev[8]) );
				}
				if(in_array("bootimage",$col)){
					TblCell( $dev[9],"?in[]=bootimage&op[]==&st[]=".urlencode($dev[9]) );
				}
				if(in_array("location",$col)){
					TblCell( $dev[10],"?in[]=location&op[]==&st[]=".urlencode($dev[10]) );
				}
				if(in_array("contact",$col)){
					TblCell( $dev[11],"?in[]=contact&op[]==&st[]=".urlencode($dev[11]) );
				}
				if(in_array("devgroup",$col)){
					TblCell( $dev[12],"?in[]=devgroup&op[]==&st[]=".urlencode($dev[12]) );
				}
				if(in_array("devmode",$col)){
					TblCell( DevMode($dev[13]),"?in[]=devmode&op[]==&st[]=".urlencode($dev[13]) );
				}
				if(in_array("snmpversion",$col)){
					TblCell( "Read:". ($dev[14] & 3) . (($dev[14] & 128)?"-HC ":" ") . (($dev[14] & 12)?" Write:".($dev[14] & 12 >> 2):"") );
				}
				if(in_array("readcomm",$col)){
					TblCell( (($guiauth != 'none')?$dev[15]:"***") );
				}
				if(in_array("writecomm",$col)){
					TblCell( (($isadmin and $guiauth != 'none')?$dev[26]:"***") );
				}
				if(in_array("cliport",$col)){
					TblCell( $dev[16],"?in[]=cliport&op[]==&st[]=".urlencode($dev[16]) );
				}
				if(in_array("login",$col)){
					TblCell( $dev[17],"?in[]=login&op[]==&st[]=".urlencode($dev[17]) );