-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
368 lines (317 loc) · 13.1 KB
/
index.php
File metadata and controls
368 lines (317 loc) · 13.1 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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Agri-Business</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="bootstrap\css\bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="bootstrap\js\bootstrap.min.js"></script>
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="login.css"/>
<script src="js/jquery.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<script>
// Check if a message is set in the session
<?php if(isset($_SESSION['message'])): ?>
// Display the message using alert
alert('<?php echo $_SESSION['message']; ?>');
// Unset the message from the session
<?php unset($_SESSION['message']); ?>
<?php endif; ?>
</script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-xlarge.css" />
</noscript>
<link rel="stylesheet" href="indexfooter.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<?php
require 'menu.php';
?>
<!-- Banner -->
<section id="banner" class="wrapper">
<div class="container">
<h2>Agri-Business</h2>
<p>Your Product Our Market</p>
<br><br>
<center>
<div class="row uniform">
<div class="6u 12u$(xsmall)">
<button class="button fit" onclick="document.getElementById('id01').style.display='block'" style="width:auto">LOGIN</button>
</div>
<div class="6u 12u$(xsmall)">
<button class="button fit" onclick="document.getElementById('id02').style.display='block'" style="width:auto">REGISTER</button>
</div>
</div>
</center>
</section>
<!-- One -->
<section id="one" class="wrapper style1 align-center">
<div class="container">
<header>
<h2 style="color: black;">Agri-Business</h2>
<p style="color: black;">Explore the new way of trading...</p>
</header>
<div class="row 200%">
<section class="4u 12u$(small)">
<i class="icon big rounded fa-clock-o"></i>
<p style="color: black;">Digital Market</p>
</section>
<section class="4u 12u$(small)">
<i class="icon big rounded fa-comments"></i>
<p style="color: black;">Agro-Blog</p>
</section>
<section class="4u$ 12u$(small)">
<i class="icon big rounded fa-user"></i>
<p style="color: black;">Register with us</p>
</section>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer-distributed" style="background-color:black" id="aboutUs">
<center>
<h1 style="font: 35px calibri;">About Us</h1>
</center>
<div class="footer-left">
<h3 style="font-family: 'Times New Roman', cursive;">Agri-Business © </h3>
<!-- <div class="logo">
<a href="index.php"><img src="images/logo.png" width="200px"></a>
</div>-->
<br />
<p style="font-size:20px;color:white">Your product Our market !!!</p>
<br />
</div>
<div class="footer-center">
<div>
<i class="fa fa-map-marker"></i>
<p style="font-size:20px">Agri Business Platform<span>India</span></p>
</div>
<div>
<i class="fa fa-phone"></i>
<p style="font-size:20px">123456789</p>
</div>
<div>
<i class="fa fa-envelope"></i>
<p style="font-size:20px"><a href="mailto:Agri-Business@gmail.com" style="color:white">demo@demo.com</a></p>
</div>
</div>
<div class="footer-right">
<p class="footer-company-about" style="color:white">
<span style="font-size:20px"><b>About Agri-Business</b></span>
Agri-Business is e-commerce trading platform for grains & grocerries...
</p>
<div class="footer-icons">
<a href="#"><i style="margin-left: 0;margin-top:5px;"class="fa fa-facebook"></i></a>
<a href="#"><i style="margin-left: 0;margin-top:5px" class="fa fa-instagram"></i></a>
<a href="#"><i style="margin-left: 0;margin-top:5px" class="fa fa-youtube"></i></a>
</div>
</div>
</footer>
<div id="id01" class="modal">
<form class="modal-content animate" action="Login/login.php" method='POST'>
<div class="imgcontainer">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="container">
<h3>Login</h3>
<form method="post" action="Login/login.php">
<div class="row uniform 50%">
<div class="7u$">
<input type="text" name="uname" id="uname" value="" placeholder="UserName" style="width:80%" required/>
</div>
<div class="7u$">
<input type="password" name="pass" id="pass" value="" placeholder="Password" style="width:80%" required/>
</div>
<div class="3u 12u$(xsmall)">
<input type="checkbox" id="show-password" onchange="togglePasswordVisibility()">
<label for="show-password">Show Password</label>
</div>
</div>
<div class="row uniform">
<p>
<b>Category : </b>
</p>
<div class="3u 12u$(small)">
<input type="radio" id="farmer" name="category" value="1" checked>
<label for="farmer">Farmer</label>
</div>
<div class="3u 12u$(small)">
<input type="radio" id="buyer" name="category" value="0">
<label for="buyer">Buyer</label>
</div>
</div>
<center>
<div class="row uniform">
<div class="7u 12u$(small)">
<input type="submit" value="Login" />
</div>
</div>
</center>
</div>
</form>
</section>
</div>
</div>
</div>
</form>
</div>
<div id="id02" class="modal">
<form class="modal-content animate" method="POST" id="signup-form" onsubmit="return validateForm()">
<div class="imgcontainer">
<span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="container">
<section>
<h3>SignUp</h3>
<div id="password-strength-message"></div>
<div id="password-match-message"></div> <!-- Display message for password match -->
<center>
<div class="row uniform">
<div class="3u 12u$(xsmall)">
<input type="text" name="name" id="name" value="" placeholder="Name" required/>
</div>
<div class="3u 12u$(xsmall)">
<input type="text" name="uname" id="uname" value="" placeholder="UserName" required/>
</div>
</div>
<div class="row uniform">
<div class="3u 12u$(xsmall)">
<input type="text" name="mobile" id="mobile" value="" placeholder="Mobile Number" required/>
</div>
<div class="3u 12u$(xsmall)">
<input type="email" name="email" id="email" value="" placeholder="Email" required/>
</div>
</div>
<div class="row uniform">
<div class="3u 12u$(xsmall)">
<input type="password" name="password" id="password" value="" placeholder="Password" required onkeyup="checkPasswordStrength();"/>
</div>
<div class="3u 12u$(xsmall)">
<input type="checkbox" id="show-password" onchange="togglePasswordVisibility()">
<label for="show-password">Show Password</label>
</div>
</div>
<div class="row uniform">
<div class="3u 12u$(xsmall)">
<input type="password" name="pass" id="confirm-password" value="" placeholder="Retype Password" required/>
</div>
</div>
<div class="row uniform">
<div class="6u 12u$(xsmall)">
<input type="text" name="addr" id="addr" value="" placeholder="Address" style="width:80%" required/>
</div>
</div>
<div class="row uniform">
<p><b>Category:</b></p>
<div class="3u 12u$(small)">
<input type="radio" id="farmerReg" name="category" value="1" checked>
<label for="farmerReg">Farmer</label>
</div>
<div class="3u 12u$(small)">
<input type="radio" id="buyerReg" name="category" value="0">
<label for="buyerReg">Buyer</label>
</div>
</div>
<div class="row uniform">
<div class="3u 12u$(small)">
<input type="submit" value="Submit" name="submit" class="special" id="submit-btn" />
</div>
<div class="3u 12u$(small)">
<input type="reset" value="Reset" name="reset"/>
</div>
</div>
</center>
</section>
</div>
</form>
</div>
<script>
function togglePasswordVisibility() {
var passwordInput = document.getElementById("password");
var confirmPasswordInput = document.getElementById("confirm-password");
var loginPasswordInput = document.getElementById("pass");
if (passwordInput.type === "password") {
passwordInput.type = "text";
confirmPasswordInput.type = "text";
loginPasswordInput.type = "text";
} else {
passwordInput.type = "password";
confirmPasswordInput.type = "password";
loginPasswordInput.type = "password";
}
}
function checkPasswordStrength() {
var password = document.getElementById("password").value;
var strengthMessage = document.getElementById("password-strength-message");
// Reset password strength message
strengthMessage.innerHTML = "";
// Check password strength
var hasUpperCase = /[A-Z]/.test(password);
var hasLowerCase = /[a-z]/.test(password);
var hasNumbers = /\d/.test(password);
var hasSpecialChars = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/.test(password);
if (password.length < 8) {
strengthMessage.innerHTML = "Password must be at least 8 characters long.";
return;
}
if (!hasUpperCase) {
strengthMessage.innerHTML = "Password must contain at least one uppercase letter.";
return;
}
if (!hasLowerCase) {
strengthMessage.innerHTML = "Password must contain at least one lowercase letter.";
return;
}
if (!hasNumbers) {
strengthMessage.innerHTML = "Password must contain at least one number.";
return;
}
if (!hasSpecialChars) {
strengthMessage.innerHTML = "Password must contain at least one special character.";
return;
}
// If all checks pass, indicate strong password
strengthMessage.innerHTML = "Strong password!";
}
function validateForm() {
var password = document.getElementById("password").value;
var confirmPassword = document.getElementById("confirm-password").value;
var strengthMessage = document.getElementById("password-strength-message");
var matchMessage = document.getElementById("password-match-message");
var form = document.getElementById("signup-form");
// Reset password strength and match messages
strengthMessage.innerHTML = "";
matchMessage.innerHTML = "";
// Check password strength
// (Assuming checkPasswordStrength() function checks password strength)
checkPasswordStrength();
// Log the values of password and confirmPassword
console.log("Password:", password);
console.log("Confirm Password:", confirmPassword);
// Check if passwords match
if (password !== confirmPassword) {
matchMessage.innerHTML = "Passwords do not match.";
return false;
}
// If password is not strong, prevent form submission
if (strengthMessage.innerHTML !== "Strong password!") {
return false;
}
// Set the form action to submit to signup.php
form.action = "Login/signUp.php";
return true;
}
// Add event listener to the form submission event
// document.getElementById("id02").addEventListener("submit", validateForm);
</script>
</body>
</html>