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

if (isset($_POST["reg"])){
    //echo "Register";

    $name= $_POST["firstname"]." ".$_POST['midname']." ".$_POST['lastname'];
    createCanditate($name, $_POST['email'], $_POST['password'], $_POST['password1']);
    //user with this id already exists. try forget 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 first">
                <label for="username">First Name</label>
                <input type="text" class="form-control" id="firstname" name="fistname" required>
               
              </div>

              <div class="form-group first">
                <label for="username">Middle Name</label>
                <input type="text" class="form-control" id="midname" name="midname">
               
              </div>

              <div class="form-group first">
                <label for="username">Last Name</label>
                <input type="text" class="form-control" id="lastname" name="lastname">
               
              </div>
              <div class="form-group first">
                <label for="idno">ID NO</label>
                <input type="text" class="form-control" id="idno" name="idno">
               
              </div>

              <div class="form-group first">
                <label for="email">Email</label>
                <input type="text" class="form-control" id="email" name="email">

              </div>
              <br>

              <div class="form-group last mb-4">
                <label for="password">Password</label>
                <input type="password" class="form-control" id="password" name="password">
                
              </div>
              <br>

              <div class="form-group last mb-4">
                <label for="password1">Repeat-Password</label>
                <input type="password" class="form-control" id="password1" name="password1">
                
              </div>
              <div class="form-group col-lg-12 mb-4">
              <input type="submit" id="reg" value="Sign Up" class="btn btn-block btn-primary"  name="reg">
              </div>
                  </form>
                  <hr>
                  <div class="form-group col-lg-12 mb-4">
                    <button class="btn btn-primary " onclick="location.replace('/hrm/views/candidate/login.php');">Back to Login</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>
</body>

</html>