コード例 #1
0
ファイル: Devices-Status.php プロジェクト: pl0o0f/nedi-puppet
		}else{	
?>
Modules</h2>
<table class="content" >
<tr class="<?= $modgroup[$self] ?>2">
<th><img src="img/16/find.png"><br>Slot / <?= $mdllbl ?></th>
<th width="130"><img src="img/16/key.png"><br><?= $serlbl ?></th></tr>
</table>
<div class="scroller">
<table class="content" >
<?php
			$row  = 0;
			while( $m = DbFetchRow($res) ){
				if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
				$row++;
				list($mcl,$img) = ModClass($m[9]);
				echo "<tr class=\"".($m[10]?"alrm":$bg)."\"><th class=\"$bi\" width=\"40\">\n";	# status = 0 is ok...TODO add modstatus to DefGen?
				echo "<img src=\"img/16/$img.png\" title=\"$mcl\"></th><td>$m[1]</td><td>$m[2]</td><td width=\"120\">$m[4]</td></tr>\n";
			}
			DbFreeResult($res);
?>
</table>
</div>
<table class="content" >
<tr class="<?= $modgroup[$self] ?>2"><td><?= $tmod[0] ?> Modules <?= $totlbl ?></td></tr>
</table>
<?php
		}
		}
	}else{
		print DbError($link);
コード例 #2
0
ファイル: librep.php プロジェクト: pl0o0f/nedi-puppet
function ModInventory($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $inflbl, $srtlbl, $typlbl, $self, $invlbl, $serlbl;
    ?>
<h2><?php 
    echo $invlbl;
    ?>
</h2>

<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th><img src="img/16/dev.png"><br>Device / Slot</th>
<th><img src="img/16/find.png"><br><?php 
    echo $inflbl;
    ?>
</th>
<th><img src="img/16/key.png"><br><?php 
    echo $serlbl;
    ?>
</th>
<th><img src="img/16/card.png"><br>HW</th>
<th><img src="img/16/cog.png"><br>FW</th>
<th><img src="img/16/cbox.png"><br>SW</th>
</tr>
<?php 
    if ($ord) {
        $ocol = "type";
        $srt = "{$srtlbl}: {$typlbl}";
    } else {
        $ocol = "device";
        $srt = "{$srtlbl}: Device";
    }
    $query = GenQuery('devices', 's', 'distinct device,type,serial,bootimage', $ocol, '', array('devos', $ina), array('!~', $opa), array('^(Printer|ESX)$', $sta), array('AND'));
    $res = DbQuery($query, $link);
    if ($res) {
        $dev = 0;
        $modu = 0;
        while ($r = DbFetchRow($res)) {
            $dev++;
            TblRow('imgb');
            echo "<th align=\"left\"><a href=\"Devices-Status.php?dev=" . urlencode($r[0]) . "\"><b>" . substr($r[0], 0, $_SESSION['lsiz']) . "</b></a></th>\n";
            echo "<td ><a href=\"Reports-Modules.php?rep[]=inv&in[]=type&op[]==&st[]=" . urlencode($r[1]) . "\">{$r['1']}</a></td><td class=\"mrn code\">{$r['2']}</td><td>-</td><td>-</td><td >{$r['3']}</td></tr>\n";
            $mquery = GenQuery('modules', 's', '*', 'modidx', '', array('device'), array('='), array($r[0]));
            $mres = DbQuery($mquery, $link);
            if ($mres) {
                while ($m = DbFetchRow($mres)) {
                    if ($modu % 2) {
                        $bg = "txta";
                        $bi = "imga";
                    } else {
                        $bg = "txtb";
                        $bi = "imgb";
                    }
                    $modu++;
                    list($mcl, $img) = ModClass($m[9]);
                    TblRow($bg);
                    echo "<td align=\"right\">{$m['1']}</td><td><img src=\"img/16/{$img}.png\" title=\"{$mcl}\"><b>{$m['2']}</b> {$m['3']}</td><td class=\"mrn code\">{$m['4']}</td><td>{$m['5']}</td><td>{$m['6']}</td><td>{$m['7']}</td></tr>\n";
                }
                DbFreeResult($mres);
            } else {
                echo DbError($link);
                die;
            }
        }
        DbFreeResult($res);
    } else {
        echo DbError($link);
        die;
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $dev;
    ?>
 Devices, <?php 
    echo $modu;
    ?>
 Modules, <?php 
    echo $srt;
    ?>
</td></tr>
</table>
<p>
<?php 
}