<?php


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

session_start();

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



$D_ID = $_GET['D_ID'];



$sql = mysqli_query($dbConn,"select * from drivers where ID='$D_ID'");
$row = mysqli_fetch_array($sql);
$D_Longitude=$row['Longitude'];
$D_Latitude=$row['Latitude'];
$D_Gender=$row['Gender'];


$sql1 = mysqli_query($dbConn,"select * from trips_privates where Driver_ID='0' AND Status='Pending' AND Gender='Mix'");
$row1 = mysqli_fetch_array($sql1);
$TP_ID=$row1['ID'];
$User_ID=$row1['User_ID'];
$From_Longitude=$row1['From_Longitude'];
$From_Latitude=$row1['From_Latitude'];



  $unit = 'K';											
  $theta = $D_Longitude - $From_Longitude;
  $dist = sin(deg2rad($D_Latitude)) * sin(deg2rad($From_Latitude)) +  cos(deg2rad($D_Latitude)) * cos(deg2rad($From_Latitude)) * cos(deg2rad($theta));

  $dist = acos($dist);
  $dist = rad2deg($dist);
  $miles = $dist * 60 * 1.1515;
  $unit = strtoupper($unit);										
  $Distance = round(($miles * 1.609344),1);	
  $Distance2 = round(($miles * 1.609344),1);	
  
  
    if ($Distance2<=0.2){
		
		
		
		
		
echo '<script language="JavaScript">
 document.location="private-mix-gender/private-mix-gender.php?User_ID='.$User_ID.'&Driver_ID='.$D_ID.'&TP_ID='.$TP_ID.'";
</script>';	
		
		
		
		
		
	}







?>
