@section('page_title') OSAA - Coop Application @stop @section('page_sub_title') Cooperative Sponsorship Application Form @stop @section('scripts') @parent @stop @section('jquery_init') if(!window.console) { window.console = { log: $.noop, group: $.noop, groupEnd: $.noop }; } // Make this script play well with IE8 if (typeof String.prototype.trim !== 'function') { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } } // 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); }) }); // Reload indicator $('input[type="text"][data-reload], select[data-reload]') .css({'border-left-color' : '#005fa9', 'border-left-width' : '2px'}); /* * Make the action area sticky */ var window_object = $(window); var action_area = $('.action_area'); var top = (action_area.offset().top) - 40; window_object.scroll(function() { action_area.toggleClass('sticky', window_object.scrollTop() > top); }); /* * Auto-complete text fields */ $('input[type="text"][data-autocomplete]') .each(function() { $(this).autocomplete({'source' : $(this).attr('data-source'), 'minLength' : 2}); }); /* * Action Area Buttons */ $('.action_area a') .css({'font-size' : '9pt', 'margin-right' : '1em'}) .button() .each(function () { var link = $(this); if (link.has('[data-icon]')) { var icon = link.attr('data-icon'); link.button({'icons' : {'primary' : icon }}); } if (link.has('[data-help]')) { var help = link.attr('data-help'); link.tooltip({'content' : help, 'items' : 'a'}); } }); /* * Run check button */ $('[data-action="check"]') .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); $('
') .attr('data-check', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-check', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Checking Form...

