78 lines
2.6 KiB
PHP
78 lines
2.6 KiB
PHP
<?php
|
|
if( isset($_POST["email"]) && isset($_POST["pass"]) && isset($_POST["submit"])) {
|
|
$link = new mysqli(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB);
|
|
$link->set_charset("utf8");
|
|
$email=$_POST['email'];
|
|
$password=md5($_POST['pass']);
|
|
$sql = "SELECT * FROM `".SHOP_ID."_user` WHERE `email`=? AND `pass`=?";
|
|
$stmt= $link->prepare($sql);
|
|
$stmt->bind_param("ss",$email,$password);
|
|
$stmt->execute();
|
|
$result= $stmt->get_result();
|
|
|
|
// print_r($result);
|
|
// exit;
|
|
$row = $result->fetch_assoc();
|
|
if ($result->num_rows == 1){
|
|
|
|
$_SESSION["loggedin"] = true; $_SESSION["shop"] = SHOP_ID; $_SESSION["name"] = $row["name"]; $_SESSION["id"] = $row["id"];$_SESSION["email"] = $row["email"]; //var_dump($_SESSION);
|
|
echo '<script>window.location.replace("/'.SHOP_ID.'/bill");</script>';
|
|
|
|
//echo"Yes";
|
|
}
|
|
else echo "credentials did not match";
|
|
$link->close();
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
|
<!-- Google Fonts -->
|
|
|
|
</head>
|
|
|
|
|
|
<div class="st_container student-login student-padding my-4">
|
|
<div class="student-form">
|
|
<div class="card card-login mx-auto text-center">
|
|
<div class="card-header mx-auto ">
|
|
<!-- <span> <img src="/assets/img/logo.png" class="responsive2 profile-img" alt="Logo"> </span><br/> -->
|
|
<span class="logo_title mt-5 text-light student-font"> Admin Login </span>
|
|
<!-- <h1>--><?php //echo $message?><!--</h1>-->
|
|
|
|
</div>
|
|
<div class="card-body">
|
|
<form action="" method="post">
|
|
<div class="input-group form-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fas fa-user"></i></span>
|
|
</div>
|
|
<input type="text" name="email" class="form-control" placeholder="Email ID.">
|
|
</div>
|
|
|
|
<div class="input-group form-group">
|
|
<div class="input-group-prepend">
|
|
<span class="input-group-text"><i class="fas fa-key"></i></span>
|
|
</div>
|
|
<input type="password" name="pass" class="form-control" placeholder="Password">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<input type="submit" name="submit" value="Login" class="btn btn-outline-danger float-right login_btn">
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|