@section('page_title') OSAA - OWWMP BIA @stop @section('page_sub_title') Edit OWWMP BIA Assessment Reconciliation Report Form @stop @section('scripts') @parent @stop @section('jquery_init') // 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); }) }); // Placeholder functionality $('[data-placeholder]').focus(function() { var input = $(this); if (input.val() == input.attr('data-placeholder')) { input.val(''); input.removeClass('placeholder'); } }).blur(function() { var input = $(this); if (input.val() == '' || input.val() == input.attr('data-placeholder')) { input.addClass('placeholder'); input.val(input.attr('data-placeholder')); } }).blur(); $('[data-placeholder]').parents('form').submit(function() { $(this).find('[data-placeholder]').each(function() { var input = $(this); if (input.val() == input.attr('data-placeholder')) { input.val(''); } }) }); // Table row highlighter function colorRows () { $('table').each(function () { var i = 0; $('tbody tr', $(this)).each(function () { if (i % 2 == 1) { $(this).addClass('odd'); } else { $(this).removeClass('odd'); } i = i + 1; }); }); } colorRows(); // Close button $('.close_button') .button({'icons':{'primary':' ui-icon-circle-close'}}) .css({'font-size':'9pt'}) .click(function(event) { @if (Input::has('admin')) window.location = '{{ url('/forms/bia/admin') }}'; return false; @endif event.preventDefault(); var link = $(this); var href = link.attr('href'); $('
') .appendTo('body') .dialog( { draggable : true, resizable : false, modal : true, height : 250, width : 400, title : 'Confirmation', buttons: [ { text : "Yes", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { window.location = href; } }, { 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 close this form and return to your BIA Assessor Dashboard?
Your changes are automatically saved. You can return to this form at any time.
'); $('.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); record.css({'background-color':original_background_color}); $(dialog_object).remove(); } }); }); // Help button $('.help_button') .button({'icons':{'primary':'ui-icon-help'}}) .css({'font-size':'9pt', 'margin-right':'10px'}) .click(function(event) { event.preventDefault(); $('
') .appendTo('body') .dialog( { draggable : true, resizable : true, height : 725, minHeight : 400, width : 615, minWidth : 330, modal : false, title : 'Assessment Reconciliation Report Form Help', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/bia/help') }}', 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(); } }); }); // Submit button $('input[type="submit"]') .button() .click(function(event) { event.preventDefault(); var button = $(this); var form = button.parents('form'); $('
') .appendTo('body') .dialog( { draggable : false, resizable : false, modal : true, height : 350, width : 500, title : 'Submit Confirmation', buttons: [ { text : "Yes, I Confirm", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { form.submit(); } }, { 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('
By submitting this form, you verify that all assessments have been completed using the standard protocol outlined in the Oregon Wrestling Weight Monitoring Program guidelines.

You also assert that the results of these assessments for each wrestler have been entered into the NWCA OPC powered by TrackWreslting within 48 hours of assessment.

Please confirm these statements?'); $('.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); record.css({'background-color':original_background_color}); $(dialog_object).remove(); } }); }); @if (count($info['assessments']) == 0) $('input[type="submit"]') .button("disable"); @endif // Edit assessor information button $('.edit_assessor_info') .button({'icons':{'primary':' ui-icon-pencil'}}) .css({'font-size' : '9pt', 'margin' : '0.5em 0 1em 0'}) .click(function(event) { var button = $(this); $('
') .appendTo('body') .dialog( { modal : false, draggable : true, resizable : false, title : 'Edit Information', height : 475, width : 625, buttons: [ { text : "Save", 'class' : "float_left", icons : { primary : 'ui-icon-disk'}, click : function() { var dialog_object = $(this); var form = $('form', dialog_object); $(form).submit(); } }, { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); $(this).remove(); } } ], open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/bia') }}/{{ $info['form']->id }}/edit-assessor', 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 loading the required data.\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { // Integer only fields $('input[data-numbers-only="integer"]', dialog_object).bind('input', function() { $(this).val($(this).val().replace(/[^0-9]/gi, '')); }); // Float only fields $('input[data-numbers-only="float"]', dialog_object).bind('input', function() { $(this).val($(this).val().replace(/[^0-9|\.]/gi, '')); }); // Limits $('select[name="type"]', dialog_object).change(function () { var selected = $('option:selected', $(this)).val(); var limit; if (selected == 'home') { limit = "4.50"; } else { limit = "5.50"; } $('[name="limit"]').text(limit); updateCostAmount(); }); // Update total amount function updateTotalAmount() { var assesses = parseInt($('input[name="assesses"]', dialog_object).val()); if (isNaN(assesses)) { assesses = 0; } var cost = parseFloat($('input[name="cost"]', dialog_object).val()); if (isNaN(cost)) { cost = 0; } var mileage = parseFloat($('input[name="mileage"]', dialog_object).val()); if (isNaN(mileage)) { mileage = 0; } var total = (assesses * cost) + mileage; $('input[name="total"]').val(total.toFixed(2)); } // Update total assessments function updateTotalAssess() { var passed = parseInt($('input[name="passed"]', dialog_object).val()); if (isNaN(passed)) { passed = 0; } var failed = parseInt($('input[name="failed"]', dialog_object).val()); if (isNaN(failed)) { failed = 0; } var assesses = passed + failed; $('input[name="assesses"]', dialog_object).val(assesses); updateTotalAmount(); } $('input[name="passed"], input[name="failed"]', dialog_object).bind('input', function () { updateTotalAssess(); }); function updateCostAmount() { var cost_field = $('input[name="cost"]', dialog_object); var limit = parseFloat($('[name="limit"]').text()); if (isNaN(limit)) { alert("An error was encountered, the limit could not be determined."); } var cost = parseFloat(cost_field.val()); if (!isNaN(cost)) { if (cost > limit) { cost = limit; cost_field.val(cost.toFixed(2)); } } updateTotalAmount(); } // Limit cost to predefined limit $('input[name="cost"]', dialog_object).bind('input', function () { updateCostAmount(); }); $('input[name="mileage"]', dialog_object).bind('input', function () { updateTotalAmount(); }); }); $('.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(); } }); }); // Add assessment $('.add_assessment') .button({'icons':{'primary':' ui-icon-plusthick'}}) .css({'font-size' : '9pt', 'margin' : '0.5em 0 1em 0'}) .click(function(event) { var button = $(this); $('
') .appendTo('body') .dialog( { modal : false, draggable : true, resizable : false, title : 'Add New Assessment Record', height : 550, width : 625, buttons: [ { text : "Add", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { var dialog_object = $(this); var form = $('form', dialog_object); $(form).submit(); } }, { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); $(this).remove(); } } ], open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/bia') }}/{{ $info['form']->id }}/add-assessment', 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 loading the required data.\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { // Integer only fields $('input[data-numbers-only="integer"]', dialog_object).bind('input', function() { $(this).val($(this).val().replace(/[^0-9]/gi, '')); }); // Float only fields $('input[data-numbers-only="float"]', dialog_object).bind('input', function() { $(this).val($(this).val().replace(/[^0-9|\.]/gi, '')); }); // Limits $('select[name="type"]', dialog_object).change(function () { var selected = $('option:selected', $(this)).val(); var limit; if (selected == 'home') { limit = "4.50"; } else { limit = "5.50"; } $('[name="limit"]').text(limit); updateCostAmount(); }); // Update total amount function updateTotalAmount() { var assesses = parseInt($('input[name="assesses"]', dialog_object).val()); if (isNaN(assesses)) { assesses = 0; } var cost = parseFloat($('input[name="cost"]', dialog_object).val()); if (isNaN(cost)) { cost = 0; } var mileage = parseFloat($('input[name="mileage"]', dialog_object).val()); if (isNaN(mileage)) { mileage = 0; } var total = (assesses * cost) + mileage; $('input[name="total"]').val(total.toFixed(2)); } // Update total assessments function updateTotalAssess() { var passed = parseInt($('input[name="passed"]', dialog_object).val()); if (isNaN(passed)) { passed = 0; } var failed = parseInt($('input[name="failed"]', dialog_object).val()); if (isNaN(failed)) { failed = 0; } var assesses = passed + failed; $('input[name="assesses"]', dialog_object).val(assesses); updateTotalAmount(); } $('input[name="passed"], input[name="failed"]', dialog_object).bind('input', function () { updateTotalAssess(); }); function updateCostAmount() { var cost_field = $('input[name="cost"]', dialog_object); var limit = parseFloat($('[name="limit"]').text()); if (isNaN(limit)) { alert("An error was encountered, the limit could not be determined."); } var cost = parseFloat(cost_field.val()); if (!isNaN(cost)) { if (cost > limit) { cost = limit; cost_field.val(cost.toFixed(2)); } } updateTotalAmount(); } // Limit cost to predefined limit $('input[name="cost"]', dialog_object).bind('input', function () { updateCostAmount(); }); $('input[name="mileage"]', dialog_object).bind('input', function () { updateTotalAmount(); }); }); $('.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(); } }); }); // Delete assessment button $('.delete_assessment_record') .button({'text' : false, 'icons' : { 'primary' : 'ui-icon-trash'}}) .css({'width' : '16px', 'height' : '16px'}) .click(function() { var button = $(this); var record = button.parents('tr'); var original_background_color = record.css('background-color'); var index = button.attr('data-index'); record.css({'background-color':'yellow'}); console.log(index); $('
') .appendTo('body') .dialog( { draggable : true, resizable : false, modal : true, height : 200, width : 400, title : 'Confirm Assessment Record Deletion', buttons: [ { text : "Delete", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { var data = { index : index }; // Submit the change var jqxhr = $.ajax( { type : 'POST', url : '{{ url('forms/bia') }}/{{ $info['form']->id }}/delete-assessment', data : data, dataType : 'html' }) .done(function (data) { console.log('Deletion was successful.'); // Reload of refresh is specified location.reload(); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); console.log(errorData); alert ("There was an error deleting that assessment record.\n\nThis page will be reloaded."); location.reload(); }); } }, { 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); dialog_object.html('
Are you sure you want to delete this assessment record?'); $('.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); record.css({'background-color':original_background_color}); $(dialog_object).remove(); } }); }); @stop @section('page_functions') Help Close @stop @section('main_content') {{-- Success Bar --}} @if (Session::has('success'))
{{ Session::get('success') }}
@endif {{-- Errors --}} @if (Session::has('errors'))
@foreach ($errors->all() as $error) {{ $error }} @endforeach
@endif {{-- Main Form --}} {{ Form::open(array('url' => url('/forms/bia/' . $info['form']->id . '/submit'), 'method' => 'post')) }}

