<?php   
        include "../koneksi.php";
        
        $data = mysqli_query ($koneksi, " select 
                                                  po_tbl.PO_ID,
                                                  detail_po.DetailPO_ID,
                                                  detail_po.QtyPO
                                                  from 
                                                  po_tbl
                                                  INNER JOIN detail_po
                                                  ON po_tbl.PO_ID=detail_po.PO_ID
                                                  where detail_po.DetailPO_ID = $_POST[id]");
        $row = mysqli_fetch_array ($data);
        
?>
        <div class="form-group">
                <input type="hidden" name="po_id" value="<?php echo $row['PO_ID'] ; ?>">
                <input type="hidden" name="detailpo_id" value="<?php echo $row['DetailPO_ID'] ; ?>">
        </div>
        <div class="form-group">
                <label>Quantity PO</label>
                <input class="form-control" id="qty_po" name="qty_po" value="<?php echo $row['QtyPO'] ; ?>">
                <p style="color:red" id="error_qty_po"></p>
        </div>
        <div id="container4"></div>

<script>
function GetURLParameter(sParam)
{
        var sPageURL = window.location.search.substring(1);
        var sURLVariables = sPageURL.split('&');
        for (var i = 0; i < sURLVariables.length; i++) 
        {
                var sParameterName = sURLVariables[i].split('=');
                if (sParameterName[0] == sParam) 
                {
                        return sParameterName[1];
                }
        }
}
var id = GetURLParameter('id');


  $('#qty_po').on('keyup', function(){
        $.get('things2.php?qty_po=' + $('#qty_po').val() + '&id=' + id, function(data) {
			//fungsi eksekusi func. Ajax
			$('#container4').html(data);
	});
  });
</script>
