').appendTo('body')
.attr('data-sending', 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 ui-di buttons')
.html('
Updating...

Please wait while your school\'s preferences are saved...
');
// Execute the toggle
var jqxhr = $.ajax(
{
type : 'POST',
url : '/schools/{{ $info['school']->id }}/update-preferences',
data : { 'preference' : 'school_staff_certification_alerts',
'property' : 'is_enabled',
'type' : 'BOOL',
'value' : status,
'school_id' : {{ $info['school']->id }} },
dataType : 'html'
})
.done(function (data)
{
if (status == 1)
{
link.html('Turn alerts off');
link.attr('data-status', 0);
$('.schedule_alert').html('
Next scheduled alert: ' + $('.schedule_alert').attr('data-schedule') + '');
}
else
{
link.html('Turn alerts on');
link.attr('data-status', 1);
$('.schedule_alert').html('
Alerts are turned off.');
}
})
.fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
//console.log(errorData);
alert("There was an error while trying to toggle the alert status.\n\n" + errorData.error.message + "\n\nThis page will be reloaded.");
location.reload();
})
.complete(function ()
{
$('[data-sending]').remove();
dialog_object.dialog("close");
});
}
},
{
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);
if (status == 0)
{
dialog_object.html('
Are you sure you want to turn OFF staff certification alerts?
Your school will not be sent any certification alerts. You can turn alerts back ON from this window in the future.
');
}
else
{
dialog_object.html('
Are you sure you want to turn ON staff certification alerts?
You can turn alerts ON/OFF from this window in the future.
');
}
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
$('.data_confirm .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');
$('.data_confirm .ui-widget-content').css('border-color', '#dddddd').css('font-size', '10pt');
$('[data-autofocus="true"]').focus();
},
close : function ()
{
var dialog_object = $(this);
$(dialog_object).remove();
}
});
});
$('.demand_button')
.button()
.click(function()
{
var button = $(this);
$('
')
.attr('data-sending', 1)
.addClass('ui-widget-overlay ui-front')
.appendTo('body');
$('
').appendTo('body')
.attr('data-sending', 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 ui-di buttons')
.html('
Sending...

Please wait while an e-mail is generated...
');
var url = button.attr('data-href');
// Execute link
var jqxhr = $.ajax(
{
type : 'GET',
url : url,
dataType : 'html'
})
.done(function (data)
{
if (data == 'success')
{
$('[data-sending]').remove();
$('.demand_status').html('An e-mail was successfully sent.').fadeIn();
$('.demand_button').button("disable");
}
else
{
alert("There was an error while trying to send the e-mail.\n\n" + data + "\n\nThis page will be reloaded.");
location.reload();
}
})
.fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
//console.log(errorData);
alert("There was an error while trying to send the e-mail.\n\n" + errorData.error.message + "\n\nThis page will be reloaded.");
location.reload();
});
});
});
}
});
});
// Group Functions
$('#content .group')
.addClass('ui-corner-all')
.each(function ()
{
$('.staff:odd', $(this)).css('background-color', '#dedede');
});
$('#content .group .title')
.click(function ()
{
var collapse = '{{ asset('/images/icons/bullet_arrow_right.png') }}';
var expand = '{{ asset('/images/icons/bullet_arrow_down.png') }}';
var group = $(this).parents('.group');
var view_state = $('.view_state', $(group));
if ($(view_state).attr('data-state') == 'expand')
{
$(view_state)
.css({'background-image' : 'url(' + collapse + ')'})
.attr('data-state', 'collapse');
$(group).css('height', '1.25em');
}
else
{
$(view_state)
.css({'background-image' : 'url(' + expand + ')'})
.attr('data-state', 'expand');
$(group).css('height', 'auto');
}
})
.hover(function()
{
$(this).css('cursor', 'pointer');
}, function ()
{
$(this).css('cursor', 'auto');
});
// Table row highlighter
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();
// 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);
})
});
$('#training_course_help')
.click(function(event)
{
event.preventDefault();
$('
')
.appendTo('body')
.dialog(
{
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 : 'http://www.osaa.org/help/training-courses?ajax=true',
dataType : 'html'
})
.done(function (data)
{
dialog_object.html(data);
}).fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
console.log(errorData);
dialog_object.html('
' + errorData.error.type + '
' + errorData.error.message + '
Line ' + errorData.error.line + ' in ' + errorData.error.file);
if (dialog_object.html() == '')
{
dialog_object.html('There was an error.');
}
});
}
});
});
$('.edit_staff_button')
.button({ text : false,
icons : { primary : 'ui-icon-pencil'}})
.css({'width' : '16px',
'height' : '16px',
'position' : 'absolute',
'right' : '10px',
'top' : '0'})
.tooltip()
.click(function ()
{
var button_obj = $(this);
var ap_staff_id = $(button_obj).attr('data-ap-staff-id');
$('')
.appendTo('body')
.dialog(
{
resizable: false,
height: 560,
width: 725,
modal: true,
title: 'Edit Contact Information',
buttons: [
{
text : "Save Changes",
'class' : "float_left",
icons : { primary : 'ui-icon-disk'},
click : function()
{
$('form', $(this)).submit();
$(this).dialog("close");
return true;
}
},
{
text : "Replace this Person",
'class' : "float_left",
'style' : "margin-left: 35px;",
icons : { primary : 'ui-icon-closethick'},
click : function()
{
// Confirm the user's choice
var result = confirm("Are you sure you want to retire this current person's contact information?\n\nThis will remove the person from his/her current position. Once this person is removed, you will be able to add a new staff contact as a replacement.");
if (result == true)
{
// Create a flag to retire this staff
var input = $('')
.attr('type', 'hidden')
.attr('name', 'replace')
.val('true');
// Append the flag to the form submission
$('form', $(this)).append($(input));
// Submit the form
$('form', $(this)).submit();
$(this).dialog("close");
return true;
}
else
{
return false;
}
}
},
{
text : "Cancel",
'class' : "float_right",
'autofocus' : true,
icons : { primary : 'ui-icon-cancel'},
click : function()
{
$(this).dialog( "close" );
$(this).remove();
return false;
}
}
],
open : function ()
{
var dialog_object = $(this);
dialog_object.html("");
var jqxhr = $.ajax({
type : 'GET',
url : 'http://www.osaa.org/schools/activity-staff/' + ap_staff_id + '/edit',
dataType : 'html'
})
.done(function (data)
{
dialog_object.html(data);
}).fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
console.log(errorData);
dialog_object.html('' + errorData.error.type + '
' + errorData.error.message + '
Line ' + errorData.error.line + ' in ' + errorData.error.file);
if (dialog_object.html() == '')
{
dialog_object.html('There was an error.');
}
});
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
$(this).parent().find('[autofocus]').focus();
}
});
});
$('.course_record')
.hover(function()
{
$(this).css({'border-color' : '#ff0000',
'cursor' : 'pointer'});
},
function ()
{
$(this).css({'border-color' : 'transparent',
'cursor' : 'auto'});
})
.click(function ()
{
var button_obj = $(this);
var record_id = $(button_obj).attr('data-record-id');
var staff_id = $(button_obj).attr('data-staff-id');
var course_slug = $(button_obj).attr('data-course-slug');
$('')
.appendTo('body')
.dialog(
{
resizable: false,
height: 525,
width: 700,
modal: true,
title: 'Edit Training Course Record',
buttons: [
{
text : "Save Changes",
'class' : "float_left",
icons : { primary : 'ui-icon-disk'},
click : function()
{
var completion_date = $('input[name="completion_date"]').val();
if (completion_date == '')
{
alert('You must provide a completion date in MM/DD/YYYY format.');
return false;
}
$('form', $(this)).submit();
$(this).dialog("close");
return true;
}
},
{
text : "Remove Certification Record",
'class' : "float_left",
'style' : "margin-left: 35px;",
icons : { primary : 'ui-icon-closethick'},
click : function()
{
// Confirm the user's choice
var result = confirm("Are you sure you want to remove this training course certification record?");
if (result == true)
{
// Create a flag to retire this staff
var input = $('')
.attr('type', 'hidden')
.attr('name', 'remove')
.val('true');
// Append the flag to the form submission
$('form', $(this)).append($(input));
// Submit the form
$('form', $(this)).submit();
$(this).dialog("close");
return true;
}
else
{
return false;
}
}
},
{
text : "Cancel",
'class' : "float_right",
'autofocus' : true,
icons : { primary : 'ui-icon-cancel'},
click : function()
{
$(this).dialog( "close" );
$(this).remove();
return false;
}
}
],
open : function ()
{
var dialog_object = $(this);
dialog_object.html("");
var jqxhr = $.ajax({
type : 'GET',
url : 'http://www.osaa.org/schools/course-records/edit',
data : { 'record_id' : record_id,
'staff_id' : staff_id,
'course_slug' : course_slug},
dataType : 'html'
})
.done(function (data)
{
dialog_object.html(data);
$('input[data-datepicker="true"]', dialog_object)
.datepicker({dateFormat : 'm/d/yy',changeYear:true});
}).fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
console.log(errorData);
dialog_object.html('' + errorData.error.type + '
' + errorData.error.message + '
Line ' + errorData.error.line + ' in ' + errorData.error.file);
if (dialog_object.html() == '')
{
dialog_object.html('There was an error.');
}
});
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
$(this).parent().find('[autofocus]').focus();
}
});
});
// Add New Staff Button
$('.add_new')
.button({ 'icons' : { 'primary' : ' ui-icon-plusthick'}})
.css({ 'font-size' : '8pt', 'margin-right' : '10px' })
.click(function ()
{
var button_obj = $(this);
var school_id = $(button_obj).attr('data-school-id');
$('')
.appendTo('body')
.dialog(
{
resizable: false,
height: 525,
width: 700,
modal: true,
title: 'Add New Staff',
buttons: [
{
text : "Save Changes",
'class' : "float_left",
icons : { primary : 'ui-icon-disk'},
click : function()
{
if ($('select[name="school_staff_list"]').val() == '')
{
var name_prefix = ($('input[name="name_prefix"]').val()).trim();
var first_name = ($('input[name="first_name"]').val()).trim();
var middle_name = ($('input[name="middle_name"]').val()).trim();
var last_name = ($('input[name="last_name"]').val()).trim();
var name_suffix = ($('input[name="name_suffix"]').val()).trim();
var name = '';
if (name_prefix != '')
{
name = name_prefix + ' ';
}
name = name + first_name + ' ';
if (middle_name != '')
{
name = name + middle_name + ' ';
}
name = name + last_name;
if (name_suffix != '')
{
name = name + ' ' + name_suffix;
}
// Confirm the user's choice
var result = confirm("Are you sure you want to create a new contact with this name?\n\n" + name + "\n\nOnce you create this contact, the name cannot be changed.");
}
else
{
var result = true;
}
if (result == true)
{
$('form', $(this)).submit();
$(this).dialog("close");
return true;
}
else
{
return false;
}
}
},
{
text : "Cancel",
'class' : "float_right",
'autofocus' : true,
icons : { primary : 'ui-icon-cancel'},
click : function()
{
$(this).dialog( "close" );
$(this).remove();
return false;
}
}
],
open : function ()
{
var dialog_object = $(this);
dialog_object.html("");
var jqxhr = $.ajax({
type : 'GET',
url : 'http://www.osaa.org/schools/' + school_id + '/activity-staff/new',
dataType : 'html'
})
.done(function (data)
{
dialog_object.html(data);
// DEBUG
//console.log(staff_info);
function nameSelect(id)
{
if (id == 'RESET')
{
// Clear out any residual staff information
$('input[name="name_prefix"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('input[name="first_name"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('input[name="middle_name"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('input[name="last_name"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('input[name="name_suffix"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('select[name="staff_type"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('disabled');
$('input[name="email"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('input[name="work_phone"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
$('input[name="mobile_phone"]')
.val('')
.css({'color' : '#000000'})
.removeAttr('readonly');
}
else
{
// Find this staff's information
var staff = null;
for (var i = 0; i < staff_info.length; i++)
{
if (staff_info[i].id == id)
{
var staff = staff_info[i];
}
}
// DEBUG
//console.log(staff);
// Ensure a staff was found
if (staff != null)
{
// Load this staff's information
$('input[name="name_prefix"]')
.val(staff.name_prefix)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('input[name="first_name"]')
.val(staff.first_name)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('input[name="middle_name"]')
.val(staff.middle_name)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('input[name="last_name"]')
.val(staff.last_name)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('input[name="name_suffix"]')
.val(staff.name_suffix)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('select[name="staff_type"]')
.val(staff.staff_type)
.css({'color' : '#7d7b7d'})
.attr('disabled', 'disabled');
$('input[name="email"]')
.val(staff.email)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('input[name="work_phone"]')
.val(staff.work_phone)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
$('input[name="mobile_phone"]')
.val(staff.mobile_phone)
.css({'color' : '#7d7b7d'})
.attr('readonly', 'readonly');
}
}
}
$('.clear_existing_staff_info')
.button()
.css({'font-size':'8pt'})
.click(function ()
{
$('select[name="school_staff_list"]').val('');
nameSelect('RESET');
});
$('.clear_existing_staff_info').button('disable');
$('select[name="school_staff_list"]').on('change', function ()
{
if ($(this).val() != '')
{
$('.clear_existing_staff_info').button('enable');
nameSelect($(this).val());
}
else
{
$('.clear_existing_staff_info').button('disable');
nameSelect('RESET');
}
});
}).fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
console.log(errorData);
dialog_object.html('' + errorData.error.type + '
' + errorData.error.message + '
Line ' + errorData.error.line + ' in ' + errorData.error.file);
if (dialog_object.html() == '')
{
dialog_object.html('There was an error.');
}
});
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
$(this).parent().find('[autofocus]').focus();
}
});
});
@stop
@section('page_functions')
Download
Help
Close
@stop
@section('main_content')
{{-- Success Bar --}}
@if (Session::has('success'))
{{ Session::get('success') }}
@endif
Not publicly visible information
Publicly visible Information
{{-- Expand/Collapse All Buttons --}}
Add New Staff
Expand All
Collapse All
Alerts
@if (count($info['ad_staff_objects']) > 0)
Athletic Director
@foreach ($info['ad_staff_objects'] as $staff)
Athletic
Director
{{ $staff->school_staff->getDisplayName() }}
Fatal error: Class 'Helpers' not found in /home/osaa/web_app/dev/app/views/schools/manage_staff_OLD.blade.php on line 1138