@section('page_title') OSAA - Forms @stop @section('tool_box') @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.edit').button({ icons : { primary : 'ui-icon-pencil'}}); $('.button_set').buttonset(); $('.button_set label').addClass('ui-corner-all'); $('.tooltip').tooltip(); $('.date_picker').datepicker({'dateFormat' : 'mm/dd/yy', 'minDate' : '11/01/13', 'maxDate' : '1/24/14'}); $('[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, '')); }); // 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); }) }); // Color table rows 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(); // Placeholder $('[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(''); } }); }); // Shake action items function shakeActionImages (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); shakeActionImages($(this)); }); } $('img.action_item').each(function() { var img = $(this); shakeActionImages(img); }); @if (Auth::check() and Auth::user()->isOsaaUser()) // Download drop-down menu $('#grabber_list') .menu() .css({'display' : 'none', 'z-index' : '200', 'position' : 'absolute', 'right' : '0', 'top' : '23px', 'margin' : '0', 'padding' : '0', 'width' : '150px'}); $('#grabber_list li ul') .css({'margin' : '0', 'padding' : '0', 'width' : '160px'}); $('#grabber_list img') .css({'position' : 'relative', 'top' : '2px', 'margin-right' : '6px'}); $('.grabber_button') .button({ icons : { secondary : 'ui-icon-triangle-1-s'}}) .css({'float':'right', 'font-size':'8pt'}) .click(function (event) { if ($('#grabber_list').is(':visible')) { $('#grabber_list').slideUp(400); $(this).button({icons : { secondary : 'ui-icon-triangle-1-s'}}); } else { $('#grabber_list').slideDown(400); $(this).button({icons : { secondary : 'ui-icon-triangle-1-n'}}); } }); @endif @if (!is_null($information['submission'])) /* 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 = {{ $information['submission']->id }}; $('*').css({'cursor':'wait'}); var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/forms/activity-program-forms') }}/' + form_id + '/update', data : { 'field' : field, 'value' : value, 'type' : type }, dataType : 'html' }) .done(function(returned_data) { // Success console.log("Successfully saved {'" + form_id + "|" + field + "' : '" + value + "'}"); var info = $.parseJSON(returned_data); $('#updated_at').html(info.updated_at); $('#updated_by').html(info.updated_by); if (info.force_reload) { reload = true; } }) .fail(function(jqXHR, status, error) { // Error var response = jqXHR.responseText; var errorData = $.parseJSON(response); console.log(errorData); alert("There was an error saving this form's data.\n\n" + errorData.error.message + "\n\nPlease try again. Please note, that if you try to reload this page, your unsaved data to be lost."); }) .complete(function () { // Reload if necessary if (reload) { location.reload(); } $('*').css({'cursor':''}); }); } /* updateRosterSize * * Update the size of the number of spaces for the roster participants. */ function updateRosterSize() { var max = $('input[name="sub_division"]:checked').attr('data-max-roster'); if (max < 20) { for (var i = max; i < 20; i++) { //$('#roster tbody tr:nth-child(' + i + ')').hide(); $('input[name="participant[' + i + '][name]"]').parents('tr').hide(); } } else { $('#roster tbody tr').show(); } return; } updateRosterSize(); // Sub-Division option $('input[name="sub_division"]').click(function () { updateRosterSize(); var item = $('input[name="sub_division"]:checked'); var value = item.val(); saveFormData('sub_division', value, 'string', false); }); // Reserve seating option $('input[name="reserve_seating"]').change(function() { var item = $(this); var value = item.is(':checked'); saveFormData('reserve_seating', value, 'bool', false); }); // Reserve room option $('input[name="reserve_room"]').change(function() { var item = $(this); var value = item.is(':checked'); saveFormData('reserve_room', value, 'bool', false); }); // Music agreement option $('input[name="music_agreement"]').change(function() { var item = $(this); var value = item.is(':checked'); saveFormData('music_agreement', value, 'bool', false); }); // Sanctioned competitions option $('select[name^="competition"]').change(function(event) { var item = $(this); var id = item.attr('data-id'); var selected = $(':selected', item); var value = selected.val(); // Ensure the selections are different if not empty if (id == '0') { var other = $('select[name^="competition"][data-id="1"]'); } else { var other = $('select[name^="competition"][data-id="0"]'); } var other_value = $(':selected', other).val(); if (other_value == value && value != '') { alert('The sanctioned competition options must be different.'); item.val($.data(item, 'current')); return false; } saveFormData('competitions[' + id + ']', value, 'int', false); }); // Alternates $('[name^="alternate"]').blur(function(event) { var item = $(this); var id = item.attr('data-id'); var part = item.attr('data-part'); if (part == 'grade') { var selected = $(':selected', item); var grade = selected.val(); var name_field = $('[name^="alternate"][data-part="name"][data-id="' + id + '"'); var name = name_field.val(); } else { var name = item.val(); var grade_field = $('[name^="alternate"][data-part="grade"][data-id="' + id + '"'); var selected = $(':selected', grade_field); var grade = selected.val(); } if (grade == '' || grade == ' ') { grade = null; } if (name == '') { name = ''; } var data = '{"name":"' + name + '","grade":' + grade + '}'; saveFormData('alternates[' + id + ']', data, 'object', false); }); // Do not allow special characters in alternates' names $('input[name^="alternate"][data-part="name"]').bind('input', function() { $(this).val($(this).val().replace(/[^A-Za-z \-'\.]/gi, '')); }); // Choreographers $('input[name^="choreographer"]') .blur(function(event) { var item = $(this); var id = item.attr('data-id'); var value = item.val(); saveFormData('choreographers[' + id + ']', value, 'string', false); }) .bind('input', function() { $(this).val($(this).val().replace(/[^A-Za-z \-'\.]/gi, '')); }); // Routine theme $('input[name="routine_theme"]').blur(function() { var item = $(this); var value = item.val(); saveFormData('routine_theme', value, 'string', false); }); // Participants $('[name^="participant"]') .blur(function(event) { var item = $(this); var field_name = item.attr('name'); var matches = field_name.match(/participant\[([0-9]+)\]\[(.*)\]/); var id = matches[1]; var part = matches[2]; if (part == 'name') { var name_item = item; } else { var name_item = $('input[name="participant[' + id + '][name]"]'); } if (part == 'grade') { var grade_item = item; } else { var grade_item = $('select[name="participant[' + id + '][grade]"]'); } if (part == 'is_captain') { var captain_item = item; } else { var captain_item = $('input[name="participant[' + id + '][is_captain]"]'); } var name = name_item.val(); var grade = $(':selected', grade_item).val(); var is_captain = captain_item.is(':checked'); if (grade == '' || grade == ' ') { grade = 'null'; } if (name == '') { name = 'null'; } else { name = '"' + name + '"'; } if (is_captain) { is_captain = 'true'; } else { is_captain = 'false'; } var data = '{"name":' + name + ',"grade":' + grade + ',"is_captain":' + is_captain + '}'; console.log(data); saveFormData('participants[' + id + ']', data, 'object', false); }); // Do not allow special characters in participant names $('input[name^="participant"]').bind('input', function() { $(this).val($(this).val().replace(/[^A-Za-z \-'\.]/gi, '')); }); // Delete team photo button $('.delete_photo') .button({'icons':{'primary':'ui-icon-trash'}}) .css({'font-size':'8pt'}) .click(function () { $('
') .appendTo('body') .dialog({ modal : true, draggable : false, resizable : false, height : 275, width : 400, title : 'Confirm Team Photo Removal', buttons: [ { text : "Yes", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { var team = {{ $information['team']->id }}; $.ajax({ type : "POST", url : '{{ url('/teams/remove-photo') }}', data : { 'team' : team }, success : function() { location.reload(); } }); $(this).dialog("close"); } }, { text : "No", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { $(this).dialog( "close" ); } }], open : function () { var dialog_object = $(this); dialog_object.html('
Are you sure you want to delete this team photo?

Once you delete this photo, it will no longer exist on our server.
'); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); @if (is_null($information['team_photo'])) $('.delete_photo').button('disable'); @endif // Upload team photo button $('.upload_photo') .button({'icons':{'primary':'ui-icon-plusthick'}}) .css({'font-size':'8pt', 'margin-right':'50px'}) .click(function () { $('
') .appendTo('body') .dialog({ modal : true, draggable : false, resizable : false, height : 500, width : 335, title : 'Upload Team Photo', buttons: [ { text : "Upload", 'class' : "float_left", icons : { primary : 'ui-icon-disk'}, click : function() { var dialog_object = $(this); var form = $('form', dialog_object); $('
') .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-dialog-buttons') .html('
Working...

Please wait, this may take a while to upload and process.
'); form.submit(); } }, { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { var dialog_object = $(this); dialog_object.dialog("close"); } }], open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('teams/' . $information['team']->id . '/upload-photo-form') }}?return_url=forms/registration/che?activity_program={{ $information['activity_program']->id }}', 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 accessing the team photo upload form.\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#preview').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $('#photo') .css({'font-size':'9pt', 'margin-top':'0.5em'}) .change(function() { readURL(this); }); }); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); // Training Course Information $('.cert_info') .css({'vertical-align' : 'middle', 'position' : 'absolute', 'left' : '100px'}) .hover(function () { $(this).css({'cursor' : 'pointer'}); }, function () { $(this).css({'cursor' : ''}); }) .click(function(event) { event.preventDefault(); $('
') .appendTo('body') .dialog( { draggable : true, resizable : false, height : 600, width : 700, modal : false, title : 'Training Course Information', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('help/training-courses?ajax=true') }}', 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(); } }); }); @endif @if (Auth::check() and Auth::user()->isOsaaUser()) $('.edit_form_button') .button({'icons' : {'primary' : 'ui-icon-pencil'}, 'text' : false}) .css({'font-size' : '8pt', 'position' : 'absolute', 'right' : '36px', 'top' : '12px', 'width' : '16px', 'height' : '16px'}) .click(function () { var ap_id = $(this).attr('data-ap-id'); window.location.href = '{{ url('/forms/registration/che') }}?activity_program=' + ap_id; }); $('.drop_form_button') .button({'icons' : {'primary' : 'ui-icon-trash'}, 'text' : false}) .css({'font-size' : '8pt', 'position' : 'absolute', 'right' : '10px', 'top' : '12px', 'width' : '16px', 'height' : '16px'}) .click(function () { var ap_id = $(this).attr('data-ap-id'); var ap_name = $(this).attr('data-ap-name'); $('
') .appendTo('body') .dialog({ modal : true, draggable : false, resizable : false, height : 275, width : 400, title : 'Confirm Team Drop', buttons: [ { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { $(this).dialog( "close" ); } }, { text : "Drop Team", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { $(this).dialog("close"); $('
') .appendTo('body') .dialog({ modal : true, draggable : false, resizable : false, height : 280, width : 425, title : 'Are You Sure?', buttons: [ { text : "No", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { $(this).dialog( "close" ); } }, { text : "Yes", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { $.ajax({ type : "POST", url : '{{ url('/forms/drop-ap-team') }}', data : { 'activity_program' : ap_id, 'activity_form' : {{ $information['activity_form']->id }}}, success : function() { location.reload(); } }); $(this).dialog("close"); } }], open : function () { var dialog_object = $(this); dialog_object.html('
Are you really sure?

Last chance. Are you really, really sure you want to drop ' + ap_name + '.
'); $('.ui-widget-header').css('background', '#f6a828 url(http://download.jqueryui.com/themeroller/images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x').css('border-color', '#f6a828'); $('.ui-widget-content').css('border-color', '#dddddd'); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, show : { effect : "shake", duration : 200}, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } }], open : function () { var dialog_object = $(this); dialog_object.html('
Are you sure you want to drop ' + ap_name + ' from the schedule?

Once you drop this team, it will no longer exist in the database. This procedure cannot be undone.
'); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); @endif @stop @section('page_functions') @if (!is_null($information['activity_program'])) Back @else Close @endif @stop @section('main_content') {{-- Success Bar --}} @if (Session::has('success'))
{{ Session::get('success') }}
@endif @if ($information['is_past_due'] and false)
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['activity_program']))
{{-- Need to select an activity program --}}

Select School


Instructions
  1. Begin by selecting your school from the drop-down list.
  2. Click Next to continue with the selection.
  3. 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 x233 or by e-mail to {{ Helpers::obfuscateEmailLink ($information['staff']->email) }}. For technical assistance, you can email {{ Helpers::obfuscateEmailLink ("support@osaa.org") }}.

Available Schools

{{ Form::open(array('url' => url('/forms/registration/' . strtolower($information['activity']->slug)), 'method' => 'get', 'style' => 'position: relative;')) }} {{ Form::select('activity_program', $information['aps_list'], null, array('style' => 'font-size: 12pt; min-width: 315px;')) }} {{ Form::submit('Next', array('class' => 'button', 'style' => 'font-size: 9pt; margin-left: 30px;')) }} {{ Form::close() }}


@if (Auth::check() and Auth::user()->isOsaaUser())
Print/Download
@endif

Registration Status

The following list shows the registration status for each school. If a school is not listed, it has not started its registration process.

@if (Auth::check() and Auth::user()->isOsaaUser()) @endif @foreach ($information['apfs'] as $apf) @if (Auth::check() and Auth::user()->isOsaaUser()) @endif @endforeach
School Status Head Coach# Participants # Alternates # Coaches Total # PassesPhoto
@if (Auth::user()->isOsaaUser())
@endif {{ $apf->ap_name }}
@if ($apf->registered) Complete @else In Progress @endif @if (!is_null($apf->head_coach)) @if (Auth::check() and Auth::user()->isOsaaUser()) {{ $apf->head_coach->school_staff->getDisplayName() }} @else {{ $apf->head_coach->school_staff->getDisplayName() }} @endif @endif @if($apf->registered) {{ $apf->number_participants }} @else - - @endif @if($apf->registered) {{ $apf->number_alternates }} @else - - @endif @if($apf->registered) {{ $apf->number_coaches }} @else - - @endif @if($apf->registered) {{ $apf->total_passes }} @else - - @endif @if (!is_null($apf->team_photo)) @else @endif

@else {{-- An activity program is selected --}}
Form #{{ $information['submission']->id }}
@if ($information['submission']->data->complete) Complete @else Incomplete @endif
Created
{{ date('g:i a m/d/Y', strtotime($information['submission']->created_at)) }}
@if (!is_null($information['submission']->submitted_at))
Submitted
{{ date('g:i a m/d/Y', strtotime($information['submission']->submitted_at)) }}
@endif
Modified
{{ date('g:i a m/d/Y', strtotime($information['submission']->updated_at)) }}
User
{{ $information['submitter']->getDisplayFullName() }}

{{ $information['activity_program']->name }}


Instructions
  1. Required fields are noted with a red asterisk*.
  2. Changes are automatically saved.
  3. When finished, click Submit to turn in your form with the information provided. A confirmation will be sent to your e-mail address.
  4. You can re-submit this form as many times as needed until the deadline.
  5. 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 x233 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

@endif {{ Form::open(array('url' => url('/forms/submit'), 'method' => 'post', 'class' => 'registration_form')) }} {{ Form::hidden('form', 'REGISTRATION') }} {{ Form::hidden('activity', $information['activity']->slug) }} {{ Form::hidden('activity_program', $information['activity_program']->id) }}

Sub-Division *

Please select one of the applicable sub-divisions your team will compete in.

@foreach ($information['sub_divisions'] as $number => $sd)
data->sub_division, $sd->title)) checked="checked" @endif />
@endforeach



