<?php
if(isset($_POST['submit'])){
    
        
$tripType=$_POST['tripType'];        
$from_ap1    = $_POST['from_ap1'];
$to_ap1 = $_POST['to_ap1'];
$date_ap1   = $_POST['date_ap1'];   
$date_ap2   = $_POST['date_ap2'];   
$psngr   = $_POST['psngr'];   
$clas   = $_POST['clas'];   
     
    
$from_multi    = $_POST['from_multi'];
$to_multi = $_POST['to_multi'];
$date_multi   = $_POST['date_multi'];   
     
$from_multi2    = $_POST['from_multi2'];
$to_multi2 = $_POST['to_multi2'];
$date_multi2   = $_POST['date_multi2'];   
     
    
$from_multi3    = $_POST['from_multi3'];
$to_multi3 = $_POST['to_multi3'];
$date_multi3   = $_POST['date_multi3'];   
     
$from_multi4    = $_POST['from_multi4'];
$to_multi4 = $_POST['to_multi4'];
$date_multi4   = $_POST['date_multi4'];   
     
    
    
$from_multi5    = $_POST['from_multi5'];
$to_multi5 = $_POST['to_multi5'];
$date_multi5   = $_POST['date_multi5'];   
    
    
    
$name    = $_POST['name'];
$email = $_POST['email'];
$phone   = $_POST['phone'];






       $message12="
<center>
<table style='width:464px;border-collapse: collapse;' border='1'>
<tr style='background-color:#464141;color:#fff;text-align:center;'><td colspan='3' style='font-size: 22px;'>Book Now</td></tr>

<tr><td style='padding: 5px 5px 5px 5px;';>Trip Type</td><td style='padding: 5px 5px 5px 5px;';>$tripType</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Name</td><td style='padding: 5px 5px 5px 5px;';>$name</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Phone</td><td style='padding: 5px 5px 5px 5px;';>$phone</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Email</td><td style='padding: 5px 5px 5px 5px;';>$email</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Flying From</td><td style='padding: 5px 5px 5px 5px;';>$from_ap1</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Flying to</td><td style='padding: 5px 5px 5px 5px;';>$to_ap1</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart</td><td style='padding: 5px 5px 5px 5px;';>$date_ap1</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Return</td><td style='padding: 5px 5px 5px 5px;';>$date_ap2</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Passenger</td><td style='padding: 5px 5px 5px 5px;';>$psngr</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Class</td><td style='padding: 5px 5px 5px 5px;';>$clas</td></tr>";


if($from_multi){
$message12.="<tr><td style='padding: 5px 5px 5px 5px;';>Flying From 2</td><td style='padding: 5px 5px 5px 5px;';>$from_multi</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Fling to 2</td><td style='padding: 5px 5px 5px 5px;';>$to_multi</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart 2</td><td style='padding: 5px 5px 5px 5px;';>$date_multi</td></tr>";
}

if($from_multi1){
$message12.="<tr><td style='padding: 5px 5px 5px 5px;';>Flying From 3</td><td style='padding: 5px 5px 5px 5px;';>$from_multi1</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Fling to 3</td><td style='padding: 5px 5px 5px 5px;';>$to_multi1</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart 3</td><td style='padding: 5px 5px 5px 5px;';>$date_multi1</td></tr>";
}
if($from_multi2){
    
$message12.="<tr><td style='padding: 5px 5px 5px 5px;';>Flying From 4</td><td style='padding: 5px 5px 5px 5px;';>$from_multi2</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Fling to 4</td><td style='padding: 5px 5px 5px 5px;';>$to_multi2</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart 4</td><td style='padding: 5px 5px 5px 5px;';>$date_multi2</td></tr>";
}
if($from_multi3){
$message12.="<tr><td style='padding: 5px 5px 5px 5px;';>Flying From 5</td><td style='padding: 5px 5px 5px 5px;';>$from_multi3</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Fling to 5</td><td style='padding: 5px 5px 5px 5px;';>$to_multi3</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart 5</td><td style='padding: 5px 5px 5px 5px;';>$date_multi3</td></tr>";
}
if($from_multi4){
$message12.="<tr><td style='padding: 5px 5px 5px 5px;';>Flying From 6</td><td style='padding: 5px 5px 5px 5px;';>$from_multi4</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Fling to 6</td><td style='padding: 5px 5px 5px 5px;';>$to_multi4</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart 6</td><td style='padding: 5px 5px 5px 5px;';>$date_multi4</td></tr>";
}
if($from_multi5){
$message12.="<tr><td style='padding: 5px 5px 5px 5px;';>Flying From 7</td><td style='padding: 5px 5px 5px 5px;';>$from_multi5</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Fling to 7</td><td style='padding: 5px 5px 5px 5px;';>$to_multi5</td></tr>
<tr><td style='padding: 5px 5px 5px 5px;';>Depart 7</td><td style='padding: 5px 5px 5px 5px;';>$date_multi5</td></tr>
"; }

// echo $message12;




 //$email_to = "adel.hany922@gmail.com";

$email_to = "Sumit.sonofgod@gmail.com";
$email_subject = "Email for: ".$name;

$headers = $headers = 'From: '.$email_to."\r\n".
       'BCC: '.$email_to_bcc."\r\n" .
       'X-Mailer: PHP/' . phpversion() . "\r\n" .
       "MIME-Version: 1.0\r\n" .
       "Content-Type: text/html; charset=utf-8\r\n" .
       "Content-Transfer-Encoding: 8bit\r\n\r\n";

if (mail($email_to, $email_subject, $message12, $headers)) {
  
   echo "<script>window.location='https://dealsflysky.com/thanku.html';</script>";alert('Your Query is send successfully!');
//   alert('Your Query is send successfully!');
}
else{
 echo "<script>window.location='https://dealsflysky.com/thanku.html';</script>";   
//  alert('Your Query is not send successfully!');
}
    
}

?>