<?php 
include "../include/config.php"; 
include "../function/inc_function.php"; 
$trf_id = isset($_REQUEST['trf_id']) ? $_REQUEST['trf_id'] :'';
$hd   = mysql_fetch_object(mysql_query("SELECT a.*, b.dept_name, c.user_name dibuat, d.user_name disetujui, e.user_name diterima FROM transfer a LEFT JOIN departement b ON b.id=a.trf_deptid 
		LEFT JOIN user c ON c.user_id=a.trf_inputby
		LEFT JOIN user d ON d.user_id=a.trf_approveby
		LEFT JOIN user e ON e.user_id=a.trf_receiveby
		WHERE a.id='$trf_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">SLIP TRANSFER BARANG</h1>
<h5>Nomor:<?=$hd->trf_spbno;?>  Tanggal:<?=DateToIndo($hd->trf_spbdate);?> </h5>
<hr size="3"></hr>
<p id="text1">
	Kepada :<br>
	Bagian Gudang Pengeluaran<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>
        <th>Harga</th>
        <th>Total</th>
	</tr>
    <?php
	$no=0;
	$query = mysql_query("SELECT a.*, b.prod_code,b.prod_name,b.prod_sat
						  FROM transfer_detail a
						  INNER JOIN product b ON b.id=a.trfd_prodid
						  WHERE a.trfd_hid='$trf_id' ");
	while($data=mysql_fetch_object($query)){
		$no++;
		$tprice = $data->trfd_qty*$data->trfd_price_satuan;
	?>
	 <tr>
		<td align="center"><?=$no;?>.</td>
		<td><?=$data->prod_code;?></td>
		<td><?=$data->prod_name;?></td>
		<td align="right"><?=number_format($data->trfd_qty,2,',','.');?></td>
		<td align="center"><?=$data->prod_sat;?></td>
        <td align="right"><?=number_format($data->trfd_price_satuan,2,',','.');?></td>
        <td align="right"><?=number_format($tprice,2,',','.');?></td>
	</tr>	
	<?php } ?>
</table>
</div>
<p id="text1">
	Atas perhatian dan kerjasamanya disampaikan terima kasih.<br>		
</p>
<table width="100%" border="0">
	<tr>
		<td align="center">Dibuat Oleh</td>
		<td align="center">Disetujui Oleh</td>
		<td align="center">Diterima Oleh</td>
	</tr>	
	<tr height="100px;">
		<td align="center" valign="bottom"><b>(<?=$hd->dibuat;?>)</b></td>
		<td align="center" valign="bottom"><b>(<?=$hd->disetujui;?>)</b></td>
		<td align="center" valign="bottom"><b>(<?=$hd->diterima;?>)</b></td>
	</tr>
	<tr>
		<td align="center">[<?=$hd->trf_inputdate;?>]</td>
		<td align="center">[<?=$hd->trf_approvedate;?>]</td>
		<td align="center">[<?=$hd->trf_receivedate;?>]</td>
	</tr>
</table>
<p id="text1">
	Catatan :<br>
	Surat ini bersifat elektronik sehingga tidak perlu tandatangan
</p>
</body>
</html>
