').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/seasonal/' . $info['season'] . '/' . $info['school']->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 += '
';
@if (!$info['school_form']->data->is_submitted)
html += '
Are you sure you want to submit this form?';
html += '
';
html += '
You will be able to make changes and re-submit this form up until the form\'s deadline. Your school will be notified by e-mail confirming receipt.
';
@if (Helpers::strEqual($info['seasonal_school_form']->season, 'S'))
html += '
Did you remember to fill out the school year enrollment survey at the bottom of the form?
';
@endif
@else
html += '
Are you sure you want to re-submit this form?';
html += '
';
html += '
You will be able to make changes and re-submit this form up until the form\'s deadline. Your school will be notified by e-mail confirming receipt.
';
@if (Helpers::strEqual($info['seasonal_school_form']->season, 'S'))
html += '
Did you remember to fill out the school year enrollment survey at the bottom of the form?
';
@endif
@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();
}
});
}
// Required field marker
$('[data-required]:not([data-required-indicator])').after('
*');
// 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['school_form']->id }};
$('*').css({'cursor':'wait'});
var jqxhr = $.ajax(
{
type : 'POST',
url : '{{ url('/forms/seasonal/') }}/' + 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);
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);
}
});
@if (Session::has('new_form') or Input::has('new-form'))
showHelp('new-form', 'New Seasonal School Form');
@endif
/* ShowHelp
*
* Shows a help topic.
*/
function showHelp(help_topic, special)
{
if (typeof special === 'undefined' || special == '')
{
$('
')
.appendTo('body')
.dialog(
{
draggable : true,
resizable : true,
height : 725,
minHeight : 400,
width : 615,
minWidth : 330,
modal : false,
title : 'Form Help',
open : function ()
{
var dialog_object = $(this);
dialog_object.html("
");
var jqxhr = $.ajax(
{
type : 'GET',
url : '{{ url('forms/seasonal/' . $info['school_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\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 : special,
open : function ()
{
var dialog_object = $(this);
dialog_object.html("
");
var jqxhr = $.ajax(
{
type : 'GET',
url : '{{ url('forms/seasonal/' . $info['school_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\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);
object.blur();
event.preventDefault();
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 status log when link is clicked.
*/
$('[name="status_log"]')
.click(function(event)
{
event.preventDefault();
var link = $(this);
link.blur();
var data = {
form_id : "{{ $info['school_form']->id }}",
created_at : "{{ date('D n/j/y g:ia', strtotime($info['school_form']->created_at)) }}",
updated_at : "{{ date('D n/j/y g:ia', strtotime($info['school_form']->updated_at)) }}",
is_submitted : "{{ ($info['school_form']->data->is_submitted) ? ('

Yes - Complete') : ('

No - Never Submitted') }}"
};
var html = '
';
html += '
Last Updated:
' + data.updated_at + '
';
html += '
Form Created:
' + data.created_at + '
';
html += '
Submitted:
' + data.is_submitted + '
';
html += '
';
@foreach ($info['school_form']->data->status_history as $i => $log)
@if (($i % 2) == 0)
html += '';
@else
html += '
';
@endif
html += '| {{ date('n/j/y g:ia', strtotime($log->timestamp)) }} | ';
html += '{{ $log->action }} | ';
html += '{{ str_replace('\'', '\\\'', $log->user) }} {{ str_replace("\n", ' ', str_replace('\'', '"', $log->notes)) }} |
';
@endforeach
html += '
';
$('
')
.appendTo('body')
.dialog(
{
resizable: false,
height: 'auto',
width: 550,
modal: false,
title: 'Status Log - Form ID ' + data.form_id,
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':''});
});
/*
* Form Behavior
*/
$('[data-format="integer"]')
.bind('input', function()
{
$(this).val($(this).val().replace(/[^0-9]/gi, ''));
});
@stop
@section('page_functions')
Submit
Help
@if (Auth::check() and Auth::user()->isOsaaUser())
Close
@else
Close
@endif
@stop
@section('main_content')
{{-- Success Bar --}}
@if (Session::has('success'))
{{ Session::get('success') }}
@endif
{{-- Past Due Notification --}}
@if (false)
{{-- NEED TO REDO --}}
This form was due by {{ date('g:i A l, F j, Y', strtotime($info['seasonal_school_form']->due_at)) }} and is now past the deadline. Please submit your entries now before the form closes and becomes unavailable.
@endif
{{-- Status Log --}}
Status
{{-- Form Icon & Heading --}}
{{ $info['school_year']->slug }} {{ ucfirst($info['season']) }} Activity Programs for {{ $info['school']->short_name }}
{{-- Instructions --}}
{{-- Not Submitted Note --}}
@if (!$info['school_form']->data->is_submitted)
Submit
This form has not been submitted.
@endif
{{-- Errors --}}
@if (Session::has('errors'))
@foreach ($errors->all() as $error){{ $error }} @endforeach
@endif
{{-- Required Note --}}
Required fields are indicated with a red asterisk, *.
Activity Programs
| Sport / Activity |
Offered This Year ({{ $info['school_year']->slug }}) |
Offering Next Year ({{ $info['next_school_year']->slug }})* |
# Males (M) |
# Females (F) |
# Non-Binary (X) |
@foreach ($info['school_form']->data->activities as $index => $activity_object)
|
{{ Helpers::getActivityName($activity_object->slug) }}
|
{{ ($activity_object->offered) ? (' Yes') : (' No') }}
|
{{ Form::label($activity_object->slug . '_preselect', 'Preselect') }}
{{ Form::checkbox($activity_object->slug . '_preselect',
true,
$info['school_form']->data->activities[$index]->preselect,
array('data-autosave' => true,
'data-field' => 'data->activities[' . $index . ']->preselect',
'data-type' => 'BOOL',
'style' => 'vertical-align: middle;',
'class' => 'preselect_option')) }}
|
@if ($activity_object->offered)
{{ Form::label($activity_object->slug . '_boys', 'M: ') }}
{{ Form::text($activity_object->slug . '_boys',
$info['school_form']->data->activities[$index]->boys,
array('data-autosave' => true,
'data-field' => 'data->activities[' . $index . ']->boys',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->activities[$index]->boys,
'style' => 'width: 40px;')) }}
@else
N/A
@endif
|
@if ($activity_object->offered)
{{ Form::label($activity_object->slug . '_girls', 'F: ') }}
{{ Form::text($activity_object->slug . '_girls',
$info['school_form']->data->activities[$index]->girls,
array('data-autosave' => true,
'data-field' => 'data->activities[' . $index . ']->girls',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->activities[$index]->girls,
'style' => 'width: 40px;')) }}
@else
N/A
@endif
|
@if ($activity_object->offered)
{{ Form::label($activity_object->slug . '_other', 'X: ') }}
{{ Form::text($activity_object->slug . '_other',
$info['school_form']->data->activities[$index]->other,
array('data-autosave' => true,
'data-field' => 'data->activities[' . $index . ']->other',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->activities[$index]->other,
'style' => 'width: 40px;')) }}
@else
N/A
@endif
|
@endforeach
@if (Helpers::strEqual($info['seasonal_school_form']->season, 'S'))
{{ $info['school_year']->slug }} School Year Enrollment Survey
These students are Home School, Associate Member School, or Private School students that participated for your school in an OSAA sanctioned activity this school year but didn't attend your school full time. Your school should have completed a School Representation Eligibility Certificate for each of the students counted below. Students competing in more than one OSAA activity should only be counted once.
{{ Form::label('survey_home_school', 'Home School Students') }}
{{ Form::text('survey_home_school',
$info['school_form']->data->spring_survey->home_school,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->home_school',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->home_school,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
How many Home School students participated for your school during this {{ $info['school_year']->slug }} school year?
{{-- Associate Member School Students --}}
@if (!Helpers::strEqual($info['school']->school_type, 'PRI'))
{{ Form::label('survey_associate_school', 'Associate Member School Students') }}
{{ Form::text('survey_associate_school',
$info['school_form']->data->spring_survey->associate_school,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->associate_school',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->associate_school,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
How many Associate Member School students participated for your school during this {{ $info['school_year']->slug }} school year?
@endif
{{-- Private School Students --}}
@if (!Helpers::strEqual($info['school']->school_type, 'PRI'))
{{ Form::label('survey_private_school', 'Private School Students') }}
{{ Form::text('survey_private_school',
$info['school_form']->data->spring_survey->private_school,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->private_school',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->private_school,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
How many Private School students participated for your school during this {{ $info['school_year']->slug }} school year?
@endif
{{-- Out of District Students --}}
@if (!Helpers::strEqual($info['school']->school_type, 'PRI'))
{{ Form::label('survey_outside_district', 'Enrolled Out of District Students') }}
{{ Form::text('survey_outside_district',
$info['school_form']->data->spring_survey->outside_district,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->outside_district',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->outside_district,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
How many out of district tuition paying students attended your school during this {{ $info['school_year']->slug }} school year? These are students who do not live in your district but pay tuition to attend your school.
@endif
{{-- Private School ADM numbers --}}
@if (Helpers::strEqual($info['school']->school_type, 'PRI'))
Enrollment Figures for {{ $info['school_year']->slug }}
The Oregon Department of Education (ODE) supplies the OSAA with Average Daily Membership (ADM) figures for all public high school in Oregon, but not for private schools. The OSAA will compute your ADM when you provide us with your actual enrollment figures for the {{ $info['school_year']->slug }} school year using this form.
Enrollment on: (grades 9 through 12)
{{ Form::label('adm_part_1', 'Sept 15, ' . $info['school_year']->id) }}
{{ Form::text('adm_part_1',
$info['school_form']->data->spring_survey->adm->part_1,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->adm->part_1',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->adm->part_1,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
{{ Form::label('adm_part_2', 'Dec 1, ' . $info['school_year']->id) }}
{{ Form::text('adm_part_2',
$info['school_form']->data->spring_survey->adm->part_2,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->adm->part_2',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->adm->part_2,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
{{ Form::label('adm_part_3', 'Feb 28, ' . ($info['school_year']->id + 1)) }}
{{ Form::text('adm_part_3',
$info['school_form']->data->spring_survey->adm->part_3,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->adm->part_3',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->adm->part_3,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
{{ Form::label('adm_part_4', 'Apr 15, ' . ($info['school_year']->id + 1)) }}
{{ Form::text('adm_part_4',
$info['school_form']->data->spring_survey->adm->part_4,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->adm->part_4',
'data-type' => 'INT',
'data-required' => true,
'data-format' => 'integer',
'data-original' => $info['school_form']->data->spring_survey->adm->part_4,
'style' => 'width: 50px;',
'maxlength' => '4')) }}
Free / Reduced Lunch
The OSAA Delegate Assembly uses an adjusted ADM number for all schools for classification purposes. This number includes an adjustment using a school's free and reduced lunch number multiplied by 25% and subtracted from the school's ADM. ODE provides the free and reduced lunch number for public schools. For private schools, the schools' free and reduced lunch number will be submitted to the OSAA using the same household size and income form and guidelines required by ODE.
{{ Form::label('adm_free_reduced', 'Yes, our school intends to submit free and reduced lunch numbers to the OSAA for the ' . $info['school_year']->slug . ' school year.') }}
{{ Form::checkbox('adm_free_reduced',
true,
$info['school_form']->data->spring_survey->adm->free_reduced,
array('data-autosave' => true,
'data-field' => 'data->spring_survey->adm->free_reduced',
'data-type' => 'BOOL',
'style' => 'vertical-align: middle; width: 24px;')) }}
If not, leave un-checked. If yes, check this box and the OSAA will send you the application forms required by ODE.
@endif
@endif
@stop