Advertisement
wahyu_f14

data-berita

Aug 28th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.06 KB | None | 0 0
  1. <?php
  2. include "koneksi/koneksi.php";
  3. session_name('profil');
  4. session_start();
  5. if (isset($_SESSION['profil-username'])) {
  6.   ?>
  7.  
  8.   <!DOCTYPE html>
  9.   <html>
  10.   <head>
  11.     <meta charset="UTF-8">
  12.     <title>Data Penelitian | Sistem Informasi Perikanan Palabuhanratu</title>
  13.     <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  14.     <!-- bootstrap 3.0.2 -->
  15.     <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  16.     <!-- font Awesome -->
  17.     <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  18.     <!-- Ionicons -->
  19.     <link href="css/ionicons.min.css" rel="stylesheet" type="text/css" />
  20.     <!-- Theme style -->
  21.     <link href="css/AdminLTE.css" rel="stylesheet" type="text/css" />
  22.     <!-- Favicon -->
  23.     <!-- DATA TABLES -->
  24.     <link href="css/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
  25.     <style>
  26.       .callout {
  27.         margin-bottom: 0;
  28.       }
  29.       .btn {
  30.         margin-bottom: 3px;
  31.       }
  32.     </style>
  33.   </head>
  34.   <body class="skin-blue">
  35.  
  36.     <?php include 'includes/header.php'; ?>
  37.  
  38.     <div class="wrapper row-offcanvas row-offcanvas-left">
  39.       <!-- Left side column. contains the logo and sidebar -->
  40.       <?php include 'includes/menu.php'; ?>
  41.  
  42.       <!-- Right side column. Contains the navbar and content of the page -->
  43.       <aside class="right-side">
  44.         <!-- Content Header (Page header) -->
  45.         <section class="content-header">
  46.           <h1>
  47.             Berita
  48.             <small><i class="fa fa-angle-right"></i>&nbsp; Data Berita</small>
  49.           </h1>
  50.         </section>
  51.  
  52.         <!-- Main content -->
  53.         <section class="content">
  54.  
  55.           <!-- top row -->
  56.           <div class="row">
  57.             <div class="col-md-12">
  58.               <div class="box box-info">
  59.                 <div class="box-header">
  60.                   <h3 class="box-title"><i class="fa fa-file-text-o"></i>&nbsp; TABEL DATA BERITA</h3>
  61.                 </div><!-- /.box-header -->
  62.                 <div class="box-body">
  63.                   <table class="table table-bordered table-striped" id="tabel-plt">
  64.                     <thead>
  65.                       <th>No.</th>
  66.                       <th>Judul</th>
  67.                       <th>Operasi</th>
  68.                     </thead>
  69.                     <tbody>
  70.                       <?php
  71.                       $get_berita = mysqli_query($db, "SELECT * FROM berita ORDER BY id DESC");
  72.                       $no = 1;
  73.                       foreach ($get_berita as $berita) {
  74.                         ?>
  75.                         <tr>
  76.                           <td><?=$no;?></td>
  77.                           <td><?=$berita['judul'];?></td>
  78.                           <td>
  79.                             <a class="btn btn-info btn-xs" href="detail-berita.php?id=<?=$berita['id'];?>"><i class="fa fa-pencil"></i>&nbsp; Ubah</a>
  80.                             <?php
  81.                             if ($berita['status'] == "publish") {
  82.                               ?>
  83.                               <a class="btn btn-default btn-xs" href="unpublish.php?id=<?=$berita['id'];?>"><i class="fa fa-share"></i>&nbsp; Unpublish</a>
  84.                               <?php
  85.                             } else {
  86.                               ?>
  87.                               <a class="btn btn-default btn-xs" href="publish.php?id=<?=$berita['id'];?>"><i class="fa fa-share"></i>&nbsp; Publish</a>
  88.                               <?php
  89.                             }
  90.                             ?>
  91.                             <a type="button" class="btn btn-danger btn-xs"  href="hapus-berita.php?id=<?=$berita['id'];?>">
  92.                               <i class="fa fa-trash-o"></i>&nbsp; Hapus
  93.                             </a>
  94.                           </td>
  95.                         </tr>
  96.                         <?php
  97.                         $no++;
  98.                       }
  99.                       ?>
  100.                     </tbody>
  101.                   </table>
  102.                 </div>
  103.               </div>
  104.             </div>
  105.           </div>
  106.           <!-- /.row -->
  107.  
  108.         </section><!-- /.content -->
  109.       </aside><!-- /.right-side -->
  110.     </div><!-- ./wrapper -->
  111.  
  112.     <!-- add new calendar event modal -->
  113.  
  114.     <!-- jQuery 2.0.2 -->
  115.     <script src="js/jquery.min.js"></script>
  116.     <!-- jQuery UI 1.10.3 -->
  117.     <script src="js/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
  118.     <!-- Bootstrap -->
  119.     <script src="js/bootstrap.min.js" type="text/javascript"></script>
  120.     <!-- AdminLTE App -->
  121.     <script src="js/AdminLTE/app.js" type="text/javascript"></script>
  122.     <!-- DATA TABES SCRIPT -->
  123.     <script src="js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
  124.     <script src="js/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
  125.  
  126.     <!-- Inline Scripts -->
  127.     <script type="text/javascript">
  128.       /* datatables */
  129.       $('table').dataTable();
  130.     </script>
  131.   </body>
  132.   </html>
  133.  
  134.   <?php
  135. } else {
  136.   header('location:login.php');
  137. }
  138. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement