Beispiel #1
0
2">
<th width="40"><img src="img/16/user.png"><br>User</th>
<th width="120"><img src="img/16/clock.png"><br><?php 
    echo $timlbl;
    ?>
</th>
<th><img src="img/16/say.png"><br><?php 
    echo $cmtlbl;
    ?>
</th>
</tr>
<?php 
    while ($m = DbFetchRow($res)) {
        if ($_SESSION['user'] == $m[1]) {
            $bg = "txta";
            $bi = "imga";
            $me = 1;
        } else {
            $bg = "txtb";
            $bi = "imgb";
            $me = 0;
        }
        list($fc, $lc) = Agecol($m[0], $m[0], $me);
        $time = date($datfmt, $m[0]);
        echo "<tr class=\"{$bg}\"><th class=\"{$bi}\">" . Smilie($m[1], 1);
        echo "</th>\n";
        echo "<td bgcolor=#{$fc}>{$time}</td><td>" . preg_replace('/(http[s]?:\\/\\/[^\\s]*)/', "<a href=\"\$1\" target=\"window\">\$1</a>", $m[2]) . "</td></tr>\n";
    }
    echo "</table>\n";
}
include_once "inc/footer.php";
}
?>
<h1>User Profile</h1>
<form method="get" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" name="pro">
<table class="content"><tr class="<?php 
echo $modgroup[$self];
?>
1">
<th width=80><a href=<?php 
echo $_SERVER['PHP_SELF'];
?>
><img src=<?php 
echo Smilie($name);
?>
 title="Set your personal information"></a>
<br><?php 
echo $name;
?>
</th>
<th valign=top align=right>
Password <input type="password" name="pass" size="12"><p>
Verify <input type="password" name="vpas" size="12">
</th>

