@section('page_title') OSAA - Eligibility @stop @section('page_sub_title') Student Eligibility Request Form @stop @section('scripts') @parent @stop @section('jquery_init') if(!window.console) { window.console = { log: $.noop, group: $.noop, groupEnd: $.noop }; } /*console.log($.parseJSON('{{ json_encode($options) }}'));*/ // 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); }) }); @if (Session::has('submitted') or Input::has('submitted')) showHelp('submitted', true); @endif /* ShowHelp * * Shows a help topic. */ function showHelp(help_topic, no_button) { if (no_button !== true) { $('
') .appendTo('body') .dialog( { draggable : true, resizable : true, height : 725, minHeight : 400, width : 615, minWidth : 330, modal : false, title : 'Eligibility Form Help', open : function () { var dialog_object = $(this); dialog_object.html(""); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/eligibility/' . $object->waiver->id . '/help') }}?topic=' + help_topic, 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(); } }); } else { $('') .appendTo('body') .css({'z-index':'2000 !important'}) .dialog( { draggable : false, resizable : false, height : 725, minHeight : 725, width : 615, modal : true, dialogClass : 'no-close', title : 'Eligibility Form Submitted', open : function () { var dialog_object = $(this); dialog_object.html(""); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/eligibility/' . $object->waiver->id . '/help') }}?topic=' + help_topic, 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_submitted_button', dialog_object) .button() .click(function () { window.open ("{{ url('/forms/eligibility/' . $object->waiver->id . '/print') }}"); dialog_object.dialog("close"); }); // Shake action items function shakeTheseActionImages (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); shakeTheseActionImages($(this)); }); } var img = $('img.action_item', dialog_object); img.position({my:"center center", at : "right+30 center", of : ".close_submitted_button"}); shakeTheseActionImages(img); }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); } } /* * Help button */ $('.help_button') .button({'icons':{'primary':'ui-icon-help'}}) .css({'font-size':'9pt', 'margin-right':'10px'}) .click(function(event) { var object = $(this); event.preventDefault(); var topic = object.attr('data-topic'); showHelp(topic); }); /* Close Button * */ $('.close_button') .button({'icons':{'primary':' ui-icon-circle-close'}}) .css({'font-size':'9pt'}); /* * Withdraw Button */ $('[data-action="withdraw"]') .click(function(event) { event.preventDefault(); var button = $(this); button.blur(); $('') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, height : 375, width : 600, title : 'Confirm Form Withdrawal', buttons: [ { text : "Withdraw Request", 'class' : "float_left", icons : { primary : 'ui-icon-check'}, click : function() { var reason = $('[name="withdraw_notes"]').val(); if (reason == '') { alert('In order to withdraw this form, you must provide a reason.'); return; } if ($('[name="send_notification_wtdn"]', $(this)).is('[type="hidden"]')) { var notify = 1; } else { if ($('[name="send_notification_wtdn"]', $(this)).is(':checked')) { var notify = 1; } else { var notify = 0; } } var data = { 'reason' : reason, 'notify' : notify, 'waiver_id' : {{ $object->waiver->id }} }; $('| {{ date('n/j/y g:ia', strtotime($log->updated_at)) }} | '; html += '{{ $log->status }} | '; html += '{{ str_replace('\'', '\\\'', $log->user) }} |