File: /var/www/grapossconnect/franchise-admin/index.php
<?php
include '../sample-wp/wp-config.php';
if(isset($_POST['login'])){
$username = $_POST['username'];
$password = $_POST['password'];
$checkUser = $wpdb->get_row("SELECT `mf_id`, `username`, `password` FROM `grp_franchise` WHERE username='$username'");
$userReg = $checkUser->username;
$userPwd = $checkUser->password;
if (strtoupper($username) != strtoupper($userReg)) {
$revertArray[] = array("status"=>"0","message"=>"Incorrect Username");
} else if ($password != $userPwd) {
$revertArray[] = array("status"=>"0","message"=>"Incorrect Password");
} else {
session_start();
$login_id = $checkUser->mf_id;
$_SESSION['login']=true;
$_SESSION['LOGIN_ID'] = $login_id;
$redirect_to = 'dashboard';
$sessionId = session_id();
header("Location: " . $redirect_to);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title> Graposs Connect | Franchise Login </title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
<link rel="icon" type="image/png" sizes="32x32" href="https://uat.grapossconnect.com/images/favicon.png">
<link href="assets/css/fontawesome.css" rel="stylesheet" />
<link href="assets/css/vendor.min.css" rel="stylesheet" />
<link href="assets/css/default/app.min.css" rel="stylesheet" />
</head>
<body id="body" class="auth-page" style="background:#f5f8fa url('assets/img/login.png'); background-size: cover; background-position: center center;">
<div class="container-md">
<div class="row vh-100 d-flex justify-content-center">
<div class="col-12 align-self-center">
<div class="card-body">
<div class="row">
<div class="col-lg-4 mx-auto">
<div class="card">
<div class="card-body p-0 auth-header-box" style="background: #ffffff; box-shadow: 0px 3px 7px 0px #c3c3c3;">
<div class="text-center p-3">
<a class="logo logo-admin">
<img src="https://grapossconnect.com/images/graposs-logo.png" height="50" alt="logo" class="auth-logo">
</a>
</div>
</div>
<?php
if ($revertArray[0]["status"] === "0") {
echo '<div style="background: red; padding: 5px 11px 8px; font-weight: 700; color: white; border-radius: 0px; text-align:center;">'.$revertArray[0]["message"].'</div>';
}
?>
<div class="card-body pt-0">
<form class="my-4" method="post">
<div class="form-floating mb-20px">
<input type="text" name="username" required class="form-control fs-13px h-45px" id="username" placeholder="USERNAME" />
<label for="username" class="d-flex align-items-center py-0">Username</label>
</div>
<div class="form-floating mb-20px">
<input type="password" name="password" class="form-control fs-13px h-45px" id="password" placeholder="Password" />
<label for="password" class="d-flex align-items-center py-0">Password</label>
</div>
<div class="form-group mb-0 row">
<div class="col-12">
<div class="d-grid mt-3">
<button class="btn btn-primary" type="submit" name="login">LOGIN <i class="fas fa-sign-in-alt ms-1"></i></button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>