Advertisement
Bannip73

laporan_harian_pdf

Nov 26th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.82 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title></title>
  5. </head>
  6. <body> 
  7.     <style type="text/css">
  8.         .table-data{
  9.             width: 100%;           
  10.             border-collapse: collapse;         
  11.         }
  12.  
  13.         .table-data tr th,
  14.         .table-data tr td{
  15.             border:1px solid black;
  16.             font-size: 10pt;
  17.         }      
  18.     </style>
  19.    
  20.     <h3>Laporan Harian</h3>
  21.    
  22.  
  23.     <table>
  24.         <tr>
  25.             <td>Tanggal</td>
  26.             <td>:</td>
  27.             <td><?php echo date('d/m/Y',strtotime($_GET['tanggal'])); ?></td>
  28.         </tr>
  29.     </table>
  30.    
  31.     <br/>
  32.     <table class="table-data">
  33.         <thead>
  34.                 <tr>
  35.                     <th scope="col">Nomor</th>
  36.                     <th scope="col">Keterangan</th>
  37.                     <th scope="col">Tanggal</th>
  38.                     <th scope="col">Jumlah</th>
  39.                     <th scope="col">Jenis</th>
  40.                     <th scope="col">&nbsp;</th>
  41.                 </tr>
  42.         </thead>
  43.         <tbody>
  44.             <?php foreach ($result as $data) { ?>
  45.                 <tr>
  46.                     <td><?=$data->nomor;?></td>
  47.                     <td><?=$data->keterangan;?></td>
  48.                     <td><?=date('d/m/Y', strtotime($data->tanggal));?></td>
  49.                     <td>Rp <?=number_format($data->jumlah,2,',','.');?></td>
  50.                     <td><?=ucwords($data->jenis);?></td>
  51.                     <?php
  52.                     if ($data->jenis == 'masuk'){
  53.                         $uri = 'pemasukan';
  54.                     }else{
  55.                         $uri = 'pengeluaran';
  56.                     }
  57.                     ?>
  58.                 </tr>
  59.             <?php } ?>
  60.             </tbody>
  61.             <thead>
  62.             <?php
  63.                 error_reporting(0);
  64.                 foreach ($ttl_masuk as $total_masuk) {
  65.                     $jumlah_masuk += $total_masuk->jumlah;
  66.                 }
  67.                 foreach ($ttl_keluar as $total_keluar) {
  68.                     $jumlah_keluar += $total_keluar->jumlah;
  69.                 }
  70.                 $jumlah = $jumlah_masuk-$jumlah_keluar;
  71.             ?>
  72.                 <tr>
  73.                     <th colspan="3" scope="col">TOTAL <small>(Pemasukan dan Pengeluaran Tanggal <?=date('d/m/Y', strtotime($data->tanggal));?>)</small></th>
  74.                     <th scope="col">Rp. <?=number_format($jumlah,2,',','.');?></th>
  75.                     <th colspan="2" scope="col">&nbsp;</th>
  76.                 </tr>
  77.             </thead>
  78. </table>
  79. </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement