Advertisement
Guest User

Untitled

a guest
May 14th, 2016
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. public function cekbulanini($waktu,$id)
  2. {
  3. $stmt = $this->db->prepare("SELECT * FROM bayar WHERE id = $id");
  4. $stmt->execute();
  5.  
  6. if($stmt->rowCount()>0)
  7. {
  8. while($row=$stmt->fetch(PDO::FETCH_ASSOC))
  9. {
  10. ?>
  11. <?php
  12. if ($row[$waktu] == 'Y') {
  13. echo "<span class='label label-sm label-success'>Telah Dibayar </span>";
  14. } elseif ($row[$waktu] == 'N') {
  15. echo "BELUM";
  16. } else {
  17. echo "ERROR";
  18. }
  19.  
  20. }
  21. ?>
  22. <?php
  23. }
  24. else
  25. {
  26. ?>
  27. <tr>
  28. <td>Nothing here...</td>
  29. </tr>
  30. <?php
  31. }
  32.  
  33. }
  34.  
  35. public function daftarsiswa()
  36. {
  37. $stmt = $this->db->prepare("SELECT * FROM siswa");
  38. $stmt->execute();
  39.  
  40. if($stmt->rowCount()>0)
  41. {
  42. while($row=$stmt->fetch(PDO::FETCH_ASSOC))
  43. {
  44. $id = $row['id'];
  45. ?>
  46. <tr class="odd gradeX">
  47. <td>
  48. <input type="checkbox" class="checkboxes" value="1"/>
  49. </td>
  50. <td>
  51. <?php print $row['nama']; ?>
  52. </td>
  53. <td>
  54. <a href="mailto:[email protected]">
  55. </td>
  56. <td>
  57. <?php print $row['nomerinduk']; ?>
  58. </td>
  59. <td class="center">
  60. <?php print $row['kelas']; ?>
  61. </td>
  62. <td class="center">
  63. <?= cekbulanini($id,$waktu); ?>
  64. </td>
  65. </tr>
  66. <?php
  67. }
  68. }
  69. else
  70. {
  71. ?>
  72. <tr>
  73. <td>Nothing here...</td>
  74. </tr>
  75. <?php
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement