
<style>
.link_grey{background-color:#CCC}
</style>
<script>
function js_calc(act){
	qty = new Number($('#item_qty').val());

	if(act=="plus"){
		qty = qty + new Number(1);
		$('#item_qty').val(qty)
	}
	if(act=="minus"){
		qty = qty - new Number(1);
		$('#item_qty').val(qty)
		if(qty<0){
			$('#item_qty').val(0)
		}
	}	
}

</script>
<div class="modal fade" id="qty_modal">
  <div class="modal-dialog modal-dialog-centered modal-lg">
    <div class="modal-content">

      <!-- Modal Header -->
      <div class="modal-header py-1">
        <h5 class="modal-title">Tambah Qty</h5>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- Modal body -->
      <div class="modal-body">
       <div>
       	<div id="item_name"></div>


		<div class="input-group">
          <span class="input-group-btn">
	          <input type="button"  class="btn btn-dark" data-type="minus" onClick="js_calc('minus')" data-field="quant[1]" value="-">
          </span>
          <input  name="quant[1]" id="item_qty" class="form-control input-number tc input-sm prevent_key" value="<?php echo $posd_qty?>" min="0" max="50">
          <span class="input-group-btn">
	          <input type="button"  class="btn btn-dark" data-type="minus" onClick="js_calc('plus')" data-field="quant[1]" value="+">
          </span>
    	</div>

        </div>

      </div>

      <!-- Modal footer -->
      <div class="modal-footer">
	       <input type="button" class="btn btn-success w-50" value="OK" onclick="save_qty()" data-dismiss="modal">
           <input type="button" class="btn btn-danger w-50" value="CANCEL"  data-dismiss="modal">
           <input type="hidden" id="posd_autoid" value="0">
      </div>

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