<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Recover Password :: Inspire Polytechnic, Course Registration Portal</title>
    <meta charset="utf-8">
	<meta name="description" content="Inspire Polytechnic, Course Registration Portal" />
	<meta name="keyword" content="Inspire Polytechnic, Course Registration, Portal, Education" />
	<meta name="author" content="Dosumu Ololade"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<link rel="icon" href="../img/lasu_logo.png">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Mukta:300,400,700"> 
    <link rel="stylesheet" href="../fonts/icomoon/style.css">

<link href="../dist/css/style.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/magnific-popup.css">
    <link rel="stylesheet" href="../css/jquery-ui.css">
    <link rel="stylesheet" href="../css/owl.carousel.min.css">
    <link rel="stylesheet" href="../css/owl.theme.default.min.css">

    <link rel="stylesheet" href="../css/aos.css">

    <link rel="stylesheet" href="../css/style.css">
    
  </head>
  <body>
  
  <div class="site-wrap">
    

    <div class="site-navbar bg-white py-2">


    <div class="site-section" style="margin-top:-50px;">
      <div class="container">
	  <?php 
			if((!isset($_GET['se'])) || (!isset($_GET['uq'])) || (!isset($_GET['q']))){
				echo '<div class="page-wrapper pa-0 ma-0 error-bg-img">
				<div class="container-fluid">
					<!-- Row -->
					<div class="table-struct full-width full-height">
						<div class="table-cell vertical-align-middle auth-form-wrap">
							<div class="auth-form  ml-auto mr-auto no-float">
								<div class="row">
									<div class="col-sm-12 col-xs-12">
										<div class="mb-30">
											<span class="block error-head text-center txt-success mb-10">500</span>
											<span style="font-weight:600;" class="text-center nonecase-font mb-20 block error-comment">Oops! Recovery Error</span>
											<p class="text-center" style="font-size:20px;">It seems you found yourself where you shouldn\'t</p>
										</div>	
									</div>	
								</div>
							</div>
						</div>
					</div>
					<!-- /Row -->	
				</div>
				
			</div>';
			}else{ 	// se='.$email.'&sc='.$staff.'&uq='.$uid.'&q='.$password.
			include("connect.php");
			$link='index.php';
			$sql=mysqli_query($con,"select * from admin where email='".$_GET['se']."' AND password='".$_GET['q']."'");
			
			if(mysqli_num_rows($sql)==0){
				echo '<div class="row">
									<div class="col-sm-12 col-xs-12">
										<div class="mb-30">
											<h1 class="block error-head text-center txt-success mb-10" style="font-size:80px;font-weight:900;text-align:center; color:#ff9900;">500</h1>
											<h3 style="font-weight:600;" class="text-center nonecase-font mb-20 block error-comment">Oops! Recovery Error</h3>
											<p class="text-center" style="font-size:22px;">It seems you found yourself where you shouldn\'t</p>
										</div>	
									</div>	
								</div>';
			}else{
				$dos=mysqli_fetch_assoc($sql);
				$name=$dos['lastname'].' '.$dos['othernames'];
				$pic='../img/avatar.png';
				?>
	  
        <div class="row">
          <div class="col-md-12">
		  <div align="center"><a href="index.php"><img src="../img/logo.png" class="img-responsive" style="width:280px;"></a></div><br>
            <h2 class="h3 mb-3 text-black" style="text-align:center;">Recover Password</h2>
          </div>
		   <div class="col-md-3 ml-auto"> </div>
          <div class="col-md-6">
              
              <div class="p-3 p-lg-5 border" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
                
               <form method="post" id="form_submit" >
						<input type="hidden" name="r_id" value="<?php echo $dos['id']; ?>">
												<div class="form-group text-center">
					<img class="img-circle" src="<?php echo $pic; ?>" style="width:90px;" class="img-responsive img-circle" alt="user">
													<h4 class="mt-10 txt-dark"><?php echo ucwords($name)?></h4>
												</div>
												<div class="form-group">
							<label class="control-label mb-10" for="exampleInputEmail_2">New Password</label>
						<input type="password" id="example-input3-group2" name="r_pass" class="form-control" required="" placeholder="Create Password"></div>
												<div class="form-group">
							<label class="control-label mb-10" for="exampleInputEmail_2">Confirm Password</label>
						<input type="password" id="example-input3-group2" name="r_cpass" class="form-control" required="" placeholder="Re-Type Password"></div>
						<div class="msg"></div>
												<div class="form-group text-center">
													<button type="submit" style="float:right;" class="btn btn-info btn-primary ">Submit <i class="fa fa-long-arrow-right"></i></button><div style="clear:both;"></div>
												</div>
											</form>
											
              </div><br>
          <p style="text-align:center;">
            Copyright &copy; <script>document.write(new Date().getFullYear());</script> Inspire Polytechnic | All rights reserved.
            </p>
          </div>
          <div class="col-md-3 ml-auto"> </div>
        </div>
		
		<?php } } ?>
		
      </div>
    </div>

  </div>

  <script src="../js/jquery-3.3.1.min.js"></script>
  
  		<script>
jQuery().ready(function(){
	$("form#form_submit").on('submit',(function(e){
			e.preventDefault();
			$("div.msg").html('<div class="alert alert-primary alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button><i class="fa fa-spin fa-spinner pr-15 pull-left"></i><p class="pull-left">Processing Request...</p><div class="clearfix"></div></div>');
				$.ajax({
						type: "POST",
                        url: "operation.php",
                        data: new FormData(this),
						contentType:false,
						processData:false,
                        cache: false,
                        success: function(data){ 
						$("div.msg").html(data);
						}
    });			
		}));
});
</script>
  
  
  <script src="../js/jquery-ui.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/jquery.magnific-popup.min.js"></script>
  <script src="../js/aos.js"></script>

  <script src="../js/main.js"></script>
    
  </body>
</html>