Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'data_koneksi.php';
- extract($_GET);
- if (isset($_GET['pageData'])) {
- $pageAktif = $_GET['pageData'];
- $jumpageTampilkan = 3;
- $pageMulai = ($pageAktif - 1) * $jumpageTampilkan;
- $sql = "SELECT * FROM data LIMIT $pageMulai, $jumpageTampilkan";
- $query = $conn->query($sql);
- $table = '';
- $id = 1;
- foreach($query as $rows) {
- $table .= '<tr>
- <td>'. $id++ .'</td>;
- <td>'. $rows['nama']. '</td>;
- <td> <img src="'. $rows['gambar'].'" width="50px" height="50px" class="rounded-circle"> </td>;
- <td>'. $rows['status']. '</td>;
- <td> <button class="btn btn-success" data-target="#updateData" data-toggle="modal" onclick="ubahData('.$rows['id'].')"> Edit </button></td>;
- <td> <button class="btn btn-danger" onclick="hapusData('.$rows['id'].')"> Hapus </button></td>;
- </tr>';
- }
- echo $table;
- }
- else {
- 1;
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement