<?php


ini_set('session.gc_maxlifetime', 30*60);

session_start();

include '../../../includes/config.php';




$Total_Riders = $_GET['Total_Riders'];



	$TU_ID = $_GET['UT_ID'];
	$Trip_ID = $_GET['Trip_ID'];
	$Max_Limit_Riders = $_GET['Max_Limit_Riders'];	
	$Gender = $_GET['Gender'];
	$Total_KM_Distance = $_GET['Total_KM_Distance'];	

	$Date = $_GET['Date'];
	$D_ID = $_GET['D_ID'];	


	$lng1 = $_GET['lng1'];	
	$lat1 = $_GET['lat1'];	
	$lng2 = $_GET['lng2'];	
	$lat2 = $_GET['lat2'];	
	$From_Location = $_GET['From_Location'];	
	$To_Location = $_GET['To_Location'];
	
	
	
	



$sql1 = mysqli_query($dbConn,"update trips_users set Status='Dropoff' WHERE ID='$TU_ID'");






$sql2 = mysqli_query($dbConn,"select * from trips where ID='$Trip_ID'");
$row2 = mysqli_fetch_array($sql2);
$Current_Total_Riders = $row2['Current_Total_Riders'];
$New_Current_Total_Riders = $Current_Total_Riders - $Total_Riders;
$sql3 = mysqli_query($dbConn,"update trips set Current_Total_Riders='$New_Current_Total_Riders' WHERE ID='$Trip_ID'");



$sql2 = mysqli_query($dbConn,"select * from trips_users where ID='$TU_ID'");
$row2 = mysqli_fetch_array($sql2);
$User_ID = $row2['User_ID'];




$Total_Price_All_Riders = $row2['Total_Price_All_Riders'];
$SHEELD_Credit = $Total_Price_All_Riders*0.10;




$sql4 = mysqli_query($dbConn,"select * from drivers where ID='$D_ID'");
$row4 = mysqli_fetch_array($sql4);
$Credit_Balance = $row4['Credit_Balance'];
$New_Credit_Balance = $Credit_Balance - $SHEELD_Credit;
$sql5 = mysqli_query($dbConn,"update drivers set Credit_Balance='$New_Credit_Balance' WHERE ID='$D_ID'");













	echo '<script language="JavaScript">
 document.location="shared-same-gender-5.php?TU_ID='.$TU_ID.'&User_ID='.$User_ID.'&Trip_ID='.$Trip_ID.'&Max_Limit_Riders='.$Max_Limit_Riders.'&Gender='.$Gender.'&Total_KM_Distance='.$Total_KM_Distance.'&Date='.$Date.'&D_ID='.$D_ID.'&lng1='.$lng1.'&lat1='.$lat1.'&lng2='.$lng2.'&lat2='.$lat2.'&From_Location='.$From_Location.'&To_Location='.$To_Location.'";
</script>';




?>
