Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_SESSION['id_admin']))
- {
- header("Content-Type:application/force-download");
- header("Cache-Control:no-cache,must-revalidate");
- header("content-disposition:attacment;filename=Laporan Realisasi Anggaran.xls");
- include "_db.php";
- $id_admin=$_POST['id_admin'];
- $tanggal1=$_POST['tanggal1'];
- $tanggal2=$_POST['tanggal2'];
- $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() );
- $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() );;
- ?>
- <script type="text/javascript" src="jquery.js"></script>
- <style type="text/css">
- #halaman { width:1200px; margin:0 auto; }
- #header { height:120px; padding:0px;background-color:; }
- #kanan { height:600px;float:right;width:500px; margin-top:5px; }
- #tengah { height:600px;float:left;width:600px;margin:15px 280px 0 0px; }
- </style>
- <table border="1" width="90%" style="border-collapse:collapse;" align="center">
- <tr class="tableheader"><center>LAPORAN REALISASI ANGGARAN<center><tr>
- <th rowspan="1">Tanggal Transaksi</th>
- <th>Keterangan Anggaran</th>
- <th>Anggaran</th>
- <th>Keterangan Transaksi</th>
- <th>Kredit</th>
- </tr></tr>
- <?php while($hasil=mysql_fetch_array($data)){
- $anggaran=$hasil['anggaran'];
- $kredit=$hasil['kredit'];?>
- <tr id="rowHover">
- <td width="10%" align="center"><?php echo $hasil['tanggal_transaksi']; ?></td>
- <td width="20%" align="center"><?php echo $hasil['keterangan_anggaran']; ?></td>
- <td width="10%" align="right"><?php echo number_format($anggaran,2,'.',','); ?></td>
- <td width="20%" align="center"><?php echo $hasil['keterangan_transaksi']; ?></td>
- <td width="10%" align="right"><?php echo number_format($kredit,2,'.',','); ?></td>
- </tr>
- <?php } ?>
- <tr>
- <td colspan="2"><div align="center"><strong>TOTAL TRANSAKSI</strong></div></td>
- <td align="right"><strong><?php echo number_format($total['tot_anggaran'],2,'.',','); ?></strong></td>
- <td colspan="2" align="right"><strong><?php echo number_format($total['tot_kredit'],2,'.',','); ?></strong></td>
- </tr>
- </table>
- <?php
- }else{
- echo "Forbidden Access!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement