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

<?php
	include '../../inc/inc.koneksi.php';
	include '../../inc/fungsi_tanggal.php';

	$user=$_GET['user'];
	
	$query= mysql_query("SELECT * FROM label WHERE user='$user' ORDER BY kode_st");
	$brs=1;
	while($r=mysql_fetch_array($query)){
		$kali= $r['kali'];
		
		while($kali>0){
			echo "<table width='100%'>
				<tr>
					<td align='center' style='font:1px arial;line-heigt:5%'>.</td>
					<td></td>
					<td align='center' style='font:1px arial;line-heigt:5%'>.</td>
					<td></td>
					<td align='center' style='font:1px arial;line-heigt:5%'>.</td>
				</tr>";
				if($brs>1){
					echo "<tr>
						<td align='center' style='font:1px arial;line-heigt:10%'>.</td>
						<td></td>
						<td align='center' style='font:1px arial;line-heigt:10%'>.</td>
						<td></td>
						<td align='center' style='font:1px arial;line-heigt:10%'>.</td>
					</tr>";
				}
				echo "<tr>
					<td align='center' width='32%' style='font:7px Arial Narrow;line-heigt:80%'><b>MB-$r[nama_st]</b></td>
					<td align='center' width='1%'></td>
					<td align='center' width='32%' style='font:7px Arial Narrow;line-heigt:80%'><b>MB-$r[nama_st]</b></td>
					<td align='center' width='1%'></td>
					<td align='center' style='font:7px Arial Narrow;line-heigt:80%'><b>MB-$r[nama_st]</b></td>
				</tr>
				<tr>				
					<td align='center' style='font:10px IDAutomationSXC39S;line-heigt:80%'>*$r[kode_st]*</td>
					<td></td>
					<td align='center' style='font:10px IDAutomationSXC39S;line-heigt:80%'>*$r[kode_st]*</td>
					<td></td>
					<td align='center' style='font:10px IDAutomationSXC39S;line-heigt:80%'>*$r[kode_st]*</td>
				</tr>
				<tr>				
					<td align='center' style='font:8px arial;line-heigt:80%'><b>$r[kode_st] - $r[kode_sp] - Rp ".number_format($r[hg_jual])."</b></td>
					<td></td>
					<td align='center' style='font:8px arial;line-heigt:80%'><b>$r[kode_st] - $r[kode_sp] - Rp ".number_format($r[hg_jual])."</b></td>
					<td></td>
					<td align='center' style='font:8px arial;line-heigt:80%'><b>$r[kode_st] - $r[kode_sp] - Rp ".number_format($r[hg_jual])."</b></td>
				</tr>
			</table>";
			$kali=$kali-3;
			$brs++;
		}
	}
	echo "</table>";
?>