<?php
include("db.php");
include("pdate.php");
 
 $currencyId=$_POST['countercurrencyId'];
 if($currencyId==""){

   echo "لطفا نوعیت پول را انتخاب کنید";
   die;
} 
 if($currencyId==1){
       
      echo"<input type='text' class='form-control' name='dollarRate'  id='dollarRate'  value='1'>";
 
 }
 else{

 $findeRateSql="select rate from  crrencyrate where baseCurrency='1' and counterCurrency='$currencyId' order by id desc limit 1";
 $findeRateQuery= $db ->query($findeRateSql);
 $findeRateRow=$findeRateQuery ->fetch_array();
 $findeRate=number_format($findeRateRow['rate'],6);
 echo"<input type='text'  class='form-control' name='dollarRate'  id='dollarRate' value=".$findeRate.">";
}
?>