<?php 
include "../include/config.php"; 
include "../function/inc_function.php"; 
$bomh_id = $_REQUEST['bomh_id'];
$hd   = mysql_fetch_object(mysql_query("SELECT a.*,b.prod_code,b.prod_name,b.prod_sat
									    FROM bom a
									    INNER JOIN product b ON b.id=a.bomh_prodid
									    WHERE a.bomh_status <> 100 AND a.id='$bomh_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">LAPORAN PROSES PRODUKSI</h1>
<h5>Nomor:<?=$hd->bomh_no;?>  Tanggal:<?=DateToIndo($hd->bomh_date);?> </h5>
<hr size="3"></hr>
<p id="text1">
	Kode Barang &nbsp;: <?=$hd->prod_code;?><br>
	Nama Barang : <?=$hd->prod_name;?><br>
	Satuan &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <?=$hd->prod_sat;?><br>
	Jumlah &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <?=$hd->bomh_total;?><br><br>
	Bersama dengan ini kami sampaikan laporan produksi 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.*, b.prod_code,b.prod_name,b.prod_sat
						  FROM bom_detail a
						  INNER JOIN product b ON b.id=a.bomd_prodid
						  WHERE a.bomd_hid='$bomh_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->bomd_qty;?></td>
		<td align="center"><?=$data->prod_sat;?></td>
	</tr>	
	<?php } ?>
</table>
<p id="text1">
	Atas perhatian dan kerjasamanya disampaikan terima kasih.<br>
	<?php echo "$comp->prof_city, ".date("d-m-Y")."";  ?><br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hormat kami <br><br><br><br><br><br>
	(............................................)
	
</p>
</div>
</body>
</html>
