<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
include('../include/session.php');


include('../include/period_select_date.php');	 
 
$table_name = $_SESSION['db_prefix']."_direct_return";	 	
$display_query = "SELECT direct_return_id, direct_return_no, return_from, return_date, returned_by FROM $table_name WHERE return_date BETWEEN '".$start."' AND '".$end."' ";
$display_result = execsql($display_query);
$i = 0;
$display_num = mysql_num_rows($display_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>
<?php
include ("../navigation/header.php");
include ("../navigation/store_sidebar.php");
$page_name = "Stores-main";
include ("../navigation/access.php");
if ($permission_num==1) {
?>
<div class="main_frame">
<div class="page_head_frame">
  <label class="label_page_head">Direct returns</label></div>

<div class="page_middle_frame">

<?php
$page='maintenance_returns_list.php';
$reference_name='';
$reference='';
include('../include/period_select_block.php');
?>
<div class="page_inside_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": [[ 2, "desc" ]],
					"aoColumns": [
								{"iDataSort": 1},
								{"bVisible": false},
								{"bVisible": true},
                             	{"bSortable": true},
								{"bSortable": true}
							 ]
				} );
			} );
		</script>    	
<table width="700" id="scroll_table" class="data_display" >
	<thead>
		<tr>
		  <th>Date</th>
		  <th>&nbsp;</th>
		  <th>Return no</th>
		  <th>Returned from</th>
		  <th>Returned by</th>
		  </tr>
	</thead>
	<tbody>
  <?php
    $b9=0;
	$b4tot='0.00';
	$b5tot='0.00';
	while($i < $display_num){
		 $b0 = mysql_result($display_result, $i, "direct_return_id");
		 $b1 = mysql_result($display_result, $i, "return_date");
		 $b2 = mysql_result($display_result, $i, "return_from");
		 $b4 = mysql_result($display_result, $i, "direct_return_no");
		 $b5 = mysql_result($display_result, $i, "returned_by"); 

	?>
		<tr >
		  <td ><?php echo date("d-m-Y", strtotime($b1 ))?></td>
		  <td ><?php echo $b1 ?>&nbsp;</td>
		  <td align="left"><a href="direct_return.php?direct_return_no=<?php echo $b4 ?>" onMouseover="ddrivetip('Click to view return note', 125)"; onMouseout="hideddrivetip()"><?php echo $b4 ?></a></td>
		  <td align="left"><?php echo $b2?></td>
			<td align="left"><?php echo $b5 ?></td>
		  </tr>
		     
		<?php
		$i++; 
	}
	?>
    </tbody>
    <tfoot>
    <tr >
		  <td >&nbsp;</td>
		  <td >&nbsp;</td>
		  <td align="left">&nbsp;</td>
		  <td align="right">&nbsp;</td>
		  <td align="right">&nbsp;</td>
		  </tr>
        </tfoot>
	
</table>
		
</div>	
</div>    
</div>
</body>
<?php } else { 
    $_SESSION['denied_return'] = "store/store_main.php";	?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>
<?php include ('../navigation/side_bar.php'); ?>