<?php
if(count(get_included_files())==1) exit("Direct access not permitted.");
$mod = basename(__FILE__, '.php');
$page->tbCss($mod);
$query="select * from tb_konten where status=1 order by tanggal desc limit 0,8";
$rsberita=$db->loadAll($query);
$jumlahagenda=sizeof($rsberita);
$databerita=array();
for($i=0;$i<$jumlahagenda;$i++){
	$arrtgl=explode(" ", $rsberita[$i]['tanggal']);
	$jam="";
	if(sizeof($arrtgl)==2){
		$jam=substr($arrtgl[1], 0,5);
	}
	$haltgl=explode(" ", $db->halfdate($rsberita[$i]['tanggal']));
	$dd="";
	$mm="";
	$yy="";
	if(sizeof($haltgl)==3){
		$dd=$haltgl[0];
		$mm=$haltgl[1];
		$yy=$haltgl[2];
	}
	ob_start();
	?>
	<div class="box_baris_berita" align="left">
		
		<div class="box_berita_isi">
			<div class="box_berita_ttl">
				<div class="berita_tanggal"><?php echo $haltgl[0]." ".$haltgl[1]." ".$haltgl[2]." : ".$arrtgl[1];?></div>
				<a href="<?php echo NPAGE.'informasi?kategori='.$rsberita[$i]['idkategori'].'&id='.$rsberita[$i]['id'];?>">
					<div class="box_berita_judul"><?php echo mb_strimwidth((strip_tags($rsberita[$i]['judul'])), 0, 60, '');?></div>
				</a>
			</div>
			<div class="box_berita_deskripsi">
				<?php
					$string=mb_strimwidth((strip_tags($rsberita[$i]['konten'])), 0, 100, '');
					$string = substr($string,0,strrpos($string," ")); 
					echo $string." ...";
				?>
			</div>
		</div>
	</div>
	<div style="clear: both;"></div>
	<?php
	$obj=ob_get_clean();
	array_push($databerita,$obj);
}
?>

<div class="box_berita_utama_bg"></div>
<div class="box_berita_utama">
	<div class="head_judul_berita">
		<div class="judul_module_berita" align="left ">BERITA INTERNAL</div>
	</div>
	<div class="box_data_berita">
		<?php
		if(sizeof($databerita)>0){
			for($i=0;$i<sizeof($databerita);$i++){
				echo $databerita[$i];
			}
		}
		?>
		<div style="clear: both;"></div>
	</div>
	<div style="clear: both;"></div>
	<!--
		<div class="head_berita_lainnya">
			<a href="<?php echo NPAGE.'informasi'?>">
				<div class="tombol_berita_lain">Informasi Lainnya</div>
			</a>
		</div>
	-->
</div>