<title>Input Photo</title>
<?php
	$sql = "SELECT armada_id,armada_nama FROM tbl_armada ORDER BY armada_id DESC";
	$getCombo = mysqli_query($koneksi, $sql,$koneksi) or die ('Query Gagal');
?>
<script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
		$("#ARID").change(function(){
			$("img#imgLoad").show();
			var armada_id = $(this).val();
			
			$.ajax({
				type: "POST",
				dataType: "html",
				url: "config/getArmada.php",
				data: "armada_id="+armada_id,
				success: function(msg){
					if(msg == ''){
						$("select#ARNAMA").html('<option value="">- Pilih -</option>');
						}else{
						$("select#ARNAMA").html(msg);                                                       
					}
					$("img#imgLoad").hide();
				}
			});                    
		});
	});
</script>
<div id="tampil_judul">INPUT PHOTO</div>
<div id="batas_padding">
	<form action="?m=busimg_simpan" method="post" enctype="multipart/form-data">
		<div id="wrapgsetting" class="clearfix">
			<div id="gsetting" class="clearfix" >
				<div id="gsettinglabel">Status</div>
				<div id="gsettingedit">
					<select name="busimg_status"> 
						<option value="Aktif">Aktif</option>
						<option value="Non-Aktif">Non-Aktif</option>
					</select>
				</div>
			</div>
			
			<div id="gsetting" class="clearfix" >
				<div id="gsettinglabel">Nama Armada</div>
				<div id="gsettingedit">
					<select name="armada_id" id="ARID">
						<option value="">- Pilih -</option>
						<?php
							while($data = mysqli_fetch_array($getCombo)){
								echo '<option value="'.$data['armada_id'].'">'.$data['armada_nama'].'</option>';
							}
						?>
					</select>
					<select name="armada_nama" id="ARNAMA" style="display:none">
						<option value="">- Pilih -</option>
					</select>
				</div>
			</div>
			<div id="gsetting" class="clearfix" >
				<div id="gsettinglabel">Upload Photo</div>
				<div id="gsettingedit">
					<input type="file" name="busimg_image" />
				</div>
			</div>
			<div id="input_text_Submit">
				<input name="Submit" type="submit" value="SIMPAN" class="submitbutton"/>
				<a href="?m=busimg_index">
					<input name="Button" type="button" value="BATAL" class="myButton" />
				</a>
			</div>
		</div>
	</form>
</div>