<?php
 
 
  if(isset($_POST['shopid']) && isset($_POST['owniD']) &&  isset($_POST['itemid']))
     {

       $customerid=$ownID=$_POST['owniD'];
       $itemid=$_POST['itemid'];
       $shopid=$_POST['shopid'];
       $itemid=$_POST['itemid'];
       $pcost=$_POST['itemcost'];
         $quantity=$_POST['quantity'];
        $cost= $pcost * $quantity;
      //isset($_POST['quantity']) &&
       $SI=$econ->getThisItem($shopid,$itemid);
    
      if($SI->rowCount()>0)
        {
          $ro=$SI->fetch();

        }

      $Sp=$econ->getThisShop($shopid);
    
      if($Sp->rowCount()>0)
        {
          $shop=$Sp->fetch();

        }
        
        
      
    

   if($econ->vQuantity($quantity))
      {
      	///$CD=$econ->getConfirmCode($code);
      	//if ($CD->rowCount()>0)
      	//{
        //echo "string";

    
       
         $econ->addOrder($shopid,$itemid,$customerid,$quantity,$cost,$batch);
      	//}
      	//else
      	/*{
           ?>
  
     <center>
     <div>
       <sup>
          <?php
       echo "Invalid payment code!";
           ?>   
       </sup>
      </div>
   </center> 
         <?php
      	}*/

      }
   else
      {
      ?>
   <center>
     <div>
       <sup>
          <?php  
            echo $econ->eQuantity($quantity)."<p/>";   

     ?>
  </sup>
</div>
</center> 
<?php 
   
}
 
  
     
}else
{
  echo "Missing some value!..";
}
 
?>
 



