<script language="JavaScript">
function buka(url) {window.open(url, 'window_baru', 'width=800,height=600,left=320,top=100,resizable=1,scrollbars=1');}
</script>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap4.min.css">
<div class="col-md-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h5 class="card-title"> Data Berita</h5><hr>
<div class="table-responsive pt-3">
<table id="example" class="table table-hover table-bordered" style="width:100%">
<thead>
<tr bgcolor="#DCDCDC">
<th width="2%">No</th>
<th width="10%">Gambar</th>
<th width="80%">Data Berita</th>
<th width="8%">Menu</th>
</tr>
</thead>
<tbody>
<?php
include "konmysqli.php";
$sql="SELECT * FROM `$tbberita` ORDER by `id_berita` asc";
$jum=getJum($conn,$sql);
if($jum > 0){
$no=1;
$arr=getData($conn,$sql);
foreach($arr as $d) {
$id_berita=$d["id_berita"];
$id_eskul=$d["id_eskul"];
$nama_eskul=getEskul($conn,$d["id_eskul"]);
$judul=ucwords($d["judul"]);
$deskripsi=$d["deskripsi"];
$tanggal=WKT($d["tanggal"]);
$jam=$d["jam"];
$status=$d["status"];
$gambar=$d["gambar"];
$keterangan=$d["keterangan"];
echo"<tr>
<td>$no</td>
<td><div align='center'>
function buka(url) {window.open(url, 'window_baru', 'width=800,height=600,left=320,top=100,resizable=1,scrollbars=1');}
</script>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap4.min.css">
<div class="col-md-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<h5 class="card-title"> Data Berita</h5><hr>
<div class="table-responsive pt-3">
<table id="example" class="table table-hover table-bordered" style="width:100%">
<thead>
<tr bgcolor="#DCDCDC">
<th width="2%">No</th>
<th width="10%">Gambar</th>
<th width="80%">Data Berita</th>
<th width="8%">Menu</th>
</tr>
</thead>
<tbody>
<?php
include "konmysqli.php";
$sql="SELECT * FROM `$tbberita` ORDER by `id_berita` asc";
$jum=getJum($conn,$sql);
if($jum > 0){
$no=1;
$arr=getData($conn,$sql);
foreach($arr as $d) {
$id_berita=$d["id_berita"];
$id_eskul=$d["id_eskul"];
$nama_eskul=getEskul($conn,$d["id_eskul"]);
$judul=ucwords($d["judul"]);
$deskripsi=$d["deskripsi"];
$tanggal=WKT($d["tanggal"]);
$jam=$d["jam"];
$status=$d["status"];
$gambar=$d["gambar"];
$keterangan=$d["keterangan"];
echo"<tr>
<td>$no</td>
<td><div align='center'>
<a href='#' onclick='buka(\"berita/zoom.php?id=$id_berita\")'><b>$nama_eskul</b>
<img src='$YPATH/$gambar' width='100' height='100' /></a>
</div></td>
<img src='$YPATH/$gambar' width='100' height='100' /></a>
</div></td>
<td><b>$judul ";
if($status=="Publish"){
echo"<label class='badge badge-success'><small>$status</small></label>";
} else if($status=="UnPublish"){
echo"<label class='badge badge-danger'><small>$status</small></label>";
}
if($status=="Publish"){
echo"<label class='badge badge-success'><small>$status</small></label>";
} else if($status=="UnPublish"){
echo"<label class='badge badge-danger'><small>$status</small></label>";
}
echo"</td>
<td><div>
<a href='?mnu=berita&pro=ubah&kode=$id_berita'><i class='fa fa-edit bg-primary' title='edit'></i></a>
<a href='?mnu=berita&pro=hapus&kode=$id_berita&judul=$judul'><i class='fa fa-trash-o bg-danger' title='hapus' onClick='return confirm(\"Apakah Anda benar-benar akan menghapus \"$judul\" pada data Berita?..\")'></i></a>
</div></td>
</tr>";
$no++;
}//for dalam
}//if
else{echo"<tr><td colspan='6'><blink>Maaf, Data belum tersedia...</blink></td></tr>";}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="assets/js/jquery/jquery.min.js "></script>
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.3/js/dataTables.bootstrap4.min.js"></script>
<script>
$(document).ready(function() {
var table = $('#example').DataTable( {
fixedHeader: true
} );
} );
</script>
Tidak ada komentar:
Posting Komentar