Please wait while your form is checked, this may take a while to process...
'); // Get a form check var jqxhr = $.ajax( { type : 'GET', url : '{{ url('/forms/coop-application/' . $info['form']->id . '/check') }}', dataType : 'html' }) .done(function (data) { $('[data-check]').remove(); var check = $.parseJSON(data); //console.log(check); showCheckResults(check); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert("There was an error checking form's data.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }); }); /* * Submit button */ $('[data-action="submit"]') .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); $('
') .attr('data-check', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-check', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Checking Form...

Please wait while your form is checked, this may take a while to process...
'); // Get a form check var jqxhr = $.ajax( { type : 'GET', url : '{{ url('/forms/coop-application/' . $info['form']->id . '/check') }}', dataType : 'html' }) .done(function (data) { $('[data-check]').remove(); var check = $.parseJSON(data); //console.log(check); if (!check[0]) { showCheckResults(check); return; } // Passed, now confirm $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 400, width : 500, title : 'Confirm Form Submission', buttons: [ { text : "Submit", 'class' : "float_left", icons : { primary : 'ui-icon-circle-arrow-e'}, click : function() { // Submit the form $('
') .attr('data-check', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-check', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Submitting Form...

Form check passed, now please wait while your form is submitted, this may take a while to process...
'); // Submit the form window.location.href = "{{ url('/forms/coop-application/' . $info['form']->id . '/submit') }}"; } }, { text : "Cancel", 'class' : "float_right", 'data-autofocus' : "true", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); } } ], open : function () { var dialog_object = $(this); var html = '
'; html += ''; html += 'Are you sure you want to submit this application??'; html += '

'; html += '
Your form has passed initial inspection for all of the required information. Please note that once you submit this form, you will not be able to make any changes.
'; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); $('[data-autofocus="true"]').focus(); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert("There was an error checking form's data.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }); }); /* * Withdraw Button */ $('[data-action="withdraw"]') .click(function(event) { event.preventDefault(); var button = $(this); $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 375, width : 600, title : 'Confirm Form Withdrawal', buttons: [ { text : "Withdraw Form", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { var reason = $('[name="withdraw_notes"]').val(); if (reason == '') { alert('In order to withdraw this form, you must provide a reason.'); return; } if ($('[name="send_notification_wtdn"]', $(this)).is('[type="hidden"]')) { var notify = 1; } else { if ($('[name="send_notification_wtdn"]', $(this)).is(':checked')) { var notify = 1; } else { var notify = 0; } } var data = { 'reason' : reason, 'notify' : notify, 'form_id' : {{ $info['form']->id }} }; $('
') .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-di buttons') .html('
Updating...

Please wait, this may take a while to process...
'); // Submit the change var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/coop-application/' . $info['form']->id . '/withdraw') }}', data : data, dataType : 'html' }) .done(function (data) { // Reload of refresh is specified window.location.href = "{{ url('/forms/coop-application/') }}"; }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error saving changes.\n\nThis page will be reloaded."); location.reload(); }); } }, { text : "Cancel", 'class' : "float_right", 'data-autofocus' : "true", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); } } ], open : function () { var dialog_object = $(this); var html = '
'; html += ''; html += 'Are you sure you want to withdraw your coop application form?'; html += '

'; html += '
This cannot be undone. If you withdraw your form, your application cannot be reinstated. If you do want to withdraw this form, please provide a reason below.
'; html += '
Suggested Reasons:'; html += ''; @if (Auth::check() and Auth::user()->isOsaaUser()) html += ''; @else html += ''; @endif html += '

Reason for Withdrawal
'; html += '' html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); $('[data-autofocus="true"]').focus(); $('[name="withdraw_reasons"]', dialog_object).change(function() { var value = $(this).val(); $('[name="withdraw_notes"]').text(value); }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); @if (Auth::user()->isOsaaUser()) @endif /* showCheckResults * * Shows the results of the form check operation. */ function showCheckResults(check) { var pass = check[0]; if (pass) { $('
') .appendTo('body') .dialog( { draggable : true, resizable : false, height : 280, width : 400, modal : true, title : 'Form Check: Pass', open : function () { var dialog_object = $(this); var html = '
'; html += '
'; html += ''; html += 'Your Form Passed Inspection'; html += '
'; html += 'All required information has been provided. This coop application form is ready to be submitted.

When you are ready, click the "Submit" button submit your form to the OSAA.

'; html += '
'; dialog_object.html(html); $('.close_button', dialog_object) .button({'icons' : {'secondary' : 'ui-icon-check'}}) .css({'font-size' : '9pt'}) .focus() .click(function(event) { event.preventDefault(); dialog_object.dialog('close'); }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } else { $('
') .appendTo('body') .dialog( { draggable : true, resizable : false, height : 330, width : 500, modal : true, title : 'Form Check: Fail', open : function () { var dialog_object = $(this); var html = '
'; html += '
'; html += ''; html += 'Your Form Failed Inspection'; html += '
'; html += 'You are missing some required information or some other item. Your coop application form is incomplete.

Error Details
'; html += '
    '; $.each(check, function (i, item) { if (i > 0) { html += '
  • ' + item + '
  • '; } }); html += '

'; html += ''; html += '
'; dialog_object.html(html); $('.close_button', dialog_object) .button({'icons' : {'secondary' : 'ui-icon-check'}}) .css({'font-size' : '9pt'}) .focus() .click(function(event) { event.preventDefault(); dialog_object.dialog('close'); }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } } /* Positioned elements * * Elements that contain the attribute data-position="true" will be positioned * using JQuery's UI positioning utility. Other expected attributes define the * element's position: * data-position-my * data-position-at * data-position-of */ $('[data-position="true"]').each(function() { var element = $(this); var my = element.attr('data-position-my'); var at = element.attr('data-position-at'); var of = element.attr('data-position-of'); var options = $.parseJSON('{ "my" : "' + my + '", "at": "' + at + '", "of": "' + of + '"}'); element.position(options); }); // Required field marker $('[data-required]:not([data-required-indicator])').after('*'); // Date picker $('[data-date-picker]').datepicker({'dateFormat':'mm/dd/yy'}); // Table row highlighter function colorRows () { $('table').each(function () { var i = 0; $('tbody tr:visible', $(this)).each(function () { if (i % 2 == 1) { $(this).addClass('odd'); } else { $(this).removeClass('odd'); } i = i + 1; }); }); } colorRows(); /* alertRequiredField * * Shows an alert box when attempting to save a blank value to a required field. */ function alertRequiredField() { $('
') .appendTo('body') .dialog( { modal : true, draggable : false, resizable : false, height : 275, width : 415, title : 'Required Field', buttons: [ { text : "OK", 'class' : "float_right", icons : { primary : 'ui-icon-check'}, click : function() { // Close the dialog box $(this).dialog("close"); } } ], open : function () { var dialog_object = $(this); dialog_object.html('
You\'ve entered in a blank value for a required field. Required fields cannot be empty.
The original value has been restored.
'); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').append('
Still having trouble?
(503) 682-6722 x228
'); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } /* 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) { // 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; // Get the form ID (same across all pages for this form) var form_id = {{ $info['form']->id }}; $('*').css({'cursor':'wait'}); var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/coop-application') }}/' + 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); 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\nThis page will now be reloaded."); location.reload(); }) .complete(function () { // Reload if necessary if (reload) { location.reload(); } else { $('*').css({'cursor':''}); } }); } // Autosave text fields function autoSaveTextField(input_field) { clearTimeout(autoSaveTextField.timeout); autoSaveTextField.timeout = setTimeout(function (){ var value = input_field.val(); var original_value = input_field.attr('data-original'); var field = input_field.attr('data-field'); var type = input_field.attr('data-type'); var readonly_attr = input_field.attr('readonly'); if (typeof readonly_attr !== typeof undefined && readonly_attr !== false) { return false; } var reload = false; var reload_attr = input_field.attr('data-reload'); if (typeof reload_attr !== typeof undefined && reload_attr !== false) { reload = true; } var required = false; var required_attr = input_field.attr('data-required'); if (typeof required_attr !== typeof undefined && required_attr !== false) { required = true; } if (required && value == '' && !(original_value == '' || typeof original_value === typeof undefined || original_value === false)) { input_field.val(original_value); input_field.focus(); alertRequiredField(); return; } if (value != original_value && ((required && value != '') || !required)) { saveFormData(field, value, type, reload); input_field.attr('data-original', value); } }, 50); } // Autosave text fields without delay function autoSaveTextFieldNoDelay(input_field) { var value = input_field.val(); var original_value = input_field.attr('data-original'); var field = input_field.attr('data-field'); var type = input_field.attr('data-type'); var readonly_attr = input_field.attr('readonly'); if (typeof readonly_attr !== typeof undefined && readonly_attr !== false) { return false; } var reload = false; var reload_attr = input_field.attr('data-reload'); if (typeof reload_attr !== typeof undefined && reload_attr !== false) { reload = true; } var required = false; var required_attr = input_field.attr('data-required'); if (typeof required_attr !== typeof undefined && required_attr !== false) { required = true; } if (required && value == '' && !(original_value == '' || typeof original_value === typeof undefined || original_value === false)) { input_field.val(original_value); input_field.focus(); alertRequiredField(); return; } if (value != original_value && ((required && value != '') || !required)) { saveFormData(field, value, type, reload); input_field.attr('data-original', value); } } // Autosave text fields and textareas $('input[type="text"][data-autosave]').on('change blur autocompletechange autocompleteselect', function (event) { autoSaveTextField ($(this)); }); $('textarea[data-autosave]').on('change blur autocompletechange autocompleteselect', function (event) { autoSaveTextField ($(this)); }); // Autosave select fields $('select[data-autosave]').on('change', function(event) { var select_field = $(this); var selected = $(':selected', select_field); var value = selected.val(); var original_value = select_field.attr('data-original'); var field = select_field.attr('data-field'); var type = select_field.attr('data-type'); var readonly_attr = select_field.attr('readonly'); if (typeof readonly_attr !== typeof undefined && readonly_attr !== false) { return false; } var reload = false; var reload_attr = select_field.attr('data-reload'); if (typeof reload_attr !== typeof undefined && reload_attr !== false) { reload = true; } if (value != original_value) { saveFormData(field, value, type, reload); select_field.attr('data-original', value); } }); // Autosave check-box fields $('input[type="checkbox"][data-autosave]').on('change', function(event) { var checkbox_field = $(this); var value = checkbox_field.is(':checked'); var original_value = checkbox_field.attr('data-original'); var field = checkbox_field.attr('data-field'); var type = checkbox_field.attr('data-type'); var readonly_attr = checkbox_field.attr('readonly'); if (typeof readonly_attr !== typeof undefined && readonly_attr !== false) { return false; } var reload = false; var reload_attr = checkbox_field.attr('data-reload'); if (typeof reload_attr !== typeof undefined && reload_attr !== false) { reload = true; } if (value != original_value) { saveFormData(field, value, type, reload); checkbox_field.attr('data-original', value); } }); @if (Session::has('new_form') or Input::has('new-form')) showHelp('new-form', true); @endif /* ShowHelp * * Shows a help topic. */ function showHelp(help_topic, no_button) { if (no_button !== true) { $('
') .appendTo('body') .dialog( { draggable : true, resizable : true, height : 745, minHeight : 400, width : 650, minWidth : 330, modal : false, title : 'Coop Application Help', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/coop-application/' . $info['form']->id . '/help') }}?topic=' + help_topic, dataType : 'html' }) .done(function (returned_data) { dialog_object.html(returned_data); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error looking up help information.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } else { $('
') .appendTo('body') .css({'z-index':'2000 !important'}) .dialog( { draggable : false, resizable : false, height : 745, minHeight : 745, width : 650, modal : true, dialogClass : 'no-close', title : 'New Coop Application Created', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/coop-application/' . $info['form']->id . '/help') }}?topic=' + help_topic, dataType : 'html' }) .done(function (returned_data) { dialog_object.html(returned_data); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error looking up help information.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { $('.close_first_view_button', dialog_object) .button() .click(function () { dialog_object.dialog("close"); }); // Shake action items function shakeTheseActionImages (object) { var direction; if ($(object).has('[data-direction]')) { var direction = $(object).attr('data-direction'); } if (typeof direction == 'undefined') { var direction = 'left'; } $(object).effect("shake", {direction : direction, distance : 5, times : 1}, 600, function () { $(this).delay(Math.floor(Math.random() * 4000) + 2000); shakeTheseActionImages($(this)); }); } var img = $('img.action_item', dialog_object); img.position({my:"center center", at : "right+30 center", of : ".close_first_view_button"}); shakeTheseActionImages(img); }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } } /* * Help button */ $('.help_button') .button({'icons':{'primary':'ui-icon-help'}}) .css({'font-size':'9pt'}) .click(function(event) { var object = $(this); event.preventDefault(); var topic = object.attr('data-topic'); showHelp(topic); object.blur(); }); /* * Special help buttons */ $('[name="category_help"]') .hover(function () { $(this).css({'cursor':'pointer'}); }, function () { }) .click(function(event) { var object = $(this); var topic = object.attr('data-topic'); showHelp(topic); }); /* * Close button */ $('.close_button') .button({'icons':{'primary':'ui-icon-circle-close'}}) .css({'font-size':'9pt', 'margin-left':'10px'}); /* Status Log * * Shows the ejection log when link is clicked. */ $('[name="status_log"]') .click(function(event) { event.preventDefault(); var link = $(this); var data = { created_at : "{{ date('D n/j/y g:ia', strtotime($info['form']->created_at)) }}", updated_at : "{{ date('D n/j/y g:ia', strtotime($info['form']->updated_at)) }}", submitted_at : "{{ (!is_null($info['form']->submitted_at)) ? date('D n/j/y g:ia', strtotime($info['form']->submitted_at)) : '- -' }}", done_at : "{{ (!is_null($info['form']->done_at)) ? date('D n/j/y g:ia', strtotime($info['form']->done_at)) : '- -' }}" }; var html = '
'; html += '
Last Updated:
' + data.updated_at + '
'; html += '
Created:
' + data.created_at + '
'; html += '
Submitted:
' + data.submitted_at + '
'; html += '
Finished:
' + data.done_at + '
'; html += ''; @foreach ($info['form']->status_data as $i => $log) @if (($i % 2) == 0) html += ''; @else html += ''; @endif html += ''; html += ''; html += ''; @endforeach html += '
{{ date('n/j/y g:ia', strtotime($log->updated_at)) }}{{ $log->status }}{{ str_replace('\'', '\\\'', $log->user) }}
{{ str_replace("\n", '
', str_replace('\'', '"', $log->notes)) }}
'; $('
') .appendTo('body') .dialog( { resizable: false, height: 'auto', width: 550, modal: false, title: 'Form Status Log', open : function () { var dialog_object = $(this); dialog_object.html(html); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }) .hover(function() { $(this).css({'cursor':'pointer'}); }, function() { $(this).css({'cursor':''}); }) .tooltip({'content':'Click to view detailed status history.','items':'.status_path'}); /* * Custom tooltip items */ $('[data-tooltip]').each(function () { var item = $(this); var help = item.attr('data-tooltip'); item.tooltip({'content' : help, 'items' : item}); }); /* * Alpha-numeric data fields */ $('input[type="text"][data-format="ALPHA-NUMERIC"]').bind('input', function(event) { var stripped_value = $(this).val().replace(/[^A-Z0-9]/gi, ''); $(this).val(stripped_value); }); /* * Set table link */ $('[data-action="set-table"]').click(function(event) { event.preventDefault(); var link = $(this); var table_name = link.attr('data-table'); var value = link.attr('data-value'); var table = $('table[data-name="' + table_name + '"]'); $('td input[type="text"]', table).each(function() { var cell = $(this); cell.val(value); autoSaveTextFieldNoDelay(cell); }); }); /* * Set row link */ $('[data-action="set-row"]').click(function(event) { event.preventDefault(); var link = $(this); var table_name = link.attr('data-table'); var row_name = link.attr('data-row'); var value = link.attr('data-value'); var table = $('table[data-name="' + table_name + '"]'); var row = $('tbody tr[data-name="' + row_name + '"]', table); $('td input[type="text"]', row).each(function() { var cell = $(this); cell.val(value); autoSaveTextFieldNoDelay(cell); console.log(cell.attr('name')); }); }); // Disable preview buttons $('[data-button-disabled="disabled"]').button('disable'); // Disable input if not WORK status @if (!Helpers::strEqual($info['form']->status, 'WORK')) @if (!Auth::user()->isOsaaUser()) $('input[type="text"], textarea, select') .attr('readonly', 'readonly') .attr('disabled', 'disabled'); $('[data-action="set-table"], [data-action="set-row"]').remove(); @endif @endif @if (Auth::check() and Auth::user()->isOsaaUser()) // Approve/deny form button $('[data-action="decide"]') .button() .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); // Get confirmation $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 350, width : 450, title : 'Confirm Application Approval or Denial', buttons: [ { text : "Submit", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { $('
') .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-di buttons') .html('
Submitting...

Please wait, this may take a while to process...
'); if ($('[name="send_notification_dec"]', $(this)).is('[type="hidden"]')) { var notify = 1; } else { if ($('[name="send_notification_dec"]', $(this)).is(':checked')) { var notify = 1; } else { var notify = 0; } } var decision = $('[name="decision"]', $(this)).val(); var data = { "form_id" : {{ $info['form']->id }}, "decision" : decision, "notify" : notify }; // Submit the form for processing var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/coop-application/' . $info['form']->id . '/decide') }}', data : data, dataType : 'html' }) .done(function (data) { if (data != "success") { alert ("There was an error saving changes.\n\n" + data + "\n\nThis page will be reloaded."); location.reload(); } else { // Go to the index page window.location.href= "{{ url('/forms/coop-application') }}"; } }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error saving changes.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }); } }, { text : "Cancel", 'class' : "float_right", 'data-autofocus' : "true", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); } } ], open : function () { var dialog_object = $(this); var html = '
'; html += ''; html += 'Are you sure you want to submit the final decision regarding this cooperative sponsorship application form?'; html += '