Reconciliation Report #{{ $info['form']->id }}

{{-- Form Status --}}
Form Status
@foreach ($info['statuses'] as $status)
@if (Helpers::strEqual($status['class'], 'done')) @elseif (Helpers::strEqual($status['class'], 'current')) @elseif (Helpers::strEqual($status['class'], 'alert')) @elseif (Helpers::strEqual($status['class'], 'deleted')) @endif
{{ $status['slug'] }}
{{ $status['name'] }}
@endforeach
@if (Helpers::strEqual($info['form']->status, 'WORK'))
This reconciliation form has not been submitted.
@endif {{-- Form Timestamps --}}
Created
{{ date('n/j/y g:i a', strtotime($info['form']->created_at)) }}
Updated
{{ date('n/j/y g:i a', strtotime($info['form']->updated_at)) }}
@if (Helpers::strEqual($info['form']->status, array('PEND', 'INSF', 'RECD', 'DONE')))
Submitted
{{ date('n/j/y g:i a', strtotime($info['form']->submitted_at)) }}
@if (Helpers::strEqual($info['form']->status, array('RECD', 'DONE')))
Received
{{ date('n/j/y g:i a', strtotime($info['form']->received_at)) }}
@if (Helpers::strEqual($info['form']->status, array('DONE')))
Paid
{{ date('n/j/y g:i a', strtotime($info['form']->paid_at)) }}
@endif @endif @elseif (!is_null($info['form']->deleted_at))
Deleted
{{ date('n/j/y g:i a', strtotime($info['form']->deleted_at)) }}
@endif
{{-- Assessor Information --}}

Assessor Information

Edit Information
Name
{{ $info['assessor']->user->getDisplayFullName() }}
Phone Number
{{ Helpers::displayCombinedPhone($info['assessor']->phone) }}
E-Mail Address
{{ $info['assessor']->user->email }}
Address
{{ $info['assessor']->address->line_1 }}@if (!Helpers::strIsEmpty($info['assessor']->address->line_2)), {{ $info['assessor']->address->line_2 }}@endif
City
{{ $info['assessor']->address->city }}
State
{{ $info['assessor']->address->state }}
Zip
{{ $info['assessor']->address->zip }}
{{-- Assessments Information --}}
Grand Total: ${{ number_format($info['form']->total_amount, 2) }}

Assessments

Add Assessment
@if (count($info['assessments']) == 0) @else @foreach ($info['assessments'] as $i => $assess) @endforeach @endif
School / Coop Name Passed Hydration Failed Hydration Total Assessments Cost Mileage Total
This reconciliation form has no assessments on record.
Click Add Assessment to create a new record. You cannot submit the form until at least one assessment record is entered.
{{ $assess->ap_name }} {{ $assess->passed }} {{ $assess->failed }} {{ $assess->assesses }} ${{ number_format($assess->cost, 2) }} ${{ number_format($assess->mileage, 2) }} ${{ number_format($assess->total, 2) }}

{{ Form::submit('Submit') }}
Help
Changes are automatically saved to this form. When you are ready, click the Submit button. Once submitted, you will not be able to edit the form. After submitting this form, a printable version will be available for you to print off and include in your packet mailed to the OSAA.
{{ Form::close() }}
@stop