Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //include 'class.php';
- //echo "$sql"?>
- <div class="box">
- <div class="box-header">
- <h3 class="box-title">Tampil Artikel</h3>
- </div>
- <div id="response"></div>
- <div id="table-data" style="margin-left: 90px;">
- <div class="row">
- <div class="box-body">
- <table id="myTable" class="table table-striped table-bordered table-condensed display nowrap dataTable dtr-inline">
- <thead>
- <tr>
- <th> No</th>
- <th> Judul</th>
- <th> Kategori</th>
- <th> Tanggal</th>
- <th> Isi</th>
- <th> Action</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $index = 1;
- $ar= new artikel();
- foreach ($ar->tampil_artikel() as $data){
- echo"
- <tr>
- <th> $index </th>
- <th> $data[Judul] </th>
- <th> $data[Namakategori] </th>
- <th> $data[Tanggal]</th>
- <th> $data[Isi] </th>
- <th>
- <a href='admin.php?modul=ubahartikel&Idartikel=$data[Idartikel]' class='btn btn-info'><i class='fa fa-pencil'></i>Ubah</a>
- <a href='modul/proses.php?aksi=hapus&Idartikel=$data[Idartikel]' class='btn btn-danger'><i class='fa fa-remove'></i>Hapus</a>
- </th>
- </tr>";
- $index++;
- }
- ?>
- </tbody>
- </table>
- <br>
- <a href="admin.php?modul=tambahartikel" class="btn btn-primary"><i class="fa fa-plus"></i> Tambah</a>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- //pageSetUp();
- $(document).ready(function(){
- $('#myTable').DataTable({
- //"sDom": "<'row'<'col-sm-12'<'form-group'<f>>>>tr<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>",
- sDom: 'T<"row view-filter"<"col-sm-12"<"pull-left"l><"clearfix">>>t<"row view-pager"<"col-sm-12"<"pull-right"ip>>>',
- PaginationType : "bootstrap",
- scrollX : true,
- 'searching': false,
- 'bPaginate': true
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment