<?php
// check if fields passed are empty


                           $client_screen = $_POST["client_screen"];
						   
                           $name = $_POST["name"];
                           $email = $_POST["email"];
                           $phone = $_POST["phone"];
                           $phone2 = $_POST["phone2"];
                           $service = $_POST["service"];
						   
						   
						   
						   
                           $airport_r_address1 = $_POST["airport_r_address1"];
                           $airport_r_zipcode = $_POST["airport_r_zipcode"];
                           $airport_r_daate = $_POST["airport_r_daate"];
                           $airport_r_picktimehour = $_POST["airport_r_picktimehour"];
                           $airport_r_picktimeminute = $_POST["airport_r_picktimeminute"];
                           $airport_r_picktimeampm = $_POST["airport_r_picktimeampm"];
                           $airport_r_vehicle = $_POST["airport_r_vehicle"];
                           $airport_r_passengers = $_POST["airport_r_passengers"];
						   
                           $airport_r_airline2 = $_POST["airport_r_airline2"];
                           $airport_r_flightnumber2 = $_POST["airport_r_flightnumber2"];
                           $airport_r_departurecity2 = $_POST["airport_r_departurecity2"];
                           $airport_r_daate2 = $_POST["airport_r_daate2"];
                           $airport_r_picktimehour2 = $_POST["airport_r_picktimehour2"];
                           $airport_r_picktimeminute2 = $_POST["airport_r_picktimeminute2"];
                           $airport_r_picktimeampm2 = $_POST["airport_r_picktimeampm2"];
                           $airport_r_bags2 = $_POST["airport_r_bags2"];
                           $airport_r_meet2 = $_POST["airport_r_meet2"];
                           $airport_r_address2 = $_POST["airport_r_address2"];
                           $airport_r_zipcode2 = $_POST["airport_r_zipcode2"];
						   
						   
                           $airport_address1 = $_POST["airport_address1"];
                           $froom_address1 = $_POST["froom_address1"];
                           $froom_r_address1 = $_POST["froom_r_address1"];
                           $froom_r_address2 = $_POST["froom_r_address2"];
                           $airport_zipcode = $_POST["airport_zipcode"];
                           $froom_zipcode = $_POST["froom_zipcode"];
                           $froom_r_zipcode = $_POST["froom_r_zipcode"];
                           $froom_r_zipcode2 = $_POST["froom_r_zipcode2"];
                           $froom_airline = $_POST["froom_airline"];
                           $froom_r_airline = $_POST["froom_r_airline"];
                           $froom_flightnumber = $_POST["froom_flightnumber"];
                           $froom_r_flightnumber = $_POST["froom_r_flightnumber"];
                           $froom_departurecity = $_POST["froom_departurecity"];
                           $froom_r_departurecity = $_POST["froom_r_departurecity"];
                           $airport_daate = $_POST["airport_daate"];
                           $froom_daate = $_POST["froom_daate"];
                           $froom_r_daate = $_POST["froom_r_daate"];
                           $froom_r_daate2 = $_POST["froom_r_daate2"];
                           $airport_picktimehour = $_POST["airport_picktimehour"];
                           $froom_picktimehour = $_POST["froom_picktimehour"];
                           $froom_r_picktimehour = $_POST["froom_r_picktimehour"];
                           $froom_r_picktimehour2 = $_POST["froom_r_picktimehour2"];
                           $airport_picktimeminute = $_POST["airport_picktimeminute"];
                           $froom_picktimeminute = $_POST["froom_picktimeminute"];
                           $froom_r_picktimeminute = $_POST["froom_r_picktimeminute"];
                           $froom_r_picktimeminute2 = $_POST["froom_r_picktimeminute2"];
                           $airport_picktimeampm = $_POST["airport_picktimeampm"];
                           $froom_picktimeampm = $_POST["froom_picktimeampm"];
                           $froom_r_picktimeampm = $_POST["froom_r_picktimeampm"];
                           $froom_r_picktimeampm2 = $_POST["froom_r_picktimeampm2"];
                           $airport_vehicle = $_POST["airport_vehicle"];
                           $froom_vehicle = $_POST["froom_vehicle"];
                           $froom_r_vehicle = $_POST["froom_r_vehicle"];
                           $airport_passengers = $_POST["airport_passengers"];
                           $froom_passengers = $_POST["froom_passengers"];
                           $froom_r_passengers = $_POST["froom_r_passengers"];
                           $froom_bags = $_POST["froom_bags"];
                           $froom_r_bags = $_POST["froom_r_bags"];
                           $froom_meet = $_POST["froom_meet"];
                           $froom_r_meet = $_POST["froom_r_meet"];
                           $seats = $_POST["seats"];
                           $seat_type = $_POST["seat_type"];
                           $price = $_POST["price"];
                           $message = $_POST["message"];

						   $if_seats = "";
						   $if_meet2 = "";
						   $if_meet3 = "";
						   $if_meet4 = "";
						   

