<?php include('include/lskfjwfe.php');
 $diff=$_GET['diff'];
  $mod=$_GET['mod'];
  $car=$_GET['car'];
  $season=$_GET['season'];
  $diffval=$diff/100;
	if($mod==1){
	$sql1 = "UPDATE api_ext_rates SET api_ext_rate_price=api_ext_rate_price+(api_ext_rate_price*$diffval) WHERE api_ext_rates.api_ext_rate_acriss='$car' AND api_ext_rates.api_ext_rate_seasid=$season ";
    }
    elseif($mod==2){
        $sql1 = "UPDATE api_ext_rates SET api_ext_rate_price=api_ext_rate_price-(api_ext_rate_price*$diffval) WHERE api_ext_rates.api_ext_rate_acriss='$car' AND api_ext_rates.api_ext_rate_seasid=$season "; 
    }
    if($db2->query($sql1) === TRUE) {
        echo "<div class='alert alert-success'>Record Updated Succesfully</div><script>";
        echo "window.history.go(-1);";
     echo "</script>";
         exit;
     } else {
         echo "<div class='alert alert-danger'>Error updating record: </div>" . $db2->error;
     }

$db2->close();
 
?>


