-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
315 lines (266 loc) · 13.5 KB
/
index.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
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
<?php
include('./Config/config.php');
?>
<?php
$dbh = new PDO("mysql:host=$dbhost;dbname=$dbname","$dbusername","$dbpassword");
$query = $dbh->prepare("SELECT COUNT(session) AS EIGHT FROM `cprclass` WHERE session='8PM'");
$query->execute();
$confirmaton = $query->fetch(PDO::FETCH_ASSOC);
// print('<h1>EIGHT: '.$confirmaton['EIGHT'].'</h1>');
$eight = $confirmaton['EIGHT'];
$query = $dbh->prepare("SELECT COUNT(session) AS TENAM FROM `cprclass` WHERE session='10AM'");
$query->execute();
$confirmaton = $query->fetch(PDO::FETCH_ASSOC);
// print('<h1>EIGHT: '.$confirmaton['EIGHT'].'</h1>');
$tenam = $confirmaton['TENAM'];
?>
<?php include('./Includes/header.php'); ?>
<script>
var dt = new Date();
dt.setFullYear(new Date().getFullYear()-16);
$('#datepicker').datepicker(
{
viewMode: "years",
endDate : dt
}
);
</script>
<?php
/*
fname
middle e
lname
home address
phone
email
age [drop down start 16 - 99]
*/
/*
max 50 (possibly increase)
do not display
2 sessions
10AM
8PM
prompt to other session if full
Output as spreadsheet
*/
// id="add_to_cart"
/*
After Successful registration
the user should get a confirmation page
that shows unique registration number
or barcode or UR code. Something they
can download and present - although in
actuality they won't be required show anything
full address street, city, zip
all required except apt no.
All fields required except apt no.
-- on successful registration user
gets email and a page with confirmation
number
Date of Birth DOB - instead of drop-down for age.
If user is younger than 16 they cannot register.
put donation button on the landing page
and in the email
*/
?>
<div class="container minheight">
<div class="row">
<div class="container newsletter_container">
<?php
// if (isset($_GET['message'])){
// print('<div class="alert alert-danger" role="alert">');
// print(stripslashes($_GET['message']));
// print('</div>');
// }
?>
<!-- <form class="col-md-6 offset-md-3" method="POST" action="./">
<h3 class="title">Sign Up For Newsletter</h3>
<div class="form-group">
<input type="text" class="form-control" name="signincode" id="signincode" placeholder="Sign in with code">
</div>
<button type="submit" class="btn btn-primary topBtn"><i class="fa fa-sign-in"></i> Sign in</button>
</form> -->
<script>
var placeSearch, autocomplete;
// List all address components (corresponds to form field IDs and Google address object)
var componentForm = {
autocomplete: ['street_number', 'route'],
inputCity: 'locality',
inputState: 'administrative_area_level_1',
inputZip: 'postal_code',
inputCounty: 'administrative_area_level_2',
inputCountry: 'country'
};
// Create autocomplete object based on the autocomplete ("street") field
// Location type restricted to geocode
function initAutocomplete() {
autocomplete = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */ (document.getElementById('autocomplete')),
{type: ['geocode']});
// Call fillInAddress when user selects an address from dropdown
autocomplete.addListener('place_changed', fillInAddress);
}
// Fill fields with values from Google Maps autocomplete object
function fillInAddress() {
// Get place data from autocomplete object
var place = autocomplete.getPlace();
console.log(place);
// Enable each field, then fill them with the corresponding value from the place object
for (var component in componentForm) {
document.getElementById(component).disabled = false;
document.getElementById(component).value = search(componentForm[component], place.address_components);
}
// Original Google Implementation - do not use
// Get each component of the address from the place
// object and fill the corresponding field
// for (var i = 0; i < place.address_components.length; i++) {
// var addressType = place.address_components[i].types[0];
// if (componentForm[addressType]) {
// var val = place.address_components[i][componentForm[addressType]];
// document.getElementById(addressType).value = val;
// }
// }
// Fill the autocomplete field with values from the place object
// If a street number is not found, set the field to route only.
if (search("street_number", place.address_components) != "") {
document.getElementById("autocomplete").value = search("street_number", place.address_components) + " ";
}
document.getElementById("autocomplete").value += search("route", place.address_components);
// Search the passed object for a specified address component/type and return the short_name value of the matched component/type
// If requested type does not exist in the placeObject, return an empty string
function search(type, placeObject) {
for (var i = 0; i < placeObject.length; i++) {
if (placeObject[i].types[0] === type) {
return placeObject[i].short_name;
} else if (i === placeObject.length - 1) {
return "";
}
}
}
}
</script>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" defer></script>
<!-- <script>
window.onloadTurnstileCallback = function () {
turnstile.render('#example-container', {
sitekey: '0x4AAAAAAAEUWVl7kkpksetT',
callback: function(token) {
console.log(`Challenge Success ${token}`);
},
});
};
</script> -->
<!-- <div id="example-container">
<form action="/login" method="POST">
<input type="text" placeholder="username"/>
<input type="password" placeholder="password"/>
<div class="cf-turnstile" data-sitekey="0x4AAAAAAAEUWVl7kkpksetT'"></div>
<button type="submit" value="Submit">Log in</button>
</form>
</div> -->
<!-- <div class="cf-turnstile"></div> -->
<!-- <div id="example-container"> -->
<!-- <form class="col-md-6 offset-md-3" method="POST" action="bounce.newcustomer.php"> -->
<div id="example-container">
<form class="col-md-6 offset-md-3" method="POST" action="bounce.cprclass.php#jumsuccess">
<input type="hidden" name="submit" value="submit"/>
<div class="form-group">
<label for="fname"><span class="required_field">*</span> First Name</label>
<input type="text" class="form-control" id="fname" name="fname" required>
</div>
<div class="form-group">
<label for="middle"> Middle Initial</label>
<input type="text" class="form-control" id="middle" name="middle">
</div>
<div class="form-group">
<label for="lname"><span class="required_field">*</span> Last Name</label>
<input type="text" class="form-control" id="lname" name="lname" required>
</div>
<div class="form-group">
<label for="clientemail"><span class="required_field">*</span> Email Address</label>
<input type="email" class="form-control" id="clientemail" name="clientemail" required>
</div>
<!-- <div class="form-group">
<label for="clientphone"><span class="required_field">*</span> Phone Number:</label>
<input type="tel" class="form-control" id="clientphone" name="clientphone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}" required>
<small>Format: 123-456-7890</small>
</div> -->
<div class="form-group">
<label for="clientphone"><span class="required_field">*</span> Phone Number:</label>
<input type="text" class="form-control" id="clientphone" name="clientphone" required>
</div>
<br/>
<div class="form-group">
<table class="table" id="address_table">
<tr><td><span class="required_field">*</span> Street</td><td><input type="street" class="form-control" name="inputStreet" id="autocomplete" required></td></tr>
<tr><td><span class="required_field">*</span> City</td><td><input type="city" class="form-control" name="inputCity" id="inputCity" required></td></tr>
<tr><td><span class="required_field">*</span> State</td><td><input type="state" class="form-control" name="inputState" id="inputState" required></td></tr>
<tr><td><span class="required_field">*</span> Zip Code</td><td><input type="zip" class="form-control" name="inputZip" id="inputZip" required></td></tr>
<tr><td> Apt No.</td><td><input type="text" class="form-control" name="inputAptNo" id="inputAptNo"></td></tr>
</table>
</div>
<br/>
<!-- <div class="form-group" style="background: #f8f8f8; padding: 20px; border: solid #ccc 1px;">
<h4><span class="required_field">*</span> Birthdate</h4>
<p><i>Must be at least 16</i></p>
<input type="date" name="birthdate" value="" min="2007-05-21" style="width: 100%; border: solid #ccc 1px;" required>
</div>
<br/> -->
<div class="form-group" style="background: #f8f8f8; padding: 20px; border: solid #ccc 1px;">
<h4><span class="required_field">*</span> Birthdate</h4>
<p><i>Must be at least 16</i></p>
<input type="date" name="birthdate" max="2007-05-21" style="width: 100%; border: solid #ccc 1px;" required>
</div>
<br/>
<div class="form-group">
<h4><span class="required_field">*</span> Choose Session</h4>
<?php // print('<p>Count 8PM: '.$eight.'</p>');?>
<?php // print('<p>Count 10AM: '.$tenam.'</p>');?>
<table class="table" style="border: solid #ccc 1px;">
<tr>
<?php if($tenam < 51 ){ ?>
<td style="background: #f8f8f8;">
<input type="radio" id="10AM" name="choose_session" value="10AM" required>
<label for="html"> 10AM</label>
</td>
<?php }else{ ?>
<td style="background: #f8f8f8;" id="closed_session">
<i>Session Full</i>
<label for="html"> 10AM</label>
</td>
<?php } ?>
</tr>
<tr>
<?php if($eight < 51){ ?>
<td style="background: #f8f8f8;">
<input type="radio" id="8PM" name="choose_session" value="8PM" required>
<label for="html"> 8PM</label>
</td>
<?php }else{ ?>
<td style="background: #f8f8f8;" id="closed_session">
<i>Session Full</i>
<label for="html"> 8PM</label>
</td>
<?php } ?>
</tr>
<tr>
<td style="background: #f8f8f8;">
<input type="radio" id="future" name="choose_session" value="future" required>
<label for="html"> Future Session</label>
<p><i>Unable to attend? Get notified of future sessions</i></p>
</td>
</tr>
</table>
</div>
<br/>
<div class="cf-turnstile" data-sitekey="0x4AAAAAAAEUWVl7kkpksetT"></div>
<br/>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<!-- </div> -->
</div>
</div>
</div>
</div>
<?php include('./Includes/footer.php'); ?>