<!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"/>
<style type="text/css">
body {
	font-family: lucida;
	font-size: 8pt;
	color: #0;}
</style>
<?php 
$nuser = $this->session->userdata('ses_username');
?>
</head>

<body onload="print()">
	<table width="250" border='0' align="center">
		<tr>
			<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>
		<!--	<font color="#00" size="+2" ><?php echo $toko->nm_toko; ?></font></a></td> -->
		</tr>
		<tr>
			<td colspan="4" align="center"><font color="#00" style="font-size: 10px;font-family: courier,serif;" ><?php echo $toko->almt_toko; ?></font></td>
		</tr>
		<tr>
			<td colspan="4" align="center"><font color="#00" style="font-size: 10px;font-family: courier,serif;"><?php echo $toko->tlp_toko; ?></font></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"; ?>
					</td>
			
		</tr>	
		<tr>
			<td colspan="2"><hr size='1' /> </td>
		</tr>
  </table>
<table width="250" border='0' align="center">
  <?php foreach ($produk as $key): ?>
 <tr>
		<?php if($key->jenis =='2') {?>
			<td valign="bottom"><div style="font-size: 11px;font-family: courier,serif;"><?php echo $key->nm_barang .' Panas'  ?></div></td>							
		<?php } ?>
		<?php if($key->jenis =='3') {?>
			<td valign="bottom"><div style="font-size: 11px;font-family: courier,serif;"><?php echo $key->nm_barang .' Dingin'  ?></div></td>							
		<?php } ?>
		<?php if($key->jenis =='1') {?>
			<td valign="bottom"><div style="font-size: 11px;font-family: courier,serif;"><?php echo $key->nm_barang  ?></div></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 style="font-size: 10px;align-text: right;" align="right"><?php echo $key->jumlah ?>x</div></td>
    <td valign="bottom"><div style="font-size: 11px;align-text: right;" align="right"><?php echo number_format($key->harga, 0, ',', '.') ?></div> </td>
    <td valign="bottom"><div style="font-size: 11px;align-text: right;" align="right"><?php echo number_format($key->sub_total_jual, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
  <td><div style="font-size: 9px;font-family: courier,sans-serif;" valign="bottom">
      <?php if ($key->diskonpersen > 0): ?>
         ~ Disc. <?php echo $key->diskonpersen ?> % ( <?php echo $key->diskonrp ?> )
       <?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->diskon, 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>
  <tr>
    <td colspan="4" align="center"><hr SIZE='1'  />
    PRODUK ANAK NEGERI</td>
</tr>
<div style="font-size: 5px;">
<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>


<script type="text/javascript" src="<?php echo base_url() ?>/assets/js/iminPrint-1.2.3.js"></script>
 <script type="text/javascript">
 // Instantiate the print plugin
 var IminPrintInstance = iminPrint('ws://localhost:8081');
</script>
</body>
</html>