<?php 
	session_start();
	include 'function_inc.php';
	Setting::current_lang();

	$lang = Setting::switch_lang($_SESSION['bigorange_lang']);
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Big Orange Hotel | Reservation Page</title>

		<!-- Bootstrap CSS -->
		<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css">
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="css/main.css">
		<link rel="stylesheet" type="text/css" href="plugins/cssmenu/styles.css">
		<link rel="stylesheet" type="text/css" href="plugins/bx-slider/jquery.bxslider.css">
		<link rel="stylesheet" type="text/css" href="plugins/colorbox/example1/colorbox.css">

		<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
			<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
			<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
		<div id="header">
			<div id="nav-background">
				<div class="container">
					<div id="cssmenu" class="pull-right col-md-12">
						<ul>
						   <li><a href="index.php"><?php echo $lang['Home'] ?></a></li>
						   <li><a href="room-type.php"><?php echo $lang['Room Type'] ?></a></li>
						   <li class="active"><a href="javascript:void(0)"><?php echo $lang['Reservation'] ?></a></li>
						   <li><a href="hotel-facilities.php"><?php echo $lang['Facilities'] ?></a></li>
						   <li><a href="wifi-cafe.php"><?php echo $lang['WiFi Cafe'] ?></a></li>
						   <li><a href="local-tourist-attraction.php"><?php echo $lang['Tourist Attraction'] ?></a></li>
						   <li><a href="photo-gallery.php"><?php echo $lang['Gallery'] ?></a></li>
						   <li><a href="news-update.php"><?php echo $lang['News/Update'] ?></a></li>
						   <li><a href="about-us.php"><?php echo $lang['Profile'] ?></a></li>
						   <li><a href="contact-us.php"><?php echo $lang['Contact'] ?></a></li>
						</ul>
					</div>
				</div>
			</div>
			<div class="container">
				<div id="language" class="pull-right">
					<a class="btn btn-warning btn-sm <?php echo Setting::current_lang_status('en') ? 'active':null; ?>" href="<?php echo Setting::base_url().'/reservation-form.php?lang=en' ?>"><font class="text-uppercase"><?php echo $lang['En'] ?></font></a>
					<a class="btn btn-warning btn-sm <?php echo Setting::current_lang_status('ch') ? 'active':null; ?>" href="<?php echo Setting::base_url().'/reservation-form.php?lang=ch' ?>"><font class="text-uppercase"><?php echo $lang['Ch'] ?></font></a>
					<a class="btn btn-warning btn-sm <?php echo Setting::current_lang_status('my') ? 'active':null; ?>" href="<?php echo Setting::base_url().'/reservation-form.php?lang=my' ?>"><font class="text-uppercase"><?php echo $lang['My'] ?></font></a>
				</div>
				<div class="logo">
					<a href="index.php">
						<img src="img/logo.png">
						<span class="company-name">Big Orange <font class="hotel">Hotel</font></span>
					</a>
				</div>
				<div class="social-icon">
					<ul>
						<li><a href="javascript:void(0)"><img src="img/social-icon/twitter.png"></a></li>
						<li><a target="_blank" href="https://www.facebook.com/pages/Big-Orange-Hotel/302680716601321"><img src="img/social-icon/facebook.png"></a></li>
						<li><a href="javascript:void(0)"><img src="img/social-icon/google.png"></a></li>
					</ul>
				</div>
				<hr class="hidden-xs">
			</div>
		</div>
		<div id="content">
			<div class="container">
				<hr class="visible-xs">
				<div id="reservation-form">
					<?php 
						if ($_POST) {
							//send email to account respond
								@session_start(); // start session if not started yet
								$to = 'info@bigorangehotel.com.my';

								$subject = 'Reservation Room(From Website)';

								$headers = "From: " . strip_tags($_POST['personal_email']) . "\r\n";
								$headers .= "Reply-To: ". strip_tags($_POST['personal_email']) . "\r\n";
								$headers .= "MIME-Version: 1.0\r\n";
								$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

								$message = '<html><body style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:14px; line-height:1.42857143">';
								$message .= '<table align="center" width="660px;" rules="all" style="border: 1px solid #d1d1d1;" cellpadding="0" border="0">';
								
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\" colspan=\"4\"><strong>Reservation Information:</strong> </td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>Check-in Date:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['reservation_date_in']) . "</td>
												<td style=\"border: 1px solid #d1d1d1;\"><strong>Check-out Date:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['reservation_date_out']) . "</td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>No. Of Room:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['reservation_no_of_room']) . "</td>
													<td style=\"border: 1px solid #d1d1d1;\"><strong>Room Type:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['reservation_room_type']) . "</td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>No. Of Adults:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['reservation_no_of_adult']) . "</td>
												<td style=\"border: 1px solid #d1d1d1;\"><strong>No. Of Childen:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['reservation_no_of_children']) . "</td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>Remark:</strong> </td><td style=\"border: 1px solid #d1d1d1;\" colspan=\"3\">" . strip_tags(nl2br($_POST['reservation_remark'])) . "</td></tr>";
								
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\" colspan=\"4\"><strong>Personal Information:</strong> </td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>Name:</strong> </td><td style=\"border: 1px solid #d1d1d1;\" colspan=\"3\">" . strip_tags($_POST['personal_name']) . "</td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>Email:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['personal_email']) . "</td>
												<td style=\"border: 1px solid #d1d1d1;\"><strong>Phone:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['personal_phone']) . "</td></tr>";

								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\" colspan=\"4\"><strong>Payment Information:</strong> </td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>Credit Card Type:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['credit_card_type']) . "</td>
												<td style=\"border: 1px solid #d1d1d1;\"><strong>Credit Card Number:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['credit_number']) . "</td></tr>";
								$message .= "<tr><td style=\"border: 1px solid #d1d1d1;\"><strong>Credit Card Expire:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['credit_expire_date']) . "</td>
												<td style=\"border: 1px solid #d1d1d1;\"><strong>Credit Card On Name:</strong> </td><td style=\"border: 1px solid #d1d1d1;\">" . strip_tags($_POST['credit_on_name']) . "</td></tr>";

								$message .= "</table>";
								$message .= "</body></html>";

							    mail($to, $subject, $message, $headers);

							    	echo "<div class=\"MarginT15 alert alert-success alert-dismissible\" role=\"alert\">
											<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>
											<strong>Success!</strong> You has successfully submit your request, we will contact you within 24hours.
										  </div>";
						}

							//end send email to account respond
					?>
					<form action="reservation-form.php" method="post" class="form-horizontal">
						<div class="row">
							<div class="col-md-12">
								<h5><?php echo $lang['Reservation Information'] ?> :-</h5>
								<hr>
								<div class="row">
									<div class="col-md-6">
										<div class="form-group">
											<label class="col-md-4 control-label"><?php echo $lang['Check-in'] ?> :</label>
											<div class="col-md-8">
												<input type="text" value="<?php echo date('d-m-Y') ?>" name="reservation_date_in" id="reservation_date_in" class="form-control" required>
											</div>
										</div>
									</div>
									<div class="col-md-6">
										<div class="form-group">
											<label class="col-md-4 control-label"><?php echo $lang['Check-out'] ?> :</label>
											<div class="col-md-8">
												<input type="text" value="<?php echo date('d-m-Y') ?>" name="reservation_date_out" id="reservation_date_out" class="form-control" required>
											</div>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-md-6">
										<div class="form-group">
											<label class="col-md-4 control-label"><?php echo $lang['No. Of Room'] ?> :</label>
											<div class="col-md-8">
												<select name="reservation_no_of_room" id="reservation_no_of_room" class="form-control" required>
													<option value="1">1</option>
													<option value="2">2</option>
													<option value="3">3</option>
													<option value="4">4</option>
													<option value="5">5</option>
													<option value="6">6</option>
													<option value="7">7</option>
													<option value="8">8</option>
													<option value="9">9</option>
													<option value="10>">10></option>
												</select>
											</div>
										</div>
									</div>
									<div class="col-md-6">
										<div class="form-group">
											<label class="col-md-4 control-label"><?php echo $lang['Room Type'] ?> :</label>
											<div class="col-md-8">
												<select name="reservation_room_type" id="reservation_room_type" class="form-control" required>
													<option <?php if(isset($_GET['reservation_room_type']) AND $_GET['reservation_room_type'] == 'deluxe-triple-bed-room')echo 'selected' ?> value="deluxe-triple-bed-room">Deluxe Triple Bed Room</option>
													<option <?php if(isset($_GET['reservation_room_type']) AND $_GET['reservation_room_type'] == 'premier-family-room')echo 'selected' ?> value="premier-family-room">Premier Family Room</option>
													<option <?php if(isset($_GET['reservation_room_type']) AND $_GET['reservation_room_type'] == 'single-bed-room')echo 'selected' ?> value="single-bed-room">Single Bed Room</option>
													<option <?php if(isset($_GET['reservation_room_type']) AND $_GET['reservation_room_type'] == 'double-bed-room')echo 'selected' ?> value="double-bed-room">Double Bed Room</option>
													<option <?php if(isset($_GET['reservation_room_type']) AND $_GET['reservation_room_type'] == 'twin-sharing-room')echo 'selected' ?> value="twin-sharing-room">Twin Sharing Room</option>
												</select>
											</div>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-md-6">
										<div class="form-group">
											<label class="col-md-4 control-label"><?php echo $lang['No. Of Adults'] ?> :</label>
											<div class="col-md-8">
												<select name="reservation_no_of_adult" id="reservation_no_of_adult" class="form-control" required>
													<option value="1">1</option>
													<option value="2">2</option>
													<option value="3">3</option>
													<option value="4">4</option>
													<option value="5">5</option>
													<option value="6">6</option>
													<option value="7">7</option>
													<option value="8">8</option>
													<option value="9">9</option>
													<option value="10>">10></option>
												</select>
											</div>
										</div>
									</div>
									<div class="col-md-6">
										<div class="form-group">
											<label class="col-md-4 control-label"><?php echo $lang['No. Of Children'] ?> :</label>
											<div class="col-md-8">
												<select name="reservation_no_of_children" id="reservation_no_of_children" class="form-control" required>
													<option value="1">1</option>
													<option value="2">2</option>
													<option value="3">3</option>
													<option value="4">4</option>
													<option value="5">5</option>
													<option value="6">6</option>
													<option value="7">7</option>
													<option value="8">8</option>
													<option value="9">9</option>
													<option value="10>">10></option>
												</select>
											</div>
										</div>
									</div>
								</div>
								<div class="row">
									<div class="col-md-12">
										<div class="form-group">
											<label class="col-md-2 control-label"><?php echo $lang['Remark'] ?> :</label>
											<div class="col-md-10">
												<textarea name="reservation_remark" id="reservation_remark" class="form-control" rows="7" placeholder="<?php echo $lang['remark_placeholder'] ?>"></textarea>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-md-6">
								<h5><?php echo $lang['Personal Information'] ?> :-</h5>
								<hr>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Name'] ?> :</label>
									<div class="col-md-8">
										<input type="text" name="personal_name" id="personal_name" class="form-control" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Email'] ?> :</label>
									<div class="col-md-8">
										<input type="text" name="personal_email" id="personal_email" class="form-control" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Phone'] ?> :</label>
									<div class="col-md-8">
										<input type="text" name="personal_phone" id="personal_phone" class="form-control">
									</div>
								</div>
							</div>
							<div class="col-md-6">
								<h5><?php echo $lang['Payment Information'] ?> :-</h5>
								<hr>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Card Type'] ?> :</label>
									<div class="col-md-8">
										<label class="radio-inline">
											<input type="radio" name="credit_card_type" id="visa" value="visa" checked> <?php echo $lang['Visa'] ?>
										</label>
										<label class="radio-inline">
											<input type="radio" name="credit_card_type" id="master" value="master"> <?php echo $lang['Master'] ?>
										</label>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Card Number'] ?> :</label>
									<div class="col-md-8">
										<input type="text" name="credit_number" id="credit_number" class="form-control" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Expire Date'] ?> :</label>
									<div class="col-md-8">
										<input type="text" name="credit_expire_date" id="credit_expire_date" class="form-control" required>
									</div>
								</div>
								<div class="form-group">
									<label class="col-md-4 control-label"><?php echo $lang['Name On Card'] ?> :</label>
									<div class="col-md-8">
										<input type="text" name="credit_on_name" id="credit_on_name" class="form-control" required>
									</div>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-md-offset-2 col-md-10 text-right">
								<button type="submit" class="btn btn-default"><?php echo $lang['Submit'] ?></button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div id="footer">
			<div class="container">
				<center>
					<h5>
						<?php echo $lang['footer_copyright'] ?>
					</h5>
				</center>
			</div>
		</div>

		<!-- Modal -->
		<div class="modal fade" id="ttx-notice" tabindex="-1" role="dialog" aria-labelledby="ttx-notice-label">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="ttx-notice-label">TTX Notice</h4>
		      </div>
		      <div class="modal-body">
		      	<p><b class="text-uppercase">TOURISM TAX</b> Effective 1 September 2017, the Federal Government has implemented the mandatory "Tourism Tax" of MYR10.00 per room, per night for all foreign passport holders.</p>
				<p>This amount is to be collected by the hotel on behalf of the government upon check out.</p>    
				<p>All Malaysian Nationals and Permanent Residents are exempted.</p>
				<p>Please be advised that Tourism Tax is not included in your total room cost and will be collected upon checkout.</p>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
		      </div>
		    </div>
		  </div>
		</div>

		<!-- jQuery -->
		<script src="//code.jquery.com/jquery.js"></script>
		<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
		<!-- Bootstrap JavaScript -->
		<script type="text/javascript" src="js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/main.js"></script>
		<script type="text/javascript" src="plugins/cssmenu/script.js"></script>
		<script type="text/javascript" src="plugins/bx-slider/jquery.bxslider.js"></script>
	    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
	    <script type="text/javascript" src="plugins/colorbox/jquery.colorbox.js"></script>
	    <script type="text/javascript" src="js/jquery.maskedinput.min.js"></script>
	    <script type="text/javascript">
	    	$(document).ready(function(){
		    	$("#ttx-notice").modal('show');
	    	});
	    </script>
	</body>
</html>