<?php
if (isset($_POST['customerid']) &&isset($_POST['shopid'])){
  require_once('../buda_pharmacy_class.php');
    $pcon= new buda_pharmacy_class();
    $customerid=$_POST['customerid'];
    $shopid=$_POST['shopid'];
    $date=$_POST['date']; 
 
        ?>
         <center>
         <div>
        
        <?php 
         $status="Confirmed";
         if(isset($_POST['orderid']))
         {
          $orderid=$_POST['orderid'];
          $itemid=$_POST['itemid'];
         $r= $pcon->updateThisOrderStatus($date,$status,$orderid,$customerid,$itemid,$shopid);
         if($r->rowCount()>0)
         { 
         
          $fr=$pcon->updateThisBatchStatus($date,$orderid,$customerid,$shopid);
          if ($fr->rowCount()>0)
               {
             echo "Successful!..";
               }
          else{
            echo "Some abnormal!..";
            print_r($fr);
              }
         }else{
          echo "Submission error!..";
          
              }
          }
          //////////////////BATCH UPDATE//////////
          //////////////////////////////////
           if(isset($_POST['batchID']))
         {
          $batchID=$_POST['batchID']; 
         
          $r=$pcon->updateThisBatchOrderStatus($date, $customerid,$batchID,$shopid);
            if($r->rowCount()>0)
            { 
             echo "Successful submitted!..";
             // print_r($r);
            }

            else{
            echo "Submission error!..<br/>";
            print_r($r);
          
              }
          }
          /////////////////BATCH UPDATE END////////
        ?> 
       </div>
       </center> 

        <?php
    
      
    }else
    {
      echo "Incomplete Submission!..";
    }
?>