<?php require_once('../config/config.php');
require_once(CLASS_DIR.'dbClass.php');
$objAdmin = new DBClass();

if(isset($_POST['submit']) && $_POST['submit'] == 'Retrive')
{
	$sql = "SELECT * FROM ".TBL_ADMIN." WHERE uname = '".$_POST['uname']."'";
	$rs = $objAdmin->executeQry($sql,$link);
	$rownum = $objAdmin->getrow();
	$row = $objAdmin->fetchrow();
	if($rownum > 0) {
		if($row['status'] == 1){
		$error[] = "Your login is disabled....!";
		} else {

		}
	} else {
        	$error[] = "Username didn't match....!";
	}
}

if(isset($_GET['action']) && $_GET['action'] == 'logout'){
	session_destroy();
	$info[] = "You are successfully logged out.";
}       

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Silver Star Jewelry - Administrative Control Panel</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
<!-- PreLoad Wait - Script -->
function waitPreloadPage() { //DOM
if (document.getElementById){
document.getElementById('prepage').style.display='block';
}else{
document.prepage.style.display = 'none';
}
}
// End -->
</SCRIPT>
</head>
<body class="loginbg">
<div id="container">
	<div class="login_box">
		<div class="loginform">
<DIV id="prepage" style="position:absolute; display:none; padding-left:145px; padding-top:10px;"> 
<img src="ajax-loader.gif" />
</DIV>
			<div><?php MiniError($error); MiniInfo($info);?></div>
			<form name="loginform" method="post" action="<?=$_SERVER['PHP_SELF'];?>" id="loginform" onsubmit="waitPreloadPage();">
			<div class="formtxt">Username</div>
			<div class="txtfield"><input name="uname" type="text" /></div>
			<div class="clear"></div>
			<div class="formtxt"></div>
			<div class="txtfield2">
			<div class="btn_login"><input name="submit" type="image" src="../images/btn_login.jpg" /><input type="hidden" name="submit" value="Retrive" /></div>
			</form>
		</div>
		<div class="clear"></div>
		</div>
	</div>
</div>
</body>
</html>