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

   
		$table_name = $_SESSION['db_prefix']."_tile_receive";
		$quote_query = "SELECT *  FROM $table_name WHERE receive_no = '".$receive_no."'";
		$quote_result = mySQL_query($quote_query);
		$cust_id=mysql_result($quote_result, 0, "cust_id");
		$branch=mysql_result($quote_result, 0, "branch");
		$order_no = mysql_result($quote_result, 0, "order_no");	
		$receive_date = mysql_result($quote_result, 0, "receive_date");		 
		
		$quote='no';
		
		//$job_no=$order_no;
		 		
		
		
		$table_name = $_SESSION['db_prefix']."_tile_receive_lines";
		$line_query = "SELECT *  FROM $table_name WHERE receive_no = '".$receive_no."' ";
		$line_result = mySQL_query($line_query);
		$line_num = mysql_num_rows($line_result);
		
		
$report_name = 'Tiles received';	
?>
<!--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 receive <?php echo $receive_no ?></title>

<!--jscript-->

</head>


<body>

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

<?php include('../include/print_report_header.php'); ?>
<div class="print_main_frame" style="height:auto; margin-left:50px;">
<br>
<br>
 
 
<div class="print_standard_frame"> 
   <div style="float:left; margin-left:0px;"><label class="print_header_label_std">Items received are from order no <?php echo $order_no ?> for:</label></div>
   <div style="float:left; margin-left:125px;"><label class="print_header_label_std">Date received:&nbsp;<?php echo date("d-m-Y", strtotime($receive_date))?></label></div><br>

        <?php 
		include ('../include/customer_block.php');
		?>
         </div><br>
<br>
<div class="print_standard_frame">
         <table width="650" id="table_display" >
           <tr>
             <td height="26" colspan="2" align="left" valign="top">Item</td>
             <td width="116" align="left" valign="top">Group</td>
             <td width="71" align="left" valign="top">Unit</td>
             <td width="56" align="left" valign="top">Quantity</td>
             <td width="85" align="left" valign="top">Price</td>
             <td width="73" align="left" valign="top">Total</td>
           </tr>
           <?php
				$i=0;
				$sub_tot=0;
				$a5_total=0;
				 while ($i<$line_num){
					 $a0 = mysql_result($line_result, $i, "receive_line_id");
					 $a1 = mysql_result($line_result, $i, "store_item_id");
					 $table_name = $_SESSION['db_prefix']."_store_items";
						$item_query = "SELECT item_name, unit, subCategory FROM $table_name WHERE store_item_id = '".$a1."' ";
						$item_result = mySQL_query($item_query);
						$a1a = mysql_result($item_result, 0, "item_name");
						$a3a = mysql_result($item_result, 0, "unit");
						$a4a = mysql_result($item_result, 0, "subCategory");
					 $a2 = mysql_result($line_result, $i, "quantity");
					 $a3 = mysql_result($line_result, $i, "purchase_price");
					 
					$a5=$a2*$a3;
					$a5_total=$a5_total+$a5;
					 
				 ?>
           <tr>
             <td colspan="2" valign="top"><?php echo $a1a ?></td>
             <td valign="top"><?php echo $a4a ?></td>
             <td valign="top"><?php echo $a3a ?></td>
             <td valign="top"><?php echo $a2 ?></td>
             <td align="right" valign="top"><?php echo $a3. "  /" .$a3a ?>&nbsp;</td>
             <td align="right" valign="top"><?php echo number_format($a5, 2, '.', ',')?></td>
           </tr>
           <?php 
			   // $a6_total=$a6_total+$a6;
				$i++;
				 }
				 ?>
           <tr>
             <td colspan="2" align="left" valign="top">&nbsp;</td>
             <td align="left" valign="top">&nbsp;</td>
             <td align="left" valign="top">&nbsp;</td>
             <td align="left" valign="top">&nbsp;</td>
             <td align="left" valign="top">Total:</td>
             <td align="right" valign="top"><?php echo number_format($a5_total, 2, '.', ',') ?></td>
           </tr>
         </table>
         </div>
         <br>
<br>
</div>
</div>    
  
</div>

</body>
