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