Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'functions.php';
- query ("SELECT * FROM data_buku");
- $buku = query ("SELECT * FROM data_buku")
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Data buku</title>
- <script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
- <script type="text/javascript" src="DataTables/media/js/jquery.dataTables.min.js"></script>
- <link rel="stylesheet" type="text/css" href="DataTables/media/css/jquery.dataTables.min.css">
- <link rel="stylesheet" type="text/css" href="css/data.css">
- </head>
- <body>
- <h1>Data Buku Perpustakaan SMK BPPI</h1>
- <!--
- <a href="tambah.php">Tambah Data Buku</a>
- <br><br>
- -->
- <table id="table1" class="display" border="1" >
- <thead>
- <tr>
- <th>No.</th>
- <th>Foto</th>
- <th>Id Buku</th>
- <th>Nama Buku</th>
- <th>Nama Penulis</th>
- <th>Tahun Terbit</th>
- <th>Tempat Buku</th>
- <th>Stock Buku</th>
- <th>Aksi</th>
- </tr>
- </thead>
- <?php $i = 1; ?>
- <?php foreach ($buku as $row ) : ?>
- <tbody>
- <tr>
- <td><?= $i; ?></td>
- <td><img src="buku/<?= $row["gambar"] ?>" width="30" height="30"></td>
- <td><?= $row["id_buku"] ?></td>
- <td><?= $row["nama_buku"] ?></td>
- <td><?= $row["nama_penulis"] ?></td>
- <td><?= $row["tahun_terbit"] ?></td>
- <td><?= $row["tempat_buku"] ?></td>
- <td><?= $row["stock_buku"] ?></td>
- <td><a href="ubah.php?id=<?= $row["id"]; ?>">ubah</a> || <a href="hapus.php?id=<?= $row["id"]; ?>" onclick="return confirm('Apakah Akan di hapus ?');">Hapus</a></td>
- </tr>
- </tbody>
- <?php $i++; ?>
- <?php endforeach; ?>
- </table>
- <script type="text/javascript">
- $(document).ready(function(){
- $("#table1").DataTable();
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement