 
  <div class="content-wrapper" style="margin-bottom: 10px">
    <div style="margin-center: 5px;margin-right: 10px;margin-left: 10px">
	
     <?php if ($faktur->keter == null) { ?>
	  
	   <div class="col-md-6">
          <div class="panel panel-default">
            <div align='center'>
				<table  class='table-responsive'>
				<tbody>
					<tr>
						<td align='center'>
							<figure align="center" class="active">
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type="hidden" name="kdharga" id="kdharga" value="KH01">                  
								<button type="submit" ><img height="80" width='80' src="<?php echo base_url() ?>/assets/img/reguler.png" /></button>
								</form>
							</figure>	
						</td>	
						<td>
						<a height="80" width='80'></a>
						</td>						
						<td align='center'>
							<figure align="center">
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type="hidden" name="kdharga" id="kdharga" value="KH02">                
								<button type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="80" width='80' src="<?php echo base_url() ?>/assets/img/gofood.png" /></a></button>
								</form>
							</figure>	
						</td>	
					</tr>	
					<tr>
					<td><a><img height="10" ></a></td></tr>
					<tr>
						<td align='center'>
							<figure align="center">
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type="hidden" name="kdharga" id="kdharga" value="KH03">                
								<button type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="80" width='80' src="<?php echo base_url() ?>/assets/img/grab.jpg" /></a></button>
								</form>
							</figure>	
						</td>
						<td><a><img width="40" ></a></td>
						<td align='center'>
							<figure align="center">
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type="hidden" name="kdharga" id="kdharga" value="KH04">                
								<button type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="80" width='80' src="<?php echo base_url() ?>/assets/img/shopee.png" /></a></button>
								</form>
							</figure>	
						</td>	
					</tr>
				</tbody>
				</table>
			  
		</div>	  
		</div>
		</div>
		 
	  <!-- dari sini -->
	  
	  <?php }
	  else {?>
	 <!--  <div class="row-fluid">
      <div class="span8">
        <div class="widget-box span12">
          <div class="widget-title bg_lg"><span class="icon"><i class="icon-th-large"></i></span>
            <h5>Menu Makanan</h5>
          </div>
          <div class="widget-content" >
            <ul class="thumbnails">
              <div class="btn-icon-pg">
		-->	  
	<div class="col-md-1">
          <div class="panel panel-default">
            <div class="panel-body">
				<div>
					<form class="form-inline" action="<?php echo base_url('kasir/kode-harga1/') ?>" method="post">
						<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
						<input type="hidden" name="kdharga" id="kdharga" value="KH01">                  
						<?php if ($faktur->kdharga == 'KH01') {?>
						<button class="btn btn-success" type="submit"  height="35px" width='60px'><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/reguler.png" /></button>
						<?php } else { ?>
						<button  type="submit"  height="35px" width='60px'><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/reguler.png" /></button>
						<?php }?>
					</form>
				</div>
			<br>
				<div>
					<form class="form-inline" action="<?php echo base_url('kasir/kode-harga1/') ?>" method="post">
						<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
						<input type="hidden" name="kdharga" id="kdharga" value="KH02">                
						<?php if ($faktur->kdharga == 'KH02') {?>
						<button class="btn btn-success" type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/gofood.png" /></a></button>
						<?php } else { ?>
						<button type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/gofood.png" /></a></button>
						<?php }?>
					</form>
				</div>			
			<br>
				<div>
					<form class="form-inline" action="<?php echo base_url('kasir/kode-harga1/') ?>" method="post">
						<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
						<input type="hidden" name="kdharga" id="kdharga" value="KH03">                
						<?php if ($faktur->kdharga == 'KH03') {?>
						<button class="btn btn-success" type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/grab.jpg" /></a></button>
						<?php } else { ?>
						<button type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/grab.jpg" /></a></button>
						<?php }?>
					</form>
				</div>			
			<br>
				<div>
					<form class="form-inline" action="<?php echo base_url('kasir/kode-harga1/') ?>" method="post">
						<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
						<input type="hidden" name="kdharga" id="kdharga" value="KH04">                
						
						<?php if ($faktur->kdharga == 'KH04') {?>
						<button class="btn btn-success" type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/shopee.png" /></a></button>
						<?php } else { ?>
						<button type="submit" ><a href="<?php echo base_url('dashboard/') ?>"><img height="35px" width='60px' src="<?php echo base_url() ?>/assets/img/shopee.png" /></a></button>
						<?php }?>
					</form>
				</div>			
			</div>	  
		</div>
	</div>  
 <div class="col-md-6" >
  <div class="panel panel-default">
				<div class="panel-heading">
				<table style="width:90%;height:25px;" >
					
						<tr >
							<td>
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga2/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type='hidden' name="jenisbrg"  id="jenisbrg" value="J01">
								<?php if ($faktur->jenisbrg == 'J01') {?>
									<button class="btn btn-success"  type="submit" >Noodle</button>
								<?php } else {?>	
									<button  type="submit" >Noodle</button>
								<?php }?>	
								</form>
							</td>
							<td>
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga2/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type='hidden' name="jenisbrg"  id="jenisbrg" value="J02">
								<?php if ($faktur->jenisbrg == 'J02') {?>
									<button class="btn btn-success"  type="submit" >Snack</button>
								<?php } else {?>	
									<button  type="submit" >Snack</button>
								<?php }?>	
								</form>
							</td>
							<td>
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga2/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type='hidden' name="jenisbrg"  id="jenisbrg" value="J03">
								<?php if ($faktur->jenisbrg == 'J03') {?>
									<button class="btn btn-success"  type="submit" >Topping</button>
								<?php } else {?>	
									<button  type="submit" >Topping</button>
								<?php }?>	
								</form>
							</td>
							<td>
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga2/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type='hidden' name="jenisbrg"  id="jenisbrg" value="J04">
								<?php if ($faktur->jenisbrg == 'J04') {?>
									<button class="btn btn-success"  type="submit" >Beverage</button>
								<?php } else {?>	
									<button  type="submit" >Beverage</button>
								<?php }?>	
								</form>
							</td>
							<td>
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga2/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type='hidden' name="jenisbrg"  id="jenisbrg" value="J05">
								<?php if ($faktur->jenisbrg == 'J05') {?>
									<button class="btn btn-success"  type="submit" >Cutlery</button>
								<?php } else {?>	
									<button  type="submit" >Cutlery</button>
								<?php }?>	
								</form>
							</td>
							<td>
								<form class="form-inline" action="<?php echo base_url('kasir/kode-harga2/') ?>" method="post">
								<input type="hidden" name="nobuk" id="nobuk" value="<?php echo $faktur->no_faktur_penjualan ?>">
								<input type='hidden' name="jenisbrg"  id="jenisbrg" value="J06">
								<?php if ($faktur->jenisbrg == 'J06') {?>
									<button class="btn btn-success"  type="submit" >Take Away</button>
								<?php } else {?>	
									<button  type="submit" >Take Away</button>
								<?php }?>	
								</form>
							</td>
							
					</tr>                
					
				</table>
				</div>
		
	<?php foreach ($menu->result() as $brg): ?>
    <div class="span14" align='center'>      
            <ul class="thumbnails">
              <div class="btn-icon-pg">
                // <ul class="btn btn-success btn-mini">
				   <li class="span1"  > 
					
						<table class="table table-bordered" >
							<div align='center'>
								<a onclick="return confirm('Yakin order?');" href="<?php echo base_url('kasir/cekbarang/') . $faktur->no_faktur_penjualan . "/" . $brg->kode_menu ?>">
								<img  style="width:60%;height:65px;" class="form-control"  src="<?php echo base_url('/gambar/')?><?php echo $brg->foto ?>" ></a>
								<tr>
									<td style="width:100%;height:25px;"><font size='1'><?php echo $brg->nama_menu;?></font></td>
									<td ><font size='1'>Rp. <?php echo number_format($brg->harga_jual, 0, ',', '.');?></font></td>
								</tr>
							</div>	
                        </table>	
                    </li>
                  <!--End Looping-->
                </ul>
              </div>
            </ul>
	</div>
	<?php endforeach ?>     
	</div>
</div> 
<?php } ?>
		<!-- smp sini yg kiri -->
		
        <div class="col-md-5">
			  <div class="panel panel-default">
				<div class="panel-heading">
				<table style="width:100%;height:35px;">
					<tr  >
						
							<td align="left" style="font-size: 16pt" ><b color='blue'><?php echo $faktur->keter ?></b></td>
						
						
						<td align="center" style="font-size: 16pt">TOTAL</td>
						<?php if ($faktur->diskon > 0): ?>
						<td align="right" style="font-size: 20pt"><strong><?php echo number_format($faktur->total_penjualan_sdiskon, 0, ',', '.') ?></strong></td>
						<?php else: ?>
						<td align="right" style="font-size: 20pt"><strong><?php echo number_format($belanja->tot_bel, 0, ',', '.') ?></strong></td>
						<?php endif?>
					</tr>                
				</table>
				</div>
			</div> 
          <div class="panel panel-default">
            <div class="panel-heading">
                Faktur : <?php echo $faktur->no_faktur_penjualan ?><span class="pull-right"><?php echo date_indo($tgl) ?> <span id="waktu"></span></span>
            </div>
            <div class="panel-body">
            <table id="tbUser" class="table table-bordered table-responsive">
              <thead>
                <tr>
                  <td align="center">Aksi</td>
                  <td>Nama Menu</td>
                  <td align="right">Harga</td>
                  <td align="center">Jumlah</td>
                  <td align="center">Diskon %</td>
                  <td align="right">Subtotal</td>
                </tr>
              </thead>
              <tbody>
                <?php foreach ($list->result() as $key): ?>
                <tr>
                  <td align="center"><a onclick="return confirm('Yakin hapus data ini?');" href="<?php echo base_url('kasir/hapus-barang-beli/') . $key->no_faktur_penjualan . "/" . $key->kd_barang ?>">Hapus</a></td>
                  
                  <td><?php echo substr($key->nm_barang, 0, 40) ?></td>
                  <td align="right"><?php echo number_format($key->harga, 0, ',', '.') ?></td>
                  <td align="center">
                  <form action="<?php echo base_url('kasir/edit_jumlah_beli/') ?>" method="post">
                    <input name="kd_barang_e" type="hidden" id="kd_barang_e" value="<?php echo $key->kd_barang ?>"/>
                    <input name="nofak_e" type="hidden" id="nofak_e" value="<?php echo $key->no_faktur_penjualan ?>"/>
                    <input style="text-align: center;" name="jml" type="text" id="jml" size="3" onkeypress="return isNumber(event)" value="<?php echo $key->jumlah ?>" />
                  </form>
                  </td>
                  <td align="center">
                  <form action="<?php echo base_url('kasir/edit_diskon_beli/') ?>" method="post">
                    <input name="kd_barang_d" type="hidden" id="kd_barang_d" value="<?php echo $key->kd_barang ?>"/>
                    <input name="nofak_d" type="hidden" id="nofak_d" value="<?php echo $key->no_faktur_penjualan ?>"/>
                    <input name="dis_d" type="text" style="text-align: center;" id="dis_d" size="2" onkeypress="return isNumber(event)" value="<?php echo $key->diskonpersen ?>" />%
                  </form>
                  </td>
                  <td align="right"><?php echo number_format($key->sub_total_jual, 0, ',', '.') ?></td>
                </tr>
<?php
$tot_item += $key->jumlah;
$tot_belanja += $key->sub_total_jual;
?>
                <?php endforeach?>
              </tbody>
              <tr>
                <td colspan="3" align="right"><strong>Total</strong></td>
                <td align="center"><strong><?php echo $tot_item ?> Items</strong></td>
                <td></td>
                <td align="right"><strong>Rp. <?php echo number_format($tot_belanja, 0, ',', '.') ?></strong></td>
              </tr>
			   
            </table>
            <a  class="btn btn-danger pull-left" href="<?php echo base_url('kasir/penjualan-pending/') ?>">Pending</a>
			 <div>
                <form class="form-inline" action="<?php echo base_url('kasir/go_to_bayar/') ?>" method="post">
                <input type="hidden" name="nofak_bayar" id="nofak_bayar" value="<?php echo $faktur->no_faktur_penjualan ?>">
                <input type="hidden" name="total_belanja" id="total_belanja" value="<?php echo $belanja->tot_bel ?>">
                <input type="hidden" name="diskon_belanja" id="diskon_belanja" value="<?php echo $faktur->diskon ?>">
                <input type="hidden" name="diskon_ket" id="diskon_ket" value="<?php echo $faktur->ket_diskon ?>">
				<button type="submit" class="btn btn-danger pull-right">Bayar</button>    
                </form>
                </div>
			
			
			
            </div>
			
          </div>
        </div>
		
    </div>
  </div>

    <!-- FOOTER SECTION END-->
    <!-- JAVASCRIPT FILES PLACED AT THE BOTTOM TO REDUCE THE LOADING TIME  -->
    <script src="<?php echo base_url() ?>/assets/js/jquery-3.3.1.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/bootstrap.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/custom.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/sweetalert.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/toastr.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/jquery-ui.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/jquery.price_format.min.js"></script>
	
    <script>
      $('form').attr('autocomplete', 'off');
      $('input').attr('autocomplete', 'off');
      $("ul.nav li.dropdown").hover(function(){$(this).find(".dropdown-menu").stop(!0,!0).delay(100).fadeIn(500)},function(){$(this).find(".dropdown-menu").stop(!0,!0).delay(100).fadeOut(500)});
      var pesan="<?php echo $this->session->flashdata('msg'); ?>",error="<?php echo $this->session->flashdata('error'); ?>";pesan?(toastr.options={positionClass:"toast-top-right"},toastr.success(pesan)):error&&swal(error,"","error");

      function startTime() {
        var today = new Date();
        var h = today.getHours();
        var m = today.getMinutes();
        var s = today.getSeconds();
        m = checkTime(m);
        s = checkTime(s);
        document.getElementById('waktu').innerHTML = h + ":" + m + ":" + s;
        var t = setTimeout(startTime, 500);
      }

      function checkTime(i) {
          if (i < 10) {i = "0" + i};
          return i;
      }

    $(document).ready(function() {
        startTime();
        $('#kd_barang').focus();
        $('#nm_barang').autocomplete({
          source: "<?php echo base_url('kasir/get_autocomplete/?'); ?>",
          select: function (event, ui) {
            $('[name="nm_barang"]').val(ui.item.label);
            $('[name="kd_barang"]').val(ui.item.kode);
            $('#kd_barang').focus();
          }
        });
    });

    $("#qty").keypress(function(e){
		
        var kd_barang= $('#kd_barang').val();
        var nofak = $('#nofak').val();
        if(e.which==13){
          if (kd_barang) {
            window.top.location.href = "<?php echo base_url('kasir/cekbarang/') ?>"+nofak+"/"+kd_barang;
          }
          return false;
        }
    });

$("#kd_barang").keypress(function(e){
		
        var kd_barang= $('#kd_barang').val();
        var nofak = $('#nofak').val();
        if(e.which==13){
          if (kd_barang) {
            window.top.location.href = "<?php echo base_url('kasir/cekbarang/') ?>"+nofak+"/"+kd_barang;
          }
          return false;
        }
    });

    function isNumber(evt) {
        evt = (evt) ? evt : window.event;
        var charCode = (evt.which) ? evt.which : evt.keyCode;
        if (charCode > 31 && (charCode < 48 || charCode > 57)) {
            return false;
        }
      return true;
    }

    $(function(){
        $('#diskon').priceFormat({
                prefix: '',
                centsLimit: 0,
                thousandsSeparator: '.'
        });
    });
    </script>

</body>
</html>