<html>
<script type="text/javascript">
	$(document).ready(function(e){
	
	$("#uploadForm").on('submit', (function(e){
		e.preventDefault();
		$.ajax({
			url	: "modul/inventory/simpan_upl.php",
			type 	: "POST",
			data 	: new FormData (this),
			contentType: false,
			cache: false,
			processData: false,
			success: function(data){
				$("#targetlayer").html(data);	
				},
				error: function(){
				}
			});			
		}));
	});	
</script>

<?php
	include "../../inc/inc.koneksi.php";
	$kodegr = $_POST['kode_gr'];
?>

<form style="background-color:skyblue" class="navbar-form" name="uploadForm" id="uploadForm" action="modul/inventory/simpan_upl.php" method="post" enctype="multipart/form-data">
	<input name='t_kodegr' type='text' value="<?php echo $kodegr; ?>" hidden />
	<fieldset>
		<legend style='font:16px arial'><b>Upload Foto</b></legend>
		<table>
			<tr>
				<td style='font:16px arial' >Nama Barang</td>
				<td>:</td>
				<td><select name='t_kodest' style='font:16px arial'>";
					<?php
						$query = mysql_query("SELECT * FROM stock WHERE kode_gr='$kodegr'");
						while($r=mysql_fetch_array($query)){
							echo "<option value='$r[kode_st]'>$r[kode_st] - $r[nama_st]</option>";
						}
						echo "</select>";
					?>
				</td>		
			</tr>
			<tr>
				<td style='font:16px arial'>Foto</td>
				<td>:</td>
				<td align='left' valign='middle'><input name='txt_foto' type='file' size='15' maxlength='15' style='font:16px arial' required='required' /></td>
			</tr>
			<tr>
				<b><td align='right' colspan='3'><input type='submit' name='rekam' value='Upload' class='btn btn-primary' /></td></b>
				<b><td><button type='reset' onclick='history.back()'>Kembali</button></td></b>
			</tr>
		</table>
	</fieldset>
</form>
</html>