Coaches & Certifications

The following information is provided by your school's Athletic Director or AD Secretary. A Head Coach with an e-mail address and a phone number is required for this form to be submitted. Only one (1) Head Coach will appear in the program with up to four (4) optional Assistant Coaches. To add, modify, or remove information in this table, contact your AD or AD Secretary.

@if (!is_null($information['ap_staff']->coach))
Position Name E-Mail Phone Certifications
Head Coach @if (Helpers::strEqual($information['ap_staff']->coach->certification_status, 'OK')) @elseif (Helpers::strEqual($information['ap_staff']->coach->certification_status, 'WARNING')) @else @endif {{ $information['ap_staff']->coach->school_staff->getDisplayName() }} {{ $information['ap_staff']->coach->school_staff->email }} @if (!is_null($information['ap_staff']->coach->school_staff->work_phone)) W: {{ $information['ap_staff']->coach->school_staff->getDisplayPhone('WORK') }} @if (!is_null($information['ap_staff']->coach->school_staff->mobile_phone))
@endif @endif @if (!is_null($information['ap_staff']->coach->school_staff->mobile_phone)) M: {{ $information['ap_staff']->coach->school_staff->getDisplayPhone('MOBILE') }} @endif
@foreach ($information['ap_staff']->coach->certs as $cert)
Fatal error: Cannot break/continue 1 level in /home/osaa/web_app/dev/app/views/forms/che_registration.blade.php on line 1424