<script type="text/javascript">	
	window.print();
</script>

<?php
	include '../../inc/inc.koneksi.php';
	include '../../inc/fungsi_tanggal.php';
			
	$kode 	 = $_GET['kode'];
	$tanggal = $_GET['tanggal'];
	$petugas = $_GET['petugas'];
    $gdtujuan= $_GET['gdtujuan'];

	$query2 = mysql_query("SELECT * FROM company");
	$r2		= mysql_fetch_assoc($query2);
	$kop1 	= $r2['nama1'];
	$kop2 	= $r2['nama2'];
	$kop3 	= $r2['alamat'];
	
	$sql2   = mysql_query("SELECT * FROM cabang WHERE kode_cab='$gdtujuan'");
	$r2     = mysql_fetch_assoc($sql2);
	$namacab= $r2['nama_cab'];
	
	echo "<table width='100%'>
		<tr>
			<td style='font:12px arial;line-height:80%'><b>$kop1</b></td>
		</tr>
		<tr>
			<td style='font:9px arial;line-height:80%'>$kop2</td>
		</tr>
		<tr>
			<td style='font:9px arial;line-height:80%'>$kop3</td>
		</tr>
		<tr>
			<td style='font:9px arial;border-top:double 0.5px;line-height:80%'></td>
		</tr>
	</table>";
	
	echo "<table width='100%'>
		<tr>
			<td align='center' style='font:13px arial'><b>BUKTI PEMINDAHAN BARANG</b></td>
		<tr>
		<tr>
			<td style='font:9px arial;border-top:double 0.5px;line-height:80%'></td>
		</tr>
	</table>";
	
	echo "<table width='100%'>
		<tr>
			<td style='font:9px arial;line-height:80%'>Nomor Bukti</td>
			<td style='font:9px arial;line-height:80%'>: $kode</td>
			<td style='font:9px arial;line-height:80%'>Tanggal</td>
			<td style='font:9px arial;line-height:80%'>: ".jin_date_str($tanggal)."</td>
		</tr>
		<tr>
			<td style='font:9px arial;line-height:80%'>Gudang</td>
			<td style='font:9px arial;line-height:80%'>: $gdtujuan - $namacab</td>
			<td style='font:9px arial;line-height:80%'>Petugas</td>
			<td style='font:9px arial;line-height:80%'>: $petugas</td>
		</tr>
	</table>
	
	<table width='100%'>
		<tr>
			<th width='5%' style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'>No.</th>
			<th width='10%' style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'>Kode</th>
			<th width='30%' style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'>Nama Barang</th>
			<th width='10%' style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'>Jumlah</th>
			<th width='10%' style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'>Satuan</th>
		</tr>";
		
	    $query= mysql_query("SELECT * FROM jurmbr WHERE kode_mb='$kode' ORDER BY no_urut");
		$no=1;
	    while($r=mysql_fetch_array($query)){
	        $user= $r['user'];
		    echo "<tr>
			    <td width='5%' align='center' style='font:13px calibri light;line-height:100%'>$no</td>
			    <td width='10%' style='font:13px calibri light;line-height:100%'>$r[kode_st]</td>
			    <td width='30%' style='font:13px calibri light;line-height:100%'>$r[nama_st]</td>
			    <td width='10%' align='right' style='font:13px calibri light;line-height:100%'>$r[jml_unit]</td>
			    <td width='10%' style='font:13px calibri light;line-height:100%'>$r[satuan]</td>
		    </tr>";
		    $no++;
	    }
        echo "<tr>
            <td style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'></td>
		    <td style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'></td>
		    <th style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'></td>
		    <th style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'></td>
		    <td style='border-top:double 2px;border-bottom:double 2px;font:13px calibri light'></td>
	    </tr>
    </table>
    <br>
    <table width='100%'>
		<tr>
			<td width='20%' style='font:13px calibri' align='center'>Penerima</td>
			<td width='60%' style='font:13px calibri' align='center'></td>
			<td width='20%' style='font:13px calibri' align='center'>Administrasi Gudang</td>
		</tr>
	</table>
	<br><br>
	<table width='100%'>
	    <tr>
	        <td width='20%' style='font:13px calibri;border-bottom:double 1px' align='center'></td>
			<td width='60%' style='font:13px calibri'></td>
			<td width='20%' style='font:13px calibri;border-bottom:double 1px' align='center'>$user</td>
		</tr>
	</table>";
?>
<script type="text/javascript">
	history.back();
</script>