<title>Tujuan</title>
<div id="pagetitle">TUJUAN</div>
<div id="bataspadding">
	<div id="tomboltambah">
		<?php
			$btdb = mysqli_query($koneksi, "SELECT * FROM cmas_bustype WHERE bustype_status='Aktif'");
			while($btdt = mysqli_fetch_array($btdb)) {
		?>
			<a href="?m=tujuan_indexkat&id=<?php echo $btdt['bustype_id']; ?>" class="addbutton"><?php echo $btdt['bustype_nama']; ?></a>
		<?php } ?>
	</div>
	<div id="tableres">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="example">
			<thead>
				<tr>
					<th>NO</th>
					<th></th>
					<th>TUJUAN</th>
					<th>JENIS</th>
					<th>HARI</th>
					<th>HARGA</th>
					<th></th>
				</tr>
			</thead>
			<?php
				$nomor = 1;
				$db = mysqli_query($koneksi, "SELECT * FROM cmas_tujuan WHERE tujuan_status='Aktif' ORDER BY tujuan_status ASC, bustype_id ASC");
				while($dt = mysqli_fetch_array($db)) {
				
				if ($dt['tujuan_status'] == "Non-Aktif") {
					$tujuan_status = "<img src='assets/images/icons/icon_no.png' width='15' alt='$dt[tujuan_status]' title='$dt[tujuan_status]'>";
				} else {
					$tujuan_status = "<img src='assets/images/icons/icon_yes.png' width='15' alt='$dt[tujuan_status]' title='$dt[tujuan_status]'>";
				}
			?>
				<tr>
					<td align="center" width="1%">
						<?php echo $nomor; ?>
					</td>
					<td align="center" width="1%">
						<?php echo $tujuan_status; ?>
					</td>
					<td>
						<a href="?m=tujuan_edit&id=<?php echo $dt['tujuan_id']; ?>">
							<?php echo $dt['tujuan_nama']; ?>
						</a>
					</td>
					<td align="center">
						<?php echo $dt['bustype_nama']; ?>
					</td>
					<td align="center">
						<?php echo $dt['tujuan_hari']; ?> Hari
					</td>
					<td align="right">
						Rp. <?php echo number_format($dt['tujuan_harga'],0,",","."); ?>
					</td>
					<td align="center" width="1%">
						<a href="?m=tujuan_hapus&id=<?php echo $dt['tujuan_id']; ?>" onclick="return confirm('DATA TUJUAN AKAN DIHAPUS, ANDA YAKIN?');">
							<img src="assets/images/icons/icon_delete.png" width="20">
						</a>
					</td>
				</tr>
			<?php $nomor++; } ?>
		</table>
	</div>
</div>