$ls  = "-";
		}
		if($i[7]){$at = date("d.M H:i",$i[7]);}else{$at = "-";}
		$ud = urlencode($i[2]);
		list($fc,$lc) = Agecol($i[4],$i[5],$row % 2);
		TblRow($bg);
		echo "<th class=\"$bi\"><a href=\"?id=$i[0]\">$i[0]</a></th><th class=\"".$mbak[$i[1]]."\" width=\"40\"><img src=\"img/16/" . $mico[$i[1]] . ".png\" title=\"" . $mlvl[$i[1]] . "\"></th>\n";
		echo "<td><a href=\"Monitoring-Setup.php?in[]=name&op[]=%3D&st[]=$ud\">$i[2]</a></td><td>$i[3] deps</td>\n";
		echo "<td bgcolor=#$fc>$fs</td><td bgcolor=#$fc>$ls</td><th>$i[6]</th><td>$at</td><td>";

		if( isset($_GET['print']) ){
			echo "<img src=\"img/16/".IncImg($i[8]).".png\">".$igrp[$i[8]]."</td><td>$i[9]";
		}else{
?>
<form method="get" action="<?= $self ?>.php">
<img src="img/16/<?=IncImg($i[8]) ?>.png">
<input type="hidden" name="ugr" value="<?= $i[0] ?>">
<input type="hidden" name="usr" value="<?= ($i[6])?$i[6]:$_SESSION['user'] ?>">
<input type="hidden" name="tme" value="<?= ($i[7])?$i[7]:time() ?>">
<input type="hidden" name="lim" value="<?= $lim ?>">
<input type="hidden" name="off" value="<?= $nof ?>">
<select size="1" name="grp" onchange="this.form.submit();" title="<?= $sellbl ?> <?= $clalbl ?>">
<?php
		foreach (array_keys($igrp) as $ig){
			echo "<option value=\"$ig\" ".(strpos($ig,'0')?"style=\"color: blue\" ":"");
			if($ig == $i[8]){echo "selected ";}
			echo (strpos($ig,'0')?"style=\"color: blue\">$igrp[$ig]\n":">- $igrp[$ig]\n");
		}
?>
</select>
</td><td>
Example #2
0
function IncGroup($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $self, $grplbl, $srtlbl, $dislbl, $qtylbl, $igrp, $tim, $totlbl, $avglbl, $durlbl;
    ?>
<h2>Incident <?php 
    echo $grplbl;
    ?>
</h2>

<table class="full fixed"><tr><td class="helper">

<h2><?php 
    echo $grplbl;
    ?>
 <?php 
    echo $dislbl;
    ?>
</h2>
<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th colspan="2" width="33%"><img src="img/16/ugrp.png"><br><?php 
    echo $grplbl;
    ?>
</th>
<th><img src="img/16/bomb.png"><br><?php 
    echo $qtylbl;
    ?>
</th>
</tr>
<?php 
    if ($ord) {
        $ocol = 'grp';
        $srt = "{$srtlbl}: {$grplbl}";
    } else {
        $ocol = 'cnt desc';
        $srt = "{$srtlbl}: {$qtylbl}";
    }
    if ($ina == "class") {
        $ina = "grp";
    }
    $query = GenQuery('incidents', 'g', 'grp', $ocol, $lim, array($ina), array($opa), array($sta), array(), '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++;
            echo "<tr class=\"{$bg}\"><th class=\"{$bi}\" width=\"50\">\n";
            echo "<img src=\"img/16/" . IncImg($r[0]) . ".png\"></th>\n<td><a href=\"Monitoring-Incidents.php?grp={$r['0']}\">";
            echo $igrp[$r[0]] . "</a></td><td>" . Bar($r[1], 'lvl100', 'mi') . " {$r['1']}</td></tr>\n";
        }
    } else {
        echo DbError($link);
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 <?php 
    echo $grplbl;
    ?>
, <?php 
    echo $srt;
    ?>
</td></tr>
</table>

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

<h2><?php 
    echo $avglbl;
    ?>
 <?php 
    echo $durlbl;
    ?>
</h2>
<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th colspan="2" width="33%"><img src="img/16/ugrp.png"><br><?php 
    echo $grplbl;
    ?>
</th>
<th><img src="img/16/clock.png"><br><?php 
    echo $avglbl;
    ?>
 <?php 
    echo $durlbl;
    ?>
</th>
</tr>
<?php 
    if ($ord) {
        $ocol = 'grp';
    } else {
        $ocol = 'avg desc';
    }
    $query = GenQuery('incidents', 'g', 'grp;avg((endinc - startinc)/60) AS avg', $ocol, $lim, array('endinc', $ina), array('>', $opa), array('0', $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++;
            echo "<tr class=\"{$bg}\"><th class=\"{$bi}\" width=\"50\">\n";
            echo "<img src=\"img/16/" . IncImg($r[0]) . ".png\"></th>\n<td><a href=\"Monitoring-Incidents.php?grp={$r['0']}\">";
            echo $igrp[$r[0]] . "</a></td><td>" . Bar($r[2], 15, 'mi') . " " . intval($r[2] / 60) . " {$tim['h']} " . $r[2] % 60 . " {$tim['i']}</td></tr>\n";
        }
    } else {
        echo DbError($link);
    }
    ?>
</table>
<table class="content" >
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2"><td><?php 
    echo $row;
    ?>
 <?php 
    echo $grplbl;
    ?>
, <?php 
    echo $srt;
    ?>
</td></tr>
</table>

</td></tr></table>
<p>
<?php 
}