<title>Input Header Bus</title>
<div id="pagetitle">INPUT HEADER BUS</div>
<div id="batascontent" class="clearfix">
	<form action="?m=bushead_update" method="post" enctype="multipart/form-data">
		<?php 
			$id = mysqli_real_escape_string($koneksi, $_GET['id']);
			$db = mysqli_query($koneksi, "SELECT * FROM cmas_bus WHERE bus_id='$id'");
			$dt = mysqli_fetch_array($db);
			
			if ($dt['bus_headerid'] == 0) {
				$bus_header = "<img src='assets/images/noimage.jpg' alt='$dt[bus_nama]' title='$dt[bus_nama]'>";
			} else {
				$bus_header = "<img src='assets/images/bus/head/$dt[bus_header]' alt='$dt[bus_nama]' title='$dt[bus_nama]'>";
			}
		?>
		<input name="bus_id" type="hidden" value="<?php echo $dt['bus_id']; ?>">
		
		<div id="wrapgsetting" class="clearfix">
			<div id="gsetting" class="clearfix">
				<div id="gsettinglabel">Judul</div>
				<div id="gsettinginput">
					<input name="bus_nama" type="hidden" value="<?php echo $dt['bus_nama']; ?>"><?php echo $dt['bus_nama']; ?>
				</div>
			</div>
			<?php if ($dt['bus_headerid'] == 0) { ?>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Upload Header</div>
					<div id="gsettinginput">
						<input name="bus_header" type="file" required />
					</div>
				</div>
			<?php } else { ?>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Header</div>
					<div id="gsettingimgbig">
						<?php echo $bus_header; ?>
						<br>
						<a href="?m=bushead_hapus&id=<?php echo $dt['bus_id']; ?>" onclick="return confirm('DATA AKAN DIHAPUS, ANDA YAKIN?');">
							<span><img src="assets/images/icons/icon_del.png" title="Hapus File"></span>
						</a>
					</div>
				</div>
			<?php } ?>
		</div>
		<div id="tombolsubmit">
			<a href="?m=bus_index&id=<?php echo $dt['bustype_id']; ?>"><input name="Button" type="button" value="KEMBALI" class="myButton"/></a>
			<input name="submit" type="submit" value="UPLOAD" class="submitbutton"/> 
		</div>
	</form>
	<div id="infobottom" class="clearfix">
		<div class="infobottomleft">
			Posted by <b><?php echo $dt['posted_nama']; ?></b> on <b><?php echo date_format(date_create($dt['postdated']), 'd/m/Y H:i:s'); ?></b>
		</div>
		<div class="infobottomrite">
			Updated by <b><?php echo $dt['updated_nama']; ?></b> on <b><?php echo date_format(date_create($dt['updated']), 'd/m/Y H:i:s'); ?></b>
		</div>
	</div>
</div>
