<?php
if(count(get_included_files())==1) exit("Direct access not permitted.");
$mod = basename(__FILE__, '.php');
$page->tbCss($mod);

$datapushid=array();

if(isset($dataid)){
	$datapushid=$dataid;
	unset($dataid);
}

$wh="";
if(sizeof($datapushid)>0){
	for($nn=0;$nn<sizeof($datapushid);$nn++){
		if($nn==0){
			$wh.=" and t1.id=? ";
		}else{
			$wh.=" or t1.id=? ";
		}
	}
}

?>
<div class="box_menuicon_horisontal">
	<?php
	$query="select t1.id,t1.nama,t1.keterangan,t1.tautan,
			t2.nama_awal,t2.nama_baru,t2.folder
		from tb_menu_icon as t1
		inner join tb_dokumen as t2 on t1.idgambar=t2.id
		where t1.status=1 ".$wh."order by id asc";
	$rsmenu=$db->loadAll($query,$datapushid);

	for($i=0;$i<sizeof($rsmenu);$i++){
		$gambarmenu=NPAGE.$rsmenu[$i]['folder']."/".$rsmenu[$i]['nama_baru'];
		?>
		<a href="<?php echo $rsmenu[$i]['tautan'];?>">
			<div class="menuicon_horisontal">
				<div class="gambarmenuicon_horisontal">
					<img src="<?php echo $gambarmenu;?>" />
				</div>
				<div class="isimenuicon_horisontal" align="left">
					<div class="judulmenuicon_horisontal"><?php echo $rsmenu[$i]['nama'];?></div>
					<div class="keteranganmenuicon_horisontal"><?php echo $rsmenu[$i]['keterangan'];?></div>
				</div>
			</div>
		</a>
		<?php
	}
	?>
	<div style="clear: both;"></div>
</div>