<?php
include ("config.php");

$salutation 	= $_POST['salutation'];
$first_name 	= $_POST['first_name'];
$last_name 		= $_POST['last_name'];
$telephone 		= $_POST['telephone'];
$email 			= $_POST['email'];
$country 		= $_POST['country'];
$enquiry_type 	= $_POST['enquiry_type'];
$enquiry 		= $_POST['enquiry'];
$source 		= $_POST['source'];
$applicants 	= $_POST['applicants'];
$academic_year 	= $_POST['academic_year'];

$day1 			= $_POST['day1'];
$month1 		= $_POST['month1'];
$year1 			= $_POST['year1'];

$day2 			= $_POST['day2'];
$month2 		= $_POST['month2'];
$year2 			= $_POST['year2'];

$day3 			= $_POST['day3'];
$month3 		= $_POST['month3'];
$year3 			= $_POST['year3'];

$day4 			= $_POST['day4'];
$month4 		= $_POST['month4'];
$year4 			= $_POST['year4'];

$from = $email;
$Subject = "KIS International - Contact Page";


/**/
if($enquiry_type == 'Admissions')
{
	$TO = "psanti@anet.net.th,pitchayat@anet.net.th";
}
else if($enquiry_type == 'Visit_Us')
{
	$TO = "psanti@anet.net.th,pitchayat@anet.net.th";
}
else if($enquiry_type == 'Employment')
{
	$TO = "psanti@anet.net.th,pitchayat@anet.net.th";
}
else if($enquiry_type == 'Other')
{
	$TO = "psanti@anet.net.th,pitchayat@anet.net.th";
}	
/**/




$headers = "MIME-Version: 1.0\r\n".
   "Content-type: text/html; charset=iso-8859-1\r\n".
   "From: <".$from.">\r\n";
   
$message = '
<html>
<body>
<br> 

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family: Arial, Helvetica, sans-serif;font-size: 12px;">
  <tr>
    <td width="24%">Salutation</td>
    <td width="1%">:</td>
    <td width="75%">'.$salutation.'</td>
  </tr>
  <tr>
    <td>First Name</td>
    <td>:</td>
    <td>'.$first_name.'</td>
  </tr>
  <tr>
    <td>Last Name</td>
    <td>:</td>
    <td>'.$last_name.'</td>
  </tr>
  <tr>
    <td>Telephone</td>
    <td>:</td>
    <td>'.$telephone.'</td>
  </tr>
  <tr>
    <td>Email</td>
    <td>:</td>
    <td>'.$email.'</td>
  </tr>
  <tr>
    <td>Country</td>
    <td>:</td>
    <td>'.$country.'</td>
  </tr>
  <tr>
    <td>Enquiry Type</td>
    <td>:</td>
    <td>'.$enquiry_type.'</td>
  </tr>
  <tr>
    <td>Enquiry</td>
    <td>:</td>
    <td>'.$enquiry.'</td>
  </tr>
  <tr>
    <td>How did you hear about KIS?</td>
    <td>:</td>
    <td>'.$source.'</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><strong>Applicants</strong></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Number of prospective applicants</td>
    <td>:</td>
    <td>'.$applicants.'</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><strong>Birthdate of applicants</strong></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Student 1</td>
    <td>:</td>
    <td>'.$day1.'-'.$month1.'-'.$year1.'</td>
  </tr>
  <tr>
    <td>Student 2</td>
    <td>:</td>
    <td>'.$day2.'-'.$month2.'-'.$year2.'</td>
  </tr>
  <tr>
    <td>Student 3</td>
    <td>:</td>
    <td>'.$day3.'-'.$month3.'-'.$year3.'</td>
  </tr>
  <tr>
    <td>Student 4</td>
    <td>:</td>
    <td>'.$day4.'-'.$month4.'-'.$year4.'</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Academic year considered</td>
    <td>:</td>
    <td>'.$academic_year.'</td>
  </tr>
</table>

</body>
</html>
';
mail($TO, $Subject, $message,$headers);
header ("location: contact_confirm.html");
?>