fadilzteria

list-siswa

Oct 11th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php include("config.php"); ?>
  2.  
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6.     <title>Pendaftaran Siswa Baru | SMK Coding</title>
  7. </head>
  8.  
  9. <body>
  10.     <header>
  11.         <h3>Siswa yang sudah mendaftar</h3>
  12.     </header>
  13.  
  14.     <nav>
  15.         <a href="form-daftar.php">[+] Tambah Baru</a>
  16.     </nav>
  17.  
  18.     <br>
  19.  
  20.     <table border="1">
  21.     <thead>
  22.         <tr>
  23.             <th>No</th>
  24.             <th>Nama</th>
  25.             <th>Alamat</th>
  26.             <th>Jenis Kelamin</th>
  27.             <th>Agama</th>
  28.             <th>Sekolah Asal</th>
  29.             <th>Tindakan</th>
  30.         </tr>
  31.     </thead>
  32.     <tbody>
  33.  
  34.         <?php
  35.         $sql = "SELECT * FROM calon_siswa";
  36.         $query = mysqli_query($db, $sql);
  37.  
  38.         while($siswa = mysqli_fetch_array($query)){
  39.             echo "<tr>";
  40.  
  41.             echo "<td>".$siswa['id']."</td>";
  42.             echo "<td>".$siswa['nama']."</td>";
  43.             echo "<td>".$siswa['alamat']."</td>";
  44.             echo "<td>".$siswa['jenis_kelamin']."</td>";
  45.             echo "<td>".$siswa['agama']."</td>";
  46.             echo "<td>".$siswa['sekolah_asal']."</td>";
  47.  
  48.             echo "<td>";
  49.             echo "<a href='form-edit.php?id=".$siswa['id']."'>Edit</a> | ";
  50.             echo "<a href='hapus.php?id=".$siswa['id']."'>Hapus</a>";
  51.             echo "</td>";
  52.  
  53.             echo "</tr>";
  54.         }
  55.         ?>
  56.  
  57.     </tbody>
  58.     </table>
  59.  
  60.     <p>Total: <?php echo mysqli_num_rows($query) ?></p>
  61.  
  62.     </body>
  63. </html>
Add Comment
Please, Sign In to add comment