<?php
require_once "config.php";

$qtn=$_POST['qtn'];
$sql="select * from quotation_details_all where quotation_no='".$qtn."'";
$query=mysqli_query($con,$sql);
$gst=0;$grand_total=0;$total=0;
while($result=mysqli_fetch_array($query)){
   
          $total=$total+$result['grand_total'];
          $gst=$gst+(($result['gst'])/100)*$result['grand_total'];
          
    
    
}
$grand_total=($gst)+$total;
echo json_encode(
        array("total"=>$total,"gst"=>$gst,"grand_total"=>$grand_total)
        );


//require_once "config.php";
//$con->autocommit(FALSE);
//$sql="select * from quotation_no_table";
//$query=mysqli_query($con,$sql);
//if($result=mysqli_fetch_array($query)){
//    $sql1="update quotation_no_table set quotation_no=quotation_no+1";
//    $query1=mysqli_query($con,$sql1);
//    echo "AMUL-".$result['quotation_no'];
//}
//$con->commit();
//$con->close();