Advertisement
ali602

list-daftar-anggota.php

May 15th, 2024
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.52 KB | Source Code | 0 0
  1. <?php include("config.php"); ?>
  2.  
  3.  
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7.     <title>Pendaftaran Anggota Perpus Baru | SMK Gamelab Indonesia</title>
  8.     <style>
  9.         .anggota {
  10.           font-family: Arial, Helvetica, sans-serif;
  11.           border-collapse: collapse;
  12.           width: 100%;
  13.         }
  14.  
  15.         .anggota td, .anggota th {
  16.           border: 1px solid #ddd;
  17.           padding: 8px;
  18.         }
  19.  
  20.         .anggota td {
  21.           padding-top: 12px;
  22.           padding-bottom: 12px;
  23.           text-align: center;
  24.         }
  25.  
  26.         .anggota tr:nth-child(even){background-color: #f2f2f2;}
  27.  
  28.         .anggota tr:hover {background-color: #ddd;}
  29.  
  30.         .anggota th {
  31.           padding-top: 12px;
  32.           padding-bottom: 12px;
  33.           text-align: center;
  34.           background-color: #04AA6D;
  35.           color: white;
  36.         }
  37.         .fcc-btn1 {
  38.           background-color:#008CBA;
  39.           color: white;
  40.           padding: 5px 15px;
  41.           border-radius:8px;
  42.         }
  43.         .fcc-btn2 {
  44.           background-color: #f44336;
  45.           color: white;
  46.           padding: 5px 15px;
  47.           border-radius:8px;
  48.         }
  49.  
  50.         .fcc-btn3 {
  51.           background-color: #4CAF50;
  52.           color: white;
  53.           padding: 5px 15px;
  54.           border-radius:8px;
  55.         }
  56.         a {
  57.             text-decoration:none;
  58.         }
  59.     </style>
  60. </head>
  61.  
  62. <body>
  63.     <header>
  64.         <h1>Daftar Anggota Perpustakaan yang sudah mendaftar</h1>
  65.     </header>
  66.    
  67.     <nav>
  68.         <a class='fcc-btn3' href="form-daftar-anggota.php">[+] Tambah Anggota</a>
  69.     </nav>
  70.    
  71.     <br>
  72.    
  73.     <table border="1" class="anggota">
  74.         <thead>
  75.             <tr>
  76.                 <th>No</th>
  77.                 <th>Nama Lengkap</th>
  78.                 <th>Alamat Lengkap</th>
  79.                 <th>Jenis Kelamin</th>
  80.                 <th>Agama</th>
  81.                 <th>Asal Sekolah</th>
  82.                 <th>Tindakan</th>
  83.             </tr>
  84.         </thead>
  85.         <tbody>
  86.            
  87.             <?php
  88.                 $sql = "SELECT * FROM anggota_perpus";
  89.                 $query = mysqli_query($db, $sql);
  90.                
  91.                 while($anggota = mysqli_fetch_array($query)){
  92.                     echo "<tr>";
  93.                            
  94.                     echo "<td>".$anggota['id_anggota']."</td>";
  95.                     echo "<td>".$anggota['nama']."</td>";
  96.                     echo "<td>".$anggota['alamat']."</td>";
  97.                     echo "<td>".$anggota['jenis_kelamin']."</td>";
  98.                     echo "<td>".$anggota['agama']."</td>";
  99.                     echo "<td>".$anggota['asal_sekolah']."</td>";
  100.                            
  101.                     echo "<td>";
  102.                     echo "<a class='fcc-btn1' href='form-edit-anggota.php?id_anggota=".$anggota['id_anggota']."' >Edit</a>    ";
  103.                         // tambahkan kode pada baris <a class='fcc-btn2' >Hapus</a>
  104.                     echo "<a class='fcc-btn2' href='hapus-anggota.php?id_anggota=".$anggota['id_anggota']."' >Hapus</a>";
  105.                     echo "</td>";
  106.                            
  107.                     echo "</tr>";
  108.                 }  
  109.             ?>
  110.            
  111.         </tbody>
  112.     </table>
  113.    
  114.     <h3>Total: <?php echo mysqli_num_rows($query) ?> Anggota baru</h3>
  115.    
  116.     </body>
  117. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement