<!DOCTYPE html>

<html>


<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">

	
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
	
	<script type="text/javascript" src="/wawan/public/adminLTE/dist/css/sweetalert.min.js"></script>
	
	<style>
		
			.tbl_stn {
			    position:absolute;
				top: 110px;
				left: 240px;
				width: 450px;
				height: 505px;
			    //border: 1px solid #543535;
			}				

			.tbl_kms {
			    position:absolute;
				top: 110px;
				right: 10px;
				width: 650px;
				height: 505px;
				//border: 1px solid #543535;
			}	
			
			.wrap {
			  width: 50%;
			  display: inline-block;
			  margin: 10px;
			}
			
		
			.tblheader {
				background: #2F4F4F;
				color: white;
				font-size: 15px;
				alignment: center;
			}

	</style>


</head>

<?php $__env->startSection('title'); ?>
    Status Stock &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<?php $__env->stopSection(); ?>

<!------------------>

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="tbl_stn">
        <div class="box">
            <div class="box-body">
<table class="table table-striped table-padding table-bordered" id="tbl-stock1" width="100%">
<thead>
   <tr class="tblheader">
   
      <th>Deskripsi</th>
	  <th>STOCK</th>
	  <th>Status</th>
  
 
	</tr>
</thead>

<tbody></tbody>	 

</table>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="tbl_kms">
        <div class="box">
            <div class="box-body">
<table class="table table-striped table-padding table-bordered" id="tbl-stock0" width="100%">
<thead>
   <tr class="tblheader">
   
      <th>Deskripsi</th>
 	  <th>STK IN</th>
	  <th>STK OUT</th>
	  <th>STK OH</th>
      <th>Status</th> 	  
 
	</tr>
</thead>

<tbody></tbody>	 

</table>
            </div>
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>

<!-------------------------------->

<?php $__env->startSection('script'); ?>

<script type="text/javascript">
var table, table1,tbl_stock, save_method;

// type barang satuan
	jQuery(document).ready(function($){
	table1 = $('#tbl-stock1').DataTable({
        "scrollY": '60vh',
        "scrollCollapse": true,
        "paging": false,
        "processing" : true,
	    "searching" : false,
	    "destroy" : true,
	    "dom" : 'bti',	 
        "ajax" : {
            "url" : "/wawan/stock/getdata_1",
            "type" : "GET"
            }
        });
    });
    
// type barang kemasan
	jQuery(document).ready(function($){
	table = $('#tbl-stock0').DataTable({
        "scrollY": '60vh',
        "scrollCollapse": true,
        "paging": false,
        "processing" : true,
	    "searching" : false,
	    "destroy" : true,
	    "dom" : 'bti',	 
        "ajax" : {
            "url" : "/wawan/stock/getdata_0",
            "type" : "GET"
            }
        });
    });

function change_1(id){
   if(confirm("  Apakah yakin Ubah Status Stock ?  ")){
     $.ajax({
       url : "/wawan/stock/"+id+"/change_1",
       type : "GET",
       dataType : "JSON",
       success : function(data){
				 if(data.msg=="error"){
					swal("WARNING", " Status gagal diubah !","error");
				 }else{
					swal("SUCCESS", " Status berhasil diubah! ","success");
					table1.ajax.reload();	
				 }
       },
           error : function(){
             //alert("Tidak dapat menyimpan data!");
			 swal("WARNING"," DATA tidak dapat disimpan, harap hubungi IT !","error");
			}   
         });
       return false;
	}
}

function change_0(id){
   if(confirm("  Apakah yakin Ubah Status Stock ?  ")){
     $.ajax({
       url : "/wawan/stock/"+id+"/change_0",
       type : "GET",
       dataType : "JSON",
       success : function(data){
				 if(data.msg=="error"){
					swal("WARNING", " Status gagal diubah !","error");
				 }else{
					swal("SUCCESS", " Status berhasil diubah! ","success");
					table.ajax.reload();	
				 }
       },
           error : function(){
             //alert("Tidak dapat menyimpan data!");
			 swal("WARNING"," DATA tidak dapat disimpan, harap hubungi IT !","error");
			}   
         });
       return false;
	}
}

</script>

<?php $__env->stopSection(); ?>
</html>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/myprojeq/public_html/wawan/resources/views/stock/change_sts.blade.php ENDPATH**/ ?>