<!--A Design by W3layouts
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<?php
require ("../connection.php");
//$user=$_SESSION['user_name'];
$ipaddress= $_SERVER['REMOTE_ADDR'];  
$datetime = date('Y-m-d H:i:s');

session_start();
  if (isset($_SESSION['user'])) {
    
    }
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title><?php echo TITLE;?></title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->	
	<link rel="icon" type="image/png" href="images/icons/bluebase.png"/>
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->	
	<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->	
	<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="css/util.css">
	<link rel="stylesheet" type="text/css" href="css/main.css">
    
	<script type="text/javascript">
	function loginval()
	{
	
		var username=document.getElementById('user_name').value;
		var password=document.getElementById('password').value;
		if (username == null || username == "")
			 {
       				 $('#msg').html('<div style="color:red;margin-bottom:20px;">User Name cannot be blank</div>');
       				 return false;
    		 }
		else if (password == null || password == "")
			 {
       				 $('#msg').html('<div style="color:red;margin-bottom:20px;">Email ID cannot be blank</div>');
       				 return false;
    		 }
		else  if ((password == null || password == "")&&(username == null || username == ""))
			{
					 $('#msg').html('<div style="color:red;margin-bottom:20px;">User Name and Email ID cannot be blank</div>');
       				 return false;
			}
		else
			{
			document.getElementById("loginval").submit();
			}
		
	}
	</script>
</head>

<body>

	<div style="width:50%;height:50%;float:center;">
	
		<form id="loginval" onSubmit="return loginval()"  action="forgotpassvalidation.php" method="post" style="width: 100%;height: 100%;margin: 0px;padding: 30px;background: rgb(238, 238, 238);    text-align: center;">
				
				
				  <div id="msg"  style="text-align:center;"></div>
				   <div class="form-group">
                                                <label>User Name</label>
                                              <span class="fa fa-user" aria-hidden="true"></span>
						<input type="text" class="form-control" name="user_name" id="user_name" placeholder="User Name" required="" autocomplete="off">
						<div class="clear">
                                            </div>
											</div>
											
											 <div class="form-group">
                                                <label>E-Mail Id</label>
                                              <span class="fa fa-envelope" aria-hidden="true"></span>
						<input type="email" class="form-control" name="email_id" id="password" placeholder="Email ID" required="" autocomplete="off">
						<div class="clear">
                                            </div>
											</div>
				
									
					<div>
						<input class="btn btn-primary"  name="submit" type="submit" value="Submit">
					</div>
				
		</form>
		</div>
						<div>
						 <a href="../index.php"><button style="margin-top:20px;" class="btn btn-success" >Go To Login</button></a>
					</div>
	
</div>
	

	<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
	<script src="vendor/animsition/js/animsition.min.js"></script>
<!--===============================================================================================-->
	<script src="vendor/bootstrap/js/popper.js"></script>
	<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
	<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
	<script src="vendor/daterangepicker/moment.min.js"></script>
	<script src="vendor/daterangepicker/daterangepicker.js"></script>
<!--===============================================================================================-->
	<script src="vendor/countdowntime/countdowntime.js"></script>
<!--===============================================================================================-->
	<script src="js/main.js"></script>


      
</body>
<?php
	if(isset($_REQUEST['p']))
	{
		if(isset($_REQUEST['p'])==1)
		{
	?>
	<script type="text/javascript">
		$('#msg').html('<div style="color:red;margin-bottom:20px;">Invalid Email Id</div>');
		
	</script>
	<?php
		}
		
	}
		if(isset($_REQUEST['u']))
	{
		if(isset($_REQUEST['u'])==1)
		{
	?>
	<script type="text/javascript">
		$('#msg').html('<div style="color:red;margin-bottom:20px;">User Doesnot exists</div>');
		
	</script>
	<?php
		}
		
	}
	if(isset($_REQUEST['s']))
	{
		if(isset($_REQUEST['s'])==1)
		{
	?>
	
	<script type="text/javascript">
		$('#msg').html('<div style="color:green;margin-bottom:20px;">Your Password has been changed and sent to your  Email Id.</div>');
		
	</script>
	<?php
	
   
		}
		
	}
	
?>
   
   
	
</html>
