Guest User

CRUD Mysqli index.php

a guest
May 25th, 2018
4,972
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. <html>
  2. <title>Aplikasi CRUD Sederhana</title>
  3. <head>
  4. <link rel="stylesheet" href="style/bootstrap.min.css" />
  5. </head>
  6. <body>
  7.  
  8. <div class="container" style="margin-top:8%">
  9.     <div class="row">
  10.         <div class="col-md-8 col-md-offset-2">
  11.             <p>
  12.                 <center>
  13.                     <h2>Aplikasi Crud Sederhana</h2>
  14.                     Oleh : <a href="https://www.facebook.com.pendeta.mokong" target="_blank">Rully Studio</a>
  15.                 </center>
  16.             </p>
  17.             <br>
  18.             <p>
  19.                 <a class="btn btn-primary" href="tambah.php">Tambah</a>
  20.             </p>
  21.             <table class="table table-bordered">
  22.                 <tr>
  23.                     <th>
  24.                         No
  25.                     </th>
  26.                     <th>
  27.                         Nama
  28.                     </th>
  29.                     <th>
  30.                         Jenis Kelamin
  31.                     </th>
  32.                     <th>
  33.                         Telepon
  34.                     </th>
  35.                     <th>
  36.                         Alamat
  37.                     </th>
  38.                     <th>
  39.                         Opsi
  40.                     </th>
  41.                 </tr>
  42.                     <?php
  43.                         include"koneksi.php";
  44.                         $no = 1;
  45.                         $data = mysqli_query ($koneksi, " select
  46.                                                                 id_mahasiswa,
  47.                                                                 nama,
  48.                                                                 jenis_kelamin,
  49.                                                                 telepon,
  50.                                                                 alamat
  51.                                                           from
  52.                                                           mahasiswa
  53.                                                           order by id_mahasiswa DESC");
  54.                         while ($row = mysqli_fetch_array ($data))
  55.                         {
  56.                     ?>
  57.                 <tr>
  58.                     <td>
  59.                         <?php echo $no++; ?>
  60.                     </td>
  61.                     <td>
  62.                         <?php echo $row['nama']; ?>
  63.                     </td>
  64.                     <td>
  65.                         <?php echo $row['jenis_kelamin']; ?>
  66.                     </td>
  67.                     <td>
  68.                         <?php echo $row['telepon']; ?>
  69.                     </td>
  70.                     <td>
  71.                         <?php echo $row['alamat']; ?>
  72.                     </td>
  73.                     <td>
  74.                         <a href="detail.php?id=<?php echo $row['id_mahasiswa']; ?>">Detail</a> |
  75.                         <a href="edit.php?id=<?php echo $row['id_mahasiswa']; ?>">Edit</a> |
  76.                         <a href="hapus.php?id=<?php echo $row['id_mahasiswa']; ?>">Hapus</a>
  77.                     </td>
  78.                 </tr>
  79.                 <?php
  80.                     }
  81.                 ?>
  82.             </table>
  83.         </div>
  84.     </div>
  85.     <p>
  86.     <center>Copyright @ 2018 by : <a href="https://www.facebook.com.pendeta.mokong" target="_blank">Rully Studio</a> All rights reserved.</center>
  87.     </p>
  88. </div>
  89. </body>
  90. </html>
Add Comment
Please, Sign In to add comment