<title>Edit Bus</title>
<div id="pagetitle">EDIT BUS</div>
<div id="batascontent" class="clearfix">
	<form action="?m=bus_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);
		?>
		<input name="bus_id" type="hidden" value="<?php echo $dt['bus_id']; ?>">
		
		<div id="wrapgsetting" class="clearfix">
			<div id="gsettingleft">
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Nama</div>
					<div id="gsettingedit">
						<input name="bus_nama" type="text" value="<?php echo $dt['bus_nama']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Deskripsi Lengkap</div>
					<div id="gsettingedit">
						<textarea name="bus_desc" id="content2"><?php echo $dt['bus_desc']; ?></textarea>
						<script type="text/javascript">
							CKEDITOR_BASEPATH = 'ckeditor';
							var editor = CKEDITOR.replace('content2', {});
						</script>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Title</div>
					<div id="gsettingedit">
						<input name="bus_metatitle" type="text" value="<?php echo $dt['bus_metatitle']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Description</div>
					<div id="gsettingedit">
						<textarea name="bus_metadesc" type="text" value="<?php echo $dt['bus_metadesc']; ?>"><?php echo $dt['bus_metadesc']; ?></textarea>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Meta Keywords</div>
					<div id="gsettingedit">
						<textarea name="bus_metakey" type="text" value="<?php echo $dt['bus_metakey']; ?>"><?php echo $dt['bus_metakey']; ?></textarea>
					</div>
				</div>
			</div>
			<div id="gsettingrite">
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Status</div>
					<div id="gsettingedit">
						<select name="bus_status" required>
							<option value="<?php echo $dt['bus_status']; ?>"><?php echo $dt['bus_status']; ?></option>
							<?php $stdb=mysqli_query($koneksi, "SELECT * FROM cmas_status ORDER BY status_id ASC"); while($stdt=mysqli_fetch_array($stdb)) { ?>
								<option value="<?php echo $stdt['status_nama']; ?>"><?php echo $stdt['status_nama']; ?></option>
							<?php } ?>
						</select>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Fasilitas</div>
					<div id="gsettingedit">
						<textarea name="bus_sdesc" type="text" rows="5"><?php echo $dt['bus_sdesc']; ?></textarea>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Model</div>
					<div id="gsettingedit">
						<input name="bus_model" type="text" value="<?php echo $dt['bus_model']; ?>">
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel">Image</div>
					<div id="gsettinginput">
						<input type="file" name="bus_image" id="file"/>
					</div>
				</div>
				<div id="gsetting" class="clearfix">
					<div id="gsettinglabel"></div>
					<div id="gsettingimgbig">
						<img src="assets/images/bus/<?php echo $dt['bus_image']; ?>">
					</div>
				</div>
			</div>
		</div>	
		<div id="tombolsubmit">
			<a href="?m=bus_index"><input name="Button" type="button" value="KEMBALI" class="myButton"/></a>
			<input name="Submit" type="submit" value="SIMPAN" class="submitbutton" /> 
		</div>
	</form>
</div>