'; html += 'Decision:'; html += '

'; html += '
Once you submit this form, the schools will receive an email with the decision and the form will be closed.

'; html += ''; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); $('[data-autofocus="true"]').focus(); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); @endif @stop @section('page_functions') Help Close @stop @section('main_content') {{-- Success Bar --}} @if (Session::has('success'))
{{ Session::get('success') }}
@endif {{-- Action Area --}}
Form Actions
Coop Application Form Status and Progression
Help @foreach ($info['action_items'] as $action => $action_info) @if ($action_info['enabled'] or $action_info['preview']) {{ $action_info['text'] }} @endif @endforeach @if (count($info['status_path']) > 0)
@foreach ($info['status_path'] as $step => $action_info) @if ($action_info['show']) @if ($action_info['trail']) @if ($action_info['complete'] or $action_info['current']) @else @endif @endif @if ($action_info['current'])
@elseif ($action_info['complete'])
@else
@endif {{ $step }}
@endif @endforeach
@endif
{{-- Work in Progress --}} @if (Helpers::strEqual($info['form']->status, 'WORK'))
This coop application is incomplete. Additional information needs to be provided before this form can be submitted.
{{-- Submitted --}} @elseif (Helpers::strEqual($info['form']->status, 'SUBT'))
This application has been submitted and is under OSAA review.
@endif {{-- Errors --}} @if (Session::has('errors'))
@foreach ($errors->all() as $error) {{ $error }} @endforeach
@endif {{-- Instructions --}} @if (Helpers::strEqual($info['form']->status, 'WORK'))