$price2 = explode("$",$price);
$price2 = $price2[1];
$price2 = round($price2/2);
$price2 = "$".$price2;
////////////////////////////////////////////////////////////////
if($airport_picktimeminute == ''){$airport_picktimeminute=00;}
if($froom_picktimeminute == ''){$froom_picktimeminute=00;}
if($froom_r_picktimeminute == ''){$froom_r_picktimeminute=00;}
if($froom_r_picktimeminute2 == ''){$froom_r_picktimeminute2=00;}
/////////////////////////////////////////////////////////////////

if($seats!=''){$if_seats="Child seat: $seats - $seat_type<br>";};
if($froom_meet=='yes'){$if_meet2="Meet and greet: $froom_meet<br>";}
if($airport_r_meet2=='yes'){$if_meet3="Meet and greet: $airport_r_meet2<br>";}
if($froom_r_meet=='yes'){$if_meet4="Meet and greet: $froom_r_meet<br>";}
if($froom_bags=='yes'){$if_bags2="Checked bags: Yes<br>";}else{$if_bags2="Checked bags: No (Just carry on)<br>";}
if($airport_r_bags2=='yes'){$if_bags3="Checked bags: Yes<br>";}else{$if_bags3="Checked bags: No (Just carry on)<br>";}
if($froom_r_bags=='yes'){$if_bags4="Checked bags: Yes<br>";}else{$if_bags4="Checked bags: No (Just carry on)<br>";}
if($message!=''){$if_message="Your notes: $message<br>";}

if($airport_r_address2==""){$airport_r_address2=$airport_r_address1;}
if($froom_r_address2==""){$froom_r_address2=$froom_r_address1;}

if($airport_r_zipcode2==""){$airport_r_zipcode2=$airport_r_zipcode;}
if($froom_r_zipcode2==""){$froom_r_zipcode2=$froom_r_zipcode;}

$body1="
$client_screen<br><br>
Hello $name,<br>
<br>
We have scheduled the car service for you from Your Address to PHX Sky Harbor Airport:<br>
<br>
<span style='font-weight:bold;color:blue;'><span style='text-decoration:underline;'>To the Airport:</span>  $airport_daate</span> 
at <span style='font-weight:bold;color:blue;'>$airport_picktimehour:$airport_picktimeminute $airport_picktimeampm</span> 
from: <span style='font-weight:bold;color:blue;'>$airport_address1 - $airport_zipcode</span>. 
Name: <span style='color:black;'>$name</span> / 
Phone: <span style='font-weight:bold;color:blue;'>$phone</span> - Alt: <span style='font-weight:bold;color:blue;'>$phone2</span> / 
Email: <span style='color:black;'>$email</span>   
fare: <span style='font-weight:bold;color:blue;'>$price</span>.<br>
<br>
To the Airport, driver calls 30 minutes before your pick up to let you know that he is on the way.
<br><br>
Number of passengers: $airport_passengers<br>
Car selected: $airport_vehicle<br>
$if_seats
$if_message
<br>
Your fare is $price<br>
You may pre-pay online, or you can pay the driver cash/credit at the end of your trip. <br>
<a href='http://samstrans.net/payment.html' target='_blank' style='text-decoration:none;'>Click if you would like to pre-pay online.</a><br>
<br>
<br>
Thank you<br>
Sincerely,<br>
Sams Trans<br>
<a href='http://www.SamsTrans.net/' style='text-decoration:none;'>www.SamsTrans.net</a><br>
(602)539-9000<br>
<br>
<br>
<br>
<br>
<br>
<br>
";

$body2="
$client_screen<br><br>

Hello $name,<br>
<br>
We have scheduled the car service for you from PHX Sky Harbor Airport to Your Address:<br>
<br>
<span style='font-weight:bold;color:blue;'><span style='text-decoration:underline;'>From the airport:</span> $froom_daate</span> 
Arriving on: <span style='font-weight:bold;color:blue;'>$froom_airline</span> 
Flight <span style='font-weight:bold;color:blue;'>$froom_flightnumber</span> 
From <span style='font-weight:bold;color:blue;'>$froom_departurecity</span>. 
Arrives <span style='font-weight:bold;color:blue;'>$froom_picktimehour:$froom_picktimeminute $froom_picktimeampm</span> 
Going to: <span style='font-weight:bold;color:blue;'>$froom_address1 - $froom_zipcode.</span> 
Name: <span style='color:black;'>$name</span> /  
Phone: <span style='font-weight:bold;color:blue;'>$phone</span> - Alt: <span style='font-weight:bold;color:blue;'>$phone2</span>  /
Email: <span style='color:black;'>$email</span> 
fare: <span style='font-weight:bold;color:blue;'>$price</span>.<br>
<br>
From the Airport, driver calls when your flight lands to let you know where to meet him.<br>
<br>
Number of passengers: $froom_passengers<br>
Car selected: $froom_vehicle<br>
$if_seats
$if_meet2
$if_bags2
$if_message
<br>
Your fare is $price<br>
You may pre-pay online, or you can pay the driver cash/credit at the end of your trip. <br>
<a href='http://samstrans.net/payment.html' target='_blank' style='text-decoration:none;'>Click if you would like to pre-pay online.</a><br>
<br>
<br>
Thank you<br>
Sincerely,<br>
Sams Trans<br>
<a href='http://www.SamsTrans.net/' style='text-decoration:none;'>www.SamsTrans.net</a><br>
(602)539-9000<br>
<br>
<br>
<br>
<br>
<br>
";

$body3="
$client_screen<br><br>

Hello $name,<br>
<br>
We have scheduled the car service for you from Your Address to PHX Sky Harbor Airport and back to Your Address (Round Trip):<br>
<br>
<span style='font-weight:bold;color:blue;'><span style='text-decoration:underline;'>To the Airport:</span>  $airport_r_daate</span> 
at <span style='font-weight:bold;color:blue;'>$airport_r_picktimehour:$airport_r_picktimeminute $airport_r_picktimeampm</span> 
from: <span style='font-weight:bold;color:blue;'>$airport_r_address1 - $airport_r_zipcode</span>. 
Name: <span style='color:black;'>$name</span> / 
 
Phone: <span style='font-weight:bold;color:blue;'>$phone</span> - Alt: <span style='font-weight:bold;color:blue;'>$phone2</span>  /
Email: <span style='color:black;'>$email</span> 
Fare: <span style='font-weight:bold;color:blue;'>$price2</span>.<br>
<br>
<span style='font-weight:bold;color:blue;'><span style='text-decoration:underline;'>From the airport:</span> $airport_r_daate2</span>  
Arriving on: <span style='font-weight:bold;color:blue;'>$airport_r_airline2</span> 
Flight <span style='font-weight:bold;color:blue;'>$airport_r_flightnumber2</span> 
From <span style='font-weight:bold;color:blue;'> $airport_r_departurecity2</span>. 
Arrives <span style='font-weight:bold;color:blue;'>$airport_r_picktimehour2:$airport_r_picktimeminute2 $airport_r_picktimeampm2</span> 
Going to: <span style='font-weight:bold;color:blue;'> $airport_r_address2 - $airport_r_zipcode2</span>. 
Name: <span style='font-weight:bold;color:blue;'>$name</span> / 
 
Phone: <span style='font-weight:bold;color:blue;'>$phone</span> - Alt: <span style='font-weight:bold;color:blue;'>$phone2</span>  / 
Email: <span style='font-weight:bold;color:blue;'>$email</span> 
Fare: <span style='font-weight:bold;color:blue;'>$price2</span>.<br>
<br>
From the Airport, driver calls when your flight lands to let you know where to meet him.<br>
To the Airport, driver calls 30 minutes before your pick up to let you know that he is on the way.
<br><br>
Number of passengers: $airport_r_passengers<br>
Car selected: $airport_r_vehicle<br>
$if_seats
$if_meet3
$if_bags3
$if_message
<br>
Your fare is $price<br>
You may pre-pay online, or you can pay the driver cash/credit at the end of your trip. <br>
<a href='http://samstrans.net/payment.html' target='_blank' style='text-decoration:none;'>Click if you would like to pre-pay online.</a><br>
<br>
<br>
Thank you<br>
Sincerely,<br>
Sams Trans<br>
<a href='http://www.SamsTrans.net/' style='text-decoration:none;'>www.SamsTrans.net</a><br>
(602)539-9000<br>
<br>
<br>
<br>
";

$body4="
$client_screen<br><br>

Hello $name,<br>
<br>
We have scheduled the car service for you from PHX Sky Harbor Airport to Your Address and back to the Airport (Round Trip):<br>
<br><span style='font-weight:bold;color:blue;'><span style='text-decoration:underline;'>From the airport:</span> $froom_r_daate</span> 
Arriving on: <span style='font-weight:bold;color:blue;'>$froom_r_airline</span> 
Flight <span style='font-weight:bold;color:blue;'>$froom_r_flightnumber</span> 
From <span style='font-weight:bold;color:blue;'> $froom_r_departurecity</span>. 
Arrives <span style='font-weight:bold;color:blue;'>$froom_r_picktimehour:$froom_r_picktimeminute $froom_r_picktimeampm</span> 
Going to: <span style='font-weight:bold;color:blue;'> $froom_r_address1 - $froom_r_zipcode</span>. 
Name: <span style='color:black;'>$name</span> / 
 
Phone: <span style='font-weight:bold;color:blue;'>$phone</span> - Alt: <span style='font-weight:bold;color:blue;'>$phone2</span>  / 
Email: <span style='color:black;'>$email</span> 
Fare: <span style='font-weight:bold;color:blue;'>$price2</span>.<br>
<br>
<span style='font-weight:bold;color:blue;'><span style='text-decoration:underline;'>To the Airport:</span>  $froom_r_daate2</span> 
at <span style='font-weight:bold;color:blue;'>$froom_r_picktimehour2:$froom_r_picktimeminute2 $froom_r_picktimeampm2</span> 
from: <span style='font-weight:bold;color:blue;'>$froom_r_address2 - $froom_r_zipcode2</span>. 
Name: <span style='font-weight:bold;color:blue;'>$name</span> / 
 
Phone: <span style='font-weight:bold;color:blue;'>$phone</span> - Alt: <span style='font-weight:bold;color:blue;'>$phone2</span>  / 
Email: <span style='font-weight:bold;color:blue;'>$email</span> 
Fare: <span style='font-weight:bold;color:blue;'>$price2</span>.<br>
<br>
From the Airport, driver calls when your flight lands to let you know where to meet him.<br>
To the Airport, driver calls 30 minutes before your pick up to let you know that he is on the way.
<br><br>
Number of passengers: $froom_r_passengers<br>
Car selected: $froom_r_vehicle<br>
$if_seats
$if_meet4
$if_bags4
$if_message
<br>
Your fare is $price<br>
You may pre-pay online, or you can pay the driver cash/credit at the end of your trip. <br>
<a href='http://samstrans.net/payment.html' target='_blank' style='text-decoration:none;'>Click if you would like to pre-pay online.</a><br>
<br>
<br>
Thank you<br>
Sincerely,<br>
Sams Trans<br>
<a href='http://www.SamsTrans.net/' style='text-decoration:none;'>www.SamsTrans.net</a><br>
(602)539-9000<br>
<br>
<br>
<br>
";

	

	
// create email body and send itsupersalman	
$to = 'engohood.1986@gmail.com'; // PUT YOUR EMAIL ADDRESS HERE
$email_subject = "Reservation $service"; // EDIT THE EMAIL SUBJECT LINE HERE
if($service=="To-Airport"){$email_body = $body1;}
if($service=="From-Airport"){$email_body = $body2;}
if($service=="Round-Trip-To-Airport[address-airport-address]"){$email_body = $body3;}
if($service=="Round-Trip-From-Airport[airport-address-airport]"){$email_body = $body4;}

$sam_email="trans@samstrans.net";

$headers  = "From:".$email."\r\n";
$headers .= "Reply-To:".$email."\r\n";	
$headers .= "MIME-Version: 1.0". "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
mail($sam_email,$email_subject,$email_body,$headers);
mail($to,$email_subject,$email_body,$headers);
return true;			
?>


























