View difference between Paste ID: kCcpYh7m and J6a5j787
SHOW: | | - or go back to the newest paste.
1
<?php 
2-
if (isset($_SESSION['id_admin']))
2+
if (isset($_SESSION['id_admin'])){ 
3-
{
3+
4
header("Cache-Control:no-cache,must-revalidate");
5
header("content-disposition:attacment;filename=Laporan Realisasi Anggaran.xls");                                                                                               
6
include "_db.php";	
7
$id_admin=$_POST['id_admin'];
8
$tanggal1=$_POST['tanggal1'];
9
$tanggal2=$_POST['tanggal2'];
10
	$data=mysql_query("select tanggal_transaksi,keterangan_anggaran,anggaran,keterangan_transaksi,kredit from tabel_transaksi where tanggal_transaksi between '$tanggal1' and '$tanggal2' and jenis_transaksi not like '%Kas Masuk%' and jenis_transaksi not like '%Saldo Awal%' where id_admin='$id_admin' order by tanggal_transaksi asc");
11
	$total=mysql_fetch_array(mysql_query("select sum(anggaran) as tot_anggaran, sum(kredit) as tot_kredit from tabel_transaksi where tanggal_transaksi between '$tanggal1' and '$tanggal2' and jenis_transaksi not like '%Kas Masuk%' and jenis_transaksi not like '%Saldo Awal%' where id_admin='$id_admin' order by kode_rekening asc"));			
12
?>
13
<script type="text/javascript" src="jquery.js"></script>
14
<style type="text/css">
15
#halaman { width:1200px; margin:0 auto; }     
16
#header { height:120px; padding:0px;background-color:; }      
17
#kanan { height:600px;float:right;width:500px; margin-top:5px; }     
18
#tengah { height:600px;float:left;width:600px;margin:15px 280px 0 0px; }
19
</style>
20
<table border="1" width="90%" style="border-collapse:collapse;" align="center">
21
<tr class="tableheader"><center>LAPORAN REALISASI ANGGARAN<center><tr>
22
	<th rowspan="1">Tanggal Transaksi</th>
23
	<th>Keterangan Anggaran</th>
24
	<th>Anggaran</th>
25
	<th>Keterangan Transaksi</th>
26
	<th>Kredit</th>
27
</tr></tr>
28
<?php while($hasil=mysql_fetch_array($data)){
29
$anggaran=$hasil['anggaran'];
30
$kredit=$hasil['kredit'];?>
31
<tr id="rowHover">
32
	<td width="10%" align="center"><?php echo $hasil['tanggal_transaksi']; ?></td>
33
	<td width="20%" align="center"><?php echo $hasil['keterangan_anggaran']; ?></td>
34
	<td width="10%" align="right"><?php echo number_format($anggaran,2,'.',','); ?></td>
35
	<td width="20%" align="center"><?php echo $hasil['keterangan_transaksi']; ?></td>
36
	<td width="10%" align="right"><?php echo number_format($kredit,2,'.',','); ?></td>
37
</tr>
38
<?php } ?>
39
<tr>
40
			<td colspan="2"><div align="center"><strong>TOTAL TRANSAKSI</strong></div></td>
41
				<td align="right"><strong><?php echo number_format($total['tot_anggaran'],2,'.',','); ?></strong></td>
42
				<td colspan="2" align="right"><strong><?php echo number_format($total['tot_kredit'],2,'.',','); ?></strong></td>
43
			</tr>
44
</table>
45
<?php 
46
}else{
47
	echo "Forbidden Access!";
48
}
49
?>