@section('page_title') OSAA - Ejection Report @stop @section('page_sub_title') Ejection Report {{ $object->ejection->id }} @stop @section('scripts') @parent @stop @section('jquery_init') if(!window.console) { window.console = { log: $.noop, group: $.noop, groupEnd: $.noop }; } // 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'}); /* * Custom tooltip items */ $('[data-tooltip]').each(function () { var item = $(this); var help = item.attr('data-tooltip'); item.tooltip({'content' : help, 'items' : item}); }); /* * 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); }); /* * 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'}); } }); /* * Print Button */ $('[data-action="print"]') .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); $('.ui-tooltip').remove(); $('textarea').each(function(index, item) { var area = $(item); var content = area.val().replace(/\r\n|\r|\n/g, '
') + '

'; var temp = $('
') .html(content) .css({'visibility':'hidden', 'display':'block', 'height':'auto', 'overflow':'visible', 'width':area.width(), 'font-size':area.css('font-size'), 'line-height':area.css('line-height')}) .appendTo('body'); console.log(temp); console.log(temp.height()); area.css({'min-height':area.css('height'), 'height':(temp.height() * 1.25) + 'px'}); temp.remove(); }); window.print(); }); @if (Helpers::strEqual($info['mode'], 'EDIT')) /* * Delete Button */ $('[data-action="delete"]') .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 375, width : 600, title : 'Confirm Report Deletion', buttons: [ { text : "Delete", 'class' : "float_left", icons : { primary : 'ui-icon-trash'}, click : function() { var reason = $('[name="delete_notes"]').val(); if (reason == '') { alert('In order to delete this report, you must provide a reason.'); return; } var data = { 'reason' : reason, 'ejection_id' : {{ $object->ejection->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') .html('
Deleting...

Please wait, this may take a while to process...
'); // Submit the change var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/ejection/' . $object->ejection->id . '/delete') }}', data : data, dataType : 'html' }) .done(function (data) { // Reload of refresh is specified window.location.href= "{{ url('/forms/ejection') }}"; }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error deleting the report.\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 delete this ejection report?'; html += '

'; html += '
This cannot be undone. If you delete this report, your form cannot be reinstated. If you do want to delete this form, please provide a reason below.
'; html += '
Suggested Reasons:'; html += ''; html += '

Reason for Deletion
'; 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="delete_reasons"]', dialog_object).change(function() { var value = $(this).val(); $('[name="delete_notes"]').text(value); }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); /* * 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/ejection/' . $object->ejection->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/ejection/' . $object->ejection->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 : 325, width : 450, 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/ejection/' . $object->ejection->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 cmsh_name = $('#commissioner_name').text(); var html = '
'; html += ''; @if (Helpers::strEqual($object->ejection_status->slug, 'WORK')) html += 'Are you sure you want to submit this report to your Commissioner, ' + cmsh_name + '?'; html += '

'; html += '
Your report has passed initial inspection for all of the required information. Please note that once you submit this report, you will not be able to make any changes.

Your Commissioner will review your ejection report and then notify the school and the OSAA.
'; @elseif (Helpers::strEqual($object->ejection_status->slug, 'CMSH')) html += 'Are you sure you want to submit this report to the school and notify the OSAA?'; html += '

'; html += '
Your report has passed inspection for all of the required information. Please note that once you submit this report, you will not be able to make any changes.

When you submit this report, the school with the ejection will be notified as well as the OSAA.
'; @else html += 'Are you sure you want to submit this report?'; html += '

'; html += '
Your form passed initial inspection. Please note that once you submit this form, you will not be able to make any additional edits.
'; @endif 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(); }); }); /* * Accept button */ $('[data-action="accept"]') .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/ejection/' . $object->ejection->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 : 325, width : 450, title : 'Accept Ejection', buttons: [ { text : "Accept", '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/ejection/' . $object->ejection->id . '/submit') }}?accept=true"; } }, { 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 accept this ejection report without appeal?'; html += '

