<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>
		Print Bill
	</title>
	<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>/assets/thema/posr/css/pos.css?ver=<?php echo date("ymdHis") ?>">
	<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>/assets/css/flexigrid/flexigrid.css">
	<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->baseUrl ?>/assets/css/jquery.apank.popUp.css">
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/jquery-1.7.2.min.js" ></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/jquery-ui-1.8.19.custom.min.js" ></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/jquery.shortcuts.min.js" ></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/apank.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/jquery.meio.mask.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/accounting.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/md5.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/thema/posr/js/pos.js"></script>
	<script type="text/javascript" src="<?php echo $this->baseUrl ?>assets/js/flexigrid.js"></script>
	<style>
	h4{
		padding:0;
		margin:0;
		margin-bottom: 3px;
		font-size: 15px;
	}
	body, tr td{
		font-size: 13px;
	}
	*{
		font-family: 'Century Gothic', sans-serif;
	}
	</style>
</head>
<body>
	<h4 style='text-align:center;border-bottom: 2px solid black;'><b><?php echo $this->login['bill_hed'] ?><b></h4>
	<table cellspacing="0" cellpadding="0" style="width:100%; border-bottom: 2px solid black; margin-bottom:5px;">
		<tr>
			<td colspan="2">
				<?php 
					$date = new DateTime($this->data->kasir->tgl);
					echo $date->format('dmy').str_pad($this->data->kasir->no_order, 3, "0", STR_PAD_LEFT).' ('.$date->format('h.i').')'; 
				?>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<h4><b> <?php if($this->data->meja->nm_kat == "TAKE AWAY") echo "TAKE AWAY"; else echo "DINE-IN"; ?>  - <?php echo $this->data->meja->nm_merek ?> </b></h4>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<?php echo $this->data->meja->nm_kat ?>
			</td>
		</tr>
		<tr>
			<td style="width: 40%;">PETUGAS</td>
			<td style="width: 60%;">: <?php echo $this->data->kasir->nm_kasir ?></td>
		</tr>
		<tr>
			<td style="width: 40%;">NO NOTA</td>
			<td style="width: 60%;">: <?php echo $this->data->kasir->no_pos ?></td>
		</tr>
	</table>
	<h4 style='text-align:center;'><b>
		<?php 
			if($this->data->mode == "bar"){
				echo 'BAR';
			}
			else if($this->data->mode == "dapur"){
				echo 'DAPUR';
			}
			else if($this->data->mode == "checker"){
				echo 'SLIP ORDER (CHECKER)';
			}
			else{
				echo 'SLIP BILL';
			}
		?>
	<b></h4>
	<table cellspacing="0" cellpadding="0" style="width:100%;">
	<?php
	$grup = array();
	$total = 0;
	foreach($this->data->item as $r){
		$grup[$r->nm_app][] = $r;
		$total = $total + $r->total;
	}
	foreach($grup as $row){
		foreach($row as $r){
	?>
	<div style="margin-bottom: 20px; font-size:13px;">
		<?php 
			if($this->data->mode == "all"){
				echo '<div>'.$r->nm_inv.' ('.$r->nota.')</div>';
				echo '<div style="margin-top: 3px; font-weight:300">&nbsp;&nbsp;'.$r->qty.' x '.number_format($r->harga).'</div>';
			}
			else{
				echo '<div>'.$r->qty.' '.$r->nm_inv.' ('.$r->nota.')</div>';
				if(!empty($r->ket_det)){
					echo '<div style="margin-top: 3px; font-weight:300"> - '.$r->ket_det.'</div>';
				}
				else{
					echo '<div style="margin-top: 3px; font-weight:300">-</div>';
				}
			}
		?>
		<!--<table cellspacing="0" cellpadding="0" style="width:100%;">
			<tr>
				<td style="width: 50%;"><?php echo $r->qty.' x '.number_format($r->harga) ?></td>
				<td style="width: 50%; text-align: right;"><?php echo number_format($r->total) ?></td>
			</tr>
		</table>-->
	</div>
	<?php 
		}
	} 
	?>
	</table>
	<?php if($this->data->mode == "all"){ ?>
		<table cellspacing="0" cellpadding="0" style="border-top: 2px solid black; margin=top:5px; width: 100%;">
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td style="width: 40%;">TOTAL</td>
				<td style="width: 60%; text-align:right;"><?php echo 'Rp '.number_format($total) ?></td>
			</tr>
			<!--<tr>
				<td>BAYAR</td>
				<td><input type="text" readonly class="_txtTot decimal" id="_bayar" name="_bayar"></td>
			</tr>
			<tr>
				<td>KEMBALI</td>
				<td><input type="text" readonly class="_txtTot decimal" id="_kembali" name="_kembali"></td>
			</tr>-->
		</table>
	<?php } ?>
</body>
<script>
$(document).ready(function(){	
	$('._qtyItem').val(1);
	$('#_inpBayar').val(0);
	$('#_kembali').val(0);
	$('.ket_item').val('');
	setDec();
	//print();
	//close();
})
</script>
</html>