<?php
include("templates/global.php"); ?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title><?php echo $settings['org_name']; ?> : User Login </title>
  <meta content="" name="description">
  <meta content="" name="keywords">
  <?php include("templates/inc.php"); ?>
  
  <!--<script src="scripts/index.js" type="text/javascript" language="javascript"></script>-->
  
  <script>
      $(document).ready(function(){
	
//Admin Login Start.
$("#btnLogin").click(function(){
	 
   $(this).html("Login In...");
   $(this).prop('disabled', true);
   setInterval(function () {
	$("#btnLogin").prop('disabled', false);
    }, 3000);

   var v_code=$("#v_code").val();
   var password=$("#password").val(); 

		$.ajax({
			 type:'post',
			 url: 'index-action.php',
			 data: {'v_code':v_code,'password':password},
			 success: function(data)
			 {	 
			    $("#btnLogin").html("Login");

				 var x=data;
				 if(x== "Login Success")
				 {
				 	window.location="./dashboard.php";
				 }
				 else
				 { 
				 $("#msg").html(data); 
				 $("#msg").slideDown("slow");
				 $("#msg").slideUp(6000); 
			     } 
			  }
		 });
  });

});
 
  </script>
  
  
</head>

<body>

  <main>
    <div class="container">

      <section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
        <div class="container">
          <div class="row justify-content-center">
            <div class="col-lg-4 col-md-6 d-flex flex-column align-items-center justify-content-center">

              <div class="d-flex justify-content-center py-4">
                
              </div><!-- End Logo -->

              <div class="card mb-3">

                <div class="card-body">
                  <center>
                  <br>
                    <img src="admin/assets/workforce-logo-rect.jpg" style="height:60px"> 
                  </center>
            
                  <div class="pt-2 pb-2">
                    <h5 class="card-title text-center pb-0 fs-4">User Login</h5>
                  </div>

                  <form class="row g-3 needs-validation" novalidate>

                    <div class="col-12">
                      <label for="yourUsername" class="form-label">User ID</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend">@</span>
                        <input type="text" name="v_code" id="v_code" class="form-control" required>
                        <div class="invalid-feedback">Please enter your user id.</div>
                      </div>
                    </div>

                    <div class="col-12">
                      <label for="yourPassword" class="form-label">Password</label>
                      <input type="password" name="password" id="password" class="form-control"  required>
                      <div class="invalid-feedback">Please enter your password!</div>
                    </div>
                    
                    <div class="col-12">
                    <button class="btn btn-primary w-100" type="button" name="btnLogin" id="btnLogin">Login</button>
                    <br>
                    <center><br>
                    <div class="col-12">
                      <p class="small mb-0" id="msg" style="color:#f00"></p>
                    </div>
					 
                  Don't have an Account ?<a href="create-account.php"> Create Account.</a>
                    </div>
					          
                      
                  </form>

                </div>
              </div>


            </div>
          </div>
        </div>

      </section>

    </div>
  </main><!-- End #main -->

  <a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>


   <?php include("templates/vendors.php"); ?>

</body>

</html>