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

<?php
	include '../../inc/inc.koneksi.php';	
		
	$tgllap =date('d-m-Y');	
	$query2 = mysql_query("SELECT * FROM company");
	$r2		= mysql_fetch_assoc($query2);
	$kop1   = $r2['nama1'];
	$kop2   = $r2['nama2'];
	$kop3   = $r2['alamat'];
	
	echo "<table width='600' style='font:11px arial'>
		<tr>
			<td>$kop1</td>
		</tr>
		<tr>
			<td>$kop2</td>
		</tr>
		<tr>
			<td>$kop3</td>
		</tr>
	</table>
		
	<table width='600'>
		<tr>
			<td align='center' style='font:14px arial'><b>DAFTAR AKUN BUKU BESAR</b></td>
		</tr>
		<tr>
			<td align='center' style='font:14px arial'><b>PER TANGGAL $tgllap</b></td>
		</tr>
	</table>
	<br>
	
	<table width='500' border='1' style='border-collapse:collapse;font:12x arial'>
		<tr>			
			<th>Kode</th>
			<th>Nama Akun</th>
			<th>Level</th>
			<th>D/K</th>			
		</tr>";
		$data1= mysql_query("SELECT * FROM gol_akun ORDER BY nogol");
		
		$jml=1;		
		while($r1=mysql_fetch_array($data1)){
			$nogol=$r1['nogol'];
			
			echo "<tr>				
				<td><b>$r1[nogol]</b></td>			
				<td><b>$r1[nagol]</b></td>
			</tr>";		
			$query = mysql_query("SELECT * FROM akun_bb WHERE nogol='$nogol' ORDER BY noakun");
					
			while($r=mysql_fetch_array($query)){
				echo "<tr>
					<td>$r[noakun]</td>
					<td>$r[naakun]</td>
					<td align='center'>$r[level]</td>
					<td align='center'>$r[kode]</td>
				</tr>";				
				$jml++;
			}	
		}	
	echo "</table>
	<table style='font:12px arial'>
		<tr>
			<td>Jumlah Data : $jml</td>
		</tr>
	</table>";
?>
<script type="text/javascript">
	history.back();
</script>