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

$table_name = $_SESSION['db_prefix']."_pallets_balance";
$credit_query = "SELECT cust_id, ret_qty, ret_date FROM $table_name WHERE entry_reference = '".$entry_reference."'  ORDER BY pallets_balance_id DESC LIMIT 1";
$credit_result = mySQL_query($credit_query);
$cust_id = mysql_result($credit_result, 0, "cust_id");
$ret_qty = mysql_result($credit_result, 0, "ret_qty");
$ret_date = mysql_result($credit_result, 0, "ret_date");

$table_name = $_SESSION['db_prefix']."_customer";
$comp_query = "SELECT comp_name, postal_place  FROM $table_name WHERE cust_id = '".$cust_id."' ";
$comp_result = mySQL_query($comp_query);
$comp_name = mysql_result($comp_result, 0, "comp_name");
$postal_place = mysql_result($comp_result, 0, "postal_place");

$report_name = 'Pallets return';
$report_no = $entry_reference;


?>
<!--style sheets-->
<link href="../css/print.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico">
<title>Tiles Return <?php echo $order_return_id ?></title>

</head>

<body>

<script>
window.onload = function () {
  window.print();
  setTimeout(function(){window.close();}, 100);
}
</script>


<div class="print_standard_frame">

</div>
<br>

  <div class="print_standard_frame">
<table width="600" id="table_display_wizard2">
  <tr>
    <td height="30">Returning pallets from:</td>
    <td><?php echo $comp_name.'&nbsp;&nbsp;--&nbsp;&nbsp;'.$postal_place ?><input name="cust_id_text" type="hidden" value="<?php echo $cust_id ?>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="33">Return date:</td>
    <td><?php echo date("d-m-Y", strtotime($ret_date ))?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="33">No of pallets returned:</td>
    <td><?php echo $ret_qty ?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="33">Entry reference:</td>
    <td><?php echo $entry_reference ?></td>
    <td>&nbsp;</td>
  </tr>
</table>

<br>
</div>

</div>
</div>
</div>





</body>
</html>
