<?php 
	error_reporting(0);
	include "config/session.php"?>
<?php 
	ob_start();
	include"config/config-url.php";
	include"config/function.php";
?>
        <link href="<?php echo $base?>css/AdminLTE.css" rel="stylesheet" type="text/css" />
     <style type="text/css">
		@media print {
			 body {
			  -webkit-print-color-adjust: exact;
			  max-height:500px;
			}
			#warna{
			  -webkit-print-color-adjust: exact;
			}
			@page {
				size: 300px 442px; 
				margin:0px;
			  }
		}
#table1 {
  border-collapse: collapse;
  margin-left:5%;
  margin-right:5%;
}
#table1 td, table th {
  border: 1px solid black;
}
#table1 tr:first-child th {
  border-top: 0;
}
     </style>
<body style="background-color:#FFF; min-height:0px; margin:0px; font-family:'Times New Roman', Times, serif" >
           <?php
		include("config/session.php");
					include("config/connection.php");
		$sql ="select no_tiket from tb_pemesanan_detil where id_pemesanan = '".$_GET['id_pemesanan']."'";

		$hasil = mysql_query($sql) or die("Kesalahan Pada SQLii");
		mysql_close($test);
		
		while($row = mysql_fetch_object($hasil)){
				
			$notiket = $row->no_tiket;
					include("config/connection.php");
              		$sql2 ="	select tb_tiket.*, tb_angkutan.nama as angkutan from tb_tiket inner join 
							tb_angkutan on tb_angkutan.id_angkutan = tb_tiket.id_angkutan
							where tb_tiket.no_tiket = '".$notiket."' ";

					$hasil2 = mysql_query($sql2) or die("Kesalahan Pada SQL");
					mysql_close($test);
					
					$row2 = mysql_fetch_object($hasil2);
					    
						$idtiket = $row2->id;
						$id_jadwal = $row2->id_jadwal;
						$harga = $row2->harga;
						$namapenumpang = $row2->nama;
						$no_identitas = $row2->no_identitas;
						$tanggal = $row2->tanggal;
						$no_tiket = $row2->no_tiket;
						$id_angkutan = $row2->id_angkutan;
						$angkutan = $row2->angkutan;
						
						if($id_angkutan == 1 or $id_angkutan == 2){
							$jenisangkutan = 'Penumpang';	
						}else{
							$jenisangkutan = 'Kendaraan';	
						}

?>

<table width="100%" border="0">
  <tr>
    <td style="padding:10px; font-size:16px; border:1px solid black"><div align="center"><strong>ELEKTRONIK TIKET</strong></div></td>
  </tr>
  <tr>
    <td style="padding-top:5px; font-size:12px;"><div align="center">TIKET TERPADU</div></td>
  </tr>
  <tr>
    <td style="font-size:12px;"><div align="center">PELABUHAN PENYEBERANGAN </div></td>
  </tr>
  <tr>
    <td style="padding:5px; font-size:16px;"><div align="center">LINTAS NUSA PENIDA - PADANG BAI</div></td>
  </tr>
</table>
<table id="table1" width="90%">   
  <tr>
    <td style="font-size:25px;  border-collapse:collapse; padding-top:15px; padding-bottom:15px;">
    <p align="center" style="margin:0;"><strong>KELAS EKONOMI</strong></p>
    <p align="center" style="margin:0;"><strong><?php echo $angkutan?></strong></p></td>
  </tr>
</table>
<table id="table1" width="90%">  
  <tr>
    <td style="padding:5px; font-size:20px; border-collapse:collapse; border-top:none"><div align="center"><strong>Rp. <?php echo number_format($harga); ?>,-</strong></div></td>
  </tr>
</table>
<table width="100%" border="0" style="margin-bottom:30px;">
  <tr>
    <td style="padding-top:10px; font-size:12px;"><div align="center">*Harga sudah termasuk tiket masuk,  Jasa Dermaga, Pemeliharaan Pelabuhan dan Asuransi</div></td>
  </tr>
  <tr>
    <td style="padding-top:10px; font-size:12px;"><div align="center">Berlaku sekali jalan</div></td>
  </tr>
  <tr>
    <td><div align="center" style="font-size:12px;">Peraturan Daerah No. 5 Tahun 2013</div></td>
  </tr>
  <tr>
    <td><div align="center" style="font-size:12px;">Peraturan Gubernur Bali No. 10 Tahun 2014</div></td>
  </tr>
  <tr>
	<td style="font-size:16px; border:1px solid black">
    	<div align="center">
            <p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
                <img alt="TESTING" src="plugins/barcode.php?codetype=Code128&size=40&text=<?php echo $notiket?>&print=true" />
            </p>
		</div>
    </td>
  </tr>
</table>

<?php } ?>
                    <div class="row no-print" style="margin-top:30px; margin-right:30px;">
                        <div class="col-xs-12">
                            <button class="btn btn-success pull-right" onClick="window.print();"><i class="fa fa-print"></i> Print</button>
                            <a href="data-pemesanan"><button class="btn btn-primary pull-right" style="margin-right: 5px;"><i class="fa fa-reply"></i> Kembali</button></a>
                        </div>
                    </div>