'; html += '
Your input has been added to this report, thank you. Please note that if you accept this ejection, you will not have an option to appeal later on.

The OSAA will be notified once you accept this ejection.
'; 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(); }); }); /* * Appeal button */ $('[data-action="appeal"]') .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/ejection/' . $object->ejection->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 : 325, width : 450, title : 'Appeal Ejection', buttons: [ { text : "Appeal", '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/ejection/' . $object->ejection->id . '/submit') }}?appeal=true"; } }, { 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 appeal the suspension or fine for this ejection?'; html += '

'; html += '
Please refer to the current OSAA Handbook, Executive Board Policies regarding the appeal process.

Ensure you have provided a reason for the appeal in the School Statement section. The Commissioner and the OSAA will be notified of your appeal.
'; 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(); }); }); /* * Done button */ $('[data-action="done"]') .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/ejection/' . $object->ejection->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 : 325, width : 450, title : 'Mark Ejection As Done', buttons: [ { text : "Finish", 'class' : "float_left", icons : { primary : 'ui-icon-circle-check'}, 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/ejection/' . $object->ejection->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 mark this ejection report as done?'; html += '

'; html += '
This will indicate that the report is finished and no further action will take place. Once you mark this report as done, any coach ejection will be forwarded onto Kelly for arranging training courses.
'; 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(); }); }); /* 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 ejection report is ready to be submitted.

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

'; 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 ejection report will not be submitted successfully.

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(); } }); } } @endif /* 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('*'); // Phone field $('[data-phone-field]').mask("(999) 999-9999"); // Date picker $('[data-date-picker]').datepicker({'dateFormat':'mm/dd/yy', 'maxDate':'+0d'}); // 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(); @if (Helpers::strEqual($info['mode'], 'EDIT')) /* * Auto-complete text fields */ $('input[type="text"][data-autocomplete]') .each(function() { $(this).autocomplete({'source' : $(this).attr('data-source'), 'minLength' : 3}); }); /* 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 = {{ $object->ejection->id }}; $('*').css({'cursor':'wait'}); var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/ejection/') }}/' + 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':''}); } }); } // 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 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); } }); @endif @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 : 725, minHeight : 400, width : 615, minWidth : 330, modal : false, title : 'Ejection Report Help', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/ejection/' . $object->ejection->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\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 : 725, minHeight : 725, width : 615, modal : true, dialogClass : 'no-close', title : 'New Ejection Report Created', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/ejection/' . $object->ejection->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\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 */ $('.page_functions .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'}); @if (Helpers::strEqual($info['mode'], 'EDIT')) /* * Add a file button */ $('.add_file') .button({'icons' : { 'primary' : 'ui-icon-circle-arrow-n'}}) .css({'font-size' : '9pt'}) .click(function(event) { event.preventDefault(); var button = $(this); $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 450, width : 525, title : 'Upload and Attach a File', buttons: [ { text : "Upload", 'class' : "float_left", icons : { primary : 'ui-icon-disk'}, click : function() { var dialog_object = $(this); $('
') .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') .html('
Uploading...

Please wait, this may take a while to process...
'); $('form', dialog_object).submit(); } }, { text : "Help", 'class' : "float_left", 'style' : 'margin-left: 125px', icons : { primary : 'ui-icon-help'}, click : function() { showHelp('upload-file'); } }, { 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); var type=button.attr('data-owner'); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/ejection/' . $object->ejection->id . '/file/upload') }}/' + type, 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 loading the upload form.\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { }); $('.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(); } }); }); /* * Delete file button */ $('.delete_file') .button({'text' : false, 'icons' : { 'primary' : 'ui-icon-trash'}}) .css({'width' : '16px', 'height' : '16px', 'float' : 'right', 'margin-right' : '50px', 'margin-top' : '5px'}) .tooltip() .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); var type = button.attr('data-owner'); $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 225, width : 400, title : 'Confirm File Deletion', buttons: [ { text : "Delete", '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') .html('
Updating...

Please wait, this may take a while to process...
'); // Submit the change var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/ejection/' . $object->ejection->id . '/file/delete') }}/' + type.toLowerCase(), dataType : 'html' }) .done(function (data) { //console.log('Deletion was successful.'); // Reload of refresh is specified location.reload(); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error deleting the file.\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); dialog_object.html('
Are you sure you want to delete this ' + type + ' file?

