<div class="modal" id="add_detail" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" >
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="modal-content" style="border-left: red 2px solid;">
     
<form class="form-horizontal" data-toggle="validator" method="post" id="form-add_detail">
   <?php echo e(csrf_field()); ?> <?php echo e(method_field('POST')); ?>

   
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"> &times; </span> </button>
        <h6 class="modal-title">Detail Product</h6>
    </div>

   <div style="padding:5px 50px">

    <input type="hidden" id="idmts2" name="idmts2">
    <input type="hidden" id="iddetail" name="iddetail">
   
    <div class="form-group">
        <label>Product</label>
        <select id="prd2" type="text" class="form-control" name="prd2" autofocus required>
            <option value=""> -- Pilih Product -- </option>
            <?php $__currentLoopData = $prd; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($list->id); ?>"><?php echo e($list->nama_brg." - ".$list->kode_brg); ?></option>
		    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>	
        </select>
    </div>

	<div class="form-group">
		<input id="kms" type="hidden" class="form-control" name="kms" readonly="true" autofocus required>	
		<label>Kemasan</label>
		<div class="input-group">
			<input type="text" class="form-control" id="kemasan" name="kemasan" autofocus required readonly="true">
			<span class="input-group-btn">
				<button onclick="showKemasan()" type="button" class="btn btn-info" style="width:10px;height:30px;">...</button>
			</span>
		</div>
    </div>
    
    <div class="form-group">
        <label>Harga </label>
        <input type="number" class="form-control" id="harga" name="harga" readonly="true" autofocus>
    </div>

    <div class="form-group">
        <label>QTY</label>
        <input type="number" id="qty" name="qty" class="form-control" value="1" autofocus required>
        <small class="text-muted">Qty barang</small>
    </div>

   
    <div class="text-right">
        <button type="submit-add" class="btn btn-primary btn-save btn-sm"><i class="fa fa-floppy-o"></i> Save </button> 
        <button type="button" class="btn btn-warning btn-close btn-sm" data-dismiss="modal"><i class="fa fa-times-circle"></i> Cancel </button>
    </div>

    </div>
    <br>
</form>

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

<!----------------------------------------------------------------->
   
<script type="text/javascript">

function showKemasan(){
	var brg=$('#prd2').val();
    $('#modal-kemasan').modal('show');
	
    tblkemasan.ajax.url("mutasi/"+brg+"/listkemasan");
	tblkemasan.ajax.reload();
}

function selectKemasan(id){
	$('#kms').val(id);
	$('#modal-kemasan').modal('hide');

	$.ajax({
        url : "mutasi/"+id+"/tampilkemasan",
        type : "GET",
        dataType : "JSON",
        success : function(data){
			$('#kemasan').val(data.kemasan);
			$('#harga').val(data.harga);
        },
        error : function(){
          alert("Tidak dapat menampilkan data!");
        }   
     });  
}

</script>
   
        


 
<?php /**PATH /home/myprojeq/public_html/sriayu/resources/views/mutasi/add_detail.blade.php ENDPATH**/ ?>