[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
simkeu
/
keuangan
/
[
Home
]
File: cpembayaran.php
<?php require_once("configure_first.php"); if(isset($_GET["id_kelas"])) $id_kelas = $_GET["id_kelas"]; else $id_kelas = 0; if(isset($_GET["tahun"])) $thn = $_GET["tahun"]; else $thn = 0; if($tahun == 2022) { $periode1 = "07-2022"; $periode2 = "06-2023"; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pembayaran Per Bulan</title> <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <style media="screen"> body { font-family: 'Nunito', sans-serif; font-size: 0.8em; } table, th, td { border: 1px solid black; } table { border-collapse: collapse; margin: 120px auto; } th, td { padding: 6px 0; } th { padding-left: 4px; background-color: #F1F1F1; } td { padding-left: 4px; padding-right: 6px; } /* unvisited link */ a:link { color: black; text-decoration: none; } /* visited link */ a:visited { color: black; text-decoration: none; } /* mouse over link */ a:hover { color: black; } /* selected link */ a:active { color: black; } </style> </head> <body> <?php echo "<table class=\"table table-hover\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin: 0; width: 1800;\">"; echo "<tr>"; echo "<th rowspan=2 width=10 align=center>No</th>"; echo "<th rowspan=2 width=70 align=center>NPM</th>"; echo "<th rowspan=2 width=70 align=left>Nama</th>"; echo "<th colspan=12 align=center>Tahun ".$thn."</th>"; echo "<th rowspan=2 width=70 align=left>Total</th>"; echo "<th rowspan=2 width=70 align=left>Harus Bayar</th>"; echo "<th rowspan=2 width=70 align=left>Kurang Bayar</th>"; echo "</tr>"; echo "<tr>"; for($a = 0,$b = count($monthName)-1; $a < $b; $a++) { echo "<th width=50 align=center>".$monthName[($a+1)]."</th>"; } echo "</tr>"; //$query="select * from 0_mandiriva a left join m_siswa b on a.nama = b.siswa_nama where siswa_kelas_skr = ".$id_kelas." order by tgl asc"; $query="select * from m_siswa where siswa_kelas_skr = ".$id_kelas." order by total_bayar asc"; //echo $query; $iData=sAllData($query); $no = 0; $totalH = 0; //$totalV = 0; if($id_kelas > 0) { for($a=0,$b=count($iData);$a<$b;$a++) { echo "<tr>"; echo "<td align=left>".($a+1)." </td>"; echo "<td align=left>".$iData[$a]["siswa_nis"]." </td>"; echo "<td align=left>".($iData[$a]["siswa_nama"])." </td>"; $totalH = 0; for($aa = 0,$bb = count($monthName)-1; $aa < $bb; $aa++) { $sql = "select sum(bayar) as total,count(bayar) as jum from 0_mandiriva where nama = '".addslashes($iData[$a]["siswa_nama"])."' and tgl between '".$thn."-".($aa+1)."-01' and '".$thn."-".($aa+1)."-31'"; $iData2=sAllData($sql); $sql3 = "select sum(pembayaran_total) as total,count(pembayaran_total) as jum from keu_p_pembayaran_siswa where id_siswa = '".($iData[$a]["siswa_id"])."' and pembayaran_tgl between '".$thn."-".($aa+1)."-01' and '".$thn."-".($aa+1)."-31'"; $iData3=sAllData($sql3); $gabungan = ($iData2[0]["total"]+$iData3[0]["total"]); $totalH = ($totalH+$gabungan); $totalV[$aa] = ($totalV[$aa]+$gabungan); echo "<td align=right> <a href='#' onclick=\"tampilkan('".$iData[$a]["siswa_nama"]."',".$iData[$a]["siswa_id"].",".$thn.",".($aa+1).");\">".format_currency($gabungan)."</a></td>"; } echo "<td align=right> ".format_currency($totalH)."</td>"; echo "<td align=right> ".format_currency($iData[$a]["total_bayar"])."</td>"; echo "<td align=right> ".format_currency(($iData[$a]["total_bayar"]-$totalH))."</td>"; echo "</tr>"; } } echo "<tr>"; echo "<th align=center colspan=3> T O T A L</th>"; $alltotal = 0; for($aa = 0,$bb = count($monthName)-1; $aa < $bb; $aa++) { $alltotal = ($alltotal+$totalV[$aa]); echo "<th align=right>".format_currency($totalV[$aa])."</th>"; } echo "<th align=right>".format_currency($alltotal)."</th>"; echo "<th align=right>".format_currency(0)."</th>"; echo "<th align=right>".format_currency(0)."</th>"; echo "</tr>"; echo "</table>"; // echo "<div align=center><input type=button value=Print onclick=showprint();></div>"; echo "</form>"; ?> </body> </html> <script> function tampilkan(a,b,c,d) { document.getElementById('id01').style.display='block'; document.getElementById('datasiswa').innerHTML="Please wait,... Loading data pembayaran..."; if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); }else{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById('datasiswa').innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","function_ajax.php?status=dt_pembayaran&nama="+a+"&id="+b+"&thn="+c+"&bln="+d,true); xmlhttp.send(); } </script> <div id="id01" class="w3-modal"> <div class="w3-modal-content w3-card-4 w3-animate-zoom" style="max-width:600px"> <div class="w3-center"><br> <span onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-xlarge w3-hover-red w3-display-topright" title="Close Modal">×</span> </div> <form class="w3-container" action="/action_page.php"> <div class="w3-section"> <span id="datasiswa"></span> </div> </form> <div class="w3-container w3-border-top w3-padding-16 w3-light-grey"> <button onclick="document.getElementById('id01').style.display='none'" type="button" class="w3-button w3-red">Close</button> </div> </div> </div>