This cannot be undone.
'); $('.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); row.removeClass('ui-state-highlight'); $(dialog_object).remove(); } }); }); @endif /* Ejection Log * * Shows the ejection log when link is clicked. */ $('[name="ejection_log"]') .click(function(event) { event.preventDefault(); var link = $(this); var data = { created_at : "{{ date('D n/j/y g:ia', strtotime($object->ejection->created_at)) }}", updated_at : "{{ date('D n/j/y g:ia', strtotime($object->ejection->updated_at)) }}", reported_at : "{{ (!is_null($object->ejection->reported_at)) ? date('D n/j/y g:ia', strtotime($object->ejection->reported_at)) : '- -' }}", submitted_at : "{{ (!is_null($object->ejection->submitted_at)) ? date('D n/j/y g:ia', strtotime($object->ejection->submitted_at)) : '- -' }}", verified_at : "{{ (!is_null($object->ejection->verified_at)) ? date('D n/j/y g:ia', strtotime($object->ejection->verified_at)) : '- -' }}" }; var html = '
'; html += '
Last Updated:
' + data.updated_at + '
'; html += '
Ejection Created:
' + data.created_at + '
'; html += '
Reported to CMSH:
' + data.reported_at + '
'; html += '
School Notified:
' + data.submitted_at + '
'; html += '
School Responded:
' + data.verified_at + '
'; html += ''; @foreach ($object->data->status_history 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: 'Ejection 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'}); /* * Form Behavior */ @if (isset($options['levels'][''])) // Remove blank level once selected $('select[name="level"]').on('change', function () { var select = $(this); $('option[value=""]', select).remove(); }); @endif @if (isset($options['types'][''])) // Remove blank type once selected $('select[name="type"]').on('change', function () { var select = $(this); $('option[value=""]', select).remove(); }); @endif @if (isset($options['designations'][''])) // Remove blank type once selected $('select[name="contest_designation"]').on('change', function () { var select = $(this); $('option[value=""]', select).remove(); }); @endif @if (isset($options['activity_programs'][''])) // Remove blank type once selected $('select[name="activity_program"]').on('change', function () { var select = $(this); $('option[value=""]', select).remove(); }); @endif @if (isset($options['yes_no'][''])) // Remove blank type once selected $('select[name="contest_is_last_contest"]').on('change', function () { var select = $(this); $('option[value=""]', select).remove(); }); @endif @if (isset($options['granted'][''])) // Remove blank type once selected $('select[name="receipt_is_granted"]').on('change', function () { var select = $(this); $('option[value=""]', select).remove(); }); @endif // Restrict some fields if submitted to school and not OSAA staff @if ((!Helpers::strEqual($object->ejection->ejection_status, array('WORK', 'CMSH')) and !(Auth::check() and Auth::user()->isOsaaUser())) or !Helpers::strEqual($info['mode'], 'EDIT')) var restricted = ["#activity", "#level", "#contest_date", "#contest_time", "#activity_program", "#contest_designation", "#contest_opponent", "#contest_location", "#type", @if ((!Helpers::strEqual(strtoupper($object->data->ejected->name), array('?', 'N/A', 'NA', 'UNKNOWN'))) or !Helpers::strEqual($info['mode'], 'EDIT')) "#ejected_name", @endif "#ejected_jersey", "#official_name", "#official_email", "#officials_association", "#ejection_reason", "#ejected_reason", "#official_notes", "#commissioner_notes"]; @if ((Helpers::strEqual($object->ejection->ejection_status, array('RECD', 'APPL', 'DONE'))) or !Helpers::strEqual($info['mode'], 'EDIT')) restricted.push("#contest_is_last_contest"); restricted.push("#receipt_notes"); restricted.push("#receipt_appeal"); restricted.push("#receipt_is_granted"); @endif @if (Helpers::strEqual($info['mode'], 'VIEW')) restricted.push(".add_file"); @endif $.each(restricted, function(index, value) { var item = $(value); // Replace text inputs if (item.is('input[type="text"]')) { var text = item.val(); var width = item.width(); var replace = $('').text(text) .css({'width' : width + 'px', 'border-bottom' : '1px solid #666666', 'display' : 'inline-block'}); item.unbind(); item.replaceWith(replace); } // Replace select inputs if (item.is('select')) { var option = $('option:selected', item); var text = option.text(); var width = item.width(); var replace = $('').text(text) .css({'width' : width + 'px', 'border-bottom' : '1px solid #666666', 'display' : 'inline-block'}); item.unbind(); item.replaceWith(replace); } // Replace text-areas if (item.is('textarea')) { var text = item.val(); var width = item.width(); var height = item.height(); var replace = $('').text(text) .css({'width' : width + 'px', 'min-height' : height + 'px', 'display' : 'inline-block'}); item.unbind(); item.replaceWith(replace); } // Remove links if (item.is('a')) { item.remove(); } }); @endif @stop @section('page_functions') Help @if (Auth::check() and Auth::user()->isOsaaUser()) Close @endif @stop @section('main_content') {{-- Success Bar --}} @if (Session::has('success'))
{{ Session::get('success') }}
@endif {{-- Action Area --}}
Form Actions
Ejection Report Status and Progression
@foreach ($options['action_items'] as $action => $action_info) @if ($action_info['enabled']) {{ $action_info['text'] }} @endif @endforeach @if (count($options['status_path']))
@foreach ($options['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
{{-- Locked to VIEW mode only --}} @if (!Helpers::strEqual($info['mode'], 'EDIT'))
This ejection report cannot be edited. You are in view mode only.
@endif {{-- Work in Progress --}} @if (Helpers::strEqual($object->ejection_status->slug, 'WORK'))
This ejection report has not yet been submitted to the Commissioner by the Official.
{{-- Commissioner Review --}} @elseif (Helpers::strEqual($object->ejection_status->slug, 'CMSH'))
This ejection report is under Commissioner review. The school has not yet been notified of this ejection.
{{-- School Review --}} @elseif (Helpers::strEqual($object->ejection_status->slug, 'SUBT'))
This ejection is under school review. Please provide any additional information before accepting or appealing this ejection.
{{-- Accepted --}} @elseif (Helpers::strEqual($object->ejection_status->slug, 'RECD'))
This ejection has been accepted without appeal. Please review and mark done to close this ejection report.
{{-- Appealed --}} @elseif (Helpers::strEqual($object->ejection_status->slug, 'APPL'))
The school is appealing this ejection. Please input the outcome of the appeal then mark done to close this ejection report.
@endif {{-- Errors --}} @if (Session::has('errors'))
@foreach ($errors->all() as $error) {{ $error }} @endforeach
@endif {{-- Instructions --}} @if (Helpers::strEqual($object->ejection_status->slug, 'WORK'))

Instructions for Officials

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 this form and to notify your Commissioner via e-mail. After you submit this form, you will not be able to make any changes to the information.
  1. Official fills out a preliminary online Ejection Report.
  2. Commissioner is notified and reviews the form before submitting.
  3. School is notified of ejection and reviews information.
  4. OSAA is notified if school is appealing the suspension or fine.
@elseif (Helpers::strEqual($object->ejection_status->slug, 'CMSH'))

Instructions for Commissioners

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 this form which will notify the school of their ejection and the OSAA will be copied. After you submit this form, you will not be able to make any changes to the information.
  1. Official provides information to the Commissioner regarding an ejection.
  2. Commissioner reviews online form and submits it to the school.
  3. School is notified of ejection and reviews information.
  4. OSAA is notified if school is appealing the suspension or fine.
@elseif (Helpers::strEqual($object->ejection_status->slug, 'SUBT'))

Instructions for Schools

You can read the information regarding the ejection that was provided by the Commissioner. You will need to provide additional information as noted on the form. If you are not appealing the ejection's suspension or fine, click Accept Ejection. Otherwise, click Appeal Ejection to start the appeal process. If you have any questions, please contact {{ $options['osaa_staff']->name }} at the OSAA by e-mail to {{ $options['osaa_staff']->email }} or {{ $options['osaa_staff']->phone }}.
  1. Official provides information to the Commissioner regarding an ejection.
  2. Commissioner reviews online form and submits it to the school.
  3. School is notified of ejection and reviews information.
  4. OSAA is notified if school is appealing the suspension or fine.
@elseif (Helpers::strEqual($object->ejection_status->slug, 'RECD'))

Instructions for OSAA Staff

The school is not appealing this ejection. You can read the information regarding the ejection that was provided by the Commissioner and any additional information that was provided by the school. Please click Mark Done to finish and close this ejection report.
  1. Official provides information to the Commissioner regarding an ejection.
  2. Commissioner reviews online form and submits it to the school.
  3. School is notified of ejection and reviews information.
  4. OSAA is notified if school is appealing the suspension or fine.
@elseif (Helpers::strEqual($object->ejection_status->slug, 'APPL'))

Instructions for OSAA Staff

The school is appealing this ejection. You can read the information regarding the ejection that was provided by the Commissioner and any additional information that was provided by the school. Please input the final outcome of the appeal in the text area near the bottom of the page. Please click Mark Done when finished to close this ejection report.
  1. Official provides information to the Commissioner regarding an ejection.
  2. Commissioner reviews online form and submits it to the school.
  3. School is notified of ejection and reviews information.
  4. OSAA is notified if school is appealing the suspension or fine.
@elseif (Helpers::strEqual($object->ejection_status->slug, 'DONE'))

Information

This form has been marked as DONE. No further action will occur regarding this ejection. OSAA Staff have reviewed this form. If school with the ejection has appealed the ejection's suspension or fine, the OSAA has rendered its decision at the bottom of the form. Schools will be invoiced for each ejection at the conclusion of each season.
  1. Official provides information to the Commissioner regarding an ejection.
  2. Commissioner reviews online form and submits it to the school.
  3. School is notified of ejection and reviews information.
  4. OSAA is notified if school is appealing the suspension or fine.
@endif

Required fields are indicated with a red asterisk, *.
{{-- Ejection Report Form --}}

Information

{{ Form::label('activity', 'Sport') }} {{ Form::select('activity', $options['activities'], $object->ejection->activity, array('data-autosave' => true, 'data-field' => 'activity', 'data-type' => 'STRING', 'data-original' => $object->ejection->activity, 'data-reload' => true, 'data-required' => true, 'style' => '')) }}

{{ Form::label('level', 'Level') }} {{ Form::select('level', $options['levels'], $object->ejection->level, array('data-autosave' => true, 'data-field' => 'level', 'data-type' => 'STRING', 'data-original' => $object->ejection->level, 'data-required' => true, 'style' => '')) }}
{{ Form::label('contest_date', 'Date') }} {{ Form::text('contest_date', (!Helpers::strIsEmpty($object->data->contest->date)) ? date('m/d/Y', strtotime($object->data->contest->date)) : null, array('data-autosave' => true, 'data-field' => 'data->contest->date', 'data-type' => 'DATE', 'data-original' => (!Helpers::strIsEmpty($object->data->contest->date)) ? date('m/d/Y', strtotime($object->data->contest->date)) : null, 'data-required' => true, 'data-date-picker' => true, 'style' => 'width: 100px;')) }} (MM/DD/YYYY)

{{ Form::label('contest_time', 'Time') }} {{ Form::text('contest_time', $object->data->contest->time, array('data-autosave' => true, 'data-field' => 'data->contest->time', 'data-type' => 'STRING', 'data-original' => $object->data->contest->time, 'maxlength' => 15, 'style' => 'width: 100px;')) }} (Optional) scheduled start time


{{ Form::label('activity_program', 'School of Ejected Person', array('style' => 'width: 205px;')) }} @if (count($options['activity_programs']) == 0) Select a sport first. @else {{ Form::select('activity_program', $options['activity_programs'], $object->ejection->activity_program, array('data-autosave' => true, 'data-field' => 'activity_program', 'data-type' => 'INT', 'data-original' => $object->ejection->activity_program, 'data-required' => true, 'style' => 'width: 300px;')) }} @endif {{ Form::label('contest_designation', 'Home/Away', array('style' => 'margin-left: 50px; float: none; display: inline-block;')) }} {{ Form::select('contest_designation', $options['designations'], $object->data->contest->designation, array('data-autosave' => true, 'data-field' => 'data->contest->designation', 'data-type' => 'STRING', 'data-original' => $object->data->contest->designation, 'data-required' => true, 'style' => 'width: 75px;')) }}
Was the ejection on the home or away team?
{{ Form::label('contest_opponent', 'Opposing School', array('style' => 'width: 205px;')) }} {{ Form::text('contest_opponent', $object->data->contest->opponent, array('data-autosave' => true, 'data-field' => 'data->contest->opponent', 'data-type' => 'STRING', 'data-original' => $object->data->contest->opponent, 'data-required' => true, 'data-autocomplete' => true, 'data-source' => url('/forms/ejection/' . $object->ejection->id . '/lookup/opponent-school'), 'style' => 'width: 300px;')) }} What was the opposing school's name?

{{ Form::label('contest_location', 'Location', array('style' => 'width: 205px;')) }} {{ Form::text('contest_location', $object->data->contest->location, array('data-autosave' => true, 'data-field' => 'data->contest->location', 'data-type' => 'STRING', 'data-original' => $object->data->contest->location, 'data-required' => true, 'data-autocomplete' => true, 'data-source' => url('/forms/ejection/' . $object->ejection->id . '/lookup/location'), 'style' => 'width: 300px;')) }} Where was the contest held?

@if (count($others) > 0 and Helpers::strEqual($object->ejection_status->slug, array('SUBT', 'APPL', 'RECD', 'DONE', 'ARCH')))

Associated Ejection Reports for {{ $object->host_school->short_name }} {{ Helpers::getActivityName($object->activity->slug) }}

@foreach ($others as $other) @endforeach
ID Number Level Type Individual Reason Status Date Notes
{{ $other->ejection->id }} {{ $other->ejection->level }} {{ $other->ejection->type }} {{ $other->data->ejected->name }} @if (!Helpers::strIsEmpty($other->data->ejected->jersey) and Helpers::strEqual($other->ejection->type, 'Player')) (#{{ $other->data->ejected->jersey }}) @endif {{ (!is_null($other->ejection_reason)) ? $other->ejection_reason->name : '- -' }} {{ $other->ejection_status->slug }} {{ date('n/j/y', strtotime($other->data->contest->date)) }} @if ($appealed) Appealed - @if ($granted) Granted @elseif (!$fine) Denied, No Fine @else Denied @endif @elseif (!$fine) No Fine @endif @if ($other->data->contest->is_last_contest == true) (Last Contest) @endif

@endif

Ejected Person

Who was ejected and why?

{{ Form::label('type', 'Coach/Player') }} {{ Form::select('type', $options['types'], $object->ejection->type, array('data-autosave' => true, 'data-field' => 'type', 'data-type' => 'STRING', 'data-original' => $object->ejection->type, 'data-required' => true, 'style' => 'width: 75px;')) }} Was the person a coach or a player?

{{ Form::label('ejected_name', 'Name') }} {{ Form::text('ejected_name', $object->data->ejected->name, array('data-autosave' => true, 'data-field' => 'data->ejected->name', 'data-type' => 'STRING', 'data-original' => $object->data->ejected->name, 'data-required' => true, 'style' => 'width: 150px;')) }} Unknown if name is not known

{{ Form::label('ejected_jersey', 'Jersey #') }} {{ Form::text('ejected_jersey', $object->data->ejected->jersey, array('data-autosave' => true, 'data-field' => 'data->ejected->jersey', 'data-type' => 'STRING', 'data-original' => $object->data->ejected->jersey, 'style' => 'width: 50px;')) }} (Optional) player's jersey number

Ejecting Official

Who was the official that ejected the person?

{{ Form::label('official_name', 'Name') }} {{ Form::text('official_name', $object->data->official->name, array('data-autosave' => true, 'data-field' => 'data->official->name', 'data-type' => 'STRING', 'data-original' => $object->data->official->name, 'data-required' => true, 'style' => 'width: 150px;')) }} Full name (i.e. John Smith)

{{ Form::label('officials_association', 'Association') }} @if (count($options['officials_associations']) == 0) You must select a sport first. @else {{ Form::select('officials_association', $options['officials_associations'], $object->ejection->officials_association, array('data-autosave' => true, 'data-field' => 'officials_association', 'data-type' => 'INT', 'data-original' => $object->ejection->officials_association, 'data-required' => true, 'data-reload' => true, 'style' => 'width: 300px;')) }} @endif

Commissioner
@if (Helpers::strIsEmpty($object->ejection->officials_association)) Select an association. @elseif (!is_null($object->commissioner)) {{ $object->commissioner->getDisplayFullName() }} @if (!Helpers::strEqual($object->ejection->ejection_status, array('WPRK')))
{{ $object->commissioner->email }} @endif @else Unknown @endif

Reason

{{ Form::label('ejection_reason', 'Category') }} Under what category, or rule, was the person ejected or disqualified?
@if (count($options['ejection_reasons']) == 0) You must select a sport first. @else @endif
@if (!is_null($object->ejection->ejection_reason))
NFHS {{ $object->ejection_reason->sport }} @if (Helpers::strContains(',', $object->ejection_reason->rule)) Rules @else Rule @endif
{{ $object->ejection_reason->rule }}
@endif

{{ Form::label('ejected_reason', 'Reason for the Ejection', array('style' => 'float: none; width: auto;', 'data-required' => true)) }} Describe the circumstances of the ejection below {{ Form::textarea('ejected_reason', $object->data->ejected->reason, array('data-autosave' => true, 'data-field' => 'data->ejected->reason', 'data-type' => 'STRING', 'data-original' => $object->data->ejected->reason, 'data-required' => true, 'data-required-indicator' => false, 'style' => 'width: 100%; height: 8em;')) }}

@if (Helpers::strEqual($object->ejection_status->slug, array('WORK')))

Additional Notes

{{ Form::label('official_notes', 'Official\'s Notes')}} (Optional) Were there any additional notes, abnormal situations, or other information relevant to this report? @elseif (Helpers::strEqual($object->ejection_status->slug, array('CMSH')))

Additional Notes

{{ Form::label('official_notes', 'Official\'s Notes')}} (Optional) Did the official provide any any additional notes, abnormal situations, or other information relevant to this report? @else

Additional Notes

{{ Form::label('official_notes', 'Official\'s Notes')}} Additional notes, abnormal situations, or other information relevant to this report provided by the Official @endif {{ Form::textarea('official_notes', $object->data->official->notes, array('data-autosave' => true, 'data-field' => 'data->official->notes', 'data-type' => 'STRING', 'style' => 'width: 100%; height: 8em;')) }}

@if (!Helpers::strEqual($object->ejection_status->slug, array('WORK'))) {{ Form::label('commissioner_notes', 'Commissioner\'s Notes', array('style' => 'width: auto;')) }} (Optional) Notes from the Commissioner {{ Form::textarea('commissioner_notes', $object->data->commissioner->notes, array('data-autosave' => true, 'data-field' => 'data->commissioner->notes', 'data-type' => 'STRING', 'style' => 'width: 100%; height: 8em;')) }}

@endif @if (Helpers::strEqual($object->ejection_status->slug, array('SUBT', 'RECD', 'APPL', 'DONE')))

School Response

{{ Form::label('contest_is_last_contest', 'Last Contest') }} {{ Form::select('contest_is_last_contest', $options['yes_no'], (is_null($object->data->contest->is_last_contest)) ? '' : (($object->data->contest->is_last_contest) ? 1 : 0), array('data-autosave' => true, 'data-field' => 'data->contest->is_last_contest', 'data-type' => 'INT', 'data-original' => (is_null($object->data->contest->is_last_contest)) ? '' : (($object->data->contest->is_last_contest) ? 1 : 0), 'data-required' => true, 'style' => '')) }} Is this the {{ strtolower($object->level->name) }} {{ strtolower($object->activity->name) }} team's last contest for the season?

{{ Form::label('receipt_notes', 'School Action / Statement', array('style' => 'width: auto;', 'data-required' => true)) }} The school's action plan or statement regarding this ejection or the reason for appeal {{ Form::textarea('receipt_notes', $object->data->receipt->notes, array('data-autosave' => true, 'data-field' => 'data->receipt->notes', 'data-original' => $object->data->receipt->notes, 'data-required' => true, 'data-required-indicator' => false, 'data-type' => 'STRING', 'style' => 'width: 100%; height: 8em;')) }}

@endif @if (Helpers::strEqual($object->ejection_status->slug, array('APPL', 'DONE')))

Appeal Information

{{ Form::label('receipt_is_granted', 'Outcome', array('style' => 'width: auto; margin-right: 20px;')) }} {{ Form::select('receipt_is_granted', $options['granted'], (is_null($object->data->receipt->is_granted)) ? '' : (($object->data->receipt->is_granted) ? 1 : 0), array('data-autosave' => true, 'data-field' => 'data->receipt->is_granted', 'data-type' => 'INT', 'data-original' => (is_null($object->data->receipt->is_granted)) ? '' : (($object->data->receipt->is_granted) ? 1 : 0), 'data-required' => true, 'style' => 'position: relative; top: -3px;')) }}
{{ Form::label('receipt_appeal', 'Appeal Resolution', array('style' => 'width: auto;', 'data-required' => true)) }} (OSAA Use Only) The outcome of the appeal {{ Form::textarea('receipt_appeal', $object->data->receipt->appeal, array('data-autosave' => true, 'data-field' => 'data->receipt->appeal', 'data-original' => $object->data->receipt->appeal, 'data-required' => true, 'data-required-indicator' => false, 'data-type' => 'STRING', 'style' => 'width: 100%; height: 8em;')) }}

@endif @if (Helpers::strEqual($object->ejection_status->slug, array('CMSH', 'SUBT', 'RECD', 'APPL', 'DONE')))

Supplemental Files

Commissioner
@if (is_null($object->data->files->commissioner->path))
No file uploaded
@else
@if (Input::has('view')) View/Download File @else View/Download File @endif
@endif @if (Helpers::strEqual($object->ejection_status->slug, array('CMSH')) or (Auth::check() and Auth::user()->isOsaaUser()))

Upload a File @endif
School
@if (is_null($object->data->files->school->path))
No file uploaded
@else
@if (Input::has('view')) View/Download File @else View/Download File @endif
@endif @if (Helpers::strEqual($object->ejection_status->slug, array('SUBT')) or (Auth::check() and Auth::user()->isOsaaUser()))

Upload a File @endif
OSAA
@if (is_null($object->data->files->osaa->path))
No file uploaded
@else
@if (Input::has('view')) View/Download File @else View/Download File @endif
@endif @if (Auth::check() and Auth::user()->isOsaaUser())

Upload a File @endif


@endif
@stop