atcApply.php 3.91 KB
<?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>