<script type="text/javascript">	
	window.print();
</script>

<?php
	include '../../inc/inc.koneksi.php';
	include '../../inc/fungsi_tanggal.php';
	
	$tgllap =date('d-m-Y');
		
	$sql	= mysql_query("SELECT * FROM company");
	$r	= mysql_fetch_assoc($sql);
	$kop1 = $r[nama1];
	$kop2 = $r[nama2];
	$kop3 = $r[alamat];
	
	echo "<table width='100%'>
		<tr>
			<td style='font:arial 11px'><b>$kop1</b></td>
		</tr>
		<tr>
			<td style='font:arial 11px'>$kop2</td>
		</tr>
		<tr>
			<td style='font:arial 11px'>$kop3</td>
		</tr>
	</table>
		
	<table width='100%'>
		<tr>
			<td align='center' style='font:arial 14px'><b>DAFTAR KENDARAAN</b></td>
		</tr>
		<tr>
			<td align='center' style='font:arial 14px'><b>PER TANGGAL $tgllap</b></td
		</tr>
	</table>
	<br>
	
	<table width='600' border='1' style='font:11px arial;border-collapse:collapse'>
		<tr>
			<th>No.</th>
			<th>No. Polisi</th>
			<th>Nama Kendaraan</th>
			<th>Tahun Produksi</th>
			<th>Tanggal STNK</th>
			<th>Aksi</th>
		</tr>";
	
		$query = mysql_query("SELECT * FROM truk ORDER BY nopol");
		
		$no=1;
		while($r_data=mysql_fetch_array($query)){
			echo "<tr>
				<td align='center'>$no</td>
				<td>$r_data[nopol]</td>
				<td>$r_data[nama_kd]</td>
				<td>$r_data[tahun]</td>
				<td>".jin_date_str($r_data[tanggal_pj])."</td>
				<td align='center'>
					<a href='javascript:void(0)' onClick=\"edit_data('$r_data[nopol]')\">
						<img src='icon/thumb_up.png' border='0' id='edit' title='Edit' width='12' height='12' >
					</a>
					<a href='javascript:void(0)' onClick=\"hapus_data('$r_data[nopol]')\">
						<img src='icon/thumb_down.png' border='0' id='hapus' title='Hapus' width='12' height='12' >
					</a>					
				</td>
			</tr>";
			$no++;
		}
	echo "</table>";
?>
<script type="text/javascript">	
	history.back();
</script>