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

$page_name = "Stores-main";
include ("../navigation/access.php");

if ($permission_num==1) {

	include ("../navigation/store_sidebar.php");
	
	include ("../include/date_set.php");
	
	$endsearch = date('Y-m-d', strtotime('+1 day', strtotime($end)));

	$store_item_id =  $_GET['store_item_id'];	 
	
		  
	$table_name1 = $_SESSION['db_prefix']."_item_history";
	$table_name2 = $_SESSION['db_prefix']."_store_items";
	  
		$displayQuery = "SELECT $table_name1.history_id, $table_name1.store_item_id, $table_name1.details, $table_name1.entry, $table_name1.reference, $table_name1.quantity, $table_name1.total, $table_name1.date, $table_name1.entryDate,  $table_name1.userId, $table_name2.store_item_id, $table_name2.item_name FROM $table_name1, $table_name2 WHERE $table_name2.store_item_id=$store_item_id AND  $table_name2.store_item_id = $table_name1.store_item_id AND $table_name1.entryDate >= '$start' AND $table_name1.entryDate <= '$endsearch' ";

		$displayResult = execsql($displayQuery);
		$i = 0;
		$num = mysql_num_rows($displayResult);
		if ($num==0) {
		  $message="No records to show"; 
		   }
		else  {
		  $message="End of list";
		  }
	
	$table_name3 = $_SESSION['db_prefix']."_store_items";
    $item_query = "SELECT item_name, subCategory, location, quantity, minimumStock, price FROM $table_name3 WHERE store_item_id = '".$store_item_id."'  ";
    $item_result = mySQL_query($item_query);
    $b2 = mysql_result($item_result, 0, "item_name");
	$b3 = mysql_result($item_result, 0, "subCategory");
	$b4 = mysql_result($item_result, 0, "location");
	$b5 = mysql_result($item_result, 0, "quantity");
	$b6 = mysql_result($item_result, 0, "minimumStock");
	$b7 = mysql_result($item_result, 0, "price");
	
	$itemTT =
		   "<img src=../images/view.png  width=20 height=16><table id=table_tool_tip width=250 ><tr><td  width=75>Item name:</td><td width=175>".$b2."</td></tr><tr><td>Category</td><td>".$b3."</td></tr><tr><td>Location</td><td>".$b4."</td></tr><tr><td>stock qty</td><td>".$b5."</td></tr><tr><td>Min. stock</td><td>".$b6."</td></tr><tr><td>Price</td><td>".$b7."</td></tr></table><br><b>Click for details</b>";
	
	?>
<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

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

</head>

<body>
<div class="main_frame">
  <div class="page_head_frame">
    <label class="label_page_head">Store Item History</label>
    &nbsp;&nbsp;
    <label class="label_page_head_2"> &nbsp;&nbsp; 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="store_item_display.php?store_item_id=<?php echo $store_item_id ?> " onMouseover="ddrivetip('<?php echo $itemTT ?>', 260)"; onMouseout="hideddrivetip()"> <?php echo $b2 ?></a></label>
  </div>
  <br />
  <br />
  <br />
  <br />
  <br />
  <form action="store_item_history.php" method="get" name="dateform" class="today" id="dateform">
    <table width="680" border="0" align="left" cellpadding="0" cellspacing="0" id="table_calendar">
      <tr>
        <td width="56"><label class="label_std">from:</label></td>
        <td width="247"><?php
		$myCalendar = new tc_calendar("date1", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($ds, $ms, $ys);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2014, 2090);
	 	$myCalendar->writeScript();?></td>
        <td width="35"><label class="label_std">to:</label></td>
        <td width="259"><?php
		$myCalendar = new tc_calendar("date2", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($de, $me, $ye);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2014, 2090);
		$myCalendar->writeScript();?>
          <input name="store_item_id" type="hidden" id="store_item_id" value="<?php echo $store_item_id ?>" />
          <input name="date" type="hidden" id="date" value="1" /></td>
        <td width="81"><input name="button5" type="submit" class="linkbutton"  id="button5" value="Select" /></td>
      </tr>
    </table>
  </form>
  <br />
  <br />
  <div class="scroll_frame_long">
    <table width="660" id="table_list" class="sortable-onload-0r rowstyle-alt no-arrow "  >
      <thead>
        <tr>
          <th colspan="2" class="sortable-numeric">Entry </th>
          <th width="468" >Details </th>
          <th width="42" align="center" > qty <br />
            in/out </th>
          <th width="41" align="center"> stock qty</th>
          <th width="38" >Date</th>
        </tr>
      </thead>
      <tbody>
        <?php
    $i=0;
	$receiveTT = "";
	$TT="";
	$link="";
	while($i < $num){
		$b1 = mysql_result($displayResult, $i, "history_id");
		$b2 = mysql_result($displayResult, $i, "details");
		$b3 = mysql_result($displayResult, $i, "quantity");
		$b4 = mysql_result($displayResult, $i, "date");
		$b5 = mysql_result($displayResult, $i, "store_item_id");
		$b7 = mysql_result($displayResult, $i, "total");
		$b8 = mysql_result($displayResult, $i, "reference");
		
		
		$b10 = mysql_result($displayResult, $i, "entry");
		$b12="";
		
		if ($b10==5) {if ($b3>0) {$b3='+'.$b3;} }
		if (($b10==20) OR ($b10==44) OR($b10==45)) {$b3='+'.$b3;}
		if (($b10==30) OR ($b10==31) OR ($b10==39)  OR ($b10==40) OR($b10==41) OR ($b10==42) OR ($b10==43)) {$b3='-'.$b3;}
		
		
		//stock count
		if ($b10==5) { 
		$b10a = "Stock count";
		$stockCountTT = "stock count";
		}
		
		//new item added
		if ($b10==10) {
			$table_name = $_SESSION['db_prefix']."_store_items";
			$item_query = "SELECT item_name, category, subCategory, location, minimumStock FROM $table_name WHERE store_item_id = '".$b5."' ";
			$item_result = mySQL_query($item_query);
			$m1 = mysql_result($item_result, 0, "item_name");
			$m2 = mysql_result($item_result, 0, "category");
			$m3 = mysql_result($item_result, 0, "subCategory");
			$m4 = mysql_result($item_result, 0, "location");
			$m5 = mysql_result($item_result, 0, "minimumStock");
			
			$itemTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Item name:</td><td width=175>".$m1."</td></tr><tr><td>Category</td><td>".$m2."</td></tr><tr><td>Sub category</td><td>".$m3."</td></tr><tr><td>Location:</td><td>".$m4."</td></tr><tr><td>Min. stock</td><td>".$m5."</td></tr></table><br><b>Click for details</b>";
			
		}
			           
		//stock received		
		if ($b10==20) {
			$table_name5 = $_SESSION['db_prefix']."_receive_store";
            $receive_query = "SELECT receive_id, supplier_id, delivery_note  FROM $table_name5 WHERE receive_id = '".$b8."'  ";
			$receive_result = mySQL_query($receive_query);
            $c1 = mysql_result($receive_result, 0, "supplier_id");
			$c3  = mysql_result($receive_result, 0, "delivery_note");		
		    $table_name6 = $_SESSION['db_prefix']."_suppliers";
            $supplier_query = "SELECT account_name FROM $table_name6 WHERE supplier_id = '".$c1."'  ";
            $supplier_result = mySQL_query($supplier_query);
            $c2 = mysql_result($supplier_result, 0, "account_name");
			$delnoteTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Delivery note:</td><td width=175>".$c3."</td></tr></table><br><b>Click for details</b>";	
			$supplierTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Supplier:</td><td width=175>".$c2."</td></tr></table><br><b>Click for details</b>";
						
		}
		
		//stock delivered to department		
		if ($b10==30) {
			
			$departmentTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Department:</td><td width=175>".$b8."</td></tr></table>";		
		}
		
		//stock delivered to employee		
		if ($b10==31) {
			$table_name7 = $_SESSION['db_prefix']."_employee";
            $employee_query = "SELECT emp_first_name, emp_last_name FROM $table_name7 WHERE emp_id = '".$b8."'  ";
            $employee_result = mySQL_query($employee_query);
            $e1 = mysql_result($employee_result, 0, "emp_first_name")." ".mysql_result($employee_result, 0, "emp_last_name");
					
			$employeeTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Employee:</td><td width=175>".$e1."</td></tr></table><br><b>Click for details</b>";
						
		}
		if ($b10==39) {
			
			$table_name9 = $_SESSION['db_prefix']."_supply_customer";
            $job_query = "SELECT cust_id, supply_id, delivery_note, job_no FROM $table_name9 WHERE supply_id = '".$b8."'  ";
			$job_result = mySQL_query($job_query);
			$job_num = mysql_num_rows($job_result);
			if ($job_num!=0) {
			$cust_id = mysql_result($job_result, 0, "cust_id");
			$supply_id = mysql_result($job_result, 0, "supply_id");
			$delivery_note = mysql_result($job_result, 0, "delivery_note");
			$job_no = mysql_result($job_result, 0, "job_no");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
			$e1 = "J".$b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
			}
			else
			{$e1 = '';
			}
			
			$jobTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Delivery note:</td><td width=175>".$delivery_note."</td></tr><tr><td  width=75>Job no:</td><td width=175>".$e1."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";			
		}
		
		if ($b10==40) {
			
			$table_name9 = $_SESSION['db_prefix']."_supply_customer";
            $job_query = "SELECT cust_id, supply_id, delivery_note FROM $table_name9 WHERE job_no = '".$b8."'  ";
			$job_result = mySQL_query($job_query);
			$job_num = mysql_num_rows($job_result);
			if ($job_num!=0) {
			$cust_id = mysql_result($job_result, 0, "cust_id");
			$supply_id = mysql_result($job_result, 0, "supply_id");
			$delivery_note = mysql_result($job_result, 0, "delivery_note");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
			$e1 = "J".$b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
			}
			else
			{$e1 = '';
			}
			$jobTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Delivery note:</td><td width=175>".$delivery_note."</td></tr><tr><td  width=75>Job no:</td><td width=175>".$e1."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";			
		}
		
		
		if ($b10==41) {
			
			$table_name9 = $_SESSION['db_prefix']."_captured_jobs";
            $job_query = "SELECT cust_id FROM $table_name9 WHERE job_no = '".$b8."'  ";
			
			
			$job_result = mySQL_query($job_query);
			$job_num = mysql_num_rows($job_result);
			if ($job_num!=0) {
			$cust_id = mysql_result($job_result, 0, "cust_id");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
			$e1 = "J".$b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
			}
			else
			{$e1 = '';
			}
			$jobTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Job no:</td><td width=175>".$e1."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";			
		}
		
		if ($b10==42) {
			$table_name9 = $_SESSION['db_prefix']."_captured_jobs";
            $job_query = "SELECT cust_id FROM $table_name9 WHERE job_no = '".$b8."'  ";
			
			
			$job_result = mySQL_query($job_query);
			$job_num = mysql_num_rows($job_result);
			if ($job_num!=0) {
			$cust_id = mysql_result($job_result, 0, "cust_id");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
						
			$e1 = "J".$b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
									
			}
			else
			{$e1 = '';
			}
						
			$jobTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Job no:</td><td width=175>".$b8."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";
		}
		
		if ($b10==43) {
			
			$table_name = $_SESSION['db_prefix']."_supply_customer";
			$supply_query = "SELECT cust_id FROM $table_name WHERE delivery_note ='".$b8."' ";
			$supply_result = mySQL_query($supply_query);
			$supply_num = mysql_num_rows($supply_result);
			if ($supply_num!=0) {
			$cust_id = mysql_result($supply_result, 0, "cust_id");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
			$e1 = $b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
			}
			else
			{$e1 = '';
			
			}
			$e3='';
						
			$deliveryTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Cash sale</td><td width=175>".$b8."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";
		}
		
		if ($b10==44) {
			$table_name9 = $_SESSION['db_prefix']."_captured_jobs";
            $job_query = "SELECT cust_id FROM $table_name9 WHERE job_no = '".$b8."'  ";
			
			
			$job_result = mySQL_query($job_query);
			$job_num = mysql_num_rows($job_result);
			if ($job_num!=0) {
			$cust_id = mysql_result($job_result, 0, "cust_id");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
						
			$e1 = "J".$b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
									
			}
			else
			{$e1 = '';
			}
			
			if ($b10==44) { 
			$e3='<font color=#FF0000>(Return)</font'; 
			}
			else {
				$e3='';
			}
			
			$jobTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Job no:</td><td width=175>".$b8."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";
		}
		
		if ($b10==45) {
			
			$table_name = $_SESSION['db_prefix']."_supply_customer";
			$supply_query = "SELECT cust_id FROM $table_name WHERE delivery_note ='".$b8."' ";
			$supply_result = mySQL_query($supply_query);
			$supply_num = mysql_num_rows($supply_result);
			if ($supply_num!=0) {
			$cust_id = mysql_result($supply_result, 0, "cust_id");
			
			$table_name10 = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT comp_name FROM $table_name10 WHERE cust_id = '".$cust_id."'  ";
            $customer_result = mySQL_query($customer_query);
			
			$e1 = $b8;
			$e2 = mysql_result($customer_result, 0, "comp_name");
			}
			else
			{$e1 = '';
			}
			
			if ($b10==45) { 
			$e3='<font color=#FF0000>(Return)</font'; 
			}
			else {
				$e3='';
			}
			
			$deliveryTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Cash sale</td><td width=175>".$b8."</td></tr></table><br><b>Click for details</b>";
			$customerTT = "<table id=table_tool_tip width=250 ><tr><td  width=75>Customer:</td><td width=175>".$e2."</td></tr></table><br><b>Click for details</b>";
		}
		
		
		
		$b9 = mysql_result($displayResult, $i, "entryDate");
		$b20 = mysql_result($displayResult, $i, "userId");
		
		
		
		
		$entryTT="<label class=tip_text_label_bold>Entered on: ". date('d-m-Y  --- H:i', strtotime($b9)) . " by: ". $b20."</label>";
		
		
		?>
        <tr class="alt">
          <td width="20"><a href=""onmouseover="ddrivetip('<?php echo $entryTT ?>', 250)" onMouseOut="hideddrivetip()";><?php echo $b1?></a></td>
          <td width="23"><a href=""onmouseover="ddrivetip('<?php echo $entryTT ?>', 250)" onMouseOut="hideddrivetip()";><?php echo date("d-m-Y", strtotime($b9));?></a><?php echo $b10?></td>
          <td><?php if ($b10==5) { ?>
            Stock count<a href="" onMouseOver="ddrivetip('<?php echo $stockCountTT ?>' , 200)" onMouseOut="hideddrivetip()";></a>
            <?php } ?>
            <?php if ($b10==10) { ?>
            <a href="store_item_display.php?store_item_id=<?php echo $b5?>" onMouseOver="ddrivetip('<?php echo $itemTT ?>' , 200)" onMouseOut="hideddrivetip()";>Item added to store</a>
            <?php } ?>
            <?php if ($b10==20) { ?>
            Stock received, del note: <a href="receive_note.php?receive_id=<?php echo $b8?>" onMouseOver="ddrivetip('<?php echo $delnoteTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $c3 ?></a> - supplier: <a href="displaySupplier.php?supplier_id=<?php echo $c1?>" onMouseOver="ddrivetip('<?php echo $supplierTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $c2 ?></a>
            <?php } ?>
            <?php if ($b10==30) { ?>
            Issued to: <a href="" onMouseOver="ddrivetip('<?php echo $departmentTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $b8 ?></a>
            <?php } ?>
            <?php if ($b10==31) { ?>
            Issued to: <a href="../hr_module/employee-details.php?emp_id=<?php echo $b8 ?>" onMouseOver="ddrivetip('<?php echo $employeeTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e1 ?></a>
            <?php } ?>
            <?php if ($b10==39) { ?>
            Cash delivery: <a href="../store/cash_sale_supplied.php?del_note=<?php echo $delivery_note ?>&supply_id=<?php echo $supply_id ?>&pr_option=copy" onMouseOver="ddrivetip('<?php echo $jobTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $delivery_note ?></a> (<?php echo $job_no ?>), customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?></a>
            <?php } ?>
            <?php if ($b10==40) { ?>
            Job delivered: <a href="../store/customer_supplied.php?del_note=<?php echo $delivery_note ?>&supply_id=<?php echo $supply_id ?>&pr_option=copy" onMouseOver="ddrivetip('<?php echo $jobTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $delivery_note ?></a> (<?php echo $e1 ?>), customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?></a>
            <?php } ?>
            <?php if ($b10==41) { ?>
            Issued for job: <a href="../production/captured_job.php?job_no=<?php echo $b8 ?>" onMouseOver="ddrivetip('<?php echo $jobTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e1 ?></a>, customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?></a>
            <?php } ?>
            <?php if ($b10==42) { ?>
            Additional delivery for job: <a href="../production/captured_job.php?job_no=<?php echo $b8 ?>" onMouseOver="ddrivetip('<?php echo $jobTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e1 ?></a>, customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?></a>
            <?php } ?>
            <?php if ($b10==43){ ?>
            Cash sale on delivery note: <a href="customer_supplied.php?del_note=<?php echo $b8 ?>&supply_id=&pr_option=copy" onMouseOver="ddrivetip('<?php echo $deliveryTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e1 ?></a>, customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?>&nbsp;&nbsp;</a>
            <?php } ?>
            <?php if ($b10==44) { ?>
            Additional delivery for job: <a href="../production/captured_job.php?job_no=<?php echo $b8 ?>" onMouseOver="ddrivetip('<?php echo $jobTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e1 ?></a>, customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?></a>&nbsp;&nbsp;<?php echo $e3 ?><?php } ?>
            <?php if ($b10==45) { ?>
            Cash sale on delivery note: <a href="customer_supplied.php?del_note=<?php echo $b8 ?>&supply_id=&pr_option=copy" onMouseOver="ddrivetip('<?php echo $deliveryTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e1 ?></a>, customer: <a href="../sales/customer_details.php?cust_id=<?php echo $cust_id ?>" onMouseOver="ddrivetip('<?php echo $customerTT ?>' , 200)" onMouseOut="hideddrivetip()";><?php echo $e2 ?>&nbsp;&nbsp;<?php echo $e3 ?></a>
            <?php } ?>
            </td>
          <td align="right"><?=$b3?></td>
          <td align="right"><?=$b7?></td>
          <td><?php echo date("d-m-Y", strtotime($b4));?></td>
        </tr>
        <?php
		$i++;
		  
	}
	
	?>
      </tbody>
    </table>
  </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'); ?>
