<?php
if($_POST["sdate"] && $_POST["inam"] && $_POST["recvq"] && $_POST["user"] && $_POST["orderID"])
{ 
  $recvq= $_POST['recvq'];
  $sdate= $_POST['sdate'];
  $user= $_POST['user'];
  $orderID= $_POST['orderID'];
  $iname= $_POST['inam'];  
  $time= "By: ".$user.": At: ".$sdate.":".Date("H:i:sa")."-Qty:(".$recvq.")";
  require_once"labClass.php";
  $con=new labClass();
  $Q= $con->getThisPOrder($orderID);
  if($Q->rowCount()>0)
    {
   $rQ= $con->updatepOrderInvRecvInfo($orderID,$time,$iname);
   
   if($rQ->rowCount()>0)
      {
     $rc= $con->updateItemQpurchInv($iname,$recvq);

     if($rc->rowCount()>0)
      {
      ?>
      <h6 class="text-success">Saved</h6>
      <?php
           }
  else{
       ?>
        <h6 class="text-danger">Updating stock failed!..</h6>
       <?php
       }
       }
       }
  else{
       ?>
        <h6 class="text-danger">Order do not exist!..</h6>
       <?php
       }
       }
  else{
       ?>
       <h6 class="text-danger">All field required!..</h6>
       <?php
       }
?>