Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Koneksi.php
- <?php
- @session_start(); //ada ini
- $koneksi = ....; //asumsikan sama
- ?>
- <?php
- require_once( '../koneksi.php');
- error_repoting(0); //kalau bisa jangan
- //session_start();
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>LAPORAN FORM KASIR DANGROUP</title>
- </head>
- <body>
- <style type="text/css">
- body{
- font-family: serif, sans-serif;
- }
- .table{
- width: 100%;
- }
- h4 {
- font: 10px serif, sans-serif;
- }
- th,td{
- font-size: 7px;
- }
- tr {
- }
- .table,
- .table th,
- .table td,
- .table tr {
- padding: 8px;
- border: 1px solid black;
- border-collapse: collapse;
- }
- .text-center{
- text-align: center;
- }
- .text-right{
- text-align: right;
- }
- .text-left{
- text-align: left;
- }
- </style>
- <center>
- <h4>LAPORAN <br/> FORM KASIR DANGROUP</h4>
- </center>
- <br>
- <?php
- if(isset($_GET['tanggal_sampai']) && isset($_GET['tanggal_dari'])){
- $tgl_dari = $_GET['tanggal_dari'];
- $tgl_sampai = $_GET['tanggal_sampai'];
- $divisi_id = $_SESSION['divisi_id'];
- $divisi = mysqli_query($koneksi,"select * from divisi where divisi_id='$divisi_id'");
- $divisi = mysqli_fetch_assoc($divisi);
- ?>
- <table style="margin-left: 5px;">
- <tr>
- <th class="text-left" width="3cm">DARI TANGGAL</th>
- <th class="text-center" width="1cm">:</th>
- <td class="text-left"><?php echo date('d-m-Y',strtotime($tgl_dari)); ?></td>
- </tr>
- <tr>
- <th class="text-left">SAMPAI TANGGAL</th>
- <th class="text-center">:</th>
- <td class="text-left"><?php echo date('d-m-Y',strtotime($tgl_sampai)); ?></td>
- </tr>
- <tr>
- <th class="text-left">DIVISI</th>
- <th class="text-center">:</th>
- <td><?php echo $divisi['divisi']; ?></td>
- </tr>
- </table>
- <table class="table">
- <tr>
- <th class="text-center">TANGGAL</th>
- <th class="text-center">SHIFT</th>
- <th class="text-center">NAMA KASIR</th>
- <th class="text-center">ACC</th>
- <th class="text-center">VOUCHER</th>
- <th class="text-center">DEPOSIT</th>
- <th class="text-center">SPPOB</th>
- <th class="text-center">PPOB</th>
- <th class="text-center" >MEMBER</th>
- <th class="text-center">BANK GUDANG</th>
- <th class="text-center">BANK SERVER</th>
- </tr>
- <?php
- require_once( '../koneksi.php'); //kok ngulang??
- $total_acc = 0;
- $total_voucher = 0;
- $total_deposit = 0;
- $total_sppob = 0;
- $total_ppob = 0;
- $total_member = 0;
- $sql ="SELECT * FROM form_kasir join bank on form_kasir.bank_server = bank.id_bank JOIN bank_gudang on form_kasir.bank_gudang = bank_gudang.bank_id JOIN divisi ON form_kasir.kode_divisi = divisi.divisi_id WHERE divisi_id='$_SESSION[divisi_id]' AND tanggal_form between '$tgl_dari' and '$tgl_sampai'";
- $data = mysqli_query($koneksi, $sql);
- while($d = mysqli_fetch_array($data))
- {
- $total_acc += $d['acc'];
- $total_voucher += $d['voucher'];
- $total_deposit += $d['deposit'];
- $total_sppob += $d['sppob'];
- $total_ppob += $d['ppob'];
- $total_member += $d['member'];
- ?>
- <tr>
- <td class="text-center"><?php echo date('d-m-Y', strtotime($d['tanggal_form'])); ?></td>
- <td class="text-center"><?php echo $d['shift'];?></td>
- <td><?php echo $d['nama_kasir']; ?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($d['acc'])." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($d['voucher'])." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($d['deposit'])." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($d['sppob'])." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($d['ppob'])." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($d['member'])." ,-";?></td>
- <td class="text-left"><?php echo $d['nama'];?></td>
- <td class="text-left"><?php echo $d['nama_bank'];?></td>
- </tr>
- <?php
- }
- ?>
- <tr>
- <th colspan="3" class="text-right">TOTAL</th>
- <td class="text-right"><?php echo "Rp. ".number_format($total_acc)." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($total_voucher)." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($total_deposit)." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($total_sppob)." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($total_ppob)." ,-";?></td>
- <td class="text-right"><?php echo "Rp. ".number_format($total_member)." ,-";?></td>
- <td colspan="2"></td>
- </tr>
- </table>
- <?php
- }
- ?>
- </body>
- </html>
- <?php
- require_once("../library/dompdf/dompdf_config.inc.php");
- $dompdf = new DOMPDF();
- $dompdf->load_html(ob_get_clean());
- $dompdf->render();
- $dompdf->set_paper("A4",'portrait');
- $dompdf->stream("Laporan Form Kasir ".$divisi['divisi'].".pdf");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement