<?php 
include "../include/config.php"; 
include "../function/inc_function.php"; 
$outh_id = isset($_REQUEST['outh_id']) ? $_REQUEST['outh_id'] :'';
$hd = mysql_fetch_object(mysql_query("SELECT a.*
									  FROM outgoing a 
									  WHERE a.id='$outh_id'"));
$comp = mysql_fetch_object(mysql_query("SELECT prof_city FROM profil"));									  
?>
<html>
<head>
<link rel='stylesheet' type='text/css' href="../include/css/print_styles.css" />	
</head>
<body>
<div id="popup">
<h3 align="center">SURAT JALAN</h1>
<h5>Nomor:<?=$hd->outh_sjno;?>  Tanggal:<?=DateToIndo($hd->outh_sjdate);?> </h5>
<hr size="3"></hr>
<p id="text1">
	Kepada Yth.<br>
	<?=$hd->nm_penerima;?>	<br>
	-	<br>
	- <br><br>
	No./Tanggal Dok Pabean: <?=$hd->outh_doctype;?>, <?=$hd->outh_docno;?>/<?=DateToIndo($hd->outh_docdate);?><br>
	No./Tanggal Invoice : <?=$hd->outh_invno;?>/<?=DateToIndo($hd->outh_invdate);?><br><br>
	Bersama dengan ini kami sampaikan telah kirimkan sejumlah barang sebagai berikut:	
</p>
<table width="100%">
	<tr>
	</tr>
	<tr>
		<th>No.</th>
		<th>Kode Barang</th>
		<th>Nama Barang</th>
		<th>Jumlah</th>
		<th>Satuan</th>
	</tr>
    <?php
	$no=0;
	$query = mysql_query("SELECT a.id,a.outd_qty,a.outd_price,a.outd_weight,a.outd_wunit,a.outd_currency,
						  		 b.prod_code,b.prod_name,b.prod_sat
						  FROM outgoing_detail a
						  INNER JOIN product b ON b.id=a.outd_prodid
						  WHERE a.outd_hid='$outh_id' ");
	while($data=mysql_fetch_object($query)){
		$no++;
	?>
	 <tr>
		<td align="center"><?=$no;?>.</td>
		<td><?=$data->prod_code;?></td>
		<td><?=$data->prod_name;?></td>
		<td align="right"><?=$data->outd_qty;?></td>
		<td align="center"><?=$data->prod_sat;?></td>
	</tr>	
	<?php } ?>
</table>
<p id="text1">
	Atas perhatian dan kerjasamanya disampaikan terima kasih.<br>
	<?=$comp->prof_city;?>, <?=DateToIndo($hd->outh_sjdate);?><br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hormat kami <br><br><br><br><br><br>
	(............................................)
	
</p>
</div>
</body>
</html>
