<?php
if (isset($_POST['owniD']) &&isset($_POST['shopid']) && isset($_POST['currency']) &&  isset($_POST['scost']) && isset($_POST['itemcost']) && isset($_POST['bestsupply']) && isset($_POST['itemid'])) {
    require("../buda_myStock_class.php");
    $mcon = new  buda_myStock_class();
    $itemid=$_POST['itemid'];
    $ownID=$_POST['owniD'];
    $currency=$_POST['currency'];
    $shopid=$_POST['shopid'];
    $itemcost=$_POST['itemcost'];
    $bestsupply=$_POST['bestsupply'];
    $scost=$_POST['scost'];
 if($mcon->vitemcost($itemcost,$currency))
      {
        ?>
         <center>
         <div>
        
        <?php   
         $r= $mcon->updateThisItemPrice($bestsupply,$scost,$itemcost,$currency,$itemid,$shopid,$ownID);
         if($r->rowCount()>0)
         { 
          echo "Successful!..";
           $itemcost ="";
           $currency="";
           $bestsupply="";
         }else{
          echo "Submission error!..";
          //$u=$r->ErrorInfo();
          //print_r($u);//"Error occurred while saving data!..";
              }
          
        ?> 
       </div>
       </center> 

        <?php
    
      }
      else{

        //////////////
        ?>
         <center>
         <div>
         <sup> <?php
              echo  $mcon->eitemcost($itemcost,$currency)."<p/>"; 
    
             ?>
       </sup>
       </div>
       </center> 

        <?php
        /////////////

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