<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="../css/main.css" rel="stylesheet" type="text/css" />
<?php
include ("../navigation/header.php");
$page_name = "AD-tracking";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/admin_sidebar.php");
?>
<?php
include('../include/period_select_date.php');	
	
	
$table_name2 = $_SESSION['db_prefix']."_tracking_log_in";
$tracking_query = "SELECT * FROM $table_name2 WHERE entry_date >= '".$start."' AND entry_date <= '".$end."' ";
$tracking_result = mySQL_query($tracking_query);
$tracking_num = mysql_num_rows($tracking_result);


?>
<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/scroll_table.css" />

<!--jscript-->


</head>

<body>


<div class="main_frame">
<div class="page_head_frame">
        
        <table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="523"><label class="label_page_head">Log in tracking</label></td>
            <td width="287">&nbsp;</td>
          </tr>
        </table>
      </div>

<div class="page_middle_frame">	
<?php
$page='tracking_login.php';
$reference_name='';
$reference='';
$reference_name_2='';
$reference_2='';
$reference_name_3='';
$reference_3='';
include('../include/period_select_block_small.php');
?>
</div>
  
<div class="page_middle_frame">
<script type="text/javascript" language="javascript" src="../jscript/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#scroll_table').dataTable( {
					"sScrollY": "500px",
					"bPaginate": false,
					"bScrollCollapse": true,
					"aaSorting": [[ 0, "desc" ]],
					"aoColumns": [
								{"iDataSort": 5},
                              	{"bSortable": true},
                             	{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
								{"bVisible": false}
								 ]
				} );
			} );
		</script>
<table width="675" id="scroll_table" class="data_display"  >
  <thead>
  <tr>
    <th>date</th>
    <th>time</th>
    <th>user</th>
    <th>action</th>
    <th>details</th>
    <th>&nbsp;</th>
    </tr>
    </thead>
<?php 

$i=0;

while ($i<$tracking_num) {
    $b0  =  mysql_result($tracking_result, $i, "log_in_id");
	$b1 =  mysql_result($tracking_result, $i, "entry_date");
	$b2 =  mysql_result($tracking_result, $i, "user");
	$b3 =  mysql_result($tracking_result, $i, "action");
	$b4 = mysql_result($tracking_result, $i, "details");
	
	?>
  
  
  <tr>
    <td width="74" align="left"><?php echo date("d-m-Y", strtotime($b1 )) ?></td>
    <td width="64" align="left"><?php echo date("H:i", strtotime($b1 ))  ?></td>
    <td width="83" align="left"><?php echo $b2 ?></td>
    <td width="89" align="left"><?php echo $b3 ?></td>
    <td width="281" align="left"><?php echo $b4 ?></td>
    <td width="56" align="left"><?php echo $b1 ?></td>
    </tr>
  <?php
  $i++;
}
?>

</table>

<br />
</div>
</div>
</body>
<?php include ('../navigation/side_bar.php'); ?>

<?php } else { 
    $_SESSION['denied_return'] = "admin_module/user_list.php";	?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>

</html>