-
Notifications
You must be signed in to change notification settings - Fork 2
/
join.php
504 lines (467 loc) · 21.6 KB
/
join.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
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
<?php
include_once './libs/const.php';
$_pageid = 113;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
$_TITLE = "Join Us";
include_once './tags/common/head.php';
?>
<?php include_once('./libs/signup.php');?>
<?php include_once './libs/masterdata.php';
$edu = getEducation();
$job = getProfession();
$languages = getLanguages();
$stblind = getStatusblindness();
$stmobility=getStatusMobility();
$optechno = getOptechnology();
$hobies = getHobies();
?>
<?php
$_TITLE = "Join Us";
include_once './tags/common/head.php';
?>
<?php include_once('./libs/signup.php');?>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places"></script>
<script>
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
<script>
// JS validation for the file
/* run the init() after the page get loaded
* Run init() after page get loaded
*/
window.onload = init;
/*
initialiation for the init
*/
function init(){
//Bind onsubmit event handler
document.getElementById("regform").onsubmit = validateForm;
// Bind the evaent handler function
document.getElementById("btnreset").onclick = clearForm;
// Bind the on focus event handler
document.getElementById("fname").focus();
}
function validateForm(theForm){
with(theForm){
return(isNotEmpty(fname, "please enter the firstname " ,elmFNameError)
&& isNotEmpty(lname, "please enter the lastname" , elmLNameError)
&& isValidEmail(email ,"please enter email or email not in the format",elmemailError)
&& isNumeric(phone, "please enter phone number",elmphoneError)
&& isNumeric(ephone, "please enter guardian number" , elmephoneError)
&& isChecked("sex", "please select the sex", elmsexError)
&& isNotEmpty(datepicker, "please enter the date of the birth" , elmdatepickerError)
&& isNotEmpty(stblind , "select you status" , elmstblindError)
&& isNotEmpty(stmobility , "select status of mobility" , elmstmobilityError)
&& isNotEmpty(optechno, "select the operating technology" , elmoptechnoError)
&& isNotEmpty(hobies, "select the hobies" , elmhobiesError)
&& isNotEmpty(lang , "please select mother tougue" , elmlangError)
&& isChecked("plang", "please select languages" , elmplangError)
&& isNotEmpty(profession , "please select profession" , elmprofessionError)
&& isNotEmpty(qualification , "please enter the qualification", elmqualificationError)
&& isNotEmpty(iname, "please enter the institution name" , elminameError)
&& isLengthMinMax(pincode,6,6,"please enter the pincode",elmpincodeError)
&& isNotEmpty(paddress, "please enter permanent address",elmpaddressError)
&& isNotEmpty(taddress, "please enter the temporary address",elmtaddressError)
&& isNotEmpty(autocomplete, "please enter Your location",elmautocompleteError)
&& isNotEmpty(dream , "please enter your dream " , elmdreamError)
);
}
}
function isLengthMinMax(inputElm,minLength,maxLength,errMsg,errElm){
var inputValue = inputElm.value.trim();
var isValid = (inputValue.length >=minLength) && (inputValue.length <=maxLength);
postValidate(isValid,errMsg,errElm,inputElm);
return isValid;
}
function isNotEmpty(inputElm,errMsg,errElm){
var isValid = (inputElm.value.trim() !== "");
postValidate(isValid,errMsg,errElm,inputElm);
return isValid;
}
function isValidEmail(inputElm,errMsg,errElm){
var isValid = (inputElm.value.trim().match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/) !== null);
postValidate(isValid,errMsg,errElm,inputElm);
return isValid;
}
function isChecked(inputElm,errMsg,errElm){
var elms=document.getElementsByName(inputElm);
var isChecked=false;
for ( var i = 0; i < elms.length ; i++){
if(elms[i].checked){
isChecked=true;
break;
}
}
postValidate(isChecked,errMsg,errElm);//pass the null it's not focus any where
return isChecked;
}
function isNumeric(inputElm,errMsg,errElm){
var isValid = (inputElm.value.trim().match(/^\d+$/) !== null);
postValidate(isValid,errMsg,errElm,inputElm);
return isValid;
}
function postValidate(isValid,errMsg,errElm,inputElm){
if(!isValid){
// show the error message is its not proper field
if(errElm !== undefined && errElm !== null && errMsg !== undefined && errMsg !== null){
errElm.innerHTML = errMsg;
}
//set focus on input element currect this message
if(inputElm !== undefined && inputElm !== null){
inputElm.classList.add("errorBox"); // add the class for the styling
inputElm.focus();
}
}
else{
//clear the if the previous error is working means
if(errElm !== undefined && errElm !== null){
errElm.innerHTML = "";
}
if(inputElm !== undefined && inputElm !== null){
inputElm.classList.remove("errorBox");
}
}
}
</script>
</head>
<style type="text/css">
.asterisk_input:after {
content:"*";
color:red;
}
</style><script>
var lati='';
var lngi='';
$("document").ready(function() {
$("#dob").datepicker();
});
function initialize()
{
var input = document.getElementById('autocomplete');
var options = {componentRestrictions: {country: 'in'}};
var autocomplete=new google.maps.places.Autocomplete(input, options);
google.maps.event.addListener(autocomplete,'place_changed', function()
{
var inputA = document.getElementById('autocomplete').value;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({
'address': inputA
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK)
{
lati=results[0].geometry.location.lat();
lngi=results[0].geometry.location.lng();
$('#latitude').val(lati);
$('#longitude').val(lngi);
}
});
});
};
function showerrormessage(message)
{
$("#message").text(message);
$("#message").show();
}
</script>
<style>
.errorMsg{
color:red;
}
label.invalid
{
color: Red;
padding: 1px;
font-size: 12px;
font-weight: normal;
margin: 0px 0px 0px 45px;
}
secHeading{font-size:20px;font-weight:300;word-spacing:normal;letter-spacing:normal}
</style>
<body onLoad="initialize()">
<?php include_once './tags/global_header/header.php'; ?>
<div class="page-content" style="margin-top:80px ">
<div class="container">
<form method="POST" class="section" id="regform" action="">
<label style="margin-left: 5%">All <span class="asterisk_input"> </span> fileds are required </label>
<br>
<br>
<div class="form-group">
<label for="firstname" class="col-md-2">
First Name:
<span class="asterisk_input"> </span>
</label>
<div class="col-md-10">
<input type="text" class="form-control" name="fname" id="fname" placeholder="Enter First Name">
<label id="elmFNameError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="lastname" class="col-md-2">
Last Name:
<span class="asterisk_input"> </span>
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="lname" name="lname" placeholder="Enter Last Name">
<label id="elmLNameError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="useremail" class="col-md-2">
Email address:
<span class="asterisk_input"> </span>
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="email" name="email" placeholder="Enter email address">
<p class="help-block">
Example: [email protected]
<label id="elmemailError" class="errorMsg"> </label>
</p>
</div>
</div>
<div class="form-group">
<label for="phone" class="col-md-2">
MobilePhone:
<span class="asterisk_input"> </span>
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="phone" name="phone" placeholder="Mobile Phone" Maxlength="20" onkeypress="return isNumberKey(event)">
<label id="elmphoneError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="phone" class="col-md-2">
Guardian Number:
<span class="asterisk_input"> </span>
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="ephone" name="ephone" placeholder="Enter Guardian Mobile Phone" Maxlength="20" onkeypress="return isNumberKey(event)">
<label id="elmephoneError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="sex" class="col-md-2">
Sex:
</label>
<div class="col-md-10">
<label class="radio">
<input type="radio" name="sex" id="sex" value="male">
Male
</label>
<label class="radio">
<input type="radio" name="sex" id="sex" value="female">
Female
</label>
<label id="elmsexError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="dob" class="col-md-2">
DateOfBirth:
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="datepicker" name="dob" placeholder="DateOfBirth">
<label id="elmdatepickerError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="stblind" class="col-md-2">
Status of blindness:
</label>
<div class="col-md-10">
<select name="stblind" id="stblind" class="form-control">
<?php
foreach ($stblind as $sb) {
echo '<option value="'.$sb['Id'].'">'.$sb['Description'].'</option>';
}
?>
</select>
<label id="elmstblindError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="stmobility" class="col-md-2">
Status of mobility:
</label>
<div class="col-md-10">
<select name="stmobility" id="stmobility" class="form-control">
<?php
foreach ($stmobility as $stm) {
echo '<option value="'.$stm['Id'].'">'.$stm['Description'].'</option>';
}
?>
</select>
<label id="elmstmobilityError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="optechno" class="col-md-2">
Operate technologie:
</label>
<div class="col-md-10">
<select name="optechno" id="optechno" class="form-control">
<?php
foreach ($optechno as $opt) {
echo '<option value="'.$opt['Id'].'">'.$opt['Description'].'</option>';
}
?>
</select>
<label id="elmoptechnoError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="hobies" class="col-md-2">
Interests/Hobies:
</label>
<div class="col-md-10">
<select name="hobies" id="hobies" class="form-control">
<?php
foreach ($hobies as $hb) {
echo '<option value="'.$hb['Id'].'">'.$hb['Description'].'</option>';
}
?>
</select>
<label id="elmhobiesError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="lang" class="col-md-2">
Mothe Toungue:
</label>
<div class="col-md-10">
<select name="lang" id="lang" name="lang" class="form-control">
<?php
foreach ($languages as $lang) {
echo '<option value="'.$lang['Id'].'">'.$lang['Description'].'</option>';
}
?>
</select>
<label id="elmlangError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="plang" class="col-md-2">
Languages:
</label>
<div class="col-md-10">
<input type="checkbox" name="plang" value="English">English<br>
<input type="checkbox" name="plang" value="English">Hindi<br>
<input type="checkbox" name="plang" value="English">Telugu<br>
<input type="checkbox" name="plang" value="English">Tamil<br>
<input type="checkbox" name="plang" value="English">Kannada<br>
<input type="checkbox" name="plang" value="English">Malayalam<br>
<input type="checkbox" name="plang" value="English">Gujarati<br>
<input type="checkbox" name="plang" value="English">Punjabi<br>
<label id="elmplangError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="profession" class="col-md-2">
Profession:
</label>
<div class="col-md-10">
<select name="profession" id="profession" name="profession" class="form-control">
<?php
foreach ($job as $jb) {
echo '<option value="'.$jb['Id'].'">'.$jb['Description'].'</option>';
}
?>
</select>
<label id="elmprofessionError" id="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="qualification" class="col-md-2">
Qualification:
</label>
<div class="col-md-10">
<select name="qualification" id="qualification" name="qualification" class="form-control">
<?php
foreach ($edu as $ed) {
echo '<option value="'.$ed['Id'].'">'.$ed['Description'].'</option>';
}
?>
</select>
<label id="elmqualificationError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="iname" class="col-md-2">
Institution Name:
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="iname" name="iname" placeholder="Institution Name">
<label id="elminameError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="pincode" class="col-md-2">
PINCODE:
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="pincode" name="pincode" placeholder="PINCODE" Maxlength="6" onkeypress="return isNumberKey(event)">
<label id="elmpincodeError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="paddress" class="col-md-2">
Permanent Address:
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="paddress" name="paddress" placeholder="Permanent Address">
<label id="elmpaddressError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="taddress" class="col-md-2">
Temperory Address:
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="taddress" name="taddress" placeholder="Temperory Address">
<label id="elmtaddressError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="location" class="col-md-2">
Location:
</label>
<div class="col-md-10">
<input type="text" class="form-control" id="autocomplete" name="autocomplete" placeholder="Choose Location" value="">
<input name="latitude" id="latitude" type="hidden" value="" />
<input name="longitude" id="longitude" type="hidden" value=""/>
<input id="action" type="hidden" name="action" value="signup">
<label id="elmautocompleteError" class="errorMsg"> </label>
</div>
</div>
<div class="form-group">
<label for="dream" class="col-md-2">
Dream in life:
</label>
<div class="col-md-10">
<textarea class="dream" name="dream" id="dream" placeholder="Dream In Your life" rows="1" cols="50" wrap="physical">
</textarea>
<label id="elmdreamError" class="errorMsg"> </label>
</div>
</div>
<input id="signup" type="hidden" name="signup" value="Signup">
<div class="section fieldset" style="margin-top:20px">
<button type="submit" class="btn btn-success submit" style="Height:30px;width:90%;
border: 1px solid; border-radius: 4px" tabindex="8" >JOIN US</button>
</div>
<p class="" style="margin-top:10px; margin-left:50px " >
By signing up, I agree to the <a href="/termsOfUse" target="_blank">Terms of Service</a> and <a href="/privacy" target="_blank">Privacy Policy</a>.
</p>
</form>
</div>
</div>
<?php include_once './tags/global_header/footer.php'; ?>
</body>
</html>