<?php
if(count(get_included_files()) ==1) exit("Direct access not permitted.");
if($db->ceckUser()) {
	?>
	<meta http-equiv="refresh" content="0; url=<?php echo NPAGE.'member';?>">
	<?php
	exit;
}else{
	if(isset($_SESSION['menu_sub'])) {
		unset($_SESSION['menu_sub']);
	}
	$page->addPlugin("login");
}

$hal = basename(__FILE__, '.php');
$page->setTitle("Halaman Login");
$page->tbCss($hal);
$render='tpl/kuduscyber/login.php';
$page->addCss(TPL_CSS."login.css");
$namaheader="Aplikasi Admin";
$namaheader2="Login Area";
if(isset($datasettingprofile['header'])) $namaheader=$datasettingprofile['header'];
if(isset($datasettingprofile['header2'])) $namaheader2=$datasettingprofile['header2'];

$logologin=NPAGE."halaman/hal_login/css/nologo.png";
if(isset($datasettingprofile['idlogo']) && $datasettingprofile['idlogo']>0){
	$query="select * from tb_dokumen where id=?";
	$rsdatalogo=$db->loadAssoc($query,array($datasettingprofile['idlogo']));
	if(isset($rsdatalogo['id'])){
		$logologin=NPAGE.$rsdatalogo['folder'].$rsdatalogo['nama_baru'];
	}
}

$page->sAtas();
?>
<div id="box_headlogin" align="left">
	<div class="boxheader">
		<div class="ttl_h1" align="left">
			<div class="ttl_head_atas">Halaman Login</div>
			<div class="ttl_head_bawah"><?php echo $namaheader." - ".$namaheader2;?></div>
		</div>
		<div style="clear: both;"></div>
	</div>
	
</div>
<?php
$page->eAtas();
$page->sTengah();
?>
<div class="halamanlogin" align="center">
	<div class="box_login" align="center">
		<div class="loginlogo">
			<img src="<?php echo $logologin;?>" />
		</div>
		<div class="loginform">
			
			<input class="login-input" placeholder="Username" id="username" onkeypress="login.enter(event,'login_loader')"/>
			<input class="login-input" placeholder="Password" id="password" type="password" onkeypress="login.enter(event,'login_loader')" />
			<div class="btlogin" onclick="login.masuk('login_loader')">LOGIN</div>
		</div>
		<div style="clear: both;"></div>
	</div>
	<div id="login_loader" class="error"></div>
	<div style="clear: both;"></div>
</div>
<?php
$page->eTengah();
?>
