Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <title>latihan - Datatables</title>
- <link rel="stylesheet" href="css/bootstrap.min.css"/>
- <link rel="stylesheet" href="css/dataTables.bootstrap.css"/>
- </head>
- <body>
- <div class="container">
- <table id="tb" class="table table-hover table-striped table-bordered">
- <tr class="info">
- <th >NISN</th>
- <th >NIS</th>
- <th >NAMA SISWA</th>
- <th >TEMPAT LAHIR</th>
- <th >TANGGAL LAHIR</th>
- <th >TAHUN MASUK</th>
- <th >KELAS</th>
- <th >PROSES</th>
- </tr>
- <?php
- include "koneksi/connect.php";
- $sql = "SELECT * FROM `perangkat`.`data_siswa`";
- $hasil = mysql_query($sql, $connect) or die ("Gagal coba berita");
- while ($data = mysql_fetch_array($hasil)) {
- //melakukan pemanggilan seluruh record dari hasil mysql_query yang dsimpan pada $baris
- ?>
- <tr >
- <td ><strong><?PHP echo $data['NISN']; ?></strong></td>
- <td ><?PHP echo $data['NIS']; ?></td>
- <td ><?PHP echo $data['nama_siswa']; ?></td>
- <td ><?PHP echo $data['tempat_lahir']; ?></td>
- <td ><?PHP echo $data['tanggal_lahir']; ?></td>
- <td ><?PHP echo $data['tahun_masuk']; ?></td>
- <td ><?PHP echo $data['kode_kelas']; ?></td>
- <td align="center">
- <a href="index.php?p=editdatasiswa&id=<?php echo $data['kode_siswa']; ?>" title="Ubah Data">
- <img src="images/Edit.jpg" width="25" height="25"></a>
- <a href="index.php?p=hapusdatasiswa&id_del=<?php echo $data['kode_siswa']; ?>"
- onClick="javascript:return confirm('hapus data ini?');" title="Hapus Data">
- <img src="images/delete.png" width="25" height="25"></a> </td>
- </tr>
- <?php
- }
- ?>
- </table>
- </div>
- <script src="js/jquery.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <script src="js/jquery.dataTables.js"></script>
- <script src="js/dataTables.bootstrap.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#tb").dataTable();
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement