Advertisement
Guest User

Untitled

a guest
Jan 13th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.18 KB | None | 0 0
  1. <?php
  2. include 'index.php';
  3. $dbhost='localhost';
  4. $dbuser='root';
  5. $dbpass='';
  6. $dbname='spktopsispemilihansekolah';
  7. $db=new mysqli($dbhost,$dbuser,$dbpass,$dbname);
  8. $sql = "SELECT
  9. a.id_sekolah, b.id_fasilitas, c.id_ekstra
  10. FROM
  11. sekolah a, fasilitas b, ekstrakulikuler c
  12. WHERE
  13. a.id_sekolah = b.id_fasilitas
  14. AND
  15. a.id_sekolah = c.id_ekstra"
  16. ;
  17. ?>
  18. <!--main content start-->
  19. <section id="main-content">
  20. <section class="wrapper">
  21. <!--overview start-->
  22. <div class="row">
  23. <div class="col-lg-12">
  24. <h3 class="page-header"><i class="fa fa-laptop"></i>Detail Sekolah</h3>
  25. <!--tab nav start-->
  26. <section class="panel">
  27. <div class="panel-body">
  28. <div class="thumbnail">
  29. <div id="data" class="tab-pane active">
  30. <h4>Detail Sekolah</h4>
  31. <table class="table table-bordered table-responsive">
  32. <thead>
  33. <tr>
  34. <th>NPSN</th>
  35. <th>Nama Sekolah</th>
  36. <th>Akreditasi</th>
  37. <th>Kepala Sekolah</th>
  38. <th>Alamat</th>
  39. <th>No. Telp</th>
  40. <th>Email</th>
  41. <th>Website</th>
  42. <th>Biaya SPP</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <?php
  47. $conn = mysqli_connect("localhost","root","","spktopsispemilihansekolah");
  48. $id_sekolah=$_GET['id_sekolah'];
  49. $altr = "SELECT * from sekolah where id_sekolah='$id_sekolah'";
  50. $tampil=mysqli_query($conn,$altr);
  51. while ($hasil=mysqli_fetch_array($tampil)) {
  52. echo "<tr>
  53. <td>$hasil[npsn]</td>
  54. <td>$hasil[nama_sekolah]</td>
  55. <td>$hasil[akreditasi]</td>
  56. <td>$hasil[kepsek]</td>
  57. <td>$hasil[alamat]</td>
  58. <td>$hasil[telp]</td>
  59. <td>$hasil[email]</td>
  60. <td>$hasil[web]</td>
  61. <td>$hasil[spp]</td>
  62. </tr>";
  63. }
  64.  
  65. ?>
  66. </tbody>
  67. </table>
  68.  
  69. <div class="thumbnail">
  70. <div id="data" class="tab-pane active">
  71. <h4>Detail Fasilitas</h4>
  72. <table class="table table-bordered table-responsive">
  73. <thead>
  74. <tr>
  75. <th>Nama Fasilitas</th>
  76. </tr>
  77. </thead>
  78. <tbody>
  79. <?php
  80. $conn = mysqli_connect("localhost","root","","spktopsispemilihansekolah");
  81. $krtr = "select * from fasilitas_sekolah where id_fasilitas = '$id_fasilitas'";
  82. $hasil = mysqli_query($conn, $krtr);
  83. while($data=mysqli_fetch_array($hasil)){
  84. echo "<tr>
  85. <td>$hasil[nama_fasilitas]</td>
  86. </tr>";
  87. }
  88. ?>
  89. </tbody>
  90. </table>
  91.  
  92. <div class="thumbnail">
  93. <div id="data" class="tab-pane active">
  94. <h4>Detail Ekstrakulikuler</h4>
  95. <table class="table table-bordered table-responsive">
  96. <thead>
  97. <tr>
  98. <th>Nama Ekstrakulikuler</th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <?php
  103. $conn = mysqli_connect("localhost","root","","spktopsispemilihansekolah");
  104. $krtr = "select * from sekolah_ekstra where id_ekstra = '$id_ekstra'";
  105. $hasil = mysqli_query($conn, $krtr);
  106. while($data=mysqli_fetch_array($hasil)){
  107. echo "<tr>
  108. <td>$hasil[nama_fasilitas]</td>
  109. </tr>";
  110. }
  111. ?>
  112. </tbody>
  113. </table>
  114. </div>
  115. </div>
  116. </div>
  117. </section>
  118. <!--tab nav start-->
  119. </div>
  120. </div>
  121. </section>
  122. </section>
  123. <!--main content end-->
  124. <?php
  125. include 'footer.php';
  126. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement