<?php
session_start();
include("config.php");
$error="";
$msg="";
if(isset($_REQUEST['login'])){
$email=$_REQUEST['email'];
$pass=$_REQUEST['pass'];
$pass=sha1($pass);
if(!empty($email)&&!empty($pass)){
$sql="SELECT * FROM user WHERE uemail='$email' && upass='$pass'";
$result=mysqli_query($con,$sql);
$row=mysqli_fetch_array($result);
if($row){
$_SESSION['uid']=$row['uid'];
$_SESSION['uemail']=$email;
header("location:index.php");
exit;
}else{
$error="<p class='alert alert-warning'>Email or Password doesnot match!</p>";
}
}else{
$error="<p class='alert alert-warning'>Please Fill all the fields</p>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="images/favicon.png">
<link href="https://fonts.googleapis.com/css?family=Muli:400,400i,500,600,700&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Comfortaa:400,700" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-slider.css">
<link rel="stylesheet" href="css/jquery-ui.css">
<link rel="stylesheet" href="css/layerslider.css">
<link rel="stylesheet" href="css/color.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="fonts/flaticon/flaticon.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/login.css">
<title>Clan Homes</title>
</head>
<body>
<div id="page-wrapper">
<div class="row">
<?php include("include/header.php"); ?>
<div class="page-wrappers login-body full-row bg-gray">
<div class="login-wrapper">
<div class="container">
<div class="loginbox">
<div class="login-right">
<div class="login-right-wrap">
<h1>Login</h1>
<p class="account-subtitle">Access to our dashboard</p>
<?php echo $error; ?><?php echo $msg; ?>
<form method="post">
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Your Email*">
</div>
<div class="form-group">
<input type="password" name="pass" class="form-control" placeholder="Your Password">
</div>
<button class="btn btn-success" name="login" type="submit">Login</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include("include/footer.php"); ?>
<a href="#" class="bg-secondary text-white hover-text-secondary" id="scroll">
<i class="fas fa-angle-up"></i>
</a>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/greensock.js"></script>
<script src="js/layerslider.transitions.js"></script>
<script src="js/layerslider.kreaturamedia.jquery.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/tmpl.js"></script>
<script src="js/jquery.dependClass-0.1.js"></script>
<script src="js/draggable-0.1.js"></script>
<script src="js/jquery.slider.js"></script>
<script src="js/wow.js"></script>
<script src="js/custom.js"></script>
</body>
</html>
