Location: PHPKode > projects > Total ISP > total-isp/getcall.php
include "./auth.inc.php";

if ($Year){
	$datetime = "$Year-$Month-$Day $Hour:$Minute:00";	

	print "$datetime <BR>";

	#offset for Adelaide!
	#ideally get offset from OS.
	$offset = date("Z")/60 - $gmt;
	$mtime = mktime($Hour,$Minute + $offset,0,$Month,$Day,$Year);
	$getdate= date("Y-m-d H:i:s",$mtime);

	$sql = "SELECT UserName, realtime, FramedIPAddress, AcctSessionTime, unix_timestamp(realtime) as t 
		FROM $table
		WHERE AcctStatusType='Stop' 
		HAVING t <= '$mtime' AND (t+AcctSessionTime) >= '$mtime'";

	print $sql;
	$res = mysql_query($sql);
	print mysql_error();
	print "<BR><TABLE border=1>";
	print "<TR><TH>Username</TH><TH>Time</TH><TH>IP Address</TH><TH>Duration</TH></TR>\n";
	while ($row = mysql_fetch_row($res)){
		print "<TR>";
		print "<TD>$row[0]</TD>";
		print "<TD>$row[1]</TD>";
		print "<TD>$row[2]</TD>";
		print "<TD>$row[3]</TD>";
		print "</TR>\n";
	print "</TABLE>";
<BODY bgcolor=white>
<H2>Enter a Time to find out who was on at that time</H2>
Warning: This is a database intensive Search.

Date: <select name=Day>
<? for ($i=1;$i<32;$i++){
        print "<option value=\"$i\">".date("jS",mktime(0,0,0,1,$i,2000))."</option>\n";

<SELECT name=Month>
<? for ($i=1;$i<13;$i++){
	print "<option value=\"$i\">".date("F",mktime(0,0,0,$i,1,2000))."</option>\n";	
        <option><? echo date("Y") ?></option>
        <option><? echo date("Y")-1 ?></option>
Time: <select name=Hour>
<?  for ($i=0;$i<24;$i++){
	print "<option>$i</option>\n";

<select name=Minute>
<?  for ($i=0;$i<60;$i++){
        print "<option>$i</option>\n";

GMT: <select name=gmt>
<? for ($i=-24;$i<24;$i++){
	$gmtn = intval($i/2)*100 + ($i%2)*30;
	if (intval($gmtn) > 0){
		#if (strlen($gmtn)==3){
		#	$gmtn = '0'.$gmtn;
		$gmtn = '+'.$gmtn;
	print "<option value=\"$value\"";
	if ($value == 570)
		print " selected";
	print ">$gmtn</option>";
Data: <SELECT NAME="table">


Return current item: Total ISP