1736324018a:1:{s:29:"bali-tiket/booking-detail.htm";a:8:{s:8:"fileName";s:29:"bali-tiket/booking-detail.htm";s:7:"content";s:18088:"title = "Booking Page"
url = "/bali-tiket/booking-detail"
layout = "BaliTiket"
==

use Yuren\BaliTiket\Models\Vendor;
use Yuren\BaliTiket\Models\Product;
use Yuren\BaliTiket\Models\Ticket;
use Yuren\BaliTiket\Models\Bookings;

function onStart()
{
	//ambil hari ini dan besok
	$datenow = date('Y-m-d');
	$tommorrow = date('Y-m-d', strtotime('+1 day'));
	$this['datenow'] = $datenow;
	$this['tommorrow'] = $tommorrow;

	//cek input
	$id_ticket = Input::post('id');
	$this['id_ticket'] = $id_ticket;

	$slug = Input::post('slug');
	$this['slug'] = $slug;

	$arrival = Input::post('arrival');
	$this['arrival'] = $arrival;

	$adult = Input::post('adult');
	$this['adult'] = $adult;

	$children = Input::post('children');
	$this['children'] = $children;

	$infant = Input::post('infant');
	$this['infant'] = $infant;

	$adult_price = Input::post('adult_price');
	$this['adult_price'] = $adult_price;

	$children_price = Input::post('children_price');
	$this['children_price'] = $children_price;

	$infant_price = Input::post('infant_price');
	$this['infant_price'] = $infant_price;

	$total_adult_price = Input::post('total_adult_price');
	$this['total_adult_price'] = (int)$total_adult_price;

	$total_children_price = Input::post('total_children_price');
	$this['total_children_price'] = (int)$total_children_price;

	$total_infant_price = Input::post('total_infant_price');
	$this['total_infant_price'] = (int)$total_infant_price;

	$this['other_vendor'] = Vendor::orderBy('id','asc')->get();

	$this['vendor'] = Vendor::where('slug',$slug)->first();

	$this['ticket'] = Ticket::where('id',$id_ticket)->first();
}
==

<section>
	<div class="container">
		<div class="row g-0">
			<div class="col-md-12">
				<div class="ratio ratio-21x9">
					<img src="{{ other_vendor[0].images[0].path }}" class="w-100 h-100 object-fit-cover">
				</div>
			</div>
		</div>

		<div class="row g-0 px-3 py-2" style="background-color: whitesmoke; margin-top: -8px;">
			<!-- form booking widget -->
			<form class="col-md-8 row g-0 py-2 py-md-0" action="{{ url('bali-tiket/booking-page') }}" method="GET" enctype="multipart/form-data">
				<div class="col-md-10 row g-0">
					<div class="col-md-3 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Vendor</label>
						<select required class="form-control fs-small rounded-1 py-2" name="slug">
							{% if slug != null %}
							{% for post in other_vendor %}
							{% if post.slug == slug %}
							<option value="{{post.slug}}" selected>{{post.name}}</option>
							{% else %}
							<option value="{{post.slug}}">{{post.name}}</option>
							{% endif %}
							{% endfor %}

							{% else %}
							<option value="" selected disabled>Select Vendor</option>
							{% for post in other_vendor %}
							<option value="{{post.slug}}">{{post.name}}</option>
							{% endfor %}

							{% endif %}
						</select>
					</div>
					<div class="col-md-3 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Arrival</label>
						<input type="date" required class="form-control fs-small rounded-1 py-2" id="arrival" name="arrival" value="{{ (arrival != null) ? arrival : datenow }}">
					</div>
					<div class="col-md-2 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Adult</label>
						<input type="number" min="1" placeholder="Adult" value="{{ (adult != null) ? adult : '1' }}" class="form-control fs-small rounded-1 py-2" name="adult">
					</div>
					<div class="col-md-2 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Children</label>
						<input type="number" min="0" placeholder="Children" value="{{ (children != null) ? children : '0' }}" class="form-control fs-small rounded-1 py-2" name="children">
					</div>
					<div class="col-md-2 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Infant</label>
						<input type="number" min="0" placeholder="Infant" value="{{ (infant != null) ? infant : '0' }}" class="form-control fs-small rounded-1 py-2" name="infant">
					</div>
				</div>
				<div class="col-md-2 p-md-2 p-3 px-2 px-md-2">
					<label class="mb-1 fs-small d-none d-md-inline-block">&ensp;</label>
					<button type="submit" class="btn btn-primary rounded-1 fs-small w-100 py-2">Apply</button>
				</div>
			</form>
			<!-- end form booking widget -->
		</div>


		<div class="row g-0 py-4">
			
			<form action="{{url('bali_tiket/booking_process.php')}}" method="POST" enctype="multipart/form-data" class="col-md-9 p-2 row g-0 mb-3">
				<!-- detail information booking -->
				<div class="col-md-12">
					<p>
						<a role="button" onclick="window.history.back()" class="btn btn-success py-2 px-4"><i class="ri-arrow-left-line me-1"></i> Back To Selection</a>
					</p>
					<div class="card rounded-0 w-100 bg-light mb-3">
						<div class="card-body">
							<p class="fs-4 fw-bold mb-3">{{ticket.name}}</p>
							<div class="row g-0 fs-small">
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Date</label>
									<p class="mb-0 fs-small">{{ arrival|date('l, d M Y') }}</p>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Session Time</label>
									<p class="mb-0 fs-small">{{ ticket.start_time|date('H:i') }} - {{ ticket.end_time|date('H:i') }}</p>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Cancellation Policy</label>
									<p class="mb-0 fs-small">{{ ticket.cancellation }}</p>
								</div>
								<div class="col-md-6 px-md-3 mb-3">
									<label class="fw-bold mb-1">Inclusion :</label>
									<ul class="ps-3" style="columns:2">
										{% for list in ticket.inclusion %}
										<li>{{ list.item }}</li>
										{% endfor %}
									</ul>
								</div>
							</div>
						</div>
					</div>
					<div class="card rounded-0 w-100 bg-light">
						<div class="card-body">
							<p class="fw-bold mb-3">Guest Details</p>

							<!-- hidden input -->
							<input type="hidden" name="adult" min="1" value="{{ (adult != null) ? adult : '1' }}">
							<input type="hidden" name="children" min="1" value="{{ (children != null) ? children : '0' }}">
							<input type="hidden" name="infant" min="1" value="{{ (infant != null) ? infant : '0' }}">

							<input type="hidden" value="{{ ticket.id }}" name="id">
							<input type="hidden" value="{{ ticket.product_id }}" name="product_id">
							<input type="hidden" value="{{ ticket.vendor_id }}" name="vendor_id">

							<input type="hidden" value="{{ slug }}" name="slug">

							<input type="hidden" value="{{ arrival }}" name="arrival">

							<input type="hidden" value="{{ ticket.adult_price }}" name="adult_price">
							<input type="hidden" value="{{ ticket.children_price }}" name="children_price">
							<input type="hidden" value="{{ ticket.infant_price }}" name="infant_price">

							<input type="hidden" value="{{ total_adult_price }}" name="total_adult_price">
							<input type="hidden" value="{{ total_children_price }}" name="total_children_price">
							<input type="hidden" value="{{ total_infant_price }}" name="total_infant_price">
							<!-- ene hidden input -->

							<div class="row g-0 fs-small">
								<div class="col-md-4 pe-md-3 mb-3">
									<label class="fw-bold mb-1">Guest Name<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="guestname" required> 
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">First Name<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="firstname" required> 
								</div>
								<div class="col-md-4 ps-md-3 mb-3">
									<label class="fw-bold mb-1">Last Name<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="lastname" required>
								</div>
								<div class="col-md-4 pe-md-3 mb-3">
									<label class="fw-bold mb-1">Email<span class="text-danger">*</span></label>
									<input type="email" class="form-control fs-small" name="email" required>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Phone Number<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="phone" required>
								</div>
								<div class="col-md-4 ps-md-3 mb-3">
									<label class="fw-bold mb-1">Country<span class="text-danger">*</span></label>
									<select class="country-list form-control fs-small" required name="country" onchange="filterStates(this.value)">
										<option selected>Other</option>
									</select>
								</div>
								<div class="col-md-4 pe-md-3 mb-3">
									<label class="fw-bold mb-1">State</label>
									<select class="state-list form-control fs-small" name="state" onchange="filterCities(this.value)">
										<option selected>Other</option>
									</select>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">City</label>
									<select class="city-list form-control fs-small" name="city">
										<option selected>Other</option>
									</select>
								</div>
								<div class="col-md-4 ps-md-3 mb-3">
									<label class="fw-bold mb-1">Zip Code</label>
									<input type="text" class="form-control fs-small" name="zipcode">
								</div>
							</div>
							<!-- <div class="row g-0 fs-small">
								<div class="col-md-4 mb-4">
									<label class="fw-bold mb-1"></label>
									<select class="form-control" name="paymentmethod" required>
										<option selected disabled>SELECT PAYMENT METHOD</option>
										<option value="Credit Card">CREDIT CARD</option>
									</select>
								</div>
							</div> -->
							<p class="">
								Total Payment: 
								<b>IDR
									{% set total_price = total_adult_price + total_children_price + total_infant_price %} 
									{{ticket.priceFormat(total_price)}}
								</b>
								<input type="hidden" name="total_price" value="{{total_price}}">
							</p>
							
							<div class="row g-0 fs-small">
								<div class="col-md-12 mb-3 d-flex flex-row">
									<input type="checkbox" class="fs-small me-2" name="terms" required> <a role="button" data-bs-toggle="modal" data-bs-target="#DetailTerms-{{ticket.id}}" class="text-decoration-none fs-small">I have read and accepted the Terms and Conditions</a>

									<div class="modal fade" id="DetailTerms-{{ticket.id}}" tabindex="-1" aria-hidden="true">
										<div class="modal-dialog modal-dialog-centered">
											<div class="modal-content">
												<div class="modal-body">
													<p><b>Terms & Conditions</b><span class="float-end"><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></span></p>
													<hr class="my-3" />
													<div class="">
														{{ticket.terms|raw}}
													</div>
												</div>
											</div>
										</div>
									</div>

								</div>
								<div class="col-md-12 mb-3 d-flex flex-row">
									<div class="g-recaptcha" data-sitekey="6Lc_yPYpAAAAAO76MhG2JNaWwJiItJKN1T9qOdz1"></div>
								</div>

								<div class="col-md-12 mb-3 d-flex flex-row">
									<button type="submit" class="btn btn-primary py-2 px-4">Book Now</button>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- end detail information booking -->
			</form>

			<!-- right content -->
			<div class="col-md-3 p-2">
				<!-- booking summary -->
				<div class="card rounded-0 mb-4">
					<div class="p-3 text-white fw-bold fs-5" style="background-color: orange !important">Booking Summary</div>
					<div class="card-body p-3 fs-small">
						<div class="row g-0">
							<div class="col-md-12">
								<p class="mb-1 fw-bold">Date : </p>
								<p class="mb-3">{{arrival|date('l, d F Y')}}</p>
							</div>
							<div class="col-md-12 row g-0">
								{% if adult != '0' %}
								<div class="col-6 pe-1 mb-1">
									<p class="mb-0 ">Adult {{adult}} x IDR {{ticket.priceFormat(adult_price)}}</p>
								</div>
								<div class="col-6 ps-1 mb-1">
									<p class="mb-0 fw-bold text-end">IDR {{ticket.priceFormat(total_adult_price)}}</p>
								</div>
								{% endif %}

								{% if children != '0' %}
								<div class="col-6 pe-1 mb-1">
									<p class="mb-0 ">Children {{children}} x IDR {{ticket.priceFormat(children_price)}}</p>
								</div>
								<div class="col-6 ps-1 mb-1">
									<p class="mb-0 fw-bold text-end">IDR {{ticket.priceFormat(total_children_price)}}</p>
								</div>
								{% endif %}

								{% if infant != '0' %}
								<div class="col-6 pe-1 mb-1">
									<p class="mb-0 ">Infant {{infant}} x IDR {{ticket.priceFormat(infant_price)}}</p>
								</div>
								<div class="col-6 ps-1 mb-1">
									<p class="mb-0 fw-bold text-end">IDR {{ticket.priceFormat(total_infant_price)}}</p>
								</div>
								{% endif %}
							</div>
							<!-- <div class="border-top border-1 border-bottom py-2 my-1 col-md-12 row g-0">
								<div class="col-6 pe-1">
									<p class="fw-bold mb-0">Room Charges</p>
								</div>
								<div class="col-6 ps-1">
									<p class="text-end mb-0">IDR {{accommodation.priceFormat(price)}}</p>
								</div>
							</div> -->
							<div class="col-md-12 row g-0 fs-6 align-items-center border-top border-1 mt-2 pt-2" style="color:orange">
								<div class="col-6 pe-1">
									<p class="fw-bold mb-0">Grand Total</p>
								</div>
								<div class="col-6 ps-1">
									<p class="text-end mb-0 fs-small fw-bold">
										{% set total_price = total_adult_price + total_children_price + total_infant_price %}
										IDR {{ticket.priceFormat(total_price)}}
									</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- end booking summary -->

				<!-- contact & location -->
				{#% partial 'bali-tiket/contact-card' %#}
				<!-- end contact & location -->
			</div>
			<!-- end right content -->
		</div>
	</div>
</section>

{% put styles %}
<style type="text/css">
	.fs-small{
		font-size: 12px!important;
	}
	.line-title{
		position: relative;
		z-index: 1;
	}
	.line-title:before{
		position: absolute;
		content: "";
		top: 50%;
		margin: 0 auto;
		width: 100%;
		border-top: 2px solid grey;
		left: 0;
	}
	.line-title span{
		padding: 0 15px;
		background: #fff;
		position: relative;
	}
	.text-truncate-4{
		display: -webkit-box;
		-webkit-line-clamp: 4;
		-webkit-box-orient: vertical;  
		overflow: hidden;
	}
	.list-facilities ul{
		padding-left: 1rem;
		columns: 2;
	}
</style>
{% endput %}


{% put scripts %}

<!-- flatpickr -->
<script type="text/javascript">
	$("#arrival").flatpickr({
		enableTime: false,
		dateFormat: "Y-m-d",
		minDate: "today",
	});
	$("#arrival-2").flatpickr({
		enableTime: false,
		dateFormat: "Y-m-d",
		minDate: "today",
	});
</script>

<!-- country js -->
<script src="https://unpkg.com/lokijs@^1.5/build/lokijs.min.js"></script>

<script type="text/javascript">
	var db = new loki('csc.db');

	const countriesJSON = 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/countries.json';
	const statesJSON = 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/states.json';
	const citiesJSON = 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/cities.json';

	async function initializeData() {
		var countries = db.getCollection("countries");
		if (!countries) {
			countries = db.addCollection('countries');
			await fetch(countriesJSON)
			.then(response => response.json())
			.then(async (data) => {
				await data.forEach((c) => {
					countries.insert(c);
					$('.country-list').append(`
						<option value="${c.name}">${c.name}</option>
						`);
				});
			});
		}

		var states = db.getCollection("states");
		if (!states) {
			states = db.addCollection('states');
			await fetch(statesJSON)
			.then(response => response.json())
			.then(async (data) => {
				await data.forEach((d) => {
					states.insert(d);
				});
			});
		}

		var cities = db.getCollection("cities");
		if (!cities) {
			cities = db.addCollection('cities');
			await fetch(citiesJSON)
			.then(response => response.json())
			.then(async (data) => {
				await data.forEach((d) => {
					cities.insert(d);
				});
			});
		}
	}

	initializeData();

	async function filterStates($cname = null) {
		let statesColl = db.getCollection("states");
		let states = await statesColl.find({ country_name: $cname });
		let $states = $('.state-list');
		$states.html('');
		$('.city-list').html('');
		if (states.length) {
			await states.forEach((s) => {
				$states.append(`
					<option value="${s.name}">${s.name}</option>
					`);
			});
		} else {
			$states.append(`
				<option>Not Found</option>
				`);
		}
	}

	async function filterCities($sname = null) {
		let citiesColl = db.getCollection("cities");
		let cities = await citiesColl.find({ state_name: $sname });
		let $cities = $('.city-list');
		$cities.html('');
		if (cities.length) {
			await cities.forEach((c) => {
				$cities.append(`
					<option value="${c.name}">${c.name}</option>
					`);
			});
		} else {
			$cities.append(`
				<tr>
				<td class="border px-4 py-2">
				No Cities Found.
				</td>
				</tr>
				`);
		}
	}
</script>

<!-- slider js -->
<script type="text/javascript">
	$('.main-slider').slick({
		slidesToShow: 1,
		slidesToScroll: 1,
		autoplay: true,
		autoplaySpeed: 2000,
		fade: false,
		arrows: false,
	});
</script>
{% endput %}";s:5:"mtime";i:1718182779;s:6:"markup";s:16408:"<section>
	<div class="container">
		<div class="row g-0">
			<div class="col-md-12">
				<div class="ratio ratio-21x9">
					<img src="{{ other_vendor[0].images[0].path }}" class="w-100 h-100 object-fit-cover">
				</div>
			</div>
		</div>

		<div class="row g-0 px-3 py-2" style="background-color: whitesmoke; margin-top: -8px;">
			<!-- form booking widget -->
			<form class="col-md-8 row g-0 py-2 py-md-0" action="{{ url('bali-tiket/booking-page') }}" method="GET" enctype="multipart/form-data">
				<div class="col-md-10 row g-0">
					<div class="col-md-3 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Vendor</label>
						<select required class="form-control fs-small rounded-1 py-2" name="slug">
							{% if slug != null %}
							{% for post in other_vendor %}
							{% if post.slug == slug %}
							<option value="{{post.slug}}" selected>{{post.name}}</option>
							{% else %}
							<option value="{{post.slug}}">{{post.name}}</option>
							{% endif %}
							{% endfor %}

							{% else %}
							<option value="" selected disabled>Select Vendor</option>
							{% for post in other_vendor %}
							<option value="{{post.slug}}">{{post.name}}</option>
							{% endfor %}

							{% endif %}
						</select>
					</div>
					<div class="col-md-3 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Arrival</label>
						<input type="date" required class="form-control fs-small rounded-1 py-2" id="arrival" name="arrival" value="{{ (arrival != null) ? arrival : datenow }}">
					</div>
					<div class="col-md-2 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Adult</label>
						<input type="number" min="1" placeholder="Adult" value="{{ (adult != null) ? adult : '1' }}" class="form-control fs-small rounded-1 py-2" name="adult">
					</div>
					<div class="col-md-2 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Children</label>
						<input type="number" min="0" placeholder="Children" value="{{ (children != null) ? children : '0' }}" class="form-control fs-small rounded-1 py-2" name="children">
					</div>
					<div class="col-md-2 col-6 py-1 p-md-2 px-2">
						<label class="mb-1 fw-bold fs-small">Infant</label>
						<input type="number" min="0" placeholder="Infant" value="{{ (infant != null) ? infant : '0' }}" class="form-control fs-small rounded-1 py-2" name="infant">
					</div>
				</div>
				<div class="col-md-2 p-md-2 p-3 px-2 px-md-2">
					<label class="mb-1 fs-small d-none d-md-inline-block">&ensp;</label>
					<button type="submit" class="btn btn-primary rounded-1 fs-small w-100 py-2">Apply</button>
				</div>
			</form>
			<!-- end form booking widget -->
		</div>


		<div class="row g-0 py-4">
			
			<form action="{{url('bali_tiket/booking_process.php')}}" method="POST" enctype="multipart/form-data" class="col-md-9 p-2 row g-0 mb-3">
				<!-- detail information booking -->
				<div class="col-md-12">
					<p>
						<a role="button" onclick="window.history.back()" class="btn btn-success py-2 px-4"><i class="ri-arrow-left-line me-1"></i> Back To Selection</a>
					</p>
					<div class="card rounded-0 w-100 bg-light mb-3">
						<div class="card-body">
							<p class="fs-4 fw-bold mb-3">{{ticket.name}}</p>
							<div class="row g-0 fs-small">
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Date</label>
									<p class="mb-0 fs-small">{{ arrival|date('l, d M Y') }}</p>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Session Time</label>
									<p class="mb-0 fs-small">{{ ticket.start_time|date('H:i') }} - {{ ticket.end_time|date('H:i') }}</p>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Cancellation Policy</label>
									<p class="mb-0 fs-small">{{ ticket.cancellation }}</p>
								</div>
								<div class="col-md-6 px-md-3 mb-3">
									<label class="fw-bold mb-1">Inclusion :</label>
									<ul class="ps-3" style="columns:2">
										{% for list in ticket.inclusion %}
										<li>{{ list.item }}</li>
										{% endfor %}
									</ul>
								</div>
							</div>
						</div>
					</div>
					<div class="card rounded-0 w-100 bg-light">
						<div class="card-body">
							<p class="fw-bold mb-3">Guest Details</p>

							<!-- hidden input -->
							<input type="hidden" name="adult" min="1" value="{{ (adult != null) ? adult : '1' }}">
							<input type="hidden" name="children" min="1" value="{{ (children != null) ? children : '0' }}">
							<input type="hidden" name="infant" min="1" value="{{ (infant != null) ? infant : '0' }}">

							<input type="hidden" value="{{ ticket.id }}" name="id">
							<input type="hidden" value="{{ ticket.product_id }}" name="product_id">
							<input type="hidden" value="{{ ticket.vendor_id }}" name="vendor_id">

							<input type="hidden" value="{{ slug }}" name="slug">

							<input type="hidden" value="{{ arrival }}" name="arrival">

							<input type="hidden" value="{{ ticket.adult_price }}" name="adult_price">
							<input type="hidden" value="{{ ticket.children_price }}" name="children_price">
							<input type="hidden" value="{{ ticket.infant_price }}" name="infant_price">

							<input type="hidden" value="{{ total_adult_price }}" name="total_adult_price">
							<input type="hidden" value="{{ total_children_price }}" name="total_children_price">
							<input type="hidden" value="{{ total_infant_price }}" name="total_infant_price">
							<!-- ene hidden input -->

							<div class="row g-0 fs-small">
								<div class="col-md-4 pe-md-3 mb-3">
									<label class="fw-bold mb-1">Guest Name<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="guestname" required> 
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">First Name<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="firstname" required> 
								</div>
								<div class="col-md-4 ps-md-3 mb-3">
									<label class="fw-bold mb-1">Last Name<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="lastname" required>
								</div>
								<div class="col-md-4 pe-md-3 mb-3">
									<label class="fw-bold mb-1">Email<span class="text-danger">*</span></label>
									<input type="email" class="form-control fs-small" name="email" required>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">Phone Number<span class="text-danger">*</span></label>
									<input type="text" class="form-control fs-small" name="phone" required>
								</div>
								<div class="col-md-4 ps-md-3 mb-3">
									<label class="fw-bold mb-1">Country<span class="text-danger">*</span></label>
									<select class="country-list form-control fs-small" required name="country" onchange="filterStates(this.value)">
										<option selected>Other</option>
									</select>
								</div>
								<div class="col-md-4 pe-md-3 mb-3">
									<label class="fw-bold mb-1">State</label>
									<select class="state-list form-control fs-small" name="state" onchange="filterCities(this.value)">
										<option selected>Other</option>
									</select>
								</div>
								<div class="col-md-4 px-md-3 mb-3">
									<label class="fw-bold mb-1">City</label>
									<select class="city-list form-control fs-small" name="city">
										<option selected>Other</option>
									</select>
								</div>
								<div class="col-md-4 ps-md-3 mb-3">
									<label class="fw-bold mb-1">Zip Code</label>
									<input type="text" class="form-control fs-small" name="zipcode">
								</div>
							</div>
							<!-- <div class="row g-0 fs-small">
								<div class="col-md-4 mb-4">
									<label class="fw-bold mb-1"></label>
									<select class="form-control" name="paymentmethod" required>
										<option selected disabled>SELECT PAYMENT METHOD</option>
										<option value="Credit Card">CREDIT CARD</option>
									</select>
								</div>
							</div> -->
							<p class="">
								Total Payment: 
								<b>IDR
									{% set total_price = total_adult_price + total_children_price + total_infant_price %} 
									{{ticket.priceFormat(total_price)}}
								</b>
								<input type="hidden" name="total_price" value="{{total_price}}">
							</p>
							
							<div class="row g-0 fs-small">
								<div class="col-md-12 mb-3 d-flex flex-row">
									<input type="checkbox" class="fs-small me-2" name="terms" required> <a role="button" data-bs-toggle="modal" data-bs-target="#DetailTerms-{{ticket.id}}" class="text-decoration-none fs-small">I have read and accepted the Terms and Conditions</a>

									<div class="modal fade" id="DetailTerms-{{ticket.id}}" tabindex="-1" aria-hidden="true">
										<div class="modal-dialog modal-dialog-centered">
											<div class="modal-content">
												<div class="modal-body">
													<p><b>Terms & Conditions</b><span class="float-end"><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></span></p>
													<hr class="my-3" />
													<div class="">
														{{ticket.terms|raw}}
													</div>
												</div>
											</div>
										</div>
									</div>

								</div>
								<div class="col-md-12 mb-3 d-flex flex-row">
									<div class="g-recaptcha" data-sitekey="6Lc_yPYpAAAAAO76MhG2JNaWwJiItJKN1T9qOdz1"></div>
								</div>

								<div class="col-md-12 mb-3 d-flex flex-row">
									<button type="submit" class="btn btn-primary py-2 px-4">Book Now</button>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- end detail information booking -->
			</form>

			<!-- right content -->
			<div class="col-md-3 p-2">
				<!-- booking summary -->
				<div class="card rounded-0 mb-4">
					<div class="p-3 text-white fw-bold fs-5" style="background-color: orange !important">Booking Summary</div>
					<div class="card-body p-3 fs-small">
						<div class="row g-0">
							<div class="col-md-12">
								<p class="mb-1 fw-bold">Date : </p>
								<p class="mb-3">{{arrival|date('l, d F Y')}}</p>
							</div>
							<div class="col-md-12 row g-0">
								{% if adult != '0' %}
								<div class="col-6 pe-1 mb-1">
									<p class="mb-0 ">Adult {{adult}} x IDR {{ticket.priceFormat(adult_price)}}</p>
								</div>
								<div class="col-6 ps-1 mb-1">
									<p class="mb-0 fw-bold text-end">IDR {{ticket.priceFormat(total_adult_price)}}</p>
								</div>
								{% endif %}

								{% if children != '0' %}
								<div class="col-6 pe-1 mb-1">
									<p class="mb-0 ">Children {{children}} x IDR {{ticket.priceFormat(children_price)}}</p>
								</div>
								<div class="col-6 ps-1 mb-1">
									<p class="mb-0 fw-bold text-end">IDR {{ticket.priceFormat(total_children_price)}}</p>
								</div>
								{% endif %}

								{% if infant != '0' %}
								<div class="col-6 pe-1 mb-1">
									<p class="mb-0 ">Infant {{infant}} x IDR {{ticket.priceFormat(infant_price)}}</p>
								</div>
								<div class="col-6 ps-1 mb-1">
									<p class="mb-0 fw-bold text-end">IDR {{ticket.priceFormat(total_infant_price)}}</p>
								</div>
								{% endif %}
							</div>
							<!-- <div class="border-top border-1 border-bottom py-2 my-1 col-md-12 row g-0">
								<div class="col-6 pe-1">
									<p class="fw-bold mb-0">Room Charges</p>
								</div>
								<div class="col-6 ps-1">
									<p class="text-end mb-0">IDR {{accommodation.priceFormat(price)}}</p>
								</div>
							</div> -->
							<div class="col-md-12 row g-0 fs-6 align-items-center border-top border-1 mt-2 pt-2" style="color:orange">
								<div class="col-6 pe-1">
									<p class="fw-bold mb-0">Grand Total</p>
								</div>
								<div class="col-6 ps-1">
									<p class="text-end mb-0 fs-small fw-bold">
										{% set total_price = total_adult_price + total_children_price + total_infant_price %}
										IDR {{ticket.priceFormat(total_price)}}
									</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- end booking summary -->

				<!-- contact & location -->
				{#% partial 'bali-tiket/contact-card' %#}
				<!-- end contact & location -->
			</div>
			<!-- end right content -->
		</div>
	</div>
</section>

{% put styles %}
<style type="text/css">
	.fs-small{
		font-size: 12px!important;
	}
	.line-title{
		position: relative;
		z-index: 1;
	}
	.line-title:before{
		position: absolute;
		content: "";
		top: 50%;
		margin: 0 auto;
		width: 100%;
		border-top: 2px solid grey;
		left: 0;
	}
	.line-title span{
		padding: 0 15px;
		background: #fff;
		position: relative;
	}
	.text-truncate-4{
		display: -webkit-box;
		-webkit-line-clamp: 4;
		-webkit-box-orient: vertical;  
		overflow: hidden;
	}
	.list-facilities ul{
		padding-left: 1rem;
		columns: 2;
	}
</style>
{% endput %}


{% put scripts %}

<!-- flatpickr -->
<script type="text/javascript">
	$("#arrival").flatpickr({
		enableTime: false,
		dateFormat: "Y-m-d",
		minDate: "today",
	});
	$("#arrival-2").flatpickr({
		enableTime: false,
		dateFormat: "Y-m-d",
		minDate: "today",
	});
</script>

<!-- country js -->
<script src="https://unpkg.com/lokijs@^1.5/build/lokijs.min.js"></script>

<script type="text/javascript">
	var db = new loki('csc.db');

	const countriesJSON = 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/countries.json';
	const statesJSON = 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/states.json';
	const citiesJSON = 'https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/cities.json';

	async function initializeData() {
		var countries = db.getCollection("countries");
		if (!countries) {
			countries = db.addCollection('countries');
			await fetch(countriesJSON)
			.then(response => response.json())
			.then(async (data) => {
				await data.forEach((c) => {
					countries.insert(c);
					$('.country-list').append(`
						<option value="${c.name}">${c.name}</option>
						`);
				});
			});
		}

		var states = db.getCollection("states");
		if (!states) {
			states = db.addCollection('states');
			await fetch(statesJSON)
			.then(response => response.json())
			.then(async (data) => {
				await data.forEach((d) => {
					states.insert(d);
				});
			});
		}

		var cities = db.getCollection("cities");
		if (!cities) {
			cities = db.addCollection('cities');
			await fetch(citiesJSON)
			.then(response => response.json())
			.then(async (data) => {
				await data.forEach((d) => {
					cities.insert(d);
				});
			});
		}
	}

	initializeData();

	async function filterStates($cname = null) {
		let statesColl = db.getCollection("states");
		let states = await statesColl.find({ country_name: $cname });
		let $states = $('.state-list');
		$states.html('');
		$('.city-list').html('');
		if (states.length) {
			await states.forEach((s) => {
				$states.append(`
					<option value="${s.name}">${s.name}</option>
					`);
			});
		} else {
			$states.append(`
				<option>Not Found</option>
				`);
		}
	}

	async function filterCities($sname = null) {
		let citiesColl = db.getCollection("cities");
		let cities = await citiesColl.find({ state_name: $sname });
		let $cities = $('.city-list');
		$cities.html('');
		if (cities.length) {
			await cities.forEach((c) => {
				$cities.append(`
					<option value="${c.name}">${c.name}</option>
					`);
			});
		} else {
			$cities.append(`
				<tr>
				<td class="border px-4 py-2">
				No Cities Found.
				</td>
				</tr>
				`);
		}
	}
</script>

<!-- slider js -->
<script type="text/javascript">
	$('.main-slider').slick({
		slidesToShow: 1,
		slidesToScroll: 1,
		autoplay: true,
		autoplaySpeed: 2000,
		fade: false,
		arrows: false,
	});
</script>
{% endput %}";s:4:"code";s:1584:"use Yuren\BaliTiket\Models\Vendor;
use Yuren\BaliTiket\Models\Product;
use Yuren\BaliTiket\Models\Ticket;
use Yuren\BaliTiket\Models\Bookings;

function onStart()
{
	//ambil hari ini dan besok
	$datenow = date('Y-m-d');
	$tommorrow = date('Y-m-d', strtotime('+1 day'));
	$this['datenow'] = $datenow;
	$this['tommorrow'] = $tommorrow;

	//cek input
	$id_ticket = Input::post('id');
	$this['id_ticket'] = $id_ticket;

	$slug = Input::post('slug');
	$this['slug'] = $slug;

	$arrival = Input::post('arrival');
	$this['arrival'] = $arrival;

	$adult = Input::post('adult');
	$this['adult'] = $adult;

	$children = Input::post('children');
	$this['children'] = $children;

	$infant = Input::post('infant');
	$this['infant'] = $infant;

	$adult_price = Input::post('adult_price');
	$this['adult_price'] = $adult_price;

	$children_price = Input::post('children_price');
	$this['children_price'] = $children_price;

	$infant_price = Input::post('infant_price');
	$this['infant_price'] = $infant_price;

	$total_adult_price = Input::post('total_adult_price');
	$this['total_adult_price'] = (int)$total_adult_price;

	$total_children_price = Input::post('total_children_price');
	$this['total_children_price'] = (int)$total_children_price;

	$total_infant_price = Input::post('total_infant_price');
	$this['total_infant_price'] = (int)$total_infant_price;

	$this['other_vendor'] = Vendor::orderBy('id','asc')->get();

	$this['vendor'] = Vendor::where('slug',$slug)->first();

	$this['ticket'] = Ticket::where('id',$id_ticket)->first();
}";s:5:"title";s:12:"Booking Page";s:3:"url";s:26:"/bali-tiket/booking-detail";s:6:"layout";s:9:"BaliTiket";}}