<th valign=top>Language<p>
<SELECT name="lang" size=2>
<OPTION VALUE="eng" <?php 
echo $u[13] == 'eng' ? "selected" : "";
}
$res = @DbQuery($query, $link);
if ($res) {
    $row = 0;
    while ($u = @DbFetchRow($res)) {
        if ($row % 2) {
            $bg = $bgb;
            $bi = $bib;
        } else {
            $bg = $bga;
            $bi = $bia;
        }
        $row++;
        list($cc, $lc) = Agecol($u[10], $u[11], $row % 2);
        echo "<tr bgcolor=#{$bg}>\n";
        echo "<th bgcolor=#{$bi}><img src=" . Smilie($u[0]) . " title=\"Hello I'm {$u['0']}\"'><br>{$u['0']}</th>\n";
        echo "<td>{$u['8']}</td><td align=center>{$u['9']}</td><td>{$u['12']}</td><td align=center>{$u['13']}</td>\n";
        echo "<td bgcolor=#{$cc}>" . date("j. M Y", $u[10]) . "</td>\n";
        echo "<td bgcolor=#{$lc}>" . date("j. M (G:i)", $u[11]) . "</td><th>\n";
        if ($u[2]) {
            echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&grm={$u['0']}&mgp=adm><img hspace={$hs} src=img/16/cfg.png border=0 title=-admin></a>";
        } else {
            echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&gad={$u['0']}&mgp=adm><img hspace={$hs} src=img/16/bcls.png border=0  title=+admin></a>";
        }
        if ($u[3]) {
            echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&grm={$u['0']}&mgp=net><img hspace={$hs} src=img/16/net.png border=0 title=-net></a>";
        } else {
            echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&gad={$u['0']}&mgp=net><img hspace={$hs} src=img/16/bcls.png border=0 title=+net></a>";
        }
        if ($u[4]) {
            echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&grm={$u['0']}&mgp=dsk><img hspace={$hs} src=img/16/ring.png border=0 title=-helpdesk></a>";
     }
     $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) {
         $heuer -= 2;
     } elseif ($lim == 100) {
Beispiel #5
0
if ($grp){
	$query	= GenQuery('users','s','*',$ord,'',array('groups'),array('&'),array($grp) );
}else{
	$query	= GenQuery('users','s','*',$ord );
}
$res	= DbQuery($query,$link);
if($res){
	$row = 0;
	while( ($usr = DbFetchRow($res)) ){
		if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
		$row++;
		list($cc,$lc) = Agecol($usr[5],$usr[6],$row % 2);
		TblRow($bg);
?>
<th class="<?= $bi ?>">
<?=Smilie($usr[0]) ?><br><?= $usr[0] ?></th>
<td nowrap><?= $usr[3] ?></td>
<td nowrap><?= $usr[4] ?></td>
<td nowrap><?= $usr[7] ?></td>
<td bgcolor="#<?= $cc ?>"><?= (date($datfmt,$usr[5])) ?></td>
<td bgcolor="#<?= $lc ?>"><?= (date($datfmt,$usr[6])) ?></td>
<td>
<?php  if( !($usr[2] & 1) ) { ?>
<form method="get">
<input type="hidden" name="usr" value="<?= $usr[0] ?>">
<select size="1" name="inv">
<?php

$vid = explode(" ",$usr[15]);
$inv = array_shift($vid);
$opv = array_shift($vid);										# Operator has no spaces (not regexp is !~ since 1.0.9)
</tr>
<?
	if($alt){
		asort($aginc);
	}else{
		arsort($aginc);
	}
	$row = 0;
	foreach($aginc as $na => $nainc){
		if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
		$row++;
		$ibar = Bar($nainc);
		$adly = intval($agdly[$na] / $nainc / 3600);
		$dbar = Bar($adly,24);
		echo "<tr class=\"$bg\"><th class=\"$bi\">\n";
		echo "<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;}
	}
	?>
</table>
<table class="content" >
<tr class="<?php 
echo $modgroup[$self];
?>
2"><td><?php 
echo $row;
?>
 agents</td></tr>
</table>
	<?
echo "<th>Groups</th><th>Action</th></tr>\n";

if ($grp){
	$query	= GenQuery('user','s','*',$ord,'',array($grp),array('='),array('1') );
}else{
	$query	= GenQuery('user','s','*',$ord );
}
$res	= @DbQuery($query,$link);
if($res){
	$row = 0;
	while( ($u = @DbFetchRow($res)) ){
		if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
		$row++;
		list($cc,$lc) = Agecol($u[10],$u[11],$row % 2);
		echo "<tr class=\"$bg\"><th class=\"$bi\">\n";
		echo "<img src=".Smilie($u[0])." title=\"Hello I'm $u[0]\"'><br>$u[0]</th>\n";
		echo "<td>$u[8]</td><td align=center>$u[9]</td><td>$u[12]</td><td align=center>$u[13]</td>\n";
		echo "<td bgcolor=#$cc>".date("j. M Y",$u[10])."</td>\n";
		echo "<td bgcolor=#$lc>".date("j. M (G:i)",$u[11])."</td><th>\n";
		if($u[2]){echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&grm=$u[0]&mgp=adm><img src=\"img/16/cfg.png\" title=-admin></a>";}
		else{echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&gad=$u[0]&mgp=adm><img src=\"img/16/bcls.png\"  title=+admin></a>";}
		if($u[3]){echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&grm=$u[0]&mgp=net><img src=\"img/16/net.png\" title=-net></a>";}
		else{echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&gad=$u[0]&mgp=net><img src=\"img/16/bcls.png\" title=+net></a>";}
		if($u[4]){echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&grm=$u[0]&mgp=dsk><img src=\"img/16/ring.png\" title=-helpdesk></a>";}
		else{echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&gad=$u[0]&mgp=dsk><img src=\"img/16/bcls.png\" title=+helpdesk></a>";}
		if($u[5]){echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&grm=$u[0]&mgp=mon><img src=\"img/16/sys.png\" title=-monitor></a>";}
		else{echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&gad=$u[0]&mgp=mon><img src=\"img/16/bcls.png\" title=+monitor></a>";}
		if($u[6]){echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&grm=$u[0]&mgp=mgr><img src=\"img/16/umgr.png\" title=-manager></a>";}
		else{echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&gad=$u[0]&mgp=mgr><img src=\"img/16/bcls.png\" title=+manager></a>";}
		if($u[7]){echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&grm=$u[0]&mgp=oth><img src=\"img/16/3d.png\" title=-other></a>";}
		else{echo "<a href=$_SERVER[PHP_SELF]?grp=$grp&ord=$ord&gad=$u[0]&mgp=oth><img src=\"img/16/bcls.png\" title=+other></a>";}
Beispiel #8
0
function IncAck($ina, $opa, $sta, $lim, $ord)
{
    global $link, $modgroup, $self, $srtlbl, $usrlbl, $acklbl, $qtylbl, $timlbl, $tim, $avglbl;
    ?>

<h2>Incident <?php 
    echo $acklbl;
    ?>
</h2>

<table class="content">
<tr class="<?php 
    echo $modgroup[$self];
    ?>
2">
<th colspan="2"><img src="img/16/ucfg.png"><br><?php 
    echo $usrlbl;
    ?>
</th>
<th><img src="img/16/bomb.png"><br><?php 
    echo $qtylbl;
    ?>
</th>
<th><img src="img/16/clock.png"><br><?php 
    echo $avglbl;
    ?>
 <?php 
    echo $acklbl;
    ?>
 <?php 
    echo $timlbl;
    ?>
</th>
</tr>
<?php 
    if ($ord) {
        $ocol = 'usrname';
        $srt = "{$srtlbl}: {$usrlbl}";
    } else {
        $ocol = 'avg desc';
        $srt = "{$srtlbl}: {$qtylbl}";
    }
    $query = GenQuery('incidents', 'g', 'usrname;avg((time - startinc)/3600) AS avg', $ocol, $lim, array('time', $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 Smilie($r[0]) . "</th><td>{$r['0']}</td><td>" . Bar($r[1], 0) . " {$r['1']}</td><td>" . Bar($r[2], 24) . " " . intval($r[2] / 24) . " {$tim['d']} " . intval($r[2] % 24) . " {$tim['h']}</td></tr>\n";
        }
        DbFreeResult($res);
    } 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>
<p>
<?php 
}