          
          <h1>LAPORAN DATA JADWAL KEBERANGKATAN</h1>
          <br>
          <table border="1" width="100%" style="border-collapse:collapse">
             <thead>
                <tr>
                    <th>No</th>
                    <th>Nama Kapal</th>
                    <th>Tanggal</th>
                    <th>Jam</th>
                    <th>Dari</th>
                    <th>Tujuan</th>
					<th>Kuota</th>
                    <th>Sisa Kursi</th>                    
                </tr>
            </thead>
            <tbody>
			<?php  
				    include("config/connection.php");
              		$sql ="select tb_jadwal.*, DATE_FORMAT(tb_jadwal.tanggal,'%d-%m-%Y') as tgl, tb_kapal.Nama as namakapal, tb_nahkoda.Nahkoda, pDari.Nama as dari, pTujuan.Nama as tujuan
							from tb_jadwal inner join tb_kapal on tb_jadwal.Id_Kapal = tb_kapal.Id_Kapal
							inner join tb_nahkoda on tb_jadwal.Id_Nahkoda = tb_nahkoda.Id_Nahkoda
							inner join tb_pelabuhan pDari on (pDari.Id_Pelabuhan = tb_jadwal.Dari)
							inner join tb_pelabuhan pTujuan on (pTujuan.Id_Pelabuhan = tb_jadwal.Tujuan) 
							where tb_jadwal.Status = '1' order by tb_jadwal.tanggal desc";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					while($row = mysql_fetch_object($hasil)){
						$id = $row->Id_Jadwal;
						$namakapal = $row->namakapal;
						$Nahkoda = $row->Nahkoda;
						$dari = $row->dari;
						$tujuan = $row->tujuan;
						$Kuota_Order = $row->Kuota_Order;
						$Sisa = $row->Sisa;
						$tanggal = $row->tgl;
						$Waktu = $row->Waktu;
						
			?>
            		<tr>
                    	<td><?php echo $id ?></td>
                        <td><?php echo $namakapal ?></td>
                        <td><?php echo $tanggal ?></td>
                        <td><?php echo $Waktu ?></td>
                        <td><?php echo $dari ?></td>
                        <td><?php echo $tujuan ?></td>
                        <td><?php echo $Kuota_Order ?></td>
                        <td><?php echo $Sisa ?></td>
                    </tr>
            <?php		
					}
			?>         
        	</tbody>
          </table>
