<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style type="text/css">
	#table1 tr td{
		padding-left:5px;
		padding-right:5px;	
	}
	#right{
		text-align:right;
		padding-right:5px;
	}
</style>
<body style="margin-left:40px; font-size:12px;">
<?php
	$id = $_GET['id'];
	include("config/connection.php");
	$sql ="select * from tb_jadwal  where Id_Jadwal = '".$id."'";
	$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
	mysql_close($test);
	
	$row = mysql_fetch_object($hasil);
		
		$Waktu = $row->Waktu;
		$tanggal = $row->tanggal;
		
			$day = date('D', strtotime($tanggal));
			$dayList = array(
				'Sun' => 'Minggu',
				'Mon' => 'Senin',
				'Tue' => 'Selasa',
				'Wed' => 'Rabu',
				'Thu' => 'Kamis',
				'Fri' => 'Jumat',
				'Sat' => 'Sabtu'
			);
			
			$tanggalnya = substr($tanggal, 8, 2);
			$bulanU = substr($tanggal, 5, 2);
			$tahun = substr($tanggal, 0, 4);
			
				if ($bulanU == '01'){
					$bulans = 'Januari';
				}elseif ($bulanU == '02'){ 
					$bulans = 'Februari';
				}elseif ($bulanU == '03'){
					$bulans = 'Maret';
				}elseif ($bulanU == '04'){
					$bulans = 'April';
				}elseif ($bulanU == '05'){
					$bulans	= 'Mei';
				}elseif ($bulanU == '06'){
					$bulans = 'Juni';	
				}elseif ($bulanU == '07'){
					$bulans = 'Juli';	
				}elseif ($bulanU == '08'){
					$bulans = 'Agustus';	
				}elseif ($bulanU == '09'){
					$bulans = 'September';	
				}elseif ($bulanU == '10'){
					$bulans = 'Oktober';
				}elseif ($bulanU == '11'){
					$bulans = 'November';
				}elseif ($bulanU == '12'){
					$bulans = 'Desember';	
				}
		
		
