Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (67478 Members, 783 Products, 5290 Topic, 12955 Comments)

SIASELAH - Membuat siswa melihat tagihan keuangan sekolah

Dibuat
Login Terakhir 3 Tahun lalu,
Telah Dilihat 1633 Kali
Hermawan Wahyudi Mengatakan : Sultan Account
  1. Bisakah Membuat siswa melihat tagihan keuangan sekolah pada sieselah

Ada 12 Jawaban

PHPMU.COM Support
commented on 20 Jan 2018 10:43:07
  1. Pastinya bisa mas,.. :)
Hermawan Wahyudi
commented on 21 Jan 2018 21:14:21
  1. caranya bagaimana mas robi. mohon pencerahan
PHPMU.COM Support
commented on 22 Jan 2018 06:34:16
  1. Oke, berikut tahapannya,..
  2. 1. harus paham dulu struktur/alur dari system siaselah, misalnya untuk penambahan modul baru
  3. - buka file index.php
  4. tambahkan rule baru disana,..
  5. <?php
  6. if ($_GET[view]=='keuangansiswa'){
  7. cek_session_siswa();
  8. echo "<div class='row'>";
  9. include "application/keuangan_siswa.php";
  10. echo "</div>";
  11. }
  12. ?>
  13.  
  14. Selanjutnya buat file baru dengan nama "keuangan_siswa.php" pada directory application sesuai degan rule diatas..
  15. tampilkan semua data jenis biaya/beban seperti berikut :
  16. <?php
  17. $query = mysql_query("SELECT * FROM rb_keuangan_jenis");
  18. while ($row = mysql_fetch_array($query)){
  19. $cek_pembayaran_siswa = mysql_fetch_array(mysql_query("SELECT sum[total_bayar] as nominal FROM rb_keuangan_bayar
  20. where nisn='$_SESSION[id]' AND tahun_akademik='$tahunakademik[id_tahun_akademik]'
  21. AND id_keuangan_jenis='$row[id_keuangan_jenis]'"));
  22. <tr>
  23. <td>$row[nama_jenis]</td>
  24. <td>$row[total_beban]</td>
  25. <td>$cek_pembayaran_siswa[nominal]</td>
  26. <td>".($row[total_beban]-$cek_pembayaran_siswa[nominal])."</td>
  27. </tr>
  28. }
  29. ?>
  30.  
  31. Selesai maka data jenis tagihan, jumlah tagihan dan sisa tagihan akan muncul,
  32. tinggal dilengkapi dilengkapi struktur table di atas agar tampilan jadi rapi,.. :)
  33. nanti modul ini bisa di akses sesuai dengan rule yang kita buat di atas dari alamat :
  34. http://localhost/akd/index.php?view=keuangansiswa
Zaka semiawan
commented on 23 Jan 2018 15:36:32
  1. mas kode ini disisipin dimana yah
  2. <?php
  3. $query = mysql_query("SELECT * FROM rb_keuangan_jenis");
  4. while ($row = mysql_fetch_array($query)){
  5. $cek_pembayaran_siswa = mysql_fetch_array(mysql_query("SELECT sum[total_bayar] as nominal FROM rb_keuangan_bayar
  6. where nisn='$_SESSION[id]' AND tahun_akademik='$tahunakademik[id_tahun_akademik]'
  7. AND id_keuangan_jenis='$row[id_keuangan_jenis]'"));
  8. <tr>
  9. <td>$row[nama_jenis]</td>
  10. <td>$row[total_beban]</td>
  11. <td>$cek_pembayaran_siswa[nominal]</td>
  12. <td>".($row[total_beban]-$cek_pembayaran_siswa[nominal])."</td>
  13. </tr>
  14. }
  15. ?>
Zaka semiawan
commented on 23 Jan 2018 15:39:02
  1. saya udah bisa nampilin tagihan disiswa tapi tampilannya sama kayak yang diadmin seharusnya muncul tagihan beban , sesuai sama yang login siswanya aja yang muncul
  2. scriptynya ngambil mentah mentah dari detailkeuangan yang admin ..
  3. <?php
  4. if ($_GET[act]==''){
  5. ?>
  6. <div class="col-xs-12">
  7. <div class="box">
  8. <div class="box-header">
  9. <h3 class="box-title">Pembayaran Keuangan Siswa </h3>
  10. <form style='margin-right:5px; margin-top:0px' class='pull-right' action='' method='GET'>
  11. <input type="hidden" name='view' value='detailkeuangansiswa'>
  12. <select name='biaya' style='padding:4px'>
  13. <?php
  14. echo "<option value=''>- Pilih Jenis Biaya -</option>";
  15. $biaya = mysql_query("SELECT * FROM rb_keuangan_jenis");
  16. while ($k = mysql_fetch_array($biaya)){
  17. if ($_GET[biaya]==$k[id_keuangan_jenis]){
  18. echo "<option value='$k[id_keuangan_jenis]' selected>$k[nama_jenis]</option>";
  19. }else{
  20. echo "<option value='$k[id_keuangan_jenis]'>$k[nama_jenis]</option>";
  21. }
  22. }
  23. ?>
  24. </select>
  25. <select name='kelas' style='padding:4px'>
  26. <?php
  27. echo "<option value=''>- Filter Kelas -</option>";
  28. $kelas = mysql_query("SELECT * FROM rb_kelas");
  29. while ($k = mysql_fetch_array($kelas)){
  30. if ($_GET[kelas]==$k[kode_kelas]){
  31. echo "<option value='$k[kode_kelas]' selected>$k[kode_kelas] - $k[nama_kelas]</option>";
  32. }else{
  33. echo "<option value='$k[kode_kelas]'>$k[kode_kelas] - $k[nama_kelas]</option>";
  34. }
  35. }
  36. ?>
  37. </select>
  38.  
  39. <input type="submit" style='margin-top:-4px' class='btn btn-info btn-sm' value='Lihat'>
  40. </form>
  41. </div><!-- /.box-header -->
  42. <div class="box-body">
  43.  
  44. <?php
  45. if (isset($_GET['sukses'])){
  46. echo "<div class='alert alert-success alert-dismissible fade in' role='alert'>
  47. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  48. <span aria-hidden='true'>×</span></button> <strong>Sukses!</strong> - Data telah Berhasil Di Proses,..
  49. </div>";
  50. }elseif(isset($_GET['gagal'])){
  51. echo "<div class='alert alert-danger alert-dismissible fade in' role='alert'>
  52. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  53. <span aria-hidden='true'>×</span></button> <strong>Gagal!</strong> - Data tidak Di Proses, terjadi kesalahan dengan data..
  54. </div>";
  55. }
  56. ?>
  57.  
  58. <form action='' method='POST'>
  59. <input type="hidden" name='kelas' value='<?php echo $_GET[kelas]; ?>'>
  60. <?php
  61. $j = mysql_fetch_array(mysql_query("SELECT * FROM `rb_keuangan_jenis` where id_keuangan_jenis='$_GET[biaya]'"));
  62. $th = mysql_fetch_array(mysql_query("SELECT * FROM rb_tahun_akademik where aktif='Ya'"));
  63. echo "<table id='example1' class='table table-bordered table-striped'>
  64. <thead>
  65. <tr><th width='30px'>No</th>
  66. <th>NIPD</th>
  67. <th>NISN</th>
  68. <th>Nama Siswa</th>
  69. <th>Kelas</th>";
  70. if ($_GET[kelas] != '' AND $_GET[biaya] != ''){
  71. if ($j[total_beban] != '0'){
  72. echo "<th>Status</th>";
  73. }
  74. }
  75.  
  76. echo "<th width='140px'>Action</th>
  77. </tr>
  78. </thead>
  79. <tbody>";
  80.  
  81. if ($_GET[kelas] != '' AND $_GET[biaya] != ''){
  82. $tampil = mysql_query("SELECT * FROM rb_siswa a LEFT JOIN rb_kelas b ON a.kode_kelas=b.kode_kelas
  83. LEFT JOIN rb_jenis_kelamin c ON a.id_jenis_kelamin=c.id_jenis_kelamin
  84. LEFT JOIN rb_jurusan d ON b.kode_jurusan=d.kode_jurusan
  85. where a.kode_kelas='$_GET[kelas]' ORDER BY a.id_siswa");
  86. }
  87. $no = 1;
  88. while($r=mysql_fetch_array($tampil)){
  89. $t = mysql_fetch_array(mysql_query("SELECT sum(total_bayar) as total FROM `rb_keuangan_bayar` where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$r[kode_kelas]' AND nisn='$_SESSION[id]' AND tahun_akademik='$th[id_tahun_akademik]'"));
  90. if ($j[total_beban] <= $t[total]) { $status = 'Lunas'; $class = 'green'; }else{ $status = 'Belum Lunas'; $class = 'red'; }
  91. echo "<tr><td>$no</td>
  92. <td>$r[nipd]</td>
  93. <td>$r[nisn]</td>
  94. <td>$r[nama]</td>
  95. <td>$r[nama_kelas]</td>";
  96. if ($_GET[kelas] != '' AND $_GET[biaya] != ''){
  97. if ($j[total_beban] != '0'){
  98. echo "<td><i style='color:$class'>$status</i></td>";
  99. }
  100. }
  101.  
  102. echo "<td><center>
  103. <a class='btn btn-info btn-xs' title='Lihat Detail' href='index.php?view=detailkeuangansiswa&act=detail&biaya=$_GET[biaya]&nisn='$_SESSION[id]'><span class='glyphicon glyphicon-search'></span> Lihat Detail</a> ";
  104. if ($j[total_beban] != '0'){
  105. if ($status == 'Lunas'){
  106. echo "<a class='btn btn-default btn-xs' title='Lihat Detail' href='index.php?view=detailkeuangansiswa&act=detail&biaya=$_GET[biaya]&nisn='$_SESSION[id]'><span class='glyphicon glyphicon-ok'></span> Lunas</a> ";
  107. }else{
  108. echo "<a class='btn btn-success btn-xs' title='Bayar Lunas' href='index.php?view=detailkeuangansiswa&biaya=$_GET[biaya]&kelas=$_GET[kelas]&nisn='$_SESSION[id]'&lunas' onclick=\"return confirm('Apa anda yakin untuk mengubah Status Menjadi Lunas?')\"><span class='glyphicon glyphicon-ok'></span> Lunas</a> ";
  109. }
  110. }
  111. echo "</center></td>
  112. </tr>";
  113. $no++;
  114. }
  115.  
  116. if (isset($_GET[lunas])){
  117. $th = mysql_fetch_array(mysql_query("SELECT * FROM rb_tahun_akademik where aktif='Ya'"));
  118. $j = mysql_fetch_array(mysql_query("SELECT * FROM `rb_keuangan_jenis` where id_keuangan_jenis='$_GET[biaya]'"));
  119. $t = mysql_fetch_array(mysql_query("SELECT sum(total_bayar) as total FROM `rb_keuangan_bayar` where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$_GET[kelas]' AND nisn='$_SESSION[id]' AND tahun_akademik='$th[id_tahun_akademik]'"));
  120. $total = $j[total_beban]-$t[total];
  121. $query = mysql_query("INSERT INTO rb_keuangan_bayar VALUES('','$j[id_keuangan_jenis]','$_GET[kelas]','$_SESSION[id]','$th[id_tahun_akademik]','$total','".date('Y-m-d H:i:s')."')");
  122. if ($query){
  123. echo "<script>document.location='index.php?view=detailkeuangansiswa&biaya=$_GET[biaya]&kelas=$_GET[kelas]&sukses';</script>";
  124. }else{
  125. echo "<script>document.location='index.php?view=detailkeuangansiswa&biaya=$_GET[biaya]&kelas=$_GET[kelas]&gagal';</script>";
  126. }
  127. }
  128. ?>
  129. </tbody>
  130. </table>
  131. </div><!-- /.box-body -->
  132. <?php
  133. if ($_GET[kelas] == '' AND $_GET[biaya] == ''){
  134. echo "<center style='padding:60px; color:red'>Silahkan Memilih Jenis Biaya dan Kelas Terlebih dahulu...</center>";
  135. }
  136. ?>
  137. </div><!-- /.box -->
  138. </form>
  139. </div>
  140. <?php
  141. }elseif($_GET[act]=='detail'){
  142. if (isset($_POST[proses])){
  143. $th = mysql_fetch_array(mysql_query("SELECT * FROM rb_tahun_akademik where aktif='Ya'"));
  144. $query = mysql_query("INSERT INTO rb_keuangan_bayar VALUES('','$_POST[a]','$_POST[b]','$_POST[c]','$th[id_tahun_akademik]','$_POST[bayar]','".date('Y-m-d H:i:s')."')");
  145. if ($query){
  146. echo "<script>document.location='index.php?view=detailkeuangansiswa&act=detail&biaya=$_POST[a]&nisn='$_SESSION[id]'&sukses';</script>";
  147. }else{
  148. echo "<script>document.location='index.php?view=detailkeuangansiswaa&act=detail&biaya=$_POST[a]&nisn='$_SESSION[id]'&gagal';</script>";
  149. }
  150. }
  151.  
  152. $d = mysql_fetch_array(mysql_query("SELECT * FROM `rb_siswa` a JOIN rb_kelas b ON a.kode_kelas=b.kode_kelas where a.nisn='$_SESSION[id]'"));
  153. $j = mysql_fetch_array(mysql_query("SELECT * FROM `rb_keuangan_jenis` where id_keuangan_jenis='$_GET[biaya]'"));
  154. $t = mysql_fetch_array(mysql_query("SELECT sum(total_bayar) as total FROM `rb_keuangan_bayar` where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$d[kode_kelas]' AND nisn='$_SESSION[id]'"));
  155. $sisa = $t[total]-$j[total_beban];
  156. if ($j[total_beban] <= $t[total]) { $status = 'Lunas'; $class = 'success'; }else{ $status = 'Belum Lunas'; $class = 'danger'; }
  157. echo "<div class='col-xs-12'>
  158. <div class='box'>
  159. <div class='box-header'>
  160. <h3 class='box-title'>Data Pembayaran Keuangan Siswa</h3>
  161. <a class='pull-right btn btn-sm btn-warning' href='index.php?view=pembayaransiswa&biaya=$_GET[biaya]&kelas=$d[kode_kelas]'>Kembali</a>
  162. <a target='_BLANK' class='pull-right btn btn-info btn-sm' href='print_kwitansi.php?biaya=$_GET[biaya]&nisn='$_SESSION[id]'>Print</a>
  163.  
  164. </div>
  165. <div class='box-body'>";
  166. if (isset($_GET['sukses'])){
  167. echo "<div class='alert alert-success alert-dismissible fade in' role='alert'>
  168. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  169. <span aria-hidden='true'>×</span></button> <strong>Sukses!</strong> - Data telah Berhasil Di Proses,..
  170. </div>";
  171. }elseif(isset($_GET['gagal'])){
  172. echo "<div class='alert alert-danger alert-dismissible fade in' role='alert'>
  173. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  174. <span aria-hidden='true'>×</span></button> <strong>Gagal!</strong> - Data tidak Di Proses, terjadi kesalahan dengan data..
  175. </div>";
  176. }
  177.  
  178. echo "<div class='col-md-12'>
  179. <form action='' method='POST'>
  180. <table class='table table-condensed table-hover'>
  181. <tbody>
  182. <tr><th width='120px' scope='row'>Nama Kelas</th> <td>$d[nama_kelas]</td></tr>
  183. <tr><th scope='row'>Nama Siswa</th> <td>$d[nama]</td></tr>
  184. <tr><th scope='row'>Jenis Biaya</th> <td>$j[nama_jenis]</td></tr>";
  185.  
  186. if ($sisa < 0){
  187. echo "<input type='hidden' value='$j[id_keuangan_jenis]' name='a'>
  188. <input type='hidden' value='$d[kode_kelas]' name='b'>
  189. <input type='hidden' value='$_GET[nisn]' name='c'>
  190. <tr><th scope='row'>Bayar Sisa</th> <td><input type='text' name='bayar' value=''> <input type='submit' name='proses' value='Proses'></td></tr>";
  191. }
  192.  
  193. if ($j[total_beban] > '0'){
  194. echo "<tr><th scope='row'>Total Beban</th> <td>Rp ".number_format($j[total_beban])."</td></tr>
  195. <tr><th scope='row'>Total Bayar</th> <td>Rp ".number_format($t[total])."</td></tr>
  196. <tr class='alert alert-$class'><th scope='row'>Sisa</th> <td>Rp ".number_format($t[total]-$j[total_beban])." <small class='pull-right'>$status</small></td></tr>";
  197. }
  198.  
  199. if ($j[total_beban] == '0'){
  200. echo "<tr><th scope='row'>Total </th> <td>Rp ".number_format($t[total])."</td></tr>
  201. <input type='hidden' value='$j[id_keuangan_jenis]' name='a'>
  202. <input type='hidden' value='$d[kode_kelas]' name='b'>
  203. <input type='hidden' value='$_GET[nisn]' name='c'>
  204. <tr><th scope='row'>Bayar</th> <td><input type='text' name='bayar' value=''> <input type='submit' name='proses' value='Proses'></td></tr>";
  205. }
  206.  
  207. echo "</tbody>
  208. </table>
  209. </form>
  210. </div>
  211.  
  212.  
  213. <table id='example' class='table table-bordered table-striped'>
  214. <thead>
  215. <tr>
  216. <th style='width:20px'>No</th>
  217. <th>Total Bayar</th>
  218. <th>Tanggal Bayar</th>";
  219. if($_SESSION[level]!='kepala'){
  220. echo "<th>Action</th>";
  221. }
  222. echo "</tr>
  223. </thead>
  224. <tbody>";
  225. $tampil = mysql_query("SELECT * FROM rb_keuangan_bayar where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$d[kode_kelas]' AND nisn='$_SESSION[id]' ORDER BY id_keuangan_bayar DESC");
  226. $no = 1;
  227. while($r=mysql_fetch_array($tampil)){
  228. $ex = explode(' ',$r[waktu_bayar]);
  229. echo "<tr><td>$no</td>
  230. <td>Rp ".number_format($r[total_bayar])."</td>
  231. <td>".tgl_indo($ex[0])." ".$ex[1]." WIB</td>";
  232. if($_SESSION[level]!='kepala'){
  233. echo "<td style='width:80px !important'><center>
  234. <a class='btn btn-danger btn-xs' title='Delete Data' href='index.php?view=pembayaransiswa&act=detail&biaya=$_GET[biaya]&nisn=$_GET[nisn]&hapus=$r[id_keuangan_bayar]' onclick=\"return confirm('Apa anda yakin untuk hapus Data ini?')\"><span class='glyphicon glyphicon-remove'></span></a>
  235. </center></td>";
  236. }
  237. echo "</tr>";
  238. $no++;
  239. }
  240.  
  241. if (isset($_GET[hapus])){
  242. mysql_query("DELETE FROM rb_keuangan_bayar where id_keuangan_bayar='$_GET[hapus]'");
  243. echo "<script>document.location='index.php?view=detailkeuangansiswa&act=detail&biaya=$_GET[biaya]&nisn='$_GET[nisn]';</script>";
  244. }
  245.  
  246. echo "<tbody>
  247. </table>
  248. </div>
  249. </div>
  250. </div>";
  251. }
  252. ?>
  253.  
  254. langusng dikasih mateng aja mas script yang benar buat nampilinnya yang benar seperti apa kalau untuk nampilin di login siswa
Terdapat 1 File dilampirkan :
1. detailkeuangan_siswa.jpg (156 KB)
Zaka semiawan
commented on 23 Jan 2018 21:00:19
  1. up
Massofik Syahsa
commented on 04 Mei 2018 14:56:41
  1. Ini di taruh mana ya mas?
  2.  
  3. <?php
  4. if ($_GET[act]==''){
  5. ?>
  6. <div class="col-xs-12">
  7. <div class="box">
  8. <div class="box-header">
  9. <h3 class="box-title">Pembayaran Keuangan Siswa </h3>
  10. <form style='margin-right:5px; margin-top:0px' class='pull-right' action='' method='GET'>
  11. <input type="hidden" name='view' value='detailkeuangansiswa'>
  12. <select name='biaya' style='padding:4px'>
  13. <?php
  14. echo "<option value=''>- Pilih Jenis Biaya -</option>";
  15. $biaya = mysql_query("SELECT * FROM rb_keuangan_jenis");
  16. while ($k = mysql_fetch_array($biaya)){
  17. if ($_GET[biaya]==$k[id_keuangan_jenis]){
  18. echo "<option value='$k[id_keuangan_jenis]' selected>$k[nama_jenis]</option>";
  19. }else{
  20. echo "<option value='$k[id_keuangan_jenis]'>$k[nama_jenis]</option>";
  21. }
  22. }
  23. ?>
  24. </select>
  25. <select name='kelas' style='padding:4px'>
  26. <?php
  27. echo "<option value=''>- Filter Kelas -</option>";
  28. $kelas = mysql_query("SELECT * FROM rb_kelas");
  29. while ($k = mysql_fetch_array($kelas)){
  30. if ($_GET[kelas]==$k[kode_kelas]){
  31. echo "<option value='$k[kode_kelas]' selected>$k[kode_kelas] - $k[nama_kelas]</option>";
  32. }else{
  33. echo "<option value='$k[kode_kelas]'>$k[kode_kelas] - $k[nama_kelas]</option>";
  34. }
  35. }
  36. ?>
  37. </select>
  38.  
  39. <input type="submit" style='margin-top:-4px' class='btn btn-info btn-sm' value='Lihat'>
  40. </form>
  41. </div><!-- /.box-header -->
  42. <div class="box-body">
  43.  
  44. <?php
  45. if (isset($_GET['sukses'])){
  46. echo "<div class='alert alert-success alert-dismissible fade in' role='alert'>
  47. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  48. <span aria-hidden='true'>×</span></button> <strong>Sukses!</strong> - Data telah Berhasil Di Proses,..
  49. </div>";
  50. }elseif(isset($_GET['gagal'])){
  51. echo "<div class='alert alert-danger alert-dismissible fade in' role='alert'>
  52. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  53. <span aria-hidden='true'>×</span></button> <strong>Gagal!</strong> - Data tidak Di Proses, terjadi kesalahan dengan data..
  54. </div>";
  55. }
  56. ?>
  57.  
  58. <form action='' method='POST'>
  59. <input type="hidden" name='kelas' value='<?php echo $_GET[kelas]; ?>'>
  60. <?php
  61. $j = mysql_fetch_array(mysql_query("SELECT * FROM `rb_keuangan_jenis` where id_keuangan_jenis='$_GET[biaya]'"));
  62. $th = mysql_fetch_array(mysql_query("SELECT * FROM rb_tahun_akademik where aktif='Ya'"));
  63. echo "<table id='example1' class='table table-bordered table-striped'>
  64. <thead>
  65. <tr><th width='30px'>No</th>
  66. <th>NIPD</th>
  67. <th>NISN</th>
  68. <th>Nama Siswa</th>
  69. <th>Kelas</th>";
  70. if ($_GET[kelas] != '' AND $_GET[biaya] != ''){
  71. if ($j[total_beban] != '0'){
  72. echo "<th>Status</th>";
  73. }
  74. }
  75.  
  76. echo "<th width='140px'>Action</th>
  77. </tr>
  78. </thead>
  79. <tbody>";
  80.  
  81. if ($_GET[kelas] != '' AND $_GET[biaya] != ''){
  82. $tampil = mysql_query("SELECT * FROM rb_siswa a LEFT JOIN rb_kelas b ON a.kode_kelas=b.kode_kelas
  83. LEFT JOIN rb_jenis_kelamin c ON a.id_jenis_kelamin=c.id_jenis_kelamin
  84. LEFT JOIN rb_jurusan d ON b.kode_jurusan=d.kode_jurusan
  85. where a.kode_kelas='$_GET[kelas]' ORDER BY a.id_siswa");
  86. }
  87. $no = 1;
  88. while($r=mysql_fetch_array($tampil)){
  89. $t = mysql_fetch_array(mysql_query("SELECT sum(total_bayar) as total FROM `rb_keuangan_bayar` where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$r[kode_kelas]' AND nisn='$_SESSION[id]' AND tahun_akademik='$th[id_tahun_akademik]'"));
  90. if ($j[total_beban] <= $t[total]) { $status = 'Lunas'; $class = 'green'; }else{ $status = 'Belum Lunas'; $class = 'red'; }
  91. echo "<tr><td>$no</td>
  92. <td>$r[nipd]</td>
  93. <td>$r[nisn]</td>
  94. <td>$r[nama]</td>
  95. <td>$r[nama_kelas]</td>";
  96. if ($_GET[kelas] != '' AND $_GET[biaya] != ''){
  97. if ($j[total_beban] != '0'){
  98. echo "<td><i style='color:$class'>$status</i></td>";
  99. }
  100. }
  101.  
  102. echo "<td><center>
  103. <a class='btn btn-info btn-xs' title='Lihat Detail' href='index.php?view=detailkeuangansiswa&act=detail&biaya=$_GET[biaya]&nisn='$_SESSION[id]'><span class='glyphicon glyphicon-search'></span> Lihat Detail</a> ";
  104. if ($j[total_beban] != '0'){
  105. if ($status == 'Lunas'){
  106. echo "<a class='btn btn-default btn-xs' title='Lihat Detail' href='index.php?view=detailkeuangansiswa&act=detail&biaya=$_GET[biaya]&nisn='$_SESSION[id]'><span class='glyphicon glyphicon-ok'></span> Lunas</a> ";
  107. }else{
  108. echo "<a class='btn btn-success btn-xs' title='Bayar Lunas' href='index.php?view=detailkeuangansiswa&biaya=$_GET[biaya]&kelas=$_GET[kelas]&nisn='$_SESSION[id]'&lunas' onclick=\"return confirm('Apa anda yakin untuk mengubah Status Menjadi Lunas?')\"><span class='glyphicon glyphicon-ok'></span> Lunas</a> ";
  109. }
  110. }
  111. echo "</center></td>
  112. </tr>";
  113. $no++;
  114. }
  115.  
  116. if (isset($_GET[lunas])){
  117. $th = mysql_fetch_array(mysql_query("SELECT * FROM rb_tahun_akademik where aktif='Ya'"));
  118. $j = mysql_fetch_array(mysql_query("SELECT * FROM `rb_keuangan_jenis` where id_keuangan_jenis='$_GET[biaya]'"));
  119. $t = mysql_fetch_array(mysql_query("SELECT sum(total_bayar) as total FROM `rb_keuangan_bayar` where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$_GET[kelas]' AND nisn='$_SESSION[id]' AND tahun_akademik='$th[id_tahun_akademik]'"));
  120. $total = $j[total_beban]-$t[total];
  121. $query = mysql_query("INSERT INTO rb_keuangan_bayar VALUES('','$j[id_keuangan_jenis]','$_GET[kelas]','$_SESSION[id]','$th[id_tahun_akademik]','$total','".date('Y-m-d H:i:s')."')");
  122. if ($query){
  123. echo "<script>document.location='index.php?view=detailkeuangansiswa&biaya=$_GET[biaya]&kelas=$_GET[kelas]&sukses';</script>";
  124. }else{
  125. echo "<script>document.location='index.php?view=detailkeuangansiswa&biaya=$_GET[biaya]&kelas=$_GET[kelas]&gagal';</script>";
  126. }
  127. }
  128. ?>
  129. </tbody>
  130. </table>
  131. </div><!-- /.box-body -->
  132. <?php
  133. if ($_GET[kelas] == '' AND $_GET[biaya] == ''){
  134. echo "<center style='padding:60px; color:red'>Silahkan Memilih Jenis Biaya dan Kelas Terlebih dahulu...</center>";
  135. }
  136. ?>
  137. </div><!-- /.box -->
  138. </form>
  139. </div>
  140. <?php
  141. }elseif($_GET[act]=='detail'){
  142. if (isset($_POST[proses])){
  143. $th = mysql_fetch_array(mysql_query("SELECT * FROM rb_tahun_akademik where aktif='Ya'"));
  144. $query = mysql_query("INSERT INTO rb_keuangan_bayar VALUES('','$_POST[a]','$_POST[b]','$_POST[c]','$th[id_tahun_akademik]','$_POST[bayar]','".date('Y-m-d H:i:s')."')");
  145. if ($query){
  146. echo "<script>document.location='index.php?view=detailkeuangansiswa&act=detail&biaya=$_POST[a]&nisn='$_SESSION[id]'&sukses';</script>";
  147. }else{
  148. echo "<script>document.location='index.php?view=detailkeuangansiswaa&act=detail&biaya=$_POST[a]&nisn='$_SESSION[id]'&gagal';</script>";
  149. }
  150. }
  151.  
  152. $d = mysql_fetch_array(mysql_query("SELECT * FROM `rb_siswa` a JOIN rb_kelas b ON a.kode_kelas=b.kode_kelas where a.nisn='$_SESSION[id]'"));
  153. $j = mysql_fetch_array(mysql_query("SELECT * FROM `rb_keuangan_jenis` where id_keuangan_jenis='$_GET[biaya]'"));
  154. $t = mysql_fetch_array(mysql_query("SELECT sum(total_bayar) as total FROM `rb_keuangan_bayar` where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$d[kode_kelas]' AND nisn='$_SESSION[id]'"));
  155. $sisa = $t[total]-$j[total_beban];
  156. if ($j[total_beban] <= $t[total]) { $status = 'Lunas'; $class = 'success'; }else{ $status = 'Belum Lunas'; $class = 'danger'; }
  157. echo "<div class='col-xs-12'>
  158. <div class='box'>
  159. <div class='box-header'>
  160. <h3 class='box-title'>Data Pembayaran Keuangan Siswa</h3>
  161. <a class='pull-right btn btn-sm btn-warning' href='index.php?view=pembayaransiswa&biaya=$_GET[biaya]&kelas=$d[kode_kelas]'>Kembali</a>
  162. <a target='_BLANK' class='pull-right btn btn-info btn-sm' href='print_kwitansi.php?biaya=$_GET[biaya]&nisn='$_SESSION[id]'>Print</a>
  163.  
  164. </div>
  165. <div class='box-body'>";
  166. if (isset($_GET['sukses'])){
  167. echo "<div class='alert alert-success alert-dismissible fade in' role='alert'>
  168. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  169. <span aria-hidden='true'>×</span></button> <strong>Sukses!</strong> - Data telah Berhasil Di Proses,..
  170. </div>";
  171. }elseif(isset($_GET['gagal'])){
  172. echo "<div class='alert alert-danger alert-dismissible fade in' role='alert'>
  173. <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
  174. <span aria-hidden='true'>×</span></button> <strong>Gagal!</strong> - Data tidak Di Proses, terjadi kesalahan dengan data..
  175. </div>";
  176. }
  177.  
  178. echo "<div class='col-md-12'>
  179. <form action='' method='POST'>
  180. <table class='table table-condensed table-hover'>
  181. <tbody>
  182. <tr><th width='120px' scope='row'>Nama Kelas</th> <td>$d[nama_kelas]</td></tr>
  183. <tr><th scope='row'>Nama Siswa</th> <td>$d[nama]</td></tr>
  184. <tr><th scope='row'>Jenis Biaya</th> <td>$j[nama_jenis]</td></tr>";
  185.  
  186. if ($sisa < 0){
  187. echo "<input type='hidden' value='$j[id_keuangan_jenis]' name='a'>
  188. <input type='hidden' value='$d[kode_kelas]' name='b'>
  189. <input type='hidden' value='$_GET[nisn]' name='c'>
  190. <tr><th scope='row'>Bayar Sisa</th> <td><input type='text' name='bayar' value=''> <input type='submit' name='proses' value='Proses'></td></tr>";
  191. }
  192.  
  193. if ($j[total_beban] > '0'){
  194. echo "<tr><th scope='row'>Total Beban</th> <td>Rp ".number_format($j[total_beban])."</td></tr>
  195. <tr><th scope='row'>Total Bayar</th> <td>Rp ".number_format($t[total])."</td></tr>
  196. <tr class='alert alert-$class'><th scope='row'>Sisa</th> <td>Rp ".number_format($t[total]-$j[total_beban])." <small class='pull-right'>$status</small></td></tr>";
  197. }
  198.  
  199. if ($j[total_beban] == '0'){
  200. echo "<tr><th scope='row'>Total </th> <td>Rp ".number_format($t[total])."</td></tr>
  201. <input type='hidden' value='$j[id_keuangan_jenis]' name='a'>
  202. <input type='hidden' value='$d[kode_kelas]' name='b'>
  203. <input type='hidden' value='$_GET[nisn]' name='c'>
  204. <tr><th scope='row'>Bayar</th> <td><input type='text' name='bayar' value=''> <input type='submit' name='proses' value='Proses'></td></tr>";
  205. }
  206.  
  207. echo "</tbody>
  208. </table>
  209. </form>
  210. </div>
  211.  
  212.  
  213. <table id='example' class='table table-bordered table-striped'>
  214. <thead>
  215. <tr>
  216. <th style='width:20px'>No</th>
  217. <th>Total Bayar</th>
  218. <th>Tanggal Bayar</th>";
  219. if($_SESSION[level]!='kepala'){
  220. echo "<th>Action</th>";
  221. }
  222. echo "</tr>
  223. </thead>
  224. <tbody>";
  225. $tampil = mysql_query("SELECT * FROM rb_keuangan_bayar where id_keuangan_jenis='$_GET[biaya]' AND kode_kelas='$d[kode_kelas]' AND nisn='$_SESSION[id]' ORDER BY id_keuangan_bayar DESC");
  226. $no = 1;
  227. while($r=mysql_fetch_array($tampil)){
  228. $ex = explode(' ',$r[waktu_bayar]);
  229. echo "<tr><td>$no</td>
  230. <td>Rp ".number_format($r[total_bayar])."</td>
  231. <td>".tgl_indo($ex[0])." ".$ex[1]." WIB</td>";
  232. if($_SESSION[level]!='kepala'){
  233. echo "<td style='width:80px !important'><center>
  234. <a class='btn btn-danger btn-xs' title='Delete Data' href='index.php?view=pembayaransiswa&act=detail&biaya=$_GET[biaya]&nisn=$_GET[nisn]&hapus=$r[id_keuangan_bayar]' onclick=\"return confirm('Apa anda yakin untuk hapus Data ini?')\"><span class='glyphicon glyphicon-remove'></span></a>
  235. </center></td>";
  236. }
  237. echo "</tr>";
  238. $no++;
  239. }
  240.  
  241. if (isset($_GET[hapus])){
  242. mysql_query("DELETE FROM rb_keuangan_bayar where id_keuangan_bayar='$_GET[hapus]'");
  243. echo "<script>document.location='index.php?view=detailkeuangansiswa&act=detail&biaya=$_GET[biaya]&nisn='$_GET[nisn]';</script>";
  244. }
  245.  
  246. echo "<tbody>
  247. </table>
  248. </div>
  249. </div>
  250. </div>";
  251. }
  252. ?>
Bukhori Muslim
commented on 05 Mei 2018 07:39:39
  1. Assalam,.. gunakan script yang dikasih pak robi di atas gan yang ini :
  2. <?php
  3. $query = mysql_query("SELECT * FROM rb_keuangan_jenis");
  4. while ($row = mysql_fetch_array($query)){
  5. $cek_pembayaran_siswa = mysql_fetch_array(mysql_query("SELECT sum[total_bayar] as nominal FROM rb_keuangan_bayar
  6. where nisn='$_SESSION[id]' AND tahun_akademik='$tahunakademik[id_tahun_akademik]'
  7. AND id_keuangan_jenis='$row[id_keuangan_jenis]'"));
  8. <tr>
  9. <td>$row[nama_jenis]</td>
  10. <td>$row[total_beban]</td>
  11. <td>$cek_pembayaran_siswa[nominal]</td>
  12. <td>".($row[total_beban]-$cek_pembayaran_siswa[nominal])."</td>
  13. </tr>
  14. }
  15. ?>
  16.  
  17. tempatkan pada file baru yang dibuat "application/keuangan_siswa.php" seperti yang di infokan pak robi di atas
  18. jangan copas dari modul keuangan di admin, karena nanti aksesnya jadi sama seperti admin,
  19. malah di edit siswa nanti data keuangannya. :D
Miftahul Alfin
commented on 05 Mei 2018 20:59:12
  1. Assalam,..
  2. Mohon Bantuannya mas..
  3. saya sudah mngikuti langkah yg dikasih diatas, tp kok msih ndk mncul ya..
  4. ini saya lmpirkan fotonya
Terdapat 3 File dilampirkan :
1. photo_2018-05-05_20-57-25.jpg (31 KB)
2. photo_2018-05-05_20-57-26.jpg (73 KB)
3. photo_2018-05-05_20-57-28.jpg (33 KB)
I Putu Hari Aditya Darma
commented on 08 Jun 2018 23:05:30
  1. Assalam,.. di bantu mas saya sama mengalami kendala seperti mas Mifyahul, di siswa cma muncul blank saja, terimakasih
Bukhori Muslim
commented on 14 Jun 2018 09:21:11
  1. Assalam,.. seperti tahaan yang disampaikan pak robi di atas,..
  2. - buka file index.php
  3. tambahkan rule baru disana,..
  4. <?php
  5. if ($_GET[view]=='keuangansiswa'){
  6. cek_session_siswa();
  7. echo "<div class='row'>";
  8. include "application/keuangan_siswa.php";
  9. echo "</div>";
  10. }
  11. ?>
  12.  
  13. insyaallah setelahnya tidak akan blank lagi,.. :)
Miftahul Alfin
commented on 27 Jun 2018 09:32:35
  1. Assalam,..
  2. maaf mas, ini masih blank
  3. mohon bantuan nya
Terdapat 2 File dilampirkan :
1. blank2.PNG (12 KB)
2. uangsiswa.PNG (153 KB)
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!