-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
189 lines (160 loc) · 7.33 KB
/
login.php
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
include 'connect.php';
//require_once 'secure_admin.php';
if(isset($_SESSION['email']))
{
if ($_SESSION['email'] == "[email protected]") {
header('location: admin_home.php');
}
else {
header('location: user_home.php');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Proyek Manpro 11</title>
<?php include('assets/header.php'); ?>
<link href="assets/css/admin_login.css" rel="stylesheet" />
</head>
<body>
<div class="comming-soon" style="background:url('assets/img/bgi.jpg');">
<div class="first-header d-flex justify-content-center">
<h1 class="display-4 text-white-50 text-center">Renungan Harian dan Pasal Alkitab</h1>
</div>
<div class="second-header text-center">
<h2>Renungan Harian Pasal Alkitab</h2>
<p>Kelompok 11 Manpro v1.0</p>
<div class="d-flex justify-content-center mb-1">
<button type="button" class="btn btn-secondary btn-block w-50 text-white" data-bs-toggle="modal" data-bs-target="#myModal">Sign In</button>
</div>
<div class="d-flex justify-content-center">
<button type="button" class="btn bg-dark btn-block w-50 text-white" data-bs-toggle="modal" data-bs-target="#myModal2">Sign Up</button>
</div>
</div>
</div>
<!-- SIGN IN -->
<div id="myModal" class="modal py-5 fade" role="dialog">
<div class="vertical-alignment-helper">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">Sign in</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body mx-3" method="POST">
<form class="form-signin">
<div class="md-form mb-4">
<i class="fas fa-envelope prefix"> </i> <label for="inputEmailIn"> Email Address </label>
<input type="email" id="inputEmailIn" class="form-control validate" placeholder="Email address">
</div>
<div class="md-form mb-4">
<i class="fas fa-lock prefix grey-text"> </i> <label for="inputPasswordIn"> Password </label>
<input type="password" id="inputPasswordIn" class="form-control validate" placeholder="Password">
</div>
<div class="modal-footer d-flex justify-content-center">
<button id="signin" class="btn-dark btn-lg btn-block text-uppercase">Login</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- SIGN UP -->
<div id="myModal2" class="modal py-4 fade" role="dialog">
<div class="vertical-alignment-helper">
<div class="modal-dialog vertical-align-center">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">Sign up</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-4">
<i class="fas fa-user prefix grey-text"> </i> <label for="inputPhone">Name</label>
<input type="text" id="inputName" class="form-control" placeholder="Name: Budi">
</div>
<div class="md-form mb-4">
<i class="fas fa-calendar-alt prefix grey-text"> </i> <label for="inputPhone">Date of Birth</label>
<input type="date" id="inputDate" class="form-control" placeholder="d/m/y">
</div>
<div class="md-form mb-4">
<i class="fas fa-phone prefix grey-text"> </i> <label for="inputPhone">Phone Number</label>
<input type="text" id="inputPhone" class="form-control" placeholder="Phone Number">
</div>
<div class="md-form mb-4">
<i class="fas fa-envelope prefix grey-text"> </i> <label for="inputPhone">Email</label>
<input type="email" id="inputEmailUp" class="form-control" placeholder="Email">
</div>
<div class="md-form mb-4">
<i class="fas fa-lock prefix grey-text"> </i> <label for="inputPhone">Password</label>
<input type="password" id="inputPasswordUp" class="form-control" placeholder="Password">
</div>
<div class="modal-footer d-flex justify-content-center">
<button type="submit" id="signup" class="btn btn-dark">Sign up</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Handle klik yang punya id signin
$("[id='signin']").click(function() {
// Ambil data dari form
var varemail = $("[id='inputEmailIn']").val();
var varpassword = $("[id='inputPasswordIn']").val();
$.ajax({
url: "signin.php",
method: "POST",
data: {
email: varemail,
password: varpassword
},
success: function(result) {
if (result.notif) {
alert(result.notif);
}
if (result.location) {
window.location.href = result.location;
}
},
error: function(result) {
}
});
});
// Handle klik yang punya id signup
$("[id='signup']").click(function() {
// Ambil info dari form
var varname = $("[id='inputName']").val();
var vardate = $("[id='inputDate']").val();
var varphone = $("[id='inputPhone']").val();
var varemail = $("[id='inputEmailUp']").val();
var varpassword = $("[id='inputPasswordUp']").val();
$.ajax({
url: "signup.php",
method: "POST",
data: {
name: varname,
date: vardate,
phone: varphone,
email: varemail,
password: varpassword
},
success: function(result) {
if (result.notif) {
alert(result.notif);
}
if (result.location) {
window.location.href = result.location;
}
},
error: function(result) {
}
});
});
</script>
</body>
</html>