?>
<table width="100%" border="2" style="border-collapse:collapse">
  <tr>
    <td><div align="center"><strong>BERITA ACARA PERKAPALAN / TRIP</strong></div></td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Nama Kapal</td>
    <td>:</td>
    <td>Kmp. Nusa Jaya Abadi</td>
  </tr>
  <tr>
    <td>Hari/Tanggal</td>
    <td>:</td>
    <td><?php echo $dayList[$day]?>, <?php echo $tanggalnya." ".$bulans." ".$tahun?></td>
  </tr>
  <tr>
    <td>GT/Pukul</td>
    <td>:</td>
    <td>629 / <?php echo $Waktu ?> WITA</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="100%" border="1" style="border-collapse:collapse" id="table1">
  <tr>
    <td width="5%"><div align="center">NO</div></td>
    <td width="21%"><div align="center">JENIS TIKET</div></td>
    <td width="13%"><p align="center">TARIF (Rp)</p></td>
    <td width="15%"><div align="center">PRODUKSI</div></td>
    <td width="15%"><p align="center">PENDAPATAN (Rp)</p></td>
    <td width="15%"><p align="center">JUMLAH (Rp)</p></td>
    <td width="16%"><p align="center">TOTAL PENDAPATAN (Rp)</p></td>
  </tr>
  <tr>
    <td><div align="center">1</div></td>
    <td>PENUMPANG</td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 1 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah1 = $row->jumlah;
						$jumlahpendapatan1 = $jumlah1 * 27300;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Ekonomi Dewasa</td>
    <td><div align="right">27,300</div></td>
    <td><div align="right">
      <?php if($jumlah1>0){ echo number_format($jumlah1); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan1>0){ echo number_format($jumlahpendapatan1); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 2 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah2 = $row->jumlah;
						$jumlahpendapatan2 = $jumlah2 * 22300;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Ekonomi Anak</td>
    <td><div align="right">22,300</div></td>
    <td><div align="right">
      <?php if($jumlah2>0){ echo number_format($jumlah2); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan2>0){ echo number_format($jumlahpendapatan2); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right">
      <?php $totalpenumpang = $jumlahpendapatan1 + $jumlahpendapatan2; if($totalpenumpang>0){ echo number_format($totalpenumpang); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td><div align="center">2</div></td>
    <td>KENDARAAN</td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 3 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah3 = $row->jumlah;
						$jumlahpendapatan3 = $jumlah3 * 13650;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol I</td>
    <td><div align="right">13,650</div></td>
    <td><div align="right">
      <?php if($jumlah3>0){ echo number_format($jumlah3); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan3>0){ echo number_format($jumlahpendapatan3); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 4 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah4 = $row->jumlah;
						$jumlahpendapatan4 = $jumlah4 * 39000;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol II </td>
    <td><div align="right">39,000</div></td>
    <td><div align="right">
      <?php if($jumlah4>0){ echo number_format($jumlah4); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan4>0){ echo number_format($jumlahpendapatan4); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 5 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah5 = $row->jumlah;
						$jumlahpendapatan5 = $jumlah5 * 46500;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol III</td>
    <td><div align="right">46,500</div></td>
    <td><div align="right">
      <?php if($jumlah5>0){ echo number_format($jumlah5); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan5>0){ echo number_format($jumlahpendapatan5); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 6 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah6 = $row->jumlah;
						$jumlahpendapatan6 = $jumlah6 * 277800;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol IV Kend Pnp</td>
    <td><div align="right">277,800</div></td>
    <td><div align="right">
      <?php if($jumlah6>0){ echo number_format($jumlah6); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan6>0){ echo number_format($jumlahpendapatan6); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 7 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah7 = $row->jumlah;
						$jumlahpendapatan7 = $jumlah7 * 200200;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol IV Kend Brg</td>
    <td><div align="right">200,200</div></td>
    <td><div align="right">
      <?php if($jumlah7>0){ echo number_format($jumlah7); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan7>0){ echo number_format($jumlahpendapatan7); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 8 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah8 = $row->jumlah;
						$jumlahpendapatan8 = $jumlah8 * 468200;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol V Kend Pnp</td>
    <td><div align="right">468,200</div></td>
    <td><div align="right">
      <?php if($jumlah8>0){ echo number_format($jumlah8); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan8>0){ echo number_format($jumlahpendapatan8); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 9 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah9 = $row->jumlah;
						$jumlahpendapatan9 = $jumlah9 * 355300;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol V Kend Brg</td>
    <td><div align="right">355,300</div></td>
    <td><div align="right">
      <?php if($jumlah9>0){ echo number_format($jumlah9); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan9>0){ echo number_format($jumlahpendapatan9); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 10 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah10 = $row->jumlah;
						$jumlahpendapatan10 = $jumlah10 * 805200;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol VI Kend Pnp</td>
    <td><div align="right">805,200</div></td>
    <td><div align="right">
      <?php if($jumlah10>0){ echo number_format($jumlah10); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan10>0){ echo number_format($jumlahpendapatan10); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 11 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah11 = $row->jumlah;
						$jumlahpendapatan11 = $jumlah11 * 580000;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol VI Kend Pnp</td>
    <td><div align="right">580,000</div></td>
    <td><div align="right">
      <?php if($jumlah11>0){ echo number_format($jumlah11); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan11>0){ echo number_format($jumlahpendapatan11); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 12 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah12 = $row->jumlah;
						$jumlahpendapatan12 = $jumlah12 * 927750;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol VII</td>
    <td><div align="right">927,750</div></td>
    <td><div align="right">
      <?php if($jumlah12>0){ echo number_format($jumlah12); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan12>0){ echo number_format($jumlahpendapatan12); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
           <?php
					include("config/connection.php");
              		$sql ="select count(id_angkutan) as jumlah from tb_tiket where id_angkutan = 14 and id_jadwal = '".$id."'";
					$hasil = mysql_query($sql) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row = mysql_fetch_object($hasil);
					    
						$jumlah13 = $row->jumlah;
						$jumlahpendapatan13 = $jumlah13 * 1688900;
						
			?>
  <tr>
    <td>&nbsp;</td>
    <td>Gol VIII</td>
    <td><div align="right">1,688,900</div></td>
    <td><div align="right">
      <?php if($jumlah13>0){ echo number_format($jumlah13); }else{ echo "-";}?>
    </div></td>
    <td><div align="right">
      <?php if($jumlahpendapatan13>0){ echo number_format($jumlahpendapatan13); }else{ echo "-";}?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="right">
      <?php $totalkendaraan = $jumlahpendapatan3 + $jumlahpendapatan4 + $jumlahpendapatan5 + $jumlahpendapatan6 + $jumlahpendapatan7 + $jumlahpendapatan8 + $jumlahpendapatan9 + $jumlahpendapatan10 + $jumlahpendapatan11 + $jumlahpendapatan12 + $jumlahpendapatan13; echo number_format($totalkendaraan); ?>
    </div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="4">PENDAPATAN KOTOR</td>
    <td><div align="right"></div></td>
    <td><div align="right">
      <?php $pendapatankotor = $totalkendaraan + $totalpenumpang; echo number_format($pendapatankotor); ?>
    </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="4">JASA RAHARJA</td>
    <td>
    	<div align="right">
    	  <?php
        	$jasaraharja = ($jumlah1 * 800) + ($jumlah2 * 800) + ($jumlah3 * 1150) + ($jumlah4 * 1500) + ($jumlah5 * 2500) + ($jumlah6 * 6800) + ($jumlah7 * 4200) + ($jumlah8 * 20200) + ($jumlah9 * 7300) + ($jumlah10 * 36200) + ($jumlah11 * 11000) + ($jumlah12 * 12750) + ($jumlah13 * 13900);
			echo number_format($jasaraharja);
		?>
    </div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="4">&nbsp;</td>
    <td><div align="right"></div></td>
    <td><div align="right">
      <?php $totaljasa = $pendapatankotor - $jasaraharja; echo number_format($totaljasa); ?>
    </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="3">PAS MASUK</td>
    <td>
		<div align="right">
		  <?php
        	$pasmasuk = ($jumlah1 * 1500) + ($jumlah2 * 1500) + ($jumlah3 * 2500) + ($jumlah4 * 5000) + ($jumlah5 * 6000) + ($jumlah6 * 15000) + ($jumlah7 * 15000) + ($jumlah8 * 35000) + ($jumlah9 * 35000) + ($jumlah10 * 53000) + ($jumlah11 * 53000) + ($jumlah12 * 60000) + ($jumlah13 * 90000);
			echo number_format($pasmasuk);
		?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="3">JASA DERMAGA</td>
    <td>		
		<div align="right">
		  <?php
        	$jasadermaga = ($jumlah4 * 2500) + ($jumlah5 * 3000) + ($jumlah6 * 6000) + ($jumlah7 * 6000) + ($jumlah8 * 13000) + ($jumlah9 * 13000) + ($jumlah10 * 16000) + ($jumlah11 * 16000) + ($jumlah12 * 55000) + ($jumlah13 * 85000);
			echo number_format($jasadermaga);
		?>
    </div></td>
    <td><div align="right"></div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="right">
      <?php $totalpelabuhan = $pasmasuk + $jasadermaga; echo number_format($totalpelabuhan);?>
    </div></td>
    <td><div align="right"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="5">PENDAPATAN BERSIH / PELAYARAN</td>
    <td><div align="right">
      <?php $pendapatanbersih = $totaljasa - $totalpelabuhan; echo number_format($pendapatanbersih);?>
    </div></td>
  </tr>
</table>
<table border="0" width="100%">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Terbilang</td>
    <td style="border:1px solid #000; padding:10px"><div align="center"><em>
    	<?php
			include "terbilang.php";
			echo terbilang($pendapatanbersih, $style=3);
	 		echo " Rupiah";
		?>
    </em></div></td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td width="45%">&nbsp;</td>
    <td width="55%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">KEPALA UPT PELABUHAN</div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">PENYEBERANGAN NUSA PENIDA</div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center"></div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">I DEWA GEDE AGUS SWARMA HENDRA, S.Sos</div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center">NIP. 19601020 198903 1 006</div></td>
  </tr>
</table>
<p>&nbsp;</p>
<blockquote>&nbsp;</blockquote>
</body>
</html>