Instructions

You can check to see if you have provided all of the required information by clicking the Run Check button at the top of the form. Once you have provided all of the required information, click Submit to submit your application to the OSAA. If you have any questions, please contact OSAA Associate Director Kelly Foster, {{ Helpers::obfuscateEmailLink('kellyf@osaa.org') }} or (503) 682-6722 x233.
Next Steps
  1. Provide information for all required fields.
  2. Input when your school's specific information.
  3. Check your form prior to submitting.
@elseif (Helpers::strEqual($info['form']->status, 'SUBT'))

Instructions

Your form has been submitted and the OSAA is reviewing your coop application. If you have any questions, please contact OSAA Associate Director Kelly Foster, {{ Helpers::obfuscateEmailLink('kellyf@osaa.org') }} or (503) 682-6722 x233.
Next Steps
  1. Form has been submitted to the OSAA for review.
@elseif (Helpers::strEqual($info['form']->status, 'DONE'))

Information

This form has been marked as finished. The OSAA office has received all of the required information and has mailed a reimbursement check to your school. No further action is required for this report. If you have any questions, please contact OSAA Business Operations Manager Candy Posey, {{ Helpers::obfuscateEmailLink('candyp@osaa.org') }} or (503) 682-6722 x225.
@endif

Required fields are indicated with a red asterisk, *.

