-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
230 lines (201 loc) · 11.4 KB
/
register.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
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
<?php
require_once( "include/page_elements.php" );
require_once( "include/registration.php" );
/* Short and sweet */
define('WP_USE_THEMES', false);
require('wp-backend/wp-blog-header.php');
http_response_code(200); // override wp
// Form submitted
$wasPost = false;
$success = false;
if ( isset( $_POST[ 'register' ] ) ) {
// Process the registration.
$wasPost = true;
$message = register( $_POST );
$success = empty( $message );
}
?>
<!DOCTYPE html>
<html>
<?php page_head( "LigerBots Registration", false, '/css/register.css' ); ?>
<body>
<div id="header-ghost" ></div>
<div class="container-fluid no-side-padding">
<div class="col-xs-12 no-side-padding">
<?php
output_header();
output_navbar();
?>
<div class="row page-body">
<div class="col-md-12 col-md-offset-0 col-sm-10 col-sm-offset-1 col-xs-12">
<div class="row top-spacer"> </div>
<div class="row side-margins bottom-margin">
<div class="col-lg-6 col-lg-offset-3 col-xs-12 no-side-padding bottom-margin">
<?php
if ( $wasPost )
{
if ( ! empty( $message ) )
echo '<div class="alert alert-danger"><strong>' . $message . '</strong></div>' . "\n";
else
{
echo '<div class="alert alert-success"><strong>Success!<br/>';
echo "Your account need to be approved by the Administrator.</br>Please watch your email for confirmation.</strong></div>\n";
}
}
?>
<?php if ( ! $success ): ?>
<form method="post" <?php echo 'action="' . $_SERVER['PHP_SELF'] . '"'; ?> onsubmit="return(validate());">
<div class="form-group">
<label class="required">Desired Username</label>
<input type="text" pattern="[a-zA-Z0-9._]{3,}" class="form-control" placeholder="liger123" name="username" aria-describedby="usernameHelp" required />
<span id="usernameHelp" class="help-block">At least 3 characters. Allows letters, numbers, underscore and period.</span>
</div>
<div class="form-group">
<label class="required">Email</label>
<input type="email" class="form-control" placeholder="john.smith@gmail.com" name="email" required />
<span id="emailHelp">Do <b>not</b> use an NPS student email; it cannot be used outside of NPS.<br />
The LigerBots rely heavily on Google Drive, so an account with access to Google is preferable.</span>
</div>
<div class="form-group">
<label class="required">Name</label>
<div class="lb-input-group name-group">
<input type="text" class="form-control" placeholder="John" name="first-name" required />
<input type="text" class="form-control" placeholder="Smith" name="last-name" required />
</div>
</div>
<div class="form-group phone-group">
<label class="required">Phone</label>
<input type="text" maxlength="12" class="form-control" placeholder="123-456-7890" name="phone" required />
</div>
<div class="form-group">
<label class="required">Address</label>
<input type="text" class="form-control" placeholder="Address line" name="address" required />
<div class="spacer"></div>
<div class="lb-input-group address-group">
<input type="text" class="form-control" placeholder="City" value="Newton" name="city" required />
<input type="text" class="form-control" placeholder="State" value="MA" name="state" required />
<input type="number" class="form-control" placeholder="Zip code" name="postalcode" maxlength="5" required />
</div>
</div>
<label class="required">School</label>
<div class="radio lb-checkbox">
<label>
<input type="radio" name="school" value="North" required /> Newton North
</label>
<label>
<input type="radio" name="school" value="South" required /> Newton South
</label>
<label>
<input type="radio" name="school" value="none" required /> N/A
</label>
</div>
<label class="required">I am a...</label>
<div class="radio lb-checkbox">
<label>
<input type="radio" name="user-type" value="student" required /> Student
</label>
<label>
<input type="radio" name="user-type" value="adult" required /> Adult
</label>
</div>
<div class="roles-group">
<label class="required">Adult roles</label>
<div class="checkbox lb-checkbox">
<label class="hidden">
<input type="checkbox" name="role-parent" disabled /> Parent/Guardian
</label>
<label class="hidden">
<input type="checkbox" name="role-mentor" disabled /> Mentor
</label>
<label class="hidden">
<input type="checkbox" name="role-coach" disabled /> Coach
</label>
</div>
</div>
<!-- There are two different sections of the form based on whether the user selected "student" or "parent" -->
<div class="form-sections">
<div class="form-section student">
<label class="required">Parent/Guardian names</label>
<!-- allows for multiple copies of input elements via some scripting
used to display a variable number of parent name inputs -->
<div class="multi-input">
<script type="text/html+template" class="multi-input-template">
<div class="lb-input-group name-group multi-name-group">
<input type="text" class="form-control" placeholder="John" name="parent-first-name[]" data-required />
<input type="text" class="form-control" placeholder="Smith" name="parent-last-name[]" data-required />
<span class="input-group-btn">
<button class="btn btn-default multi-input-remove" type="button">X</button>
</span>
</div>
</script>
<div class="multi-input-items"></div>
<div class="spacer"></div>
<div class="multi-input-buttons">
<button type="button" class="btn multi-input-add">
Add
</button>
</div>
<div class="spacer"></div>
</div>
<div class="form-group">
<label class="required">Parent/Guardian email</label>
<input type="email" class="form-control" placeholder="john.smith@example.com" name="parent_email" data-required />
</div>
<div class="form-group phone-group">
<label class="required">Emergency Phone</label>
<input type="text" maxlength="14" class="form-control" placeholder="123-456-7890" name="emergency_phone" data-required />
</div>
<div class="form-group">
<label class="required">Graduation year</label>
<input type="number" class="form-control" name="graduation" min="2020" max="2035" />
</div>
</div>
<div class="form-section parent">
<label class="required">Child(ren)'s Name(s)</label>
<!-- same idea as the one for the student section -->
<div class="multi-input">
<script type="text/html+template" class="multi-input-template">
<div class="lb-input-group name-group multi-name-group">
<input type="text" class="form-control" placeholder="John" name="child-first-name[]" data-required />
<input type="text" class="form-control" placeholder="Smith" name="child-last-name[]" data-required />
<span class="input-group-btn">
<button class="btn btn-default multi-input-remove" type="button">X</button>
</span>
</div>
</script>
<div class="multi-input-items"></div>
<div class="spacer"></div>
<div class="multi-input-buttons">
<button type="button" class="btn multi-input-add">
Add
</button>
</div>
</div>
</div>
</div>
<div class="spacer"></div>
<div class="form-group">
<label class="required">Password</label>
<div class="lb-input-group">
<input type="password" pattern=".{8,}" class="form-control" placeholder="Password" name="password" aria-describedby="passwordHelp" required />
<input type="password" class="form-control" placeholder="Confirm" name="password-confirm" required />
</div>
<span id="passwordHelp" class="help-block">Password must be a minimum of 8 characters and contain mixed case and at least 1 digit.</span>
</div>
<div class="help-block">
<label class="required"></label> required
</div>
<button type="submit" name="register" class="btn btn-default">Submit</button>
</form>
<?php endif; ?>
</div>
</div>
<?php output_footer(); ?>
</div>
</div>
</div>
</div>
<?php page_foot(); ?>
<script src="/js/register.js"></script>
</body>
</html>