<?php
require_once($_SERVER['DOCUMENT_ROOT']."/hrm/config/config.php");
require_once($_SERVER['DOCUMENT_ROOT']."/hrm/base/recruit.php");

if (isset($_POST['login'])){
    clogin($_POST['username'], $_POST['password']);
}

?>
<!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">
  <meta name="description" content="">
  <meta name="author" content="">
  <link href="/hrm/views/img/logo/logo.png" rel="icon">
  <title>MNC HR CAREER PORTAL</title>
  <link href="/hrm/views/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link href="/hrm/views/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  <link href="/hrm/views/css/ruang-admin.min.css" rel="stylesheet">

</head>

<body class="bg-gradient-login">
  <!-- Login Content -->
  <div class="container-login">
    <div class="row justify-content-center">
      <div class="col-xl-6 col-lg-12 col-md-9">
        <div class="card shadow-sm my-5">
          <div class="card-body p-0">
            <div class="row">
              <div class="col-lg-12">
                <div class="login-form">
                  <div class="text-center">
                   <img style="width: 200px; height: 100px" src="/hrm/views/img/logo/logo.png" >
                   <hr>

                   <?php
                   
                   if(count($errors)> 0){
                    echo '
                    <div class="alert alert-danger alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                      <span aria-hidden="true">&times;</span>
                    </button>
                    '.$errors[0].'
                  </div>
                    ';
                }
                   ?>
                    <!-- <h1 class="h4 text-gray-900 mb-4">Login</h1> -->
                    
                  </div>
                  <form class="user" action="" method="POST">
                    <div class="form-group">
                      <input type="text" class="form-control" id="exampleInputEmail" name="username"
                        placeholder="Enter your username">
                    </div>
                <div class="form-group col-lg-12" style="display:flex">
                    <div class="form-group col-lg-12" style="margin-left: -25px">
                      <input type="password" class="form-control" id="psd" placeholder="Password" name="password">
                     
                    </div>
                    <div class="form-group col-lg-1" onclick="myFunction()">
                    <i class="fa fa-eye " aria-hidden="true"  style="padding-top:10px; border-width:1px"></i>
                    </div>
              </div>
                    <div class="form-group">
                      <div class="custom-control custom-checkbox small" style="line-height: 1.5rem;">
                        <input type="checkbox" class="custom-control-input" id="customCheck">
                        <label class="custom-control-label" for="customCheck">Remember
                          Me</label>
                      </div>
                    </div>
                    <div class="form-group">
                      <input type="submit" value="Login" class="btn btn-primary btn-block" name="login">
                    </div>

                    
                    <a class="font-weight-bold small" href="forgot.php" style="align-items: right">Forgot Password?</a>
                 

                    <hr>
                    <div class="text-center">
                    <h6 class="font-weight-bold " >OR</h6>
                  </div>
                    
                  </form>
                  <hr>
                  <div class="form-group col-lg-12 mb-4">
                    <button class="btn btn-primary btn-block" onclick="location.replace('/hrm/views/candidate/signup.php');">Sign Up</button>
                  </div>
                  <div class="text-center">
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- Login Content -->
  <script src="/hrm/views/vendor/jquery/jquery.min.js"></script>
  <script src="/hrm/views/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="/hrm/views/vendor/jquery-easing/jquery.easing.min.js"></script>
  <script src="/hrm/views/js/ruang-admin.min.js"></script>
  <script>
    function myFunction() {
  var x = document.getElementById("psd");
  if (x.type === "password") {
    x.type = "text";
  } else {
    x.type = "password";
  }
}
  </script>
</body>

</html>