-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
152 lines (147 loc) · 4.55 KB
/
signup.php
File metadata and controls
152 lines (147 loc) · 4.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
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
<?php
use Years\Year;
require_once("assets/Class/year.class.php");
$year = new Year();
$years=$year->select();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="assets/Photos/StudyHub.png">
<title>Sign Up</title>
<link rel="stylesheet" href="assets/css/login.css">
<?php
include("assets/includes/cdns.php");
?>
</head>
<body>
<div class="loaderClass">
<img src="assets/Photos/loading.gif" alt="Loading...">
</div>
<div class="content">
<form id="signup" method="post">
<table>
<tr>
<td>
<h1>Sign Up</h1>
</td>
<td></td>
</tr>
<tr>
<td colspan="2"><input type="text" name="email" placeholder="Email"></td>
</tr>
<tr>
<td colspan="2">
<select name="year">
<option value="">Select Year</option>
<?php
foreach ($years as $year) {
echo "<option value='".$year["id"]."'>".$year["course"]."-".$year["name"]."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input type="password" id="password" name="password" placeholder="Password"></td>
</tr>
<tr>
<td colspan="2"><input type="password" name="confirm_password" placeholder="Confirm Password"></td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Sign Up">
</td>
<td>
<a href="login"><label>Login</label></a>
</td>
</tr>
<table>
</form>
</div>
</body>
<script>
$(document).ready(function(){
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": "toast-top-right",
"preventDuplicates": true,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "3000",
"extendedTimeOut": "3000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
$(".loaderClass").css("display", "none");
$("#signup").validate({
rules: {
email: {
required: true,
email:true
},
year:{
required:true,
},
password: {
required: true,
minlength: 8
},
confirm_password: {
required: true,
equalTo: "#password"
},
},
messages: {
email: {
required: "Email is required"
},
year:{
required:"Select Year",
},
password: {
required: "Password is required",
},
confirm_password: {
required: "Confirm Password is required",
equalTo: "Password doesn't match"
},
},
errorClass: "text-danger",
errorElement:"small",
submitHandler: function(form, event) {
event.preventDefault();
let data = new FormData(form);
$.ajax({
type: 'post',
url: "assets/Exec/signup.php",
data: data,
dataType: 'JSON',
contentType: false,
processData: false,
async: true,
cache: false,
beforeSend: function() {
$(".loaderClass").css("display", "flex");
},
success: function(data) {
$(".loaderClass").css("display", "none");
if (data.status == 1) {
toastr.success(data.message);
} else {
toastr.error(data.message);
}
}
});
}
});
});
</script>
</html>