@section('page_title')
OSAA - Forms
@stop
@section('page_sub_title')
{{ $information['form_name'] }}
@stop
@section('scripts')
@parent
@stop
@section('jquery_init')
$('.button').button();
$('.button.notext').button({text:false});
$('.button.close').button({ icons : { primary : 'ui-icon-circle-close'}});
$('.button.switch').button({ icons : { primary : 'ui-icon-transferthick-e-w'}});
$('.button.back').button({ icons : { primary : 'ui-icon-arrowthick-1-w'}});
$('.button.delete').button({ icons : { primary : 'ui-icon-closethick'}});
$('.button.add').button({ icons : { primary : 'ui-icon-plusthick'}});
$('.button.save').button({ icons : { primary : 'ui-icon-disk'}});
$('.button.edit').button({ icons : { primary : 'ui-icon-pencil'}});
$('.button_set').buttonset();
$('.tooltip').tooltip();
$('.accordion').accordion({active : false, collapsible : true, heightStyle : 'content'});
$('.date_picker').datepicker({'dateFormat' : 'mm/dd/yy'});
$('[data-required="required"]').after('*');
/* Limit input to numbers only */
$('.numbers_only').bind('input', function()
{
$(this).val($(this).val().replace(/[^0-9]/gi, ''));
});
/* Limit input to letters only */
$('.alphas_only').bind('input', function()
{
$(this).val($(this).val().replace(/[^A-Za-z]/gi, ''));
});
function colorRows ()
{
$('table').each(function ()
{
var i = 0;
$('tbody tr:visible', $(this)).each(function ()
{
if (i % 2 == 0)
{
$(this).addClass('odd');
}
else
{
$(this).removeClass('odd');
}
i = i + 1;
});
});
}
colorRows();
$('[placeholder]').focus(function()
{
var input = $(this);
if (input.val() == input.attr('placeholder'))
{
input.val('');
input.removeClass('placeholder');
}
}).blur(function()
{
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder'))
{
input.addClass('placeholder');
input.val(input.attr('placeholder'));
}
}).blur();
$('[placeholder]').parents('form').submit(function()
{
$(this).find('[placeholder]').each(function()
{
var input = $(this);
if (input.val() == input.attr('placeholder'))
{
input.val('');
}
});
});
/* Save information */
$('.button.save').click(function ()
{
var form = $(this).parents('form');
var input = $('').attr('type', 'hidden').attr('name', 'save').val('true');
$(form).append($(input));
$(form).submit();
});
// 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);
})
});
{{-- Include script for the league or school selection landing form --}}
@if (is_null($information['league']) and is_null($information['activity_program']))
/* Disable the next button and hide the loading icon */
$('#select_league_form input[type="submit"]').button('disable')
.addClass('ui-state-error');
$('#select_league_form img').hide();
/* When a code is input, check it's value */
$('#select_league_form [name="code"]').bind('input', function ()
{
$('#select_league_form img').show();
var code = $(this).val();
// Skip for now, to make it process faster
if (false && code.length != 17)
{
$('#select_league_form input[type="submit"]').button('disable')
.addClass('ui-state-error');
$('#select_league_form img').hide();
}
else
{
var jqxhr = $.ajax(
{
type : 'POST',
url : '/forms/check-code',
data : { 'activity' : 'SOL', 'code' : code },
dataType : 'html'
})
.fail(function ()
{
$('#select_league_form input[type="submit"]').button('disable')
.addClass('ui-state-error');
$('#select_league_form img').hide();
})
.success(function ()
{
$('#select_league_form input[type="submit"]').button('enable')
.removeClass('ui-state-error');
$('#select_league_form img').hide();
});
}
});
// Only submit the form if the submit button is enabled
$('#select_league_form').submit(function ()
{
if ($('#select_league_form input[type="submit"]').is(':enabled'))
{
$('#select_league_form [name="code"]').remove();
return true;
}
else
{
return false;
}
});
{{-- Hide the school registration form if the user is not logged in --}}
@if (!Auth::check())
$('[data-form="school"] a').each(function ()
{
$(this).replaceWith($(this).text());
});
$('[data-form="school"] input').remove();
$('[data-form="school"]').addClass('ui-state-disabled');
$('[data-form="school"] select').replaceWith('
No schools to list.
');
$('.main_content').append('
You must log in to access this form for schools.
');
@endif
@endif
{{-- Include script for the league submission form --}}
@if (!is_null($information['league']))
// Up and down sorting arrows
var up_arrow = '{{ asset('/images/icons/bullet_arrow_up.png') }}';
var down_arrow = '{{ asset('/images/icons/bullet_arrow_down.png') }}';
// Bind a click event to table headers that are sortable
$('thead').on('click', 'th[data-sortable="true"]', function()
{
// Remove any sorting images
$('th[data-sortable="true"] img').remove();
// Get the table and the set of rows
var table = $(this).parents('table').eq(0);
var rows = table.find('tr:gt(0)').toArray().sort(comparer($(this).index()));
// Figure out sorting directions
this.asc = !this.asc;
var arrow = down_arrow;
if (!this.asc)
{
rows = rows.reverse();
arrow = up_arrow;
}
// Recreate rows
for (var i = 0; i < rows.length; i++)
{
table.append(rows[i]);
}
// Show sorting arrow
$(this).append('');
// Recolor the rows
colorRows();
});
// Bind hover events to the table headers that are sortable
$('thead').on('mouseover', 'th[data-sortable="true"]', function ()
{
$(this).css('cursor', 'pointer');
});
$('thead').on('mouseout', 'th[data-sortable="true"]', function ()
{
$(this).css('cursor', 'auto');
});
// Compare string values
function comparer(index)
{
return function(a, b)
{
var valA = getCellValue(a, index);
var valB = getCellValue(b, index);
return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.localeCompare(valB);
}
}
// Get a table cell's value
function getCellValue(row, index)
{
return $(row).children('td').eq(index).html();
}
/*
*
* Interactive grid prototype
*
*/
// Get the options for some drop-down lists
var school_options = {{ $information['school_options'] }};
var category_options = {{ $information['category_options'] }};
var placement_options = {{ $information['placement_options'] }};
/* rowMouseOverHandler
*
* This function handles the event when a table body row is hovered over
*/
function rowMouseOverHandler(row)
{
// If this row is already being edited, do nothing
if ($('tbody tr[data-editing]').size() > 0)
{
return false;
}
// Highlight this row
row.addClass('ui-state-active')
.css('cursor', 'pointer')
.css('font-weight', 'normal');
// Add a delete button
$('td:nth-child(5)', row).append('');
$('td:nth-child(5) .button', row).button(
{
text : false,
icons : { primary : 'ui-icon-closethick'}
})
.css({'margin-right' : '1em',
'position' : 'absolute',
'right' : '0',
'width' : '18px',
'height' : '18px'})
.hover(function ()
{
$(this).addClass('ui-state-active');
},
function ()
{
$(this).removeClass('ui-state-active');
})
.click(function (event)
{
$('').appendTo('body')
.html(' Are you sure you want to remove this row and delete this qualifier?')
.dialog(
{
autoOpen: true,
draggable: false,
resizable: false,
height:200,
width: 400,
title: 'Confirm Removal',
modal: true,
buttons: [
{
text : "Yes",
'class' : "float_left",
icons : { primary : 'ui-icon-check'},
click : function()
{
// Remove this row
row.remove();
$(this).dialog( "close");
$(this).remove();
// Recolor the rows
colorRows();
}
},
{
text : "No",
'class' : "float_right",
icons : { primary : 'ui-icon-cancel'},
click : function()
{
$(this).dialog( "close");;
$(this).remove();
}
}
],
open : function ()
{
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
$('.ui-dialog-titlebar').addClass('ui-state-highlight');
}
});
event.stopPropagation();
});
}
/* rowMouseOutHandler
*
* This function handles the event when a table body row is no longer hovered over
*/
function rowMouseOutHandler(row)
{
// If this row is being edited, do nothing
if ($('tbody tr[data-editing]').size() > 0)
{
return false;
}
// Remove the highlight and delete button
row.removeClass('ui-state-active');
$('td:nth-child(5) .button', row).remove();
}
/* rowClickHandler
*
* This function handles the event when a table body row is clicked
*/
function rowClickHandler(row)
{
// Get the cells of this row
var first_name = $('td:nth-child(1)', row);
var last_name = $('td:nth-child(2)', row);
var school = $('td:nth-child(3)', row);
var category = $('td:nth-child(4)', row);
var placement = $('td:nth-child(5)', row);
// If the first cell is already a form field (i.e. already being edited), then skip it
if ($('input', first_name).size() > 0)
{
return false;
}
// If no rows are being edited, then stop editing
if ($('tbody tr[data-editing]').size() > 0)
{
stopEditing();
}
// Mark this row as being edited
row.attr('data-editing', 'true');
// Replace the cell values with form fields
first_name.replaceWith("
");
last_name.replaceWith("
");
// Get the currently entered values for drop-down lists
var selected_school = school.text();
var selected_category = category.text();
var selected_placement = placement.text();
school.replaceWith("
");
category.replaceWith("
");
placement.replaceWith("
");
// If a current school was selected, mark the option as selected in the drop-down list
if (selected_school != "")
{
$('td:nth-child(3) option', row).each(function ()
{
var opt = $(this);
if (opt.val() == selected_school)
{
opt.attr('selected', 'selected');
}
});
}
// If a current category was selected, mark the option as selected in the drop-down list
if (selected_category != "")
{
$('td:nth-child(4) option', row).each(function ()
{
var opt = $(this);
if (opt.val() == selected_category)
{
opt.attr('selected', 'selected');
}
});
}
// If a current placement was selected, mark the option as selected in the drop-down list
if (selected_placement != "")
{
$('td:nth-child(5) option', row).each(function ()
{
var opt = $(this);
if (opt.val() == selected_placement)
{
opt.attr('selected', 'selected');
}
});
}
$('td:first input', row).focus();
// Highlight this row
row.addClass('ui-state-highlight');
}
/* stopEditing
*
* When called, this will remove the editing tag from a row and convert
* form inputs to text values.
*/
function stopEditing()
{
// Process each table row in the body
$('tbody tr').each(function ()
{
var row = $(this);
// Is this row being edited?
if (row.is('[data-editing]'))
{
// Remove the editing attribute and highlight
row.removeClass('ui-state-highlight');
row.removeAttr('data-editing');
// Get the cells
var first_name = $('td:nth-child(1)', row);
var last_name = $('td:nth-child(2)', row);
var school = $('td:nth-child(3)', row);
var category = $('td:nth-child(4)', row);
var placement = $('td:nth-child(5)', row);
// Replace the cells with their form values
first_name.replaceWith("
" + $('input', first_name).val() + "
");
last_name.replaceWith("
" + $('input', last_name).val() + "
");
if ($('select', school).val().length > 35)
{
school.replaceWith("
" + $('select', school).val() + "
");
}
else
{
school.replaceWith("
" + $('select', school).val() + "
");
}
category.replaceWith("
" + $('select', category).val() + "
");
placement.replaceWith("
" + $('select', placement).val() + "
");
}
// Remove any hover over effects
row.removeClass('ui-state-active');
});
}
// Click the add row button
$('.button.add').on('click', function()
{
var add = 1;
if ($(this).is('.five'))
{
add = 5;
}
for (var i = 0; i < add; i++)
{
// Add a newly created row
var row = $('
');
row.appendTo('tbody');
// Bind the hover handlers
row.hover(function ()
{
var row = $(this);
rowMouseOverHandler(row);
},
function ()
{
var row = $(this);
rowMouseOutHandler(row);
});
// Bind the click handler
row.click(function (event)
{
var row = $(this);
rowClickHandler(row);
// Prevent this click event from reaching higher levels
event.stopPropagation();
});
}
// Recolor the rows
colorRows();
});
// Hover over an existing row in the table body
$('tbody tr').hover(function ()
{
var row = $(this);
rowMouseOverHandler(row);
},
function ()
{
var row = $(this);
rowMouseOutHandler(row);
});
// Handle clicks anywhere on the page
$(document).click(function (event)
{
stopEditing();
});
// Handle clicks to a row in the table body
$('tbody tr').click(function (event)
{
var row = $(this);
rowClickHandler(row);
// Prevent this click event from reaching higher levels
event.stopPropagation();
});
$('input[type="submit"]').click(function (event)
{
event.preventDefault();
var form = $(this).parent('form');
$('').appendTo('body')
.html(' Are you sure you want to submit this form?
Each time this form is submitted, e-mails will be sent to Kyle Stanfield of the OSAA, the district director, and to each qualifier\'s school. It is recommended to submit this form only once, with all qualifiers listed from your district competition.
Please wait, this may take a while to process and send e-mails.
');
form.submit();
}
},
{
text : "No",
'class' : "float_right",
icons : { primary : 'ui-icon-cancel'},
click : function()
{
$(this).dialog( "close");;
$(this).remove();
}
}
],
open : function ()
{
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
//$('.ui-dialog-titlebar').addClass('ui-state-highlight');
}
});
return false;
});
// Handle form submission
$('form').submit(function (event)
{
var form = $(this);
var fields = new Array('first_name', 'last_name', 'school', 'category', 'placement');
// Create an array of qualifiers
var qualifiers = new Array();
var i = 0;
// Go through each row in the form
$('tbody tr').each(function ()
{
var row = new Array();
// Go through each column in this row and get its text value
for (var j = 0; j < 5; j++)
{
row[j] = $('td:nth-of-type(' + (j + 1) + ')', this).text();
}
// Add this row's data to the array of qualifiers, if a first and last name was provided
if (row[0] != "" && row[1] != '')
{
qualifiers[i] = row;
i = i + 1;
}
});
// Go through all qualifiers and add them to the form's input
for (i = 0; i < qualifiers.length; i++)
{
var qualifier = qualifiers[i];
for (j = 0; j < qualifier.length; j++)
{
var input = $('').attr('type', 'hidden')
.attr('name', 'qualifiers[' + i + '][' + fields[j] + ']')
.val(qualifier[j]);
form.append($(input));
}
}
});
@endif
{{-- Show the OSAA tool bar --}}
@if (Auth::check() and Auth::user()->isOsaaUser())
/* Enable the next button */
$('#select_league_form input[type="submit"]').button('enable')
.removeClass('ui-state-error');
$('#submissions_report').dialog(
{
dialogClass : 'submission_content',
autoOpen : false,
buttons : [ { text : 'Done', 'class' : 'float_right', click : function () { $(this).dialog('close'); }} ],
draggable : true,
height : 600,
modal : false,
resizable : false,
open : function ()
{
$('#submissions_report').html("");
var jqxhr = $.ajax(
{
type : 'GET',
url : '/reports/sol-registrations',
dataType : 'html'
})
.done(function (data)
{
$('#submissions_report').html(data);
})
.fail(function ()
{
$('#submissions_report').html('There was an error.');
});
$('.submission_content .ui-dialog-buttonpane').css('padding', '0').css('font-size', '8pt');
$('.submission_content .ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
},
show : { effect : 'highlight', delay : 0, duration : 400, easing : 'easeInOutSine' },
title : 'OSAA Solo Music District Submissions',
width : 650
}
);
$('.button.submissions').click(function () { $('#submissions_report').dialog('open'); });
$('#entries_report').dialog(
{
dialogClass : 'entry_content',
autoOpen : false,
buttons : [ { text : 'Done', 'class' : 'float_right', click : function () { $(this).dialog('close'); }} ],
draggable : true,
height : 300,
modal : false,
resizable : false,
open : function ()
{
$('#entries_report').html("");
var jqxhr = $.ajax(
{
type : 'GET',
url : '/reports/sol-entries',
dataType : 'html'
})
.done(function (data)
{
$('#entries_report').html(data);
})
.fail(function ()
{
$('#entries_report').html('There was an error.');
});
$('.entry_content .ui-dialog-buttonpane').css('padding', '0').css('font-size', '8pt');
$('.entry_content .ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
},
show : { effect : 'highlight', delay : 0, duration : 400, easing : 'easeInOutSine' },
title : 'OSAA Solo Music Entries',
width : 500
}
);
$('.button.entries').click(function () { $('#entries_report').dialog('open'); });
@endif
@stop
@section('page_functions')
@if (!is_null($information['league']))
Back
@else
Close
@endif
@stop
@section('main_content')
{{-- Success Bar --}}
@if (Session::has('success'))
{{ Session::get('success') }}
@endif
@if ($information['is_past_due'])
This form was due by {{ date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)) }} and is now past the deadline. Please submit your entries now before the form closes and becomes unavailable.
@endif
@if (is_null($information['league']) and is_null($information['activity_program']))
{{-- Need to select an league or activity program --}}
District Results - For District Directors
This form is for District Directors to submit district contest results identifying state qualifiers.
Instructions
Begin by selecting the special district from the drop-down list.
Then please enter the key code/password provided by the OSAA.
Click Next to continue with the selection.
Note: All entries must be submitted by {{ date('g:i A l, F j, Y', strtotime('2016-03-14 16:00:00')) }} using this online form.
For questions, contact {{ $information['staff']->first_name }} {{ $information['staff']->last_name }} at (503) 682-6722 x239 or by e-mail to {{ Helpers::obfuscateEmailLink ($information['staff']->email) }}. For technical assistance, you can email {{ Helpers::obfuscateEmailLink ("support@osaa.org") }}.
Use this form to submit your district's results. You may resubmit this form as many times as needed until the deadline. To complete this form, you will need to supply the following information.
Your contact information (name, e-mail address, phone number)
State qualifiers' information (name, school, category, placement)
Qualifier Registration - For Schools
This form is for Schools to register their state qualifiers for the state championship.
Instructions
You must be logged in and authorized to use this form.
Begin by selecting your school from the drop-down list.
Click Next to continue with the selection.
Note: All entries must be submitted by {{ date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)) }} using this online form.
For questions, contact {{ $information['staff']->first_name }} {{ $information['staff']->last_name }} at (503) 682-6722 x239 or by e-mail to {{ Helpers::obfuscateEmailLink ($information['staff']->email) }}. For technical assistance, you can email {{ Helpers::obfuscateEmailLink ("support@osaa.org") }}.
District Directors must submit their form to indicate which participants qualified for the state championship first. However, schools must then follow through and register their qualified participants. Just because a student qualified for state does not mean he or she is automatically registered for state.
Use this form to register your school's students. You may resubmit this form as many times as needed until the deadline.
@elseif (!is_null($information['league']))
{{-- A league is selected --}}
@if (!is_null($information['submission']))
Form entries created at {{ date('g:i a m/d/Y', strtotime($information['submission']->created_at)) }}.
Last updated at {{ date('g:i a m/d/Y', strtotime($information['submission']->updated_at)) }}.
@if ($information['submission']->data->complete)
Complete
@else
Incomplete
@endif
@else
Incomplete
@endif
{{ $information['league']->name }} Solo Contest Qualifiers
Instructions
Use this form to record the OSAA Solo Music State Championship qualifiers from the {{ $information['league']->name }} Solo Contest.
Required fields are noted with a red asterisk*.
Additional instructions and hints are included before each section.
Click Save at any time to save your entries without submitting the form.
When finished, click Submit to turn in this form with the entries provided. E-mails will be sent to {{ $information['staff']->first_name }} {{ $information['staff']->last_name }}, the district director, and to the schools of the listed qualifiers.
You can go back to the league selection page by clicking the Back button. You will lose all unsaved entries.
Note: All entries must be submitted by {{ date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)) }} using this online form.
For questions, contact {{ $information['staff']->first_name }} {{ $information['staff']->last_name }} at (503) 682-6722 x239 or by e-mail to {{ Helpers::obfuscateEmailLink ($information['staff']->email) }}. For technical assistance, you can email {{ Helpers::obfuscateEmailLink ("support@osaa.org") }}.
@if (Session::has('errors'))
@foreach ($errors->all() as $error){{ $error }} @endforeach
Contest judges must choose the three top 1‐rated soloists in each category whom they feel are of Solo State Championships quality and list them in order of preference (First Place, Second Place, and Third Place.) No ties are accepted. It is not possible to send the top‐rated contestant in a category if no one in that category received a one rating.
Add all qualifiers to the grid below, click the Add Row or Add 5 Rows buttons to add additional rows. Columns can be sorted by clicking the column header. Click a row to edit its values. To delete a row, hover over the row and click the X button on the right.
You must provide the qualifier's first name, last name, school, music category, and placement. Partial qualifier entries will not be saved. Empty rows will be ignored.
First Name *
Last Name *
School *
Category *
Placement *
@if (!is_null($information['submission']) and count($information['submission']->data->qualifiers) > 0)
@foreach ($information['submission']->data->qualifiers as $qualifier)
{{ $qualifier->first_name }}
{{ $qualifier->last_name }}
{{ $qualifier->school }}
{{ $qualifier->category }}
{{ $qualifier->placement }}
@endforeach
@endif
Add Row
Add 5 Rows
Save
Click Submit to turn in your district contest's state qualifiers and to send notification e-mails.
@elseif (!is_null($information['activity_program']))
{{-- An activity program is selected --}}
@if (!is_null($information['submission']))
Form entries created at {{ date('g:i a m/d/Y', strtotime($information['submission']->created_at)) }}.
Last updated at {{ date('g:i a m/d/Y', strtotime($information['submission']->updated_at)) }}. Saved
@else
Never Saved
@endif
Register Solo Participants for {{ $information['activity_program']->name }}
Instructions
Use this form to register your school's contestants for state.
Each student must be registered separately.
Only district qualifiers will appear on this form.
Required fields are noted with a red asterisk*.
Additional instructions and hints are included before each section.
Click Save at any time to save your entries. Every time you save your form, you will receive an e-mail indicating which qualifiers are registered or not.
Note: All registrants must be saved by {{ date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)) }} using this online form.
For questions, contact {{ $information['staff']->first_name }} {{ $information['staff']->last_name }} at (503) 682-6722 x239 or by e-mail to {{ Helpers::obfuscateEmailLink ($information['staff']->email) }}. For technical assistance, you can email {{ Helpers::obfuscateEmailLink ("support@osaa.org") }}.
Spelling corrections for qualifier names can be sent to {{ $information['staff']->first_name }} {{ $information['staff']->last_name }} via {{ Helpers::obfuscateEmailLink ($information['staff']->email) }}.
@else
There are no district qualifiers from {{ $information['activity_program']->name }}.
@endif
{{ Form::close() }}
@else
Missing District Results
The results from the {{ $information['activity_program']->league }} District Contest have not been submitted, yet. The district director must use the results form and supply the state qualifiers before you can register your students for state.