<div id="bgpricelist">
	<div id="bopricelist" class="clearfix">
		<div id="pricelisttop">
			<?php
				include "../libs/functiondb.php";
				$keywords 	= mysqli_real_escape_string($koneksi, $_POST['keywords']);
				$caridb 	= mysqli_query($koneksi, "SELECT * FROM cmas_tujuan WHERE tujuan_nama LIKE '%$keywords%' OR bustype_nama LIKE '%$keywords%' ORDER BY tujuan_hari ASC");
				$caridt 	= mysqli_fetch_array($caridb);
				echo "<title>Hasil pencarian: $keywords</title>";
			?>
			<div class="pricelisttoptit">
				<h1>HASIL PENCARIAN</h1>
			</div>
			<div class="pricelisttopdes">
				<?php if (mysqli_num_rows($caridb) > 0) { ?>
					Hasil pencarian tujuan <b><?php echo $keywords; ?></b> ditemukan.
				<?php } else { ?>
					Maaf, hasil pencarian tujuan <b><?php echo $keywords; ?></b> tidak ditemukan. Silahkan coba dengan tujuan lain.
				<?php } ?>
			</div>
		</div>
		
		<div id="pricelistbot">
			<div id="priceres">
				<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="example">
					<thead>
						<tr>
							<th>NO</th>
							<th>TUJUAN</th>
						</tr>
					</thead>
					<tbody>
						<?php
							date_default_timezone_set("Asia/Jakarta");
							$today	= date("d-M-Y");
							$nomor = 1;
							$db = mysqli_query($koneksi, "SELECT * FROM cmas_tujuan WHERE tujuan_status='Aktif' AND tujuan_nama LIKE '%$keywords%' OR bustype_nama LIKE '%$keywords%' ORDER BY tujuan_hari ASC");
							while ($dt = mysqli_fetch_array($db)) {
							
						?>
							<tr valign="top">
								<td width="1%">
									<?php echo $nomor; ?>
								</td>
								<td>
									<?php echo $dt['tujuan_nama']; ?><br>
									<?php echo $dt['tujuan_hari']; ?> Hari<br>
									<?php echo $dt['bustype_nama']; ?><br>
									Rp. <?php echo number_format($dt['tujuan_harga'],0,',','.'); ?>
									<br>
									<br>
									<?php
										$bdb = mysqli_query($koneksi, "SELECT * FROM cmas_banner WHERE banner_id='109' AND banner_status='Aktif'");
										$bdt = mysqli_fetch_array($bdb);
										$banner_caption = $bdt['banner_url'];
									?>
									<a href="https://api.whatsapp.com/send?phone=<?php echo $banner_caption; ?>&text=Halo Bayu Berkah Trans, Saya mau booking bus pariwisata tipe: <?php echo $dt['bustype_nama']; ?>, Tujuan: <?php echo $dt['tujuan_nama']; ?> (<?php echo $dt['tujuan_hari']; ?> Hari), Tarif: Rp<?php echo number_format($dt['tujuan_harga'],0,",","."); ?>, Nama Lengkap: ____________________, Tanggal Pakai: <?php echo $today; ?>" target="_blank" class="wabutton">PESAN</a>
								</td>
							</tr>
						<?php $nomor++; } ?>
					</tbody>
				</table>
			</div>
		</div>
		
		<div id="pricelistfot">
			<?php
				include "../libs/functiondb.php";
				$bndb = mysqli_query($koneksi, "SELECT * FROM cmas_banner WHERE banner_id='76'"); 
				$bndt = mysqli_fetch_array($bndb);
			?>
			<div class="pricelisttoptit">
				<h2><?php echo $bndt['banner_judul']; ?></h2>
			</div>
			<div class="pricelisttopdes">
				<?php echo $bndt['banner_deskripsi']; ?>
			</div>
		</div>
		
		<div id="pricelistfot">
			<?php
				include "../libs/functiondb.php";
				$bndb = mysqli_query($koneksi, "SELECT * FROM cmas_banner WHERE banner_id='92'"); 
				$bndt = mysqli_fetch_array($bndb);
			?>
			<div class="pricelisttoptit">
				<h2><?php echo $bndt['banner_judul']; ?></h2>
			</div>
			<div class="pricelisttopdes">
				<?php echo $bndt['banner_deskripsi']; ?>
			</div>
		</div>
	</div>
</div>