<?php
	include "../koneksi.php";
	
	$data = mysqli_query ($koneksi, " select 
											detailekspedisi.DetailEkspedisi_ID,
											ekspedisi.EkspedisiID,
											ekspedisi.Ekspedisi,
											detailekspedisi.Sopir,
											detailekspedisi.NoPolisi,
											detailekspedisi.NoHP
									  from 
									  detailekspedisi
									  INNER JOIN ekspedisi
									  ON detailekspedisi.EkspedisiID=ekspedisi.EkspedisiID
									  where DetailEkspedisi_ID = $_POST[id]");
	$row = mysqli_fetch_array ($data);
	
?>
<form role="form" id="form-edit" method="post" action="update.php">
<input type="hidden" name="detail_ekspedisi_id" value="<?php echo $row['DetailEkspedisi_ID'] ; ?>">
<div class="form-group">
	<label>Ekspedisi</label>
	<select class="form-control" id="ekspedisi_id" name="ekspedisi_id">
		<option value="<?php echo  $row['EkspedisiID']; ?>" selected><?php echo $row['Ekspedisi']; ?> </option>
		<?php 
		$data2 = mysqli_query ($koneksi, " select 
								EkspedisiID,
								Ekspedisi
								from 
								ekspedisi 
								order by EkspedisiID DESC");
		while ($row2 = mysqli_fetch_array ($data2))
		{
		?>
		<option value="<?php echo  $row2['EkspedisiID']; ?>"><?php echo $row2['Ekspedisi']; ?> </option>
		<?php } ?>
	</select>
	<p style="color:red" id="error_edit_ekspedisi_id"></p>
</div>
<div class="form-group">
	<label>Sopir</label>
	<input class="form-control" id="sopir" name="sopir" value="<?php echo $row['Sopir'] ; ?>">
	<p style="color:red" id="error_edit_sopir"></p>
</div>
<div class="form-group">
	<label>Nomor Polisi</label>
	<input class="form-control" id="nopol" name="nopol" value="<?php echo $row['NoPolisi'] ; ?>">
	<p style="color:red" id="error_edit_nopol"></p>
</div>
<div class="form-group">
	<label>No. HP</label>
	<input class="form-control" id="hp" name="hp" value="<?php echo $row['NoHP'] ; ?>">
	<p style="color:red" id="error_edit_hp"></p>
</div>			
	
</form>