<?php 
    include_once('config/db.php');  include_once('config/check.php');      
   error_reporting(0) ;


if(isset($_POST["vat"]))
    {    
         $id = $_POST['vat'];             
          
          $stmt = $conn->prepare(" SELECT a.id ,a.currency ,b.id bid ,b.name bname ,b.rate erate ,b.code bcode 
                                   FROM bppartner a 
                                   LEFT JOIN acccurrency b  ON a.currency = b.id
                                   WHERE id=:i  

                                ");
          $stmt->execute(['i'=>$id ]); 
          $row = $stmt->fetch();  //extract($row);
     
            
            $data["erate"] = $row["erate"];
         
             
        
    }

 echo json_encode($data);
?>


