[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
xampp182
/
htdocs
/
simkeu
/
sia
/
[
Home
]
File: RekapPengeluaran.inc.php
<?php $id = ""; $uraian = ""; $nominal = ""; $tgl = ""; $buton = "Proses"; $u_pswd = "-"; $u_name = "-"; $nominal = "-"; $ktp = "-"; $kota_asal = "-"; $alamat = "-"; $tgl = "-"; $uraian = "-"; if(isset($_POST["Tahun"])) $Tahun = $_POST["Tahun"]; if(isset($_POST["Cetak"])) { echo "<script>window.open('rekap_pengeluaran.php?tahun=".$_POST["Tahun"]."');</script>"; } ?> <div class="container-fluid"> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Filter Data </h6> </div> <div class="card-body"> <form class="user" action="dashboard.php?RekapPengeluaran" accept-charset="utf-8" method="post"> <div class="col m6"> <div class="row"> <div class="input-field col m6 s12"> <table border="0" width="100%" cellspacing="1" cellpadding="1"> <tr> <td width="30%">Tahun</td> <td width="70%"> <select name="Tahun" type="text" class="form-control" id="Tahun"> <option value=0>-- Pilih --</option> <?php for($a=2020, $b=2030; $a<$b; $a++) { ?> <option value="<?php echo $a;?>" <?php if($Tahun == $a) echo "selected";?>><?php echo $a;?></option> <?php } ?> </select> </td> </tr> <tr> <td> </td> <td> <div class="form-group row"> <div class="col-sm-3 mb-3 mb-sm-0"> <button name="<?php echo $buton;?>" type="submit" class="btn btn-primary btn-block"><?php echo $buton;?></button> </div> <div class="col-sm-3"> <button name="Cetak" type="submit" class="btn btn-primary btn-block">Cetak</button> </div> </div> </td> </tr> </table> </div> </div> </div> </div> </div> </div> </form> <div class="container-fluid"> <!-- Page Heading --> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">DataTables</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>No</th> <th>Bulan</th> <th>Nominal</th> </tr> </thead> <tbody> <?php $no = 0; $jtotal = 0; $sql = "SELECT sum(nominal) as total,substr(tgl,1,7) as bln FROM keu_pengeluaran a left join keu_jpengeluaran b on a.id_jenispengeluaran = b.id where substr(tgl,1,4) = '".$_POST["Tahun"]."' group by substr(tgl,1,7) order by tgl desc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { $no = ($no+1); $jtotal = ($jtotal+$row['total']); ?> <tr> <td><?php echo $no;?></td> <td><?php echo $monthName[intval(substr($row['bln'],5,2))];?> <?php echo substr($row['bln'],0,4);?></td> <td align="right">Rp. <?php echo format_currency($row['total']);?></td> </tr> <?php } } ?> <tr> <td colspan="2" align="center">TOTAL</td> <td align="right">Rp. <?php echo format_currency($jtotal);?></td> </tr> </tbody> </table> </div> </div> </div> </div>