  <div class="content-wrapper" style="margin-bottom: 20px">
    <div class="container">
      <div class="row pad-botm">
          <div class="col-md-12">
              <h4 class="header-line">PENAMBAHAN BAHAN <?php echo date_indo($tanggal) ?> <span class="pull-right"><a id="btnLihat" class="btn btn-danger" href="<?php echo base_url('kasir/cetak-barang-masuk') ?>">Cetak</a></span></h4>
          </div>
      </div>
      <div class="row">
        <div class="col-md-12">
            
              
				<form class="form-inline" action="<?php echo base_url('kasir/barang-masuk/') ?>" method="post">
					<tr>
					<label>No Surat Jalan : </label>
					<input name='sj' id='sj' VALUE='' ></input>
					<button  class="btn" type="submit" ><font color='blue' ><b>GO</b></font></button>
					</tr>
				</form>	
			<table id="tbPenjualan" class="table table-bordered table-striped table-responsive">	
			<thead>
                <tr>
				  <th>No.SJ</th>
                  <th>No</th>
                  <th>Kode Barang</th>
                  <th>Nama Barang</th>
				  <th>Kemasan</th>
                  <th>Qty SJ</th>
                  <th>Qty Terima</th>
                  <th>Keterangan</th>
                  
                </tr>
              </thead>
              <tbody>
                <?php foreach ($daftar->result() as $key): ?>
				<?php
				$nobukti=$key->nobukti;
				$st=$key->st;
				?>
					
                <tr>
				   <td><?php echo $key->nobukti ?></td>
                  <td><?php echo $key->nourut ?></td>
                  <td><?php echo $key->kdbrg ?></td>
                  <td><?php echo $key->nm_barang ?></td>
				  <td><?php echo $key->satuan ?></td>
                  <td align="center"><?php echo number_format($key->qty) ?></td>
				  <?php if($key->st=='2'){?>
					<td align='center'>
						<form align='center' action="<?php echo base_url('kasir/edit_jumlah_masuk/') ?>" method="post">
							<input name="kdbrg" type="hidden" id="kdbrg" value="<?php echo $key->kdbrg ?>"/>
							<input name="nofak" type="hidden" id="nofak" value="<?php echo $key->nobukti ?>"/>
							<input name="jml" type="text" id="jml" size="10" onkeypress="return isNumber(event)" value="<?php echo number_format($key->qtyterima) ?>" autocomplete="off" />
						</form>
					</td>	
					<td>
						<form action="<?php echo base_url('kasir/edit_ket_masuk/') ?>" method="post">
							<input name="kdbrg" type="hidden" id="kdbrg" value="<?php echo $key->kdbrg ?>"/>
							<input name="nofak" type="hidden" id="nofak" value="<?php echo $key->nobukti ?>"/>
							<input name="keter" id="keter" type="text"  value="<?php echo $key->keter ?>" autocomplete="off" />
						</form>
					</td>	
					<?php } else {?>
						<td align='center'><?php echo number_format($key->qtyterima) ?></td>
						<td><?php echo $key->keter ?></td>
					<?php }?>
                </tr>
                <?php endforeach?>
              </tbody>
            </table>
		
              <button type="submit"  data-id='$nobukti' data-toggle="modal" data-target=".modalKecil" onclick="return confirm('Apakah sudah selesai?');" class="btn btn-info pull-right">Aprovel</button>
		
        </div>
      </div>
    </div>
  </div>
     <!-- CONTENT-WRAPPER SECTION END-->
    <section class="footer-section">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                   &copy; Copyright <?php echo date('Y') ?>, <a href="enambelasapp.my.id" target="_blank">Mandiri</a>
                </div>
            </div>
        </div>
    </section>
	
 
<div class="modal fade modalKecil" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-sm">
 
    <div class="modal-content">
      <div class="modal-header">
        <h4><font color='red'><b>Input Validasi Token</b></font></h4>
		<?php 
			$tgl=date('j');
			$jam=date('G');
			$detik=date('s');
			if ($detik==0)  $token=((($tgl*$jam*1)*1305));
			if ($detik>0) $token=((($tgl*$jam*$detik)*1305));
		?>
		
      </div>
        <div class="modal-body" align='center' >
          <form class="form-horizontal" action="<?php echo base_url('kasir/masuk_token/')?>" method="post">
            <div  class="form-group">
              <label  class="control-label " for="id_fak">Kode Token</label>
              <div class="col-sm-10">
                <input  type="text" class="form-control" id="token" name="token"  value='<?php echo $token ?>' readonly>
              </div>
            </div>
            <div class="form-group" >
              <label class="control-label " for="idtoken">Password</label>
              <div class="col-sm-10">
                <input type="number" class="form-control" id="idtoken" name="idtoken" required >
              </div>
            </div>
			<div class="form-group" >
              <label class="control-label " for="note">Note</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="note" name="note" required >
              </div>
            </div>
        </div>
        <div class="modal-footer">
		 <input type="hidden" name="nobuk" id="nobuk" value="<?php echo $nobukti ?>">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <button type="submit" id="btnSimpan" class="btn btn-primary">Simpan</button>
        </div>
        </form>
    </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>
	 $('#tbPenjualan').DataTable({
          "searching": false,
          "ordering": false,
          "info": false,
		  
      });
	  
      $('form').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);
    $("#btnLihat").on('click', function(e){
      e.preventDefault();
      var url = $(this).attr('href');
      window.open(url, '_blank', 'location=yes,height=600,width=500,scrollbars=yes,status=yes');
    });
	
	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;
    } 

	$("#jml").keypress(function(e){
        var kd_barang= $('#kbrg').val();
        var nofak = $('#nofak').val();
        if(e.which==13){
			document.getElementById('keter').focus();  
        }
    });

</script>  
 
</script>  

    </script>

</body>
</html>