  <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">STOK PORSI PER BAHAN <?php echo $tgl ?></h4>
          </div>
      </div>
      <div class="row">
        <div class="col-md-12">
            <table id="tbStok" class="table table-bordered table-striped table-responsive">
              <thead>
                <tr>
                  <th>No Urut</th>        
                  <th>Kode Barang</th>
                  <th>Nama Barang</th>
                  <th>Kategori</th>
                  <th>Satuan</th>
                  <th>Porsi Stok</th>
                  <th>Stok Real</th>
                </tr>
              </thead>
              <tbody>
                <?php foreach ($stok->result() as $key): 
                $sreal=$key->sreal;
                ?>
                
                <tr>
                  <td><?php echo $key->nourut ?></td>
                  <td><?php echo $key->kdbrg ?></td>
                  <td><?php echo $key->nmbrg ?></td>
                  <td><?php echo $key->nm_kategori ?></td>
                  <td><?php echo $key->stn ?></td>
                  <td align="center"><?php echo $key->stok ?></td>
                  	<td align='center'>
						<form align='center' action="<?php echo base_url('gudang/simpan_stok_edit/') ?>" method="post">
							<input name="kdbrg" type="hidden" id="kdbrg" value="<?php echo $key->kdbrg ?>"/>
							<input name="tgl" type="hidden" id="tgl" value="<?php echo $key->tgl ?>"/>
							<input name="kdtoko" type="hidden" id="kdtoko" value="<?php echo $key->kdtoko ?>"/>
						
							<input name="jml" type="number" id="jml" size="10" onkeypress="return isNumber(event)" value="<?php echo number_format($key->sreal) ?>" autocomplete="off" />
						
						</form>
					</td>	
                </tr>
                <?php endforeach?>
              </tbody>
            </table>
        </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_simpan_stok/')?>" 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/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/buttons.flash.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/jszip.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/pdfmake.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/vfs_fonts.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/buttons.html5.min.js"></script>
    <script src="<?php echo base_url() ?>/assets/js/buttons.print.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>
      $('#tbStok').DataTable({
          "paging":   false,
          "ordering": false,
          "info":     false,
          "searching":     false,
          "dom": 'Bfrtip',
          "buttons": [
            'copy', 'csv', 'pdf', 'print'
        ]
      });
      $('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);
      
	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();
        if(e.which==13){
			document.getElementById('jml').focus();  
        }
    });
    
    </script>

</body>
</html>