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

$judulhalaman="GALLERY";
$linkkategori="";

$idkonten=0;
if(isset($_GET['id'])){
	$idkonten=$_GET['id'];
}

$wh="";
$datapush=array($idkonten);

$tanggal="";
$judul="";
$keterangan="";

$query="select 
			t1.id,t1.tanggal,t1.nama,
			t1.idkategori,
			t1.keterangan,t1.idgambar,
			t3.nama as kategori,
			t2.nama_baru,t2.folder,
			t3.nama as kategori
		from tb_album as t1
		inner join tb_dokumen as t2 on t1.idgambar=t2.id
		inner join tb_album_kategori as t3 on t1.idkategori=t3.id
		where t1.status=1 and t1.id=? ".$wh;
	$rsgallery=$db->loadAssoc($query,$datapush);

if(isset($rsgallery['id'])){
	$haltgl=explode(" ", $db->halfdate($rsgallery['tanggal']));
	$dd="";
	$mm="";
	$yy="";
	if(sizeof($haltgl)==3){
		$dd=$haltgl[0];
		$mm=$haltgl[1];
		$yy=$haltgl[2];
	}
	
	$arrtgl=explode(" ", $rsgallery['tanggal']);
	$jam="";
	if(sizeof($arrtgl)==2){
		$jam=substr($arrtgl[1], 0,5);
	}
	
	$tanggal=$haltgl[0]." ".$haltgl[1]." ".$haltgl[2]." - ".$jam;
	$judulhalaman=$rsgallery['kategori'];
	$gambargallery=NPAGE.$rsgallery['folder'].$rsgallery['nama_baru'];
	
	?>
	<div class="box_detailgallery">
		<a href="<?php echo NPAGE.'album/?kategori='.$rsgallery['idkategori'];?>"><h2><?php echo $judulhalaman;?></h2></a>
		<div class="box_detailgallery_judul"><?php echo strtoupper($rsgallery['nama']);?></div>
		<div class="box_detailgallery_tanggal"><?php echo $haltgl[0]." ".$haltgl[1]." ".$haltgl[2]." - ".$jam;?></div>
		<div class="box_detailgallery_image">
			<img src="<?php echo $gambargallery;?>" />
		</div>
	</div>
	<?php
}
?>
