<?php
	include "../koneksi.php";
	$data = mysqli_query ($koneksi, " select
											deliverytbl.Del_ID,
											deliverytbl.DateKirim,
											detailekspedisi.DetailEkspedisi_ID,
											ekspedisi.EkspedisiID,
											ekspedisi.Ekspedisi,
											detailekspedisi.Sopir,
											deliverytbl.NoDN	
										  from 
										  deliverytbl
										  INNER JOIN detailekspedisi
										  ON deliverytbl.DetailEkspedisi_ID=detailekspedisi.DetailEkspedisi_ID
										  INNER JOIN ekspedisi
										  ON detailekspedisi.EkspedisiID=ekspedisi.EkspedisiID
										  where Del_ID = $_POST[id]");
	$row = mysqli_fetch_array ($data);
	
?>
<form role="form" id="form-edit" method="post" action="update.php">
<div class="form-group">
	<input type="hidden" name="del_id" value="<?php echo $row['Del_ID'] ; ?>">
	<label>Date Kirim</label>
	<input type="text" class="input-tanggal form-control" id="date_kirim" name="date_kirim" data-date-format="dd-mm-yy" placeholder="Masukkan Tanggal kirim.." value="<?php echo $row['DateKirim'] ; ?>" >
	<p style="color:red" id="error_edit_date_kirim"></p>
</div>
<div class="form-group">
	<label>Nama Sopir</label>
	<select class="form-control" id="detail_ekspedisi" name="detail_ekspedisi">
		<option value="<?php echo  $row['DetailEkspedisi_ID']; ?>" selected><?php echo $row['Ekspedisi']; ?>|<?php echo $row['Sopir']; ?></option>
		<?php 
		$data1 = 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
											order by DetailEkspedisi_ID DESC");
		while ($row1 = mysqli_fetch_array ($data1))
		{
		?>
		<option value="<?php echo  $row1['DetailEkspedisi_ID']; ?>"><?php echo $row1['Ekspedisi']; ?>|<?php echo $row1['Sopir']; ?></option>
		<?php } ?>
	</select>
	<p style="color:red" id="error_detail_ekspedisi"></p>
</div>
<div class="form-group">
	<label>Nomor DN</label>
	<input class="form-control" id="dn" name="dn" value="<?php echo $row['NoDN'] ; ?>">
	<p style="color:red" id="error_edit_dn"></p>
</div>			
</form>
