Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/
Upload File :
Current File : /var/www/html/mmishra/mm/accesslogs.php

<?php
$tbl = 'accesslogs';

$dateaccess = $_REQUEST["dateaccess"];
$pno = $_REQUEST["pno"];
$submit = $_POST["submit"];

if (!$dateaccess) $dateaccess = '%';
if (!$pno) $pno = 1;
$pgsize = 20;
$start = (($pno - 1) * $pgsize);

echo "Filter by Date <input type='text' name='dateaccess' value='$dateaccess' size='20'>
<input type='submit' name='submit' value='VIEW' style='width: 80pt'><br>";

$rs = mysql_query("select SQL_CALC_FOUND_ROWS * from $tbl where dateaccess like '$dateaccess%'");
$tro = mysql_fetch_object(mysql_query("select FOUND_ROWS() as t"));
$total = $tro->t;

if ($total > $pgsize) {
        $firstpno = max (1, ceil($start/$pgsize) - 2);
        $lastpno = $firstpno + 9;
        if (ceil($total/$pgsize) > $pgsize && $lastpno >= ceil($total/$pgsize)) $firstpno = ceil($total/$pgsize) - 10;
        for($i = $firstpno; $i <= min($lastpno, ceil($total/$pgsize)); $i++) {
                if ($i == $pno) echo "<b>$i</b>&nbsp;";
                else echo "<a href='$PHP_SELF?conf=$conf&pno=$i&dateaccess=$dateaccess'>$i</a>&nbsp;";
        }
} else echo "1";

$sql = "select * from $tbl where webid='$webid' and dateaccess like '$dateaccess%' order by rowid desc limit $start,$pgsize";
$rs = mysql_query($sql);
while ($o = mysql_fetch_object($rs)) {
	echo "<br>$o->dateaccess [$o->userid/$o->remoteip] <a href='$o->weburl'>$o->weburl</a>";
	//echo "<br>$o->dateaccess [$o->userid/$o->remoteip] <a href='o->weburl'>$o->weburl</a> [$o->referer]";
	$i++;
}
if (!$i) echo "<br>None";
else echo "<br><b>Total entry: $total</b><br>";
?>