-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
122 lines (100 loc) · 5.55 KB
/
index.php
File metadata and controls
122 lines (100 loc) · 5.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
require_once 'config.php';
// session_start();
if(isset($_SESSION['passwordTokens'])){
header("Location: passwordReset.php");
exit();
}
if(isset($_SESSION['account_id'])){
header("Location: CUSTOMER/dashboard.php");
exit();
}
if($_SERVER["REQUEST_METHOD"] == "POST"){
$email = $_POST['email'];
$password = $_POST['password'];
include 'classes/Dbh.class.php';
include 'classes/signupmodel.class.php';
include 'classes/signupcontr.class.php';
include 'classes/signupview.class.php';
$signupcontr = new signupcontr($email, $password);
$logged = $signupcontr->loginProcess();
unset($_POST['email'], $_POST['password']);
if($logged == 'correct' && isset($_SESSION['account_id'])){
header("Location: CUSTOMER/dashboard.php");
exit();
}
$signupview = new signupview();
$result = $signupview->showAlert($logged);
}
?>
<!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.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="css/index.css">
<title>Boostrap Login | Ludiflex</title>
</head>
<body style="background-color:#fffdf2;">
<!----------------------- Main Container -------------------------->
<div class="container d-flex justify-content-center align-items-center min-vh-100">
<!----------------------- Login Container -------------------------->
<div class="row rounded-5 box-area " id="login-container">
<!--------------------------- Left Box ----------------------------->
<div class="col-md-6 rounded-4 d-flex justify-content-center align-items-center flex-column left-box " id="left-box">
<div class="featured-image mb-3 logo">
<img src="images/logo.png" class="rounded-circle mt-4" style="width: 300px;">
</div>
<p class="text-white fs-2 pt-3 mb-1 logo" style="font-family: 'Courier New', Courier, monospace; font-weight: 600;">FLAT-OS</p>
<p class="text-white mb-3"><small>CBB's Apartment</small></p>
</div>
<!-------------------- ------ Right Box ---------------------------->
<div class="col-md-6 right-box" id="right-box">
<form action="#" method="post">
<div class="row align-items-center">
<?php
$displayaAlert = isset($result)? $result : '';
echo $displayaAlert;
if(isset($_GET['status'])){
echo '<div class="alert alert-success alert-dismissible fade show">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<strong>Account activated!</div>';
}
?>
<div class="header-text mb-4" id="right-header">
<h2>Hello, Again</h2>
<p>Our team are grateful to have you back.</p>
</div>
<div class="input-group mb-3">
<input type="text" name="email" value = "<?php echo $data = isset($email) ? htmlentities($email) : null ?>" class="form-control form-control-lg bg-light fs-6" placeholder="Email address">
</div>
<div class="input-group mb-1">
<input type="password" id="password" name="password" class="form-control form-control-lg bg-light fs-6" placeholder="Password">
</div>
<div class="input-group mb-5 d-flex justify-content-between">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="formCheck">
<label for="formCheck" class="form-check-label text-secondary"><small>Show password</small></label>
</div>
<div class="forgot">
<small><a href="forgotPassword.php">Forgot Password?</a></small>
</div>
</div>
<div class="input-group mb-3">
<button type="submit" class="btn btn-lg btn-primary w-100 fs-6" id="right-btn">Login</button>
</div>
<div class="row" >
<small id="right-signup">Don't have account? <a href="signup.php"> Sign Up</a></small>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="javascript/index.js"></script>
</body>
</html>