Skip to main content
/*Load Current Time*/ $.ajax({ url: 'https://www.athabascau.ca/scripts/university-relations/mainsite/contact/current-time.php', type: 'POST', data: {}, success: function (response) { $("#athabasca-current-time").html(response); $.getScript("https://www.athabascau.ca/framework/v1/theme/js/vendor/jquery-autocomplete-min.js"); }, error: function (e) { console.log(e); } }); /* /*Load System Status Image*/ $.ajax({ url: 'https://itss.athabascau.ca/systemstatus/statusimg.inc.php', type: 'POST', data: {}, success: function (response) { $("#itss").html(response); }, error: function (e) { console.log(e); } }); /* Contact page pilot ITSS status script =====================================================================*/ $( document ).ready(function() { var $issueName = $('#itss a img').prop('alt'), $systemMessage = $('.system .msg'); if ($issueName == "System Status: yellow") { $systemMessage.addClass('warning').find('p').append('IT System Status: Issue or Alert - A system is currently unavailable or undergoing maintenance. [More Details]'); } else if ($issueName == "System Status: red") { $systemMessage.addClass('error').find('p').append('IT System Status: Warning - Our automated monitoring has detected potential issues/outages with one or more systems. [More Details]'); } else if ($issueName == "System Status: success") { $systemMessage.addClass('success').find('p').append('IT System Status: Optimal - There are currently no known issues or outages.'); } else if ($issueName == "System Status: warning") { $systemMessage.addClass('warning').find('p').append('IT System Status: Potential Issue: - We have detected potential issues/outages with one or more systems. [More Details]'); } else { $systemMessage.addClass('info').find('p').append('IT System Status: No system information available. [More Details]'); } console.log($issueName); }); /*Contact Form Captcha*/ function checkRecaptcha() { var $reCaptcha = grecaptcha.getResponse(); if ($reCaptcha.length > 0) { document.getElementById("g-recaptcha-error").innerHTML = ""; return true; } else { document.getElementById("g-recaptcha-error").innerHTML = '

Please verify that you are not a robot.

'; return false; } } /*Contact Form Handler*/ var contactForm = $("#askau-contact-form"); contactForm.validate({ errorElement: "span", errorPlacement: function (error, element) { error.insertBefore(element.parent(".input-group, .checkbox, .radio-group")); }, errorLabelContainer: "#form-error", rules: { confirm_email: { equalTo: "#email", }, }, messages: { confirm_email: { equalTo: "Email address must match", }, }, submitHandler: function submitForm() { /* Get the values from the form */ var fname = $("#firstname").val(); var lname = $("#lastname").val(); var q = $("#askau-input").val(); var type = $("#type").val(); var title = $("#title").val(); var email = $("#email").val(); var phone = $("#phone").val(); var category = $("input[name='categories']:checked").val(); var student_id = $("#student_id").val(); var question = $("#question").val(); /* checking if recaptcha has been interacted with */ if (grecaptcha.getResponse().length > 0) { $.ajax({ type: "POST", url: "https://www.athabascau.ca/scripts/university-relations/mainsite/askau/form-submission.php", data: { firstname: fname, lastname: lname, q: q, type: type, title: title, email: email, phone: phone, categories: category, question: question, student_id: student_id, captcha: grecaptcha.getResponse(), }, success: function (response) { contactForm.fadeOut("slow", function () { var $email = $("#email").val(); $("#thank-you").fadeIn("slow"); $("#thank-you p strong").text($email); }); }, }); return false; } }, });