Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/icure/
Upload File :
Current File : /var/www/html/mmishra/icure/websessions.inc

<h3 align='left'>Login Sessions</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'>$dated1</a> 
<font size='+1' color='red'>[ $dated ]</font>";

if ($dated != date("Y-m-d")) echo "<a href='?pg=$pg&dated=$dated2'>$dated2</a>";

$sql = "select sessionid as session,userid as user,logintime as login,logouttime as logout,remoteip as clientPC from websessions where date(logintime)='$dated'";
if ($role != 'admin') {
	$sql .= " and userid='$user'";
}
$sql .= " order by logintime desc";
$rs = mysql_query($sql);
if (mysql_num_rows($rs)) {
        $colHeads = mysql_num_fields($rs);

        echo "<table border='1' width='90%'>\n<tr><th>Sr</th>";

        for ($i=0; $i < $colHeads; $i++) { // Header
                $fld = ucwords(str_replace("_"," ",mysql_field_name($rs, $i)));
                echo "<th>$fld</th>";
        }

        echo "</tr>\n";

	$j = $pgno;
        while ($row = mysql_fetch_row($rs)) { //data
                $j++;
		echo "<tr><td>$j</td><td>".implode($row,"</td><td>")."</td></tr>\n";
        }

        echo "</table>\n";

} else {
        echo "<h3>None</h3>";
}

?>
</center>