');
},
close : function ()
{
var dialog_object = $(this);
$(dialog_object).remove();
}
});
}
{{-- League specific form scripts --}}
@if (!is_null($information['submission']))
// Reset form button
$('.reset_form')
.button({'icons' : {'primary' : 'ui-icon-trash'}})
.css({'font-size' : '9pt'})
.click(function(event)
{
event.preventDefault();
// Get the form ID (same across all pages for this form)
var form_id = {{ $information['submission']->id }};
$('')
.appendTo('body')
.dialog(
{
draggable : false,
resizable : false,
modal : true,
height : 275,
width : 400,
title : 'Confirmation',
buttons: [
{
text : "Yes",
'class' : "float_left",
icons : { primary : 'ui-icon-check'},
click : function()
{
$('*').css({'cursor':'wait'});
var jqxhr = $.ajax(
{
type : 'POST',
url : '{{ url('/forms/league-forms/') }}/' + form_id + '/delete',
data : { 'form' : form_id},
dataType : 'html'
})
.done(function(returned_data)
{
// Success
})
.fail(function(jqXHR, status, error)
{
// Error
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
console.log(errorData);
alert("There was an error deleting this form's data.\n\n" + errorData.error.message + "\n\nThis page will be reloaded.");
})
.complete(function ()
{
location.reload();
});
}
},
{
text : "No",
'class' : "float_right",
'data-autofocus' : "true",
icons : { primary : 'ui-icon-close'},
click : function()
{
// Close the dialog box
$(this).dialog("close");
}
}
],
open : function ()
{
var dialog_object = $(this);
dialog_object.html(' Are you sure you want to reset this form and clear out all of the entered data?
This will delete all entries and start the form from scratch.
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);
$(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 = {{ $information['submission']->id }};
$('*').css({'cursor':'wait'});
var jqxhr = $.ajax(
{
type : 'POST',
url : '{{ url('/forms/league-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 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', function (event)
{
autoSaveTextField ($(this));
});
$('textarea[data-autosave]').on('change blur autocompletechange', 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
{{-- Landing page, scripts for the league selection and ASI form --}}
@if (is_null($information['league']))
/* 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' : 'BTN', '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;
}
});
{{-- Access to ASI form is allowed --}}
@if (Helpers::strEqual($information['user_status'], 'OK'))
// View/Edit button
$('.view_edit_qualifier')
.css({'font-size' : '9pt',
'margin-top' : '1.5em'})
.button()
.click(function(event)
{
var button = $(this);
var option = $('#qualifier option:selected');
// Get the qualifier's data into an object payload
var data = {
league_form : parseInt($(option).attr('data-league-form')),
sub_division : $(option).attr('data-sub-division'),
index : parseInt($(option).val()),
name : ($(option).text()).trim(),
ap_id : parseInt($(option).attr('data-ap')),
ap_verify_id : parseInt($(option).attr('data-ap-verify')),
ap_access : parseInt($(option).attr('data-ap-access'))
};
var load_url = '{{ url('forms/league-forms') }}/' + data.league_form + '/tennis-qualifiers/' + data.sub_division + '/' + data.index + '/edit-asi';
$('')
.appendTo('body')
.dialog(
{
modal : true,
draggable : true,
resizable : false,
height : 700,
width : 725,
title : 'View/Edit Additional Seeding Information',
buttons: [{
text : "Save",
'class' : "float_left",
icons : { primary : 'ui-icon-disk'},
click : function()
{
var dialog_object = $(this);
var form = $('form', dialog_object);
$('
');
form.submit();
return;
}
},
{
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);
// Show the loading image
dialog_object.html("");
// Disable dialog buttons
$('.ui-dialog-buttonset button').button('disable');
// Get the AJAX form
var jqxhr = $.ajax(
{
type : 'GET',
url : load_url,
dataType : 'html'
})
.done(function (returned_data)
{
dialog_object.html(returned_data);
// Enable dialog buttons
$('.ui-dialog-buttonset button').button('enable');
// Verify qualifier information
var verify = {
ap_id : parseInt($('div.asi_dialog', dialog_object).attr('data-ap-id')),
ap_verify_id : parseInt($('div.asi_dialog', dialog_object).attr('data-ap-verify-id')),
index : parseInt($('div.asi_dialog', dialog_object).attr('data-index')),
name : $('div.asi_dialog', dialog_object).attr('data-name-verification'),
league_form : parseInt($('div.asi_dialog', dialog_object).attr('data-form-id')),
sub_division : $('div.asi_dialog', dialog_object).attr('data-sub-division')
};
// Debug
console.log(data);
console.log(verify);
var errors = [];
// Ensure values match
if (data.ap_id !== verify.ap_id)
{
errors.push("Activity program ID number mismatch");
}
if (data.ap_verify_id !== verify.ap_verify_id)
{
errors.push("Activity program ID number verification failure");
}
if (data.index !== verify.index)
{
errors.push("Array index mismatch");
}
if (data.league_form !== verify.league_form)
{
errors.push("League form ID number mismatch");
}
if (data.name.localeCompare(verify.name) !== 0)
{
errors.push("Qualifier name mismatch");
}
// Abort on errors
if (errors.length > 0)
{
dialog_object.remove();
$('
').addClass('ui-widget-overlay ui-front').appendTo('body');
var error_message = "There were verification errors when loading the selected qualifier: ";
for (var i = 0; i < errors.length; i++)
{
error_message += "\n - " + errors[i];
}
error_message += "\n\nThis page will reload.";
alert(error_message);
location.reload();
return false;
}
// Get the min and max match dates
var min = $('div.asi_dialog', dialog_object).attr('data-date-min');
var max = $('div.asi_dialog', dialog_object).attr('data-date-max');
// Setup ASI form behavior
$('.matches input[data-format="datepicker"]', dialog_object)
.datepicker({'dateFormat' : 'mm/dd/yy', 'minDate' : min, 'maxDate' : max});
// Limit input to numbers only
$('[data-format="numbers_only"]', dialog_object).bind('input', function()
{
$(this).val($(this).val().replace(/[^0-9]/gi, ''));
});
// Custom label behavior
$('[data-for]', dialog_object)
.css({'cursor' : 'default'})
.click(function(event)
{
var target_selector = $(this).attr('data-for');
var target = $('[name="' + target_selector + '"]');
target.focus();
});
// Add a match row
$('.add_match_row')
.css({'font-size' : '8pt', 'margin-top' : '0.5em'})
.button({'icons':{'primary' : ' ui-icon-plusthick'}})
.click(function()
{
var table = $('.matches', dialog_object);
var row = $('
');
// Add a date picker
var dp = $('');
$(dp).datepicker({'dateFormat' : 'mm/dd/yy', 'minDate' : min, 'maxDate' : max});
$('td:eq(0)', row).html(dp);
// Add an opponent text field
var op = $('');
$('td:eq(1)', row).html(op);
// Add a match type drop down
var mt = $('');
$('td:eq(2)', row).html(mt);
// Add a score text field
var ms = $('');
$('td:eq(3)', row).html(ms);
// Add a result drop down
var mr = $('');
$('td:eq(4)', row).html(mr);
// Add this new row to the table
row.appendTo(table);
});
})
.fail(function (jqXHR, status, error)
{
// There was an error
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
//console.log(errorData);
alert("There was an error loading the required information.\n\n" + errorData.error.message + "\n\nThis page will reload.");
location.reload();
})
.complete(function ()
{
// Form logic bindings
});
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
},
close : function ()
{
var dialog_object = $(this);
$(dialog_object).remove();
}
});
});
@endif
@endif
@if (Auth::check() and Auth::user()->isOsaaUser())
/* Enable the next button */
$('#select_league_form input[type="submit"]').button('enable')
.removeClass('ui-state-error');
$('.button.entries').click(function ()
{
window.open('{{ url('/reports/tn-entries/csv') }}');
});
$('.button.sheets').click(function ()
{
window.open('{{ url('/reports/tn-entries/sheets') }}');
});
$('.button.populate')
.click(function ()
{
$('')
.appendTo('body')
.html(' Are you sure you want to reset all {{ (Session::get('year') + 1) }} tennis brackets and re-populate the database?
This will clear the database of all existing tennis participants for the current school year, erasing any existing bracket placements.
Note: This cannot be undone. Choose wisely.
This procedure should only be executed once, after all entries have been submitted and before placing any participants onto a tennis bracket.
Please wait, this may take a while to process and update the database.
');
var jqxhr = $.ajax(
{
type : 'GET',
url : '/brackets/populate-tennis-participants',
dataType : 'html',
error : function ()
{
alert('There was an error populating the database. The procedure was unexpectedly interrupted.');
},
success : function (data)
{
alert('Database was successfully populated with ' + data + ' participants.');
},
complete : function ()
{
$('#waiting').remove();
$('#shadow').remove();
}
});
$(this).dialog("close");
$(this).remove();
}
},
{
text : "No",
'class' : "float_right",
'autofocus' : true,
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');
}
});
});
@endif
@stop
@section('page_functions')
@if (!is_null($information['league']))
Back
@if (Helpers::strEqual($information['activity']->slug, 'BTN'))
Switch to Girls
@else
Switch to Boys
@endif
Reset Form
@else
@if (Helpers::strEqual($information['activity']->slug, 'BTN'))
Switch to Girls
@else
Switch to Boys
@endif
Close
@endif
@stop
@section('main_content')
@if (Session::has('success'))
{{ Session::get('success') }}
@endif
@if ($information['is_past_due'])
District tournament results were due by {{ date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)) }}.
@endif
{{-- Need to select a league --}}
@if (is_null($information['league']))
{{-- Results Form for DMDs --}}
District Tournament Results
This form is for District Directors to submit district tournament results and name state qualifying participants.
Instructions
Select the league or special district from the drop-down list.
Type in the password provided by the OSAA.
Click Next to continue with submitting entries.
You can switch to the
@if (Helpers::strEqual($information['activity']->slug, 'BTN'))
Girls
@else
Boys
@endif
Tennis form by clicking the Switch to
@if (Helpers::strEqual($information['activity']->slug, 'BTN'))
Girls
@else
Boys
@endif
button at the top of the page.
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") }}.
{{ Helpers::getActivityName($information['activity']->slug) }} Leagues & Special Districts
Your account is not linked to any tennis program so you will not be able to access this form.
Click here to link your account to a new school/role for tennis.
For additional assistance with OSAA website accounts, please refer to the OSAA Help page.
@elseif (Helpers::strEqual($information['user_status'], 'NO QUALIFIERS'))
No participants from your school have been submitted as state qualifiers. You must wait for your league or special district results to be submitted before accessing this form.
Click the View/Edit button to add or modify additional seeding information for the selected participant.
@endif
You can switch to the
@if (Helpers::strEqual($information['activity']->slug, 'BTN'))
Girls
@else
Boys
@endif
Tennis form by clicking the Switch to
@if (Helpers::strEqual($information['activity']->slug, 'BTN'))
Girls
@else
Boys
@endif
button at the top of the page.
Note: All additional seeding information must be submitted by 11:59 PM {{ date('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") }}.
There was an error; unable to save ASI data:
{{ Session::get('asi_error_message') }}
@endif
It is the responsibility of the coach to ensure that the OSAA receives any additional seeding information using this online form. The OSAA and the seeding committee will not be held accountable for not seeding a participant for whom additional information has not been supplied beyond the published league or special district results. Only this online form will be used to accept additional seeding information.
@else
{{-- A League is selected --}}
Fatal error: Class 'Helpers' not found in /home/osaa/web_app/dev/app/views/forms/tn_registration.blade.php on line 1369