<?php  include("includes/db_config.php"); 
if(isset($_POST["gst_id"]))  
 {  $gst_id=$_POST['gst_id'];
   $price=$_POST['price'];
     $sqlct=mysqli_query($conn,"select * from tax_rate where id='".$gst_id."'");
     $resct= mysqli_fetch_array($sqlct);
     $tax=$resct['tax_gst'];
     $tax_rate=filter_var($tax, FILTER_SANITIZE_NUMBER_INT);
     $taxs=$price*$tax_rate/100;
     $total=$price+$taxs;
     $ttl= round($total);
      echo json_encode(array("total"=>"$total","taxs"=>"$taxs"));  
 }  
 ?>