{{-- Coop Application Form --}}

Coop Information - {{ implode(' / ', $info['coop_names']) }}

Activity:
{{ Helpers::getActivityName($info['form']->activity )}}
Duration:
{{ $info['form']->getCoopDuration() }} years
School Years:
{{ $info['form']->starting_school_year }}-{{ substr($info['form']->starting_school_year + 1, 2, 2) }} through {{ $info['form']->ending_school_year }}-{{ substr($info['form']->ending_school_year + 1, 2, 2) }}


* {{ Form::label('reason_to_coop', 'Reason:') }}
What is the reason for creating this cooperative sponsorship?
{{ Form::textarea('reason_to_coop', $info['form']->form_data->reason_to_coop, array('data-autosave' => true, 'data-field' => 'form_data->reason_to_coop', 'data-type' => 'STRING', 'data-required' => true, 'data-required-indicator' => false, 'data-original' => $info['form']->form_data->reason_to_coop, 'style' => 'width: 100%; height: 2.5em;')) }}

{{ Form::label('practice_location', 'Practice Location:', array('style' => 'width: 175px;')) }} {{ Form::text('practice_location', $info['form']->form_data->practice_location, array('data-autosave' => true, 'data-field' => 'form_data->practice_location', 'data-type' => 'STRING', 'data-original' => $info['form']->form_data->practice_location, 'data-required' => true, 'style' => 'width: 320px;')) }} Where will practices be held?

{{ Form::label('contest_location', 'Contest Location:', array('style' => 'width: 175px;')) }} {{ Form::text('contest_location', $info['form']->form_data->contest_location, array('data-autosave' => true, 'data-field' => 'form_data->contest_location', 'data-type' => 'STRING', 'data-original' => $info['form']->form_data->contest_location, 'data-required' => true, 'style' => 'width: 320px;')) }} Where will home contests be held?

Placement

Combined ADM:
{{ $info['form']->form_data->combined_adm }}
Sum of {{ $info['form']->bothOrAll() }} school's ADM numbers from the selected starting school year.
@if (Helpers::strContains('/', $info['form']->division))
Coop Division:
@else
Coop Classification:
@endif {{ $info['form']->division }}
Based on the combined ADM, this coop would compete in this {{ (Helpers::strContains('/', $info['form']->division)) ? 'division' : 'classification' }}.
{{ Form::label('league', 'Coop League:') }} {{ Form::select('league', $info['leagues'], $info['form']->league, array('data-autosave' => true, 'data-field' => 'league', 'data-type' => 'STRING', 'data-original' => $info['form']->league, 'data-required' => true, 'data-reload' => true, 'style' => 'width: 300px;')) }}
Select the league in which you wish to join and compete.

@foreach ($info['school_data_objects'] as $index => $data_object_name)
Fatal error: Cannot break/continue 1 level in /home/osaa/web_app/dev/app/views/coop_form/edit.blade.php on line 1930