mnaufaldillah

list siswa tugas php

Dec 6th, 2021
565
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php include('config.php'); ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.     <title>List Pendaftar</title>
  6.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  7. </head>
  8. <body>
  9.     <header>
  10.         </center><h3>List Pendaftar</h3></center>
  11.     </header>
  12.  
  13.     <table border="1" class="table">
  14.         <thead class="thead-dark">
  15.             <th>NO</th>
  16.             <th>Nama</th>
  17.             <th>Alamat</th>
  18.             <th>Jenis Kelamin</th>
  19.             <th>Agama</th>
  20.             <th>Sekolah Asal</th>
  21.             <th colspan="2">Aksi</th>
  22.         </thead>
  23.         <tbody>
  24.             <?php
  25.                 $sql = "SELECT * FROM calon_siswa";
  26.                 $query = mysqli_query($db_connection, $sql);
  27.  
  28.                 while ($siswa = mysqli_fetch_array($query)) {
  29.                     echo "<tr>";
  30.  
  31.                     echo "<td>".$siswa['id']."</td>";
  32.                     echo "<td>".$siswa['nama']."</td>";
  33.                     echo "<td>".$siswa['alamat']."</td>";
  34.                     echo "<td>".$siswa['jenis_kelamin']."</td>";
  35.                     echo "<td>".$siswa['agama']."</td>";
  36.                     echo "<td>".$siswa['sekolah_asal']."</td>";
  37.                     echo "<td>"."<a href='form-edit.php?id=".$siswa['id']."'>Edit</a>"."</td>";
  38.                     echo "<td>"."<a href='hapus.php?id=".$siswa['id']."'>Hapus</a>"."</td>";
  39.  
  40.                     echo "</tr>";
  41.                  }
  42.             ?>
  43.         </tbody>
  44.     </table>
  45. </body>
  46. </html>
RAW Paste Data