<!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-user list";
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']."_error_log";
$alert_query = "SELECT * FROM $table_name2 WHERE  error_report_date >= '".$start."' AND error_report_date <= '".$end."' ORDER BY error_report_date DESC ";
$alert_result = mySQL_query($alert_query);
$alert_num = mysql_num_rows($alert_result);

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

<!--jscript-->
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 


</head>

<body>
<div class="main_frame" style="height:auto;">
<div class="page_middle_frame" > <label class="label_page_head">Error log</label></div>
        <br />
<br />
<br />
<br />
<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": "400px",
					"bPaginate": false,
					"bScrollCollapse": true,
					"aaSorting": [[ 2, "desc" ]],
					"aoColumns": [
								{"bSortable": true},
								{"bSortable": false},
								{"iDataSort": 9},
                              	{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
                             	{"bSortable": true},
								{"bSortable": false},
								{"bSortable": false},
								{"bVisible": false}								
								 ]
								 
				} );
			} );
		</script>
<div class="page_middle_frame" >	
<?php
$page='error_log_list.php';
$reference_name='';
$reference='';
include('../include/period_select_block.php');
?>
</div>  
<div  class="page_middle_frame" style="height:460px;">
<table width="700" id="scroll_table" class="data_display">
  <thead>
  <tr>
    <th>Error id</th>
    <th>&nbsp;</th>
    <th width="48">Date</th>
    <th width="61">Module</th>
    <th width="180">Error</th>
    <th width="100">Reported by</th>
    <th width="52">Status</th>
    <th width="69">Attend<br />
      date</th>
    <th width="39">&nbsp;</th>
    <th width="24">&nbsp;</th>
    </tr>
   </thead>
<?php 

$i=0;

while ($i<$alert_num) {
    $b0  =  mysql_result($alert_result, $i, "error_id");
	$b1 =  mysql_result($alert_result, $i, "error_report_date");
	$b2 =  mysql_result($alert_result, $i, "error_title");
	$b3 =  mysql_result($alert_result, $i, "error_reported_by");
	$b4 =  mysql_result($alert_result, $i, "error_solved_date");
	$b5 =  mysql_result($alert_result, $i, "error_importance");
	$b6 =  mysql_result($alert_result, $i, "error_module");
	$b7 =  mysql_result($alert_result, $i, "error_solved");
	?>
  
  
  <tr>
    <td width="53" align="left"><a href="error_report.php?error_id=<?php echo $b0 ?>" onmouseover="ddrivetip('Click to view report', 150)"; onmouseout="hideddrivetip()"><?php echo $b0 ?></a></td>
    <td width="30" align="center"><?php if ($b5=='yes') {?>
      <img src="../images/exclamation.png" width="12" height="12" /><?php } ?></td>
    <td align="left"><?php echo date("d-m-Y", strtotime($b1 )) ?></td>
    <td align="left"><?php echo $b6 ?></td>
    <td align="left"><?php echo $b2 ?></td>
    <td align="left"><?php echo $b3 ?></td>
    <td align="center"><?php if ($b7=='yes') { ?><img src="../images/check_mark_green.png" width="12" height="12" /><?php } ?>
      <?php if ($b7=='no') { ?><img src="../images/check_mark_orange.png" width="12" height="12" /><?php } ?>
      </td>
    <td align="left">
	  <?php if ($b7!='') { echo date("d-m-Y, H:i", strtotime($b4)); } ?>
      </td>
    <td align="left"><?php if ($_SESSION['username']=='huubvm') { ?><a href="close_error_report.php?error_id=<?php echo $b0?>">Fix</a><?php } ?></td>
    <td align="left"><a href="error_report.php?error_id=<?php echo $b0 ?>" onmouseover="ddrivetip('Click to view report', 150)"; onmouseout="hideddrivetip()"><?php echo $b1 ?></a></td>
    </tr>
  <?php
  $i++;
}
?>

</table>
</div>

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