| Current Path : /var/www/html/mmishra/iws8/html/iport/ |
| Current File : /var/www/html/mmishra/iws8/html/iport/weblogs.inc |
<h3 align='left'><i class='fa fa-list' aria-hidden='true'></i> Web Logs</h3>
<center>
<?php
$dated = $_REQUEST["dated"];
if (!$dated) $dated = date("Y-m-d");
$dated1 = date('Y-m-d', strtotime($dated .' -1 day'));
$dated2 = date('Y-m-d', strtotime($dated .' +1 day'));
echo "<a href='?pg=$pg&dated=$dated1'><<</a>
<font size='+1' color='red'>[ $dated ]</font>";
if ($dated != date("Y-m-d")) echo " <a href='?pg=$pg&dated=$dated2'>>></a>";
$sql = "select userID,referer,webURL,remoteIP,dateAccess as timeStamp from weblogs where";
if ($role == 'admin')
$sql .= " date(dateaccess)='$dated'";
else
$sql .= " userID='$user' and date(dateaccess)='$dated'";
$sql .= " order by dateaccess desc";
$rs = mysql_query($sql);
if ($rs) {
$colHeads = mysql_num_fields($rs);
echo "<table border='1' width='90%'><tr><th>#</th>";
for ($i=0; $i < $colHeads; $i++) { // Header
$fld = ucwords(str_replace("_"," ",mysql_field_name($rs, $i)));
echo "<th>$fld</th>";
}
echo "</tr>";
$j = $pgno;
while ($row = mysql_fetch_row($rs)) { //data
$j++;
echo "<tr><th>$j</th><td>".implode($row,"</td><td>")."</td></tr>";
}
echo "</table>";
} else
echo 'None';
?>
</center>