137 lines
4.3 KiB
PHP
137 lines
4.3 KiB
PHP
<?php
|
|
$is_invalid = false;
|
|
require dirname( __DIR__, 2 ) . "/portal/admin/core/api/php/includes/include.php";
|
|
|
|
|
|
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|
$mysqli = require __DIR__ . "/database.php";
|
|
$sql = sprintf("SELECT * FROM sponsor_users WHERE email = '%s'", $mysqli->real_escape_string($_POST["email"]));
|
|
$result = $mysqli->query($sql);
|
|
$user = $result->fetch_assoc();
|
|
if ($user) {
|
|
if ($_POST["password"]==$user["password_hash"]) {
|
|
// if (password_verify($_POST["password"], $user["password_hash"])) {
|
|
session_start();
|
|
session_regenerate_id();
|
|
$_SESSION["user_id"] = $user["id"];
|
|
header("Location: index.php");
|
|
exit;
|
|
}
|
|
}
|
|
$is_invalid = true;
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Cradle2Career - Sponsor Console</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<link rel="icon" type="image/x-icon" href="../../assets/favicon.ico">
|
|
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css">
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
|
|
|
|
<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
|
|
|
|
<link href='https://unpkg.com/boxicons@2.0.7/css/boxicons.min.css' rel='stylesheet'>
|
|
|
|
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"> -->
|
|
<script src="https://unpkg.com/just-validate@latest/dist/just-validate.production.min.js" defer></script>
|
|
<script src="/js/validation.js" defer></script>
|
|
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<?php if ($is_invalid): ?>
|
|
<em>Invalid login</em>
|
|
<?php endif; ?>
|
|
<!-- <form method="post">
|
|
<label for="email">email</label>
|
|
<input type="email" name="email" id="email" value="<?= htmlspecialchars($_POST["email"] ?? "") ?>">
|
|
<label for="password">Password</label>
|
|
<input type="password" name="password" id="password">
|
|
<button>Log in</button>
|
|
</form> -->
|
|
|
|
<div class="container-fluid mt-4">
|
|
<div class="row d-flex justify-content-center mt-4">
|
|
<div class="col-12 col-lg-3 mt-5">
|
|
<!-- <h3 class="d-flex justify-content-center">Cradle2Careertx</h3> -->
|
|
<div class="d-flex justify-content-center"><img src="../../../assets/c2c_stckd_pos_PMS.svg" height="75" alt="Cradle2Career" class=""></div>
|
|
<h3 class="d-flex justify-content-center">Sponsor Login</h3>
|
|
<!-- Email input -->
|
|
<form class="p-3" method="post">
|
|
<div class="form-outline mb-4">
|
|
<input type="email" name="email" class="form-control" id="email" value="<?= htmlspecialchars($_POST["email"] ?? "") ?>">
|
|
<label class="form-label" for="form2Example1">Email address</label>
|
|
</div>
|
|
|
|
<!-- Password input -->
|
|
<div class="form-outline mb-4">
|
|
<input type="password" name="password" class="form-control" id="password">
|
|
<label class="form-label" for="form2Example2">Password</label>
|
|
</div>
|
|
|
|
<!-- 2 column grid layout for inline styling -->
|
|
<!-- <div class="row mb-4">
|
|
<div class="col d-flex justify-content-center">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" value="" id="form2Example31" checked />
|
|
<label class="form-check-label" for="form2Example31"> Remember me </label>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<a href="#!">Forgot password?</a>
|
|
</div>
|
|
</div> -->
|
|
|
|
<!-- Submit button -->
|
|
<button type="submit" class="btn btn-primary btn-block mb-4">Sign in</button>
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|