<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Struk Penjualan</title>
<link rel="icon" type="image/png" href="<?php echo base_url('assets/') ?>/img/favicon.png"/>
<script type="text/javascript" src="<?php echo base_url() ?>/assets/js/iminPrint-1.2.3.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>/assets/js/jquery.jqprint-0.3.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>/assets/js/jquery.min.js"></script>
<?php 
$nuser = $this->session->userdata('ses_username');
$kd_toko = $this->session->userdata('kd_toko');
$kdtoko = $this->session->userdata('kd_toko');
?>
    
<style>
	html, body{border: 0px solid #FFFFFF;}
	body{font-size: 12px!important;font-family: 'Arial Normal', 'Arial';background-color: #F5F5F5;color: #333333;}
	#PrintContent{width: 290px;padding: 5px; margin: 0 auto; line-height: 22px; overflow: auto;background-color: #FFFFFF;}
	.clearboth{clear: both;}
	.fs12{font-size: 12px!important;}
	.fs13{font-size: 13px!important;}
	.fs16{font-size: 16px!important;}
	.fs18{font-size: 18px!important;}
	.fs28{font-size: 28px!important;}
	.fs22{font-size: 22px!important;}
	.center{text-align: center;}
	.left{float: left;}
	.right{float: right;}
	.mgt5{margin-top: 5px;}
	.mgt10{margin-top: 10px;}
	.pdt20{padding-top: 20px;}
	.pdt10{padding-top: 10px;}
	.line{border-bottom: 1px dotted #333333;height: 5px;}
	.middle{position: absolute;right: 80px;width: 20px;text-align: center;}
	.relative{position: relative;}
	.mgl20{margin-left: 20px;}
	#PrintEvent{width: 80px;height: 35px;font-size: 16px; background-color: #0050F1;color: #FFFFFF;text-align: center;border: 0px;margin: 20px auto;display: inherit;border-radius: 5px;cursor: pointer;}
	#PrintEvent:hover{background-color: #0146d2;}
	
/* @media print {
	html,body {
	    font-size: 10px!important;
	    width:80mm;
	    height:297mm;
		font-weight: normal;
	}
} */	
</style>

</head>

    <body onload="print()">
        <input type="button" id="PrintEvent" value="Print"/>
	
<div id="PrintContent" style="font-size: 10px!important;font-weight: normal;width:384;" border='0' align="center">
        
	    <table  >
		    <tr>
			<?php if ($kd_toko =='JBG03') { ?>
			<td colspan="4" align="center" ><a href="<?php echo base_url('dashboard/') ?>"><img  style="width:45%;height:55px;" src="<?php echo base_url() ?>/assets/img/logobwjt.png" /></a></td>
			<?php } if ($kd_toko !='JBG03') { ?>
			<td colspan="4" align="center" ><a href="<?php echo base_url('dashboard/') ?>"><img  style="width:45%;height:55px;" src="<?php echo base_url() ?>/assets/img/logobw.png" /></a></td>
			<?php } ?>
		<!--	<font color="#00" size="+2" ><?php echo $toko->nm_toko; ?></font></a></td> -->
		</tr>
		<tr>
			<td colspan="4" align="center"><?php echo $toko->almt_toko; ?></td>
		</tr>
		<tr>
			<td colspan="4" align="center"><?php echo $toko->tlp_toko; ?></td>
		</tr>
		<tr>
			<td colspan="4"><hr /> </td>
		</tr>
		<tr>  
			<td>No.<?php echo substr($faktur->no_faktur_penjualan,8,7); ?></td>
			<td colspan="3" align="right"><?php echo $tgl . " " . $waktu ?></td>			
		</tr>
		<tr>
			<td>Kasir : <?php echo $nuser ?></td>
			<td colspan="3" align="right"><?php echo $faktur->keter; ?></td>			
		</tr>	
		<tr>
			<td>PIN Ojol : <?php echo $faktur->pinojol; ?></td>
			
			<td colspan="3" align="right"><?php if($faktur->promo=='1') echo 'Biasa'; ?>
			<?php if($faktur->promo=='2') echo 'Promo'; ?></td>			
		</tr>	
		<tr>
			<td><?php if($faktur->layanan=='1') echo 'Dine In'; ?>
			    <?php if($faktur->layanan=='2') echo 'TakeAway'; ?>
			    <?php if($faktur->layanan=='3') echo 'DO'; ?>
			</td>
			<td colspan="3" align="right">No Meja : <?php echo $faktur->nomeja; ?></td>
		</tr>	
		<tr>
			<td align='left'>A/n: <?php echo $faktur->npelanggan; ?></td>
			<td  align='right'>
			<?php if($faktur->jnsbayar=='1') echo "Cash"; ?>
			<?php if($faktur->jnsbayar=='2') echo "Debet"; ?>		
			<?php if($faktur->jnsbayar=='3') echo "Gopay"; ?>
			<?php if($faktur->jnsbayar=='4') echo "OVO"; ?>
			<?php if($faktur->jnsbayar=='5') echo "Spay"; ?>
			<?php if($faktur->jnsbayar=='6') echo "Spay"; ?>
			<?php if($faktur->jnsbayar=='7') echo "OVO"; ?>
					</td>
			
		</tr>	
		<tr>
			<td colspan="2"><hr size='1' /> </td>
		</tr>
  </table>
<table >
  <?php foreach ($produk as $key): ?>
 <tr>
		<?php if($key->jenis =='2') {?>
			<td valign="bottom"><?php echo $key->nm_barang .' Panas'  ?></td>							
		<?php } ?>
		<?php if($key->jenis =='3') {?>
			<td valign="bottom"><?php echo $key->nm_barang .' Dingin'  ?></td>							
		<?php } ?>
		<?php if($key->jenis =='1') {?>
			<td valign="bottom"><?php echo $key->nm_barang  ?></td>							
		<?php } ?>
		
	    <?php if ($key->diskonpersen > 0 or $key->diskonrp>0 ): ?>
              <i> ~ Disc. <?php echo $key->diskonpersen ?>% (<?php echo $key->diskonrp ?> )</i></td>
       <?php endif?>
       
    <td valign="bottom"><div align="right"><?php echo $key->jumlah ?>x</div></td>
    <?php if($key->qty>0) { ?>
        <td valign="bottom"><div style="font-size: large;" align="right"><?php echo number_format($key->harga1, 0, ',', '.') ?></div> </td>
    <?php } else {?>
        <td valign="bottom"><div style="font-size: large;" align="right"><?php echo number_format($key->harga, 0, ',', '.') ?></div> </td>
    <?php }?>
    
    <td valign="bottom"><div align="right"><?php echo number_format($key->sub_total_jual, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
  <td>
      <div style="font-family: courier,sans-serif;" valign="bottom">
      <?php if ($key->diskonpersen > 0): ?>
         ~ Disc. <?php echo $key->diskonpersen ?> % ( <?php echo $key->diskonrp ?> )
       <?php endif?></div>
       <div style="font-family: courier,sans-serif;" valign="bottom">
      <?php if ($key->npromo > 0): ?>
         ~ Disc. <?php echo $key->npromo ?> 
       <?php endif?></div>
       
    </td>
       
	</tr>
<?php
$total_item += $key->jumlah;
$subtotal += $key->sub_total_jual;
?>
 <?php endforeach?>
 <tr>
    <td colspan="4"><hr SIZE='1'  /> </td>
  </tr>
  <tr>
    <td>TOTAL</td>
    <td colspan="2"><?php echo $total_item ?> ITEM</td>
    <td><div align="right"><?php echo number_format($subtotal, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
    <td align="right">Pb1/Tax(10%)</td>
    <td></td>
    <td colspan="2"><div align="right"><?php echo number_format($faktur->nppn, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
    <td align="right">Diskon Promo</td>
    <td></td>
    <td colspan="2"><div align="right"><?php echo number_format($faktur->ndisc, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
    <td align="right">Ongkos Kirim</td>
    <td></td>
    <td colspan="2"><div align="right"><?php echo number_format($faktur->ongkir, 0, ',', '.') ?></div></td>
  </tr>
	<tr>
		<td></td>
		<td></td>
		<td colspan="4"><hr SIZE='1'  /> </td>
	</tr>
  <tr>
    <td align="right">GRAND TOTAL</td>
    <td></td>
    <td colspan="2"><div align="right"><?php echo number_format($faktur->netto, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
    <td align="right">Bayar</td>
    <td></td>
    <td colspan="2"><div align="right"><?php echo number_format($faktur->nbayar, 0, ',', '.') ?></div></td>
  </tr>
		<tr>
			<td></td>	
			<td></td>
			<td colspan="4"><hr SIZE='1'  /> </td>
		</tr>
  <tr>
    <td align="right">Kembali</td>
    <td></td>
    <td colspan="2"><div align="right"><?php echo number_format($faktur->nkembali, 0, ',', '.') ?></div></td>
  </tr>
<div style="font-size: 5px;">
  <tr>
    <td colspan="4" align="center"><hr SIZE='1'  />
    BERSERTIFIKAT HALAL MUI </td>
</tr>
<tr>
    <td colspan="4" align="center">
    ID 35120000135790920 </td>
</tr>
  
  <tr>
    <td colspan="4" align="center">
    PRODUK ANAK NEGERI</td>
</tr>

<tr>	
	<td colspan="4" align="center"><i>CV Q-TA, Kediri Jawa Timur</i> </td>
</tr><tr>	
	<td colspan="4" align="center"><i>Kritik & Saran : 081331479744</i></td>
</tr><tr>	
	<td colspan="4" align="center">TERIMA KASIH</td>
</tr><tr>	
	<td colspan="4" align="center"><i>Selamat Datang Kembali</i></td>
  </tr>
 </div> 
</table>
</div>
</body>

<script type="text/javascript">
	
	$("#PrintEvent").click(function(){
		$("#PrintContent").jqprint();
	})
	
</script>


</html>