예제 #1
0
		if($os == "Printer"){
?>
Supplies</h2>
<table class="content" >
<tr class="<?= $modgroup[$self] ?>2">
<th width="350"><img src="img/16/file.png" title="<?= $typlbl ?>,<?= $deslbl ?>"><br><?= $typlbl ?></th>
<th><img src="img/16/form.png"><br><?= $levlbl ?></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++;
				echo "<tr class=\"$bg\"><th class=\"$bi\" width=\"40\">".PrintSupply($m[1])."</th>\n";
				echo "<td width=\"300\">$m[3]</td><td>".Bar($m[10],-33)." $m[10]%</td></tr>\n";
			}
			DbFreeResult($res);
?>
</table>
</div>
<table class="content" >
<tr class="<?= $modgroup[$self] ?>2">
<td><?= $tmod[0] ?> Supplies <?= $totlbl ?></td></tr>
</table>
<?php
		}elseif($os == "ESX"){#TODO check XEN (xe vm-start name-label=)
?>
Virtual Machines</h2>
<table class="content" >
예제 #2
0
function ModPrint($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $self, $srtlbl, $stalbl, $typlbl, $loclbl, $locsep;
    ?>
<h2>Printsupplies</h2>

<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th width="33%"  colspan="3"><img src="img/16/print.png"><br>Printer</th>
<th colspan="3"><img src="img/16/file.png"><br>Supplies</th>
</tr>
<?php 
    $nprt = 0;
    if ($ord) {
        $ocol = "location";
        $srt = "{$srtlbl}: {$loclbl}";
    } else {
        $ocol = "status";
        $srt = "{$srtlbl}: {$stalbl}";
    }
    $query = GenQuery('modules', 's', 'modules.*,location,contact,icon', $ocol, $lim, array('devos', $ina), array('=', $opa), array('Printer', $sta), array('AND'), 'LEFT JOIN devices USING (device)');
    $res = DbQuery($query, $link);
    if ($res) {
        $row = 0;
        while ($r = DbFetchRow($res)) {
            if ($row % 2) {
                $bg = "txta";
                $bi = "imga";
            } else {
                $bg = "txtb";
                $bi = "imgb";
            }
            $row++;
            $l = explode($locsep, $r[12]);
            TblRow($bg);
            echo "<th class=\"{$bi}\"><a href=\"Devices-Status.php?dev=" . urlencode($r[0]) . "\"><img src=\"img/dev/{$r['14']}.png\"></a>\n";
            echo "</th><td><b>" . substr($r[0], 0, $_SESSION['lsiz']) . "</b></td>\n";
            echo "<td><img src=\"img/16/user.png\" title=\"{$conlbl}\"> {$r['12']}<br><img src=\"img/16/home.png\" title=\"{$loclbl} {$l['1']}, {$l['0']}\"> {$l['2']} {$l['3']} {$l['4']}</td>";
            echo "<th class=\"{$bi}\">" . PrintSupply($r[1]) . "</th>\n";
            echo "<td>{$r['3']}</td><td>" . Bar($r[10], -33) . " {$r['10']}%</td></tr>\n";
        }
        DbFreeResult($res);
    } else {
        echo DbError($link);
        die;
    }
    ?>
</table>
<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 Printer, <?php 
    echo $srt;
    ?>
</td></tr>
</table>
<p>
<?php 
}