"; include "header.phtml"; > \n"; echo "\n"; $i=0; while($i < 31) { $t = time()-60*60*24*$i; $year= date("Y",$t); $month= date("m",$t); $day = date("d",$t); echo "\n"; $i++; } echo "\n"; $i=-1; while($i < 12) { $t = time()-60*60*24*30*$i+60*60*24*2; $year= date("Y",$t); $month= date("m",$t); $day = date("d",$t); echo "\n"; $i++; } echo "\n"; ); if(!$User) { echo "No such user logged!!"; exit; } mysql_Connect($host,$dbuser,$dbpassword); $self = "show_user.phtml"; if($monat>1) { $month=date("m",time()); $year=date("Y",time()); $m=sprintf("%02d",$monat); if($monat>$month) { $year--; }; $firstdate="$year$m" + "01000000"; $lastdate= "$year$m" + "31235959"; }; if(!$firstdate) { if(!$days) { $days=14; } $firstdate= date("Ymd000000",time()-60*60*24*$days); }; if(!$lastdate) { $lastdate= date("Ymd235959",time()); }; >
"> Back > days
"> Choose Month
"> From to
$firstdate AND usertime.start_time<=$lastdate"; # $query += " GROUP by name "; echo ""; echo "
$query
"; $result = mysql($db, $query); if (!$result) { echo "An error occured.\n"; exit; } echo "
"; $num = mysql_NumRows($result); $i = 0; if ($num == 0) { echo "No usage for $User"; } else { echo "

Usage for user $User "; ereg("([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])",$firstdate,$reg); echo "$reg[3]-$reg[2]-$reg[1]"; echo " und "; ereg("([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])",$lastdate,$reg); echo "$reg[3]-$reg[2]-$reg[1]"; echo "
"; echo "\n"; while ($i < $num) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; /* echo "\n"; echo "\n"; */ echo "\n"; echo "\n"; echo "\n"; echo "\n"; $i++; } /* while */ echo "
NAME:"; echo $User; echo "
Connects:"; echo mysql_Result($result, $i, "anzahl" ); echo "
TIME-total:"; $h = mysql_Result($result, $i, "time_on" ) / (60*60); echo "%7.2f" $h; echo "
TIME-day:"; $h = mysql_Result($result, $i, "time_on_day" ) / (60*60); echo "%7.2f" $h; echo "
OUTBYTES:"; echo mysql_Result($result, $i, "outbytes" ); echo "
INBYTES:"; echo mysql_Result($result, $i, "inbytes" ); echo "
"; } if(!$details) { echo "Show Details"; echo "
"; } else { echo "
Hide Details"; echo ""; $query = "SELECT "; $query += " usertime.*,ts.name"; $query += " FROM usertime,ts "; $query += " WHERE usertime.name='$User' AND usertime.start_time>$firstdate AND usertime.start_time<=$lastdate"; $query += " AND usertime.server = ts.ip_int"; $query += " ORDER by start_time"; echo ""; echo "
$query
"; $result = mysql($db, $query); if (!$result) { echo "An error occured.\n"; exit; } echo "
"; $num = mysql_NumRows($result); $i = 0; if ($num == 0) { echo "No usage for User $User"; } else { echo "\n"; > \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; /* echo "\n"; */ echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $i++; } echo "
NAS Start Stop Time
(min)
Time_day
(min)
Type IP InBytes OutBytes TC id
\n"; echo mysql_Result($result, $i, "ts.name" ); echo "\n"; echo mysql_Result($result, $i, "start_time" ); echo "\n"; echo mysql_Result($result, $i, "stop_time" ); echo "\n"; $s = mysql_Result($result, $i, "time_on" ); echo $s / 60 ; echo "\n"; $s = mysql_Result($result, $i, "time_on_day" ); echo $s / 60 ; echo "\n"; $s = mysql_Result($result, $i, "port_type" ); if($s == 0) { echo "Async"; elseif($s == 2) { echo "ISDN"; } else { echo "????"; } echo "\n"; echo mysql_Result($result, $i, "connect_info" ); echo "\n"; echo mysql_Result($result, $i, "ip" ); echo "\n"; echo mysql_Result($result, $i, "InBytes" ); echo "\n"; echo mysql_Result($result, $i, "OutBytes" ); echo "\n"; echo mysql_Result($result, $i, "term_cause" ); echo "\n"; echo mysql_Result($result, $i, "id" ); echo "
\n"; } } mysql_FreeResult($result); mysql_Close(); >