<?php
require_once("../config/session.php");
require_once("../config/function.php");
$site_data = site_data();
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title> Forgot Password | <?=$site_data['brand']?></title>
    <meta name="author" content="HKB WEB">
    <meta property="og:locale" content="en_US">
    <meta name="description" content="Responsive admin theme build on top of Bootstrap 4">
    <!-- Favicons -->
    <link rel="icon" href="<?=$site_data['logo']?>" type="image/*" sizes="16x16">
    <meta name="theme-color" content="#3063A0">
    <link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600" rel="stylesheet"><!-- End Google font -->
    <!-- BEGIN PLUGINS STYLES -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic-bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- BEGIN THEME STYLES -->
    <link rel="stylesheet" href="../layouts/members/assets/stylesheets/theme.min.css" data-skin="default">
    <link rel="stylesheet" href="../layouts/members/assets/stylesheets/theme-dark.min.css" data-skin="dark">
    <link rel="stylesheet" href="../layouts/members/assets/stylesheets/custom.css">
<script>
var skin = localStorage.getItem('skin') || 'default';
var disabledSkinStylesheet = document.querySelector('link[data-skin]:not([data-skin="' + skin + '"])');
// Disable unused skin immediately
disabledSkinStylesheet.setAttribute('rel', '');
disabledSkinStylesheet.setAttribute('disabled', true);
</script>

<style>
.logo {
	max-width: 100%;
	height: 100px;
}
</style>

  </head>
  <body>
    <main class="auth">
      <header id="auth-header" class="auth-header" style="background-image: url(../layouts/members/assets/images/illustration/img-1.png);">
        <h1>
          <img src="<?=$site_data['logo']?>" class="logo">	
        </h1>
        <p>Forgot Password</p>
      </header>
      <form class="auth-form" method="POST" action="">
<?php
if(isset($_POST['forgotpassword'])){
$username = strip_tags($_POST['username']);
if(!empty($username)){
$forgotpassword = forgotpassword($username);
if($forgotpassword['status']==true){
alert_msg("Password Has Been Sent To Email Successfully!",'success','login');
}else{
alert_msg("Username is incorrect!",'danger');
}
}else{
alert_msg("Please fill all fields!",'danger');
}
}
?>

        <div class="form-group">
          <div class="form-label-group">
            <input type="number" name="username" class="form-control" placeholder="Username" autofocus="" onkeypress="if(this.value.length==10) return false;" required> <label for="inputUser">Username & Mobile Number</label>
          </div>
        </div>
        <div class="form-group">
          <button class="btn btn-lg btn-primary btn-block" type="submit" name="forgotpassword">Submit</button>
        </div>

        <div class="text-center pt-2">
          <a href="login" class="link">Back To Login</a> 
        </div>
      </form>

      <!-- copyright -->
      <footer class="auth-footer">Copyright © <?=date("Y")?> All Rights Reserved.</footer>
    </main><!-- /.auth -->
    <!-- BEGIN BASE JS -->
    <script src="../layouts/members/assets/vendor/jquery/jquery.min.js"></script>
    <script src="../layouts/members/assets/vendor/popper.js/umd/popper.min.js"></script>
    <script src="../layouts/members/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
  </body>
</html>