Guest User

cetak_laporan_realilasi

a guest
Jan 21st, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <?php
  2. if (isset($_SESSION['id_admin']))
  3. {
  4. ?>
  5. <?php
  6. header("Content-Type:application/force-download");
  7. header("Cache-Control:no-cache,must-revalidate");
  8. header("content-disposition:attacment;filename=Laporan Realisasi Anggaran.xls");
  9. include "_db.php";
  10. $id_admin=$_POST['id_admin'];
  11. $tanggal1=$_POST['tanggal1'];
  12. $tanggal2=$_POST['tanggal2'];
  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");
  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"));
  15. ?>
  16. <script type="text/javascript" src="jquery.js"></script>
  17. <style type="text/css">
  18. #halaman { width:1200px; margin:0 auto; }
  19. #header { height:120px; padding:0px;background-color:; }
  20. #kanan { height:600px;float:right;width:500px; margin-top:5px; }
  21. #tengah { height:600px;float:left;width:600px;margin:15px 280px 0 0px; }
  22. </style>
  23. <table border="1" width="90%" style="border-collapse:collapse;" align="center">
  24. <tr class="tableheader"><center>LAPORAN REALISASI ANGGARAN<center><tr>
  25. <th rowspan="1">Tanggal Transaksi</th>
  26. <th>Keterangan Anggaran</th>
  27. <th>Anggaran</th>
  28. <th>Keterangan Transaksi</th>
  29. <th>Kredit</th>
  30. </tr></tr>
  31. <?php while($hasil=mysql_fetch_array($data)){
  32. $anggaran=$hasil['anggaran'];
  33. $kredit=$hasil['kredit'];?>
  34. <tr id="rowHover">
  35. <td width="10%" align="center"><?php echo $hasil['tanggal_transaksi']; ?></td>
  36. <td width="20%" align="center"><?php echo $hasil['keterangan_anggaran']; ?></td>
  37. <td width="10%" align="right"><?php echo number_format($anggaran,2,'.',','); ?></td>
  38. <td width="20%" align="center"><?php echo $hasil['keterangan_transaksi']; ?></td>
  39. <td width="10%" align="right"><?php echo number_format($kredit,2,'.',','); ?></td>
  40. </tr>
  41. <?php } ?>
  42. <tr>
  43. <td colspan="2"><div align="center"><strong>TOTAL TRANSAKSI</strong></div></td>
  44. <td align="right"><strong><?php echo number_format($total['tot_anggaran'],2,'.',','); ?></strong></td>
  45. <td colspan="2" align="right"><strong><?php echo number_format($total['tot_kredit'],2,'.',','); ?></strong></td>
  46. </tr>
  47. </table>
  48. <?php
  49. }else{
  50. echo "Forbidden Access!";
  51. }
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment