@section('page_title') OSAA - Forms @stop @section('page_sub_title') {{ $information['form_name'] }} @stop @section('scripts') @parent @stop @section('jquery_init') // Success bar $('.success_bar').animate({ 'top' : 32, 'background-color' : 'rgba(176, 255, 190, 1.0)'}, 1600, 'easeOutQuad', function () { $(this).delay(6000).fadeOut(4000); $(this).hover(function () { $(this).stop(true).css('opacity', '1.0'); }, function () { $(this).fadeOut(4000); }) }); // Close button $('.close_button') .button({'icons':{'primary':'ui-icon-circle-close'}}) .css({'font-size' : '9pt', 'margin-left' : '10px'}); // Back button $('.back_button') .button({'icons':{'primary':'ui-icon-arrowthick-1-w'}}) .css({'font-size' : '9pt', 'margin-left' : '10px'}); // Next button $('.next_button') .button() .css({'font-size' : '9pt', 'position' : 'relative', 'top' : '-2px'}); // Required field marker $('[data-required]').after('*'); {{-- Scripts for selecting the league --}} @if (is_null($information['league'])) /* Disable the next button and hide the loading icon */ $('#select_league_form input[type="submit"]') .button('disable') .addClass('ui-state-error'); $('#select_league_form img').hide(); /* When a code is input, check it's value */ $('#select_league_form [name="code"]').on('change input', function () { $('#select_league_form img').show(); var code = $(this).val(); // Skip for now, to make it process faster var jqxhr = $.ajax( { type : 'POST', url : '/forms/check-code', data : {'activity' : 'SOL', 'code' : code}, dataType : 'html' }) .fail(function () { $('#select_league_form input[type="submit"]') .button('disable') .addClass('ui-state-error'); $('#select_league_form img').hide(); }) .success(function () { $('#select_league_form input[type="submit"]') .button('enable') .removeClass('ui-state-error'); $('#select_league_form img').hide(); }); }); @if (Auth::check() and Auth::user()->isOsaaUser()) $('.download_button') .button({'icons' : {'primary' : 'ui-icon-circle-arrow-s'}}) .css({'font-size' : '9pt'}); $('#select_league_form [name="code"]') .val('STATEREGISTRATION') .change(); @endif // Only submit the form if the submit button is enabled $('#select_league_form').submit(function () { if ($('#select_league_form input[type="submit"]').is(':enabled')) { $('#select_league_form [name="code"]').remove(); return true; } else { return false; } }); {{-- Access to additional information form is allowed --}} @if (Helpers::strEqual($information['user_status'], 'OK')) /* saveFormData * * Given a form field and a value, this function will do a * JSON POST request to save the form's information. The optional * third parameter will determine if the page will be reloaded or not. */ function saveFormData(field, value, type, reload, form_id) { // Ensure the field and value parameters are provided if (typeof field == 'undefined' || typeof value == 'undefined' || typeof type == 'undefined') { alert('Scripting error. Unable to save form data.'); } // Get the optional reload parameter reload = typeof reload !== 'undefined' ? reload : false; $('*').css({'cursor':'wait'}); var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/league-forms') }}/' + form_id + '/update', data : { 'field' : field, 'value' : value, 'type' : type }, dataType : 'html' }) .done(function(returned_data) { // Success console.log("Successfully saved {'" + form_id + "|" + field + "' : '" + value + "'}"); var info = $.parseJSON(returned_data); $('#updated_at').html(info.updated_at); $('#updated_by').html(info.updated_by); if (info.force_reload) { reload = true; } }) .fail(function(jqXHR, status, error) { // Error var response = jqXHR.responseText; var errorData = $.parseJSON(response); console.log(errorData); alert("There was an error saving this form's data.\n\n" + errorData.error.message + "\n\nPlease try again. Please note, that if you try to reload this page, your unsaved data will be lost."); }) .complete(function () { // Reload if necessary if (reload) { location.reload(); } else { $('*').css({'cursor':''}); } }); } // View/Edit button $('.view_edit_qualifier') .css({'font-size' : '9pt', 'margin-top' : '1.75em', 'margin-bottom' : '0.20em'}) .button() .click(function(event) { var button = $(this); var option = $('#qualifier option:selected'); // Get the qualifier's data into an object payload var data = { league_form : parseInt($(option).attr('data-league-form')), index : parseInt($(option).val()), name : ($(option).text()).trim(), ap_id : parseInt($(option).attr('data-ap')), ap_verify_id : parseInt($(option).attr('data-ap-verify')), ap_access : parseInt($(option).attr('data-ap-access')) }; var load_url = '{{ url('forms/league-forms') }}/' + data.league_form + '/edit-solo-qualifier/' + data.index + '/additional-information'; $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 700, width : 725, title : 'View/Edit Additional Information', buttons: [{ text : "Save", 'class' : "float_left", icons : { primary : 'ui-icon-disk'}, click : function() { var dialog_object = $(this); var form = $('form', dialog_object); var index = $('input[name="index"]', form).val(); var record = { 'registered' : $('input[name="registered"]', form).val(), 'notes' : $('textarea[name="notes"]', form).val(), 'selected' : $('input[name="selected"]', form).val(), 'first_name' : $('input[name="first_name"]', form).val(), 'last_name' : $('input[name="last_name"]', form).val(), 'grade' : $('select[name="grade"] option:checked', form).val(), 'school' : $('[name="school"]', form).val(), 'category' : $('[name="category"]', form).val(), 'placement' : $('[name="placement"]', form).val(), 'director_name' : $('input[name="director_name"]', form).val(), 'director_email' : $('input[name="director_email"]', form).val(), 'director_phone' : $('input[name="director_phone"]', form).val(), 'accompanist_name' : $('input[name="accompanist_name"]', form).val(), 'accompanist_email' : $('input[name="accompanist_email"]', form).val(), 'accompanist_phone' : $('input[name="accompanist_phone"]', form).val(), 'selection_1_title' : $('input[name="selection_1_title"]', form).val(), 'selection_1_composer' : $('input[name="selection_1_composer"]', form).val(), 'selection_2_title' : $('input[name="selection_2_title"]', form).val(), 'selection_2_composer' : $('input[name="selection_2_composer"]', form).val() }; var errors = []; // Check for required fields if (record.first_name == "") { errors.push("The qualifier's first name is required."); } if (record.last_name == "") { errors.push("The qualifier's last name is required."); } if (record.grade == "") { errors.push("The qualifier's grade in school is required."); } if (record.school == "") { errors.push("The qualifier's school is required."); } if (record.category == "") { errors.push("You did not select which category this individual was qualified for state."); } if (record.placement == "") { errors.push("You did not select the qualification placement for this individual."); } if (record.director_name == "") { errors.push("The name of the qualifier's director."); } if (record.director_email == "") { errors.push("The director's email address is required."); } if (record.accompanist_name == "") { errors.push("The name of the qualifier's accompanist is required. You can type in \"N/A\" if there is no accompanist."); } if (errors.length < 1) { var field = "data->qualifiers[" + index + "]"; var value = JSON.stringify(record); var type = "OBJECT"; var reload = true; saveFormData(field, value, type, reload, data.league_form); } else { var error_message = "Unable to save this qualifier because some information is missing.\n\n"; for (var i = 0; i < errors.length; i++) { error_message += errors[i] + "\n"; } alert(error_message); } } }, { text : "Cancel", 'class' : "float_right", 'data-autofocus' : "true", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); $(this).remove(); } }], open : function () { var dialog_object = $(this); // Show the loading image dialog_object.html(""); // Disable dialog buttons $('.ui-dialog-buttonset button').button('disable'); // Get the AJAX form var jqxhr = $.ajax( { type : 'GET', url : load_url, dataType : 'html' }) .done(function (returned_data) { dialog_object.html(returned_data); // Enable dialog buttons $('.ui-dialog-buttonset button').button('enable'); // Verify qualifier information var verify = { ap_id : parseInt($('div.ai_dialog', dialog_object).attr('data-ap-id')), ap_verify_id : parseInt($('div.ai_dialog', dialog_object).attr('data-ap-verify-id')), index : parseInt($('div.ai_dialog', dialog_object).attr('data-index')), name : $('div.ai_dialog', dialog_object).attr('data-name-verification'), league_form : parseInt($('div.ai_dialog', dialog_object).attr('data-form-id')) }; // Debug console.log(data); console.log(verify); var errors = []; // Ensure values match if (data.ap_id !== verify.ap_id) { errors.push("Activity program ID number mismatch"); } if (data.ap_verify_id !== verify.ap_verify_id) { errors.push("Activity program ID number verification failure"); } if (data.index !== verify.index) { errors.push("Array index mismatch"); } if (data.league_form !== verify.league_form) { errors.push("League form ID number mismatch"); } if (data.name.localeCompare(verify.name) !== 0) { errors.push("Qualifier name mismatch"); } // Abort on errors if (errors.length > 0) { dialog_object.remove(); $('This form is for District Directors to submit district results and name state qualifying participants.
Use this form to submit your district's results. You may resubmit this form as many times as needed until the deadline. To complete this form, you will need to supply the following information.
This form is for Schools to submit additional information for their school's state qualifying participants.
Use this form to edit your participants' information. You may resubmit this form as many times as needed until the deadline. You must provide the following information: