atcApply.php
3.91 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
<?php
session_start();
require_once 'classes/realops.php';
$get = new Get();
$stats = new Stats();
$set = new Set();
date_default_timezone_set('Australia/Sydney');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include 'sections/header.php'; ?>
</head>
<body>
<div class="wrapper">
<?php include 'sections/navbar.php' ?>
<div class="container" id="realops-container">
<div class="row">
<article class="col-sm-12 panel panel-default" id="realops-body">
<div class="page-header">
<h2>ATC Application Form</h2>
</div>
<div class="alert alert-info">
<strong>ATC Applications have now closed.</strong> Thank you to all who applied.
</div>
</div>
</div>
</div>
</article>
</div><!-- /.row -->
</div><!-- /.container -->
</div><!-- /.wrapper -->
<?php include 'sections/footer.php'; ?>
<script type="text/javascript">
$(document).ready(function() {
// Generate a simple captcha
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
};
$('#captchaOperation').html([randomNumber(1, 10), '+', randomNumber(1, 10), '='].join(' '));
$('#defaultForm').formValidation({
message: 'This value is not valid',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
firstName: {
row: '.col-sm-4',
validators: {
notEmpty: {
message: 'The first name is required'
}
}
},
lastName: {
row: '.col-sm-4',
validators: {
notEmpty: {
message: 'The last name is required'
}
}
},
rating: {
message: 'The rating is not valid',
validators: {
notEmpty: {
message: 'The rating is required'
}
}
},
position1: {
message: 'The position 1 is not valid',
validators: {
notEmpty: {
message: 'You must select a position'
}
}
},
'shifts[]': {
validators: {
choice: {
min: 1,
message: 'Please choose more than 1 shift'
}
}
},
email: {
validators: {
notEmpty: {
message: 'The email address is required'
},
emailAddress: {
message: 'The input is not a valid email address'
}
}
},
captcha: {
validators: {
callback: {
message: 'Wrong answer',
callback: function(value, validator, $field) {
var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0]) + parseInt(items[2]);
return value == sum;
}
}
}
}
}
});
});
</script>