<style>
div.paging {
	padding     : 2px;
	margin      : 2px;
	text-align  : center;
	font-family : Tahoma;
	font-size   : 11px;
	line-height:220%;
}
div.paging a {
	padding:4px 7px 4px 7px;
	margin:2px;
	border:1px solid #C2D0DC;
	color: #444444;
	border-radius:3px;	
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	text-decoration:none;
	background:#ecf1f5; background:-moz-linear-gradient(top, #f6f9fb 0%, #d9e1e9 100%); 
								  background:-webkit-linear-gradient(top, #f6f9fb 0%, #d9e1e9 100%); box-shadow:inset 0px 1px 0px #fff,inset 0px 0px 0px 1px #f3f7fb;
}
div.paging a:hover {
	border: 1px solid #999;
	color: #000;
}
div.paging span.current {
	 margin: 2px;
	padding:4px 7px 4px 7px;
		border: 1px solid #999;
	color: #fff;
		border-radius:3px;	
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	text-decoration:none;
	background:#ecf1f5; background:-moz-linear-gradient(top, #42A0FF 0%, #0054B0 100%); 
								  background:-webkit-linear-gradient(top, #42A0FF 0%, #0054B0 100%); box-shadow:inset 0px 1px 0px #fff,inset 0px 0px 0px 1px #f3f7fb;
}
div.paging span.disabled {
	padding:4px 7px 4px 7px;
		margin:2px;
		border:1px solid #E2E2E2;
		color:#CCCCCC;
		border-radius:3px;	
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	text-decoration:none;
		background:#ecf1f5; background:-moz-linear-gradient(top, #ffffff 0%, #E2E2E2 100%); 
								  background:-webkit-linear-gradient(top, #ffffff 0%, #E2E2E2 100%); box-shadow:inset 0px 1px 0px #fff,inset 0px 0px 0px 1px #f3f7fb;
}
div.paging span.prevnext {
  font-weight : bold;
}	

.pagiNation				{ margin:0; padding:15px 0; line-height:25px; text-align:center; font-family:'Gotham', Arial; font-size:11px; }
.pagiNation span		{ display:inline-block; margin:2px; padding:0; color:#444444; font-weight:bold; border:1px solid #444444; border-radius:3px; 
						  background:#444444; -moz-transition:0.3s; -webkit-transition:0.3s; transition:0.3s; }
.pagiNation span:hover	{ background:#fff; border-color:#444444; }
.pagiNation span.ui-state-disabled,
.pagiNation span.active	{ padding:0 10px; color:#444444; text-shadow:0 1px 0 rgba(255,255,255,0.15); background:#fff; box-shadow:none; 
						  border-color:#444444; }
.pagiNation span:active	{ background:#fff; }
.pagiNation span a		{ display:block; margin:0; padding:0 10px; color:#fff; text-shadow:0 1px 0 rgba(0,0,0,0.2); }
.pagiNation span a:hover{ color:#444444; text-decoration:none; text-shadow:none; }
.pagiNation span:active a	{ color:#000; }
.pagiNation span:first-child a,
.pagiNation span:first-child{ border-radius:5px 3px 3px 5px; }
.pagiNation span:last-child a,
.pagiNation span:last-child	{ border-radius:3px 5px 5px 3px; }

.clearfix { zoom: 1; }

.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

</style>
<?php
if (basename($_SERVER['SCRIPT_FILENAME']) == basename(__FILE__)){
echo "<p align=center><br><br><br><br><br><br><font size=\"6\" color=\"#FF0000\">ILLEGAL ACCESS !!";
echo "<meta http-equiv=\"refresh\" content=\"2; url=../index.php\">";
exit();} 
?>

		<h1>Our <span>News</span></h1>
		<div class="separator"></div>
		<div class="news_page">
			<div class="news_list">
								
                                
                               
                                
                                
  <?php
$batas   = 10;
if(isset($_GET['halaman'])) { $halaman = anti_injection($_GET['halaman']); } 
if(empty($halaman)){
	$posisi  = 0;
	$halaman = 1;
}
else{
	$posisi = ($halaman-1) * $batas;
}

$db->select("id_berita, id_user, judul, isi_berita, gambar, tanggal, counter, published", "berita", "published=1", "id_berita desc LIMIT $posisi,$batas");

if($db->num_rows() > 0) {
	while($row = $db->fetch_row()) {
	$tgle = date('d', strtotime($row[5]));
    $bulane = date('M', strtotime($row[5]));
    $tahune = date('Y', strtotime($row[5]));
	$adafoto = $row[4];
	$judul = $row[2];
	$isine = $row[3];
	$tgl = formatglxy($row[5]);
	$counter = $row[7];
	$idne = anti_injection($row[0]);
    	$isi = substr($isine,0,150);
	$tglbln=date('m / Y',strtotime($tgl));
	$harine=date('d',strtotime($tgl));
	
	?>                              
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <div class="nl_block light_bg">
					<div class="nl_top">
						<div class="nl_title"><?php echo $judul; ?></div>
						<div class="nl_date"><?php echo $tgl; ?></div>
					</div>
					<div class="nl_text"><?php echo $isine; ?>
<br></div>
				</div>
	
		
							<?
	} 
	
	} else {
	
?>
<div class="message error">- No News -</div> 

<?
	}
	
?>	
								
                                
                                
							</div>
                            
                            
  <?
//Langkah 3: Hitung total data dan halaman 
$tampil2 = mysql_query("SELECT * FROM berita WHERE published=1");
$jmldata = mysql_num_rows($tampil2);
$jmlhal  = ceil($jmldata/$batas);
if($jmldata > 10){
echo "<br><div class=pagiNation><div class='dataTables_paginate ui-buttonset paging_full_numbers'>";
// Link ke halaman sebelumnya (previous)
if($halaman > 1){
	$prev=$halaman-1;
	echo "<span class='next ui-button'><a href=./page.php?p=news&halaman=$prev>".$LANG["prev"]."</a></span> ";
}
else{ 
	echo "<span class='ui-button ui-state-disabled'>".$LANG["prev"]."</span> ";
}

// Tampilkan link halaman 1,2,3 ...
for($i=1;$i<=$jmlhal;$i++)
if ($i != $halaman){
	echo " <span class='ui-button'><a href=./page.php?p=news&halaman=$i>$i</a></span>";
}
else{
	echo " <span class='ui-button ui-state-disabled'>$i</span> ";
}

// Link kehalaman berikutnya (Next)
if($halaman < $jmlhal){
	$next=$halaman+1;
	echo "<span class='next ui-button'><a href=./page.php?p=news&halaman=$next>".$LANG["next"]."</a></span>";
}
else{ 
	echo "<span class='ui-button ui-state-disabled'>".$LANG["next"]."</span>";
}
echo "</div></div>";
}
?>                          
                            
                            
                            
					
					</div>