include "includes/header.php";
$msg = isset($msg)?$msg:'';
if(isset($lgSub) || isset($_REQUEST['dlogin'])) {
if(isset($_REQUEST['dlogin']))
{
$username=base64_decode(addslashes(ltrim($_REQUEST['username'])));
$password=base64_decode(addslashes(ltrim($_REQUEST['password'])));
$password=md5($password);
}
else
{
$username = $db->escapstr($username);
$password = md5($db->escapstr($password));
}
$res = $db->singlerec("select * from register where (userprofile_id='$username' or email='$username') and password='$password'");
$row_ct = $db->singlerec("select count(*) as ct from register where (userprofile_id='$username' or email='$username') and password='$password'");
if($row_ct['ct'] == 0) {
echo "";
header("location:login.php?inval");
exit;
}
else if($res['active_status']==1){
if($res['deactive_status']==0){
$userprofile_id = $db->Extract_Single("select userprofile_id from register where (userprofile_id='$username' or email='$username') and password='$password'");
$db->insertrec("update register set last_login_date='$datetime',login_ip_addr='$ip' where userprofile_id='$userprofile_id'");
$_SESSION['usr_prfid'] = $userprofile_id;
echo "";
header("location:user-dashboard.php");
exit;
} elseif($res['deactive_status']==1){
$ur_id=$res['userprofile_id'];
echo "";
header("location:usr_val_id.php?dact=$ur_id&deac");
exit;
}
}else{
echo "";
header("location:login.php?inact");
exit;
}
}
if(isset($inact))
$msg = 'Your account has been inactive';
if(isset($fail))
$msg = 'Invalid Transaction. Please Try Again';
if(isset($inval))
$msg = 'Invalid Credentials!';
if(isset($suc))
$msg = 'Registration Success! Let\'s Login';
if(isset($sente))
$msg = 'Kindly check your Email!';
if(isset($sentm))
$msg = 'Kindly check your Mobile!';
if(isset($_REQUEST['resuc']))
$msg = 'You have Successfully Resubcribed';
if(isset($_REQUEST['refail']))
$msg = 'Your Resubcribed is failed';
?>
include "includes/headersection.php"; ?>
include "includes/footer.php";?>
include "validation.php"; ?>