<?php $__env->startSection('page_title'); ?>
    OSAA - Ejection Report
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
    OSAA Ejection Report
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    @parent

    <script src='https://www.google.com/recaptcha/api.js' async="async" defer="defer"></script>

    <style type="text/css">
    	h3 {
    		color: #1C43A6 !important;
    	}
    	
    	.success_bar {
    		position: fixed;
    		top: 600px;
    		left: 0;
    		width: 100%;
    		padding: 0.25em 0;
    		line-height: 1.5em;
    		background-color: rgba(176, 255, 190, 0.0);
    		border-bottom: 2px solid rgba(13, 88, 27, 0.50);
    		border-top: 2px solid rgba(13, 88, 27, 0.50);
    		z-index: 500;
    	}

    	.success_bar .message {
    		width: 1200px;
    		margin: 0 auto;
    		font-size: 14pt;
    		color: #151515;
    	}    	

    	.page_functions {
    		width: auto !important;
    	}

    	.ui-autocomplete {
		    max-height: 100px;
		    overflow-y: auto;
		    /* prevent horizontal scrollbar */
		    overflow-x: hidden;
		    font-size: 8pt;
		  }
		  /* IE 6 doesn't support max-height
		   * we use height instead, but this forces the menu to always be this tall
		   */
		  * html .ui-autocomplete {
		    height: 100px;
		  }

		table {
    		width: 100%;
    		border-collapse: collapse;
    		font-size: 10pt;
    	}

    	table thead {
    		background-color: #005fa9;
    		color: #ffffff;
    	}

    	table thead th {
    		padding: 4px 2px;
			text-align: left;
    	}    	

    	table tbody tr{
    		height: 2em;
    	}

    	table tbody tr.odd {
    		background-color: #eeeeee;
    	}

    	.access_mode {    		
    		padding: 0.5em 1em; 
    		font-size: 9pt;   		
    	}

    	.access_mode.commissioner {
    		border: 1px solid #0d581b;
    		background-color: #b0ffbe;
    	}

    	.access_mode.official {
    		border: 1px solid #e1c146;
    		background-color: #ffefb0;
    	}

    	.access_mode .mode_type {
    		float: right;
    		font-weight: bold;
    		font-size: 12pt;
    	}

    	img.current_step {
    		position: absolute;
    		width: 16px;
    		left: -35px;
    	}

    	a.new_form .ui-button-text {
    		line-height: 2em;
    	}

        #results {
            width: 510px;
            height: 525px;
            overflow-y: auto;
            padding-right: 8px;
            margin-top: 0.5em;
        }

        .item {
            border-bottom: 1px solid #dedede;
            position: relative;
            margin: 0 0 0.75em 0;
            line-height: 1.1em;
        }       

        .item .id {
            font-size: 8pt;
            position: absolute;
            right: 0;
            top: 3em;
        }

        .item .activity {
            font-size: 8pt;
            position: absolute;
            right: 0;
            top: 0em;
        }

        .item .status {
            font-size: 8pt;
            position: absolute;
            right: 0;
            top: 1.5em;
        }

        .item .school {
            font-size: 10pt;
            font-weight: bold;
        }

        .item .association {
            font-size: 9pt;
            color: #7d7b7d;
            font-style: italic;
        }

        .item .school_year {
            font-size: 9pt;            
            display: inline-block;
            width: 65px;
        }

        .item .type {
            font-size: 9pt;            
            display: inline-block;
            width: 55px;
        }

        .item .reason {
            font-size: 9pt;            
            display: inline-block;
        }

        .item.item_hover .association {
            color: #fcb069 !important;
        }

        .item.item_hover {
            color: #e17009 !important;
            cursor: pointer;
            border-bottom: 1px solid #dfeffc !important;

            background: #f5f8f9;
        }

        .ui-menu { position: absolute; width: 107px;}

        ul.ui-menu {
            padding: 0 !important;
        }    	

    </style>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('jquery_init'); ?>
	
	// 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);
		})
	});


	/* Positioned elements
     *
     * Elements that contain the attribute data-position="true" will be positioned
     * using JQuery's UI positioning utility.  Other expected attributes define the
     * element's position:
     *    data-position-my
     *    data-position-at
     *    data-position-of
     */
    $('[data-position="true"]').each(function()
    {
        var element = $(this);
        var my = element.attr('data-position-my');
        var at = element.attr('data-position-at');
        var of = element.attr('data-position-of');

        var options = $.parseJSON('{ "my" : "' + my + '", "at": "' + at + '", "of": "' + of + '"}');

        element.position(options);
    });


	// Buttons
	$('.close_button')
		.button({'icons':{'primary':'ui-icon-circle-close'}})
		.css({'font-size':'9pt'});		

    /* 
     * Help button    
     */
    $('.help_button')
        .button({'icons':{'primary':'ui-icon-help'}})
        .css({'font-size':'9pt', 'margin-right':'10px'});

    /*
     * New form button
     */
    $('.new_form')
    	.button()
    	.css({'font-size' : '9pt', 'height' : '3em'})
    	.click(function(event)
    	{
    		event.preventDefault();

    		$('#create_form').submit();
    	});
	

	// 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);
    });

    <?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>

        <?php
            // Get the OSAA user's last search from OSAA user preferences
            $term = Auth::user()->getOsaaPreference('last_ejection_search');            

            if (is_null($term))
            {
                if (Helpers::strEqual(Auth::user()->email, array('peterw@osaa.org')))
                {
                    $term = '_PETER';
                }
                elseif (Helpers::strEqual(Auth::user()->email, array('bradg@osaa.org')))
                {
                    $term = '_BRAD';
                }
                elseif (Helpers::strEqual(Auth::user()->email, array('cindys@osaa.org')))
                {
                    $term = '_CINDY';
                }
                elseif (Helpers::strEqual(Auth::user()->email, array('meridithp@osaa.org')))
                {
                    $season = Helpers::getCurrentSeason();
                    $seasons = array(
                        'F' => 'FALL',
                        'W' => 'WINTER',
                        'S' => 'SPRING'
                    );

                    $term = $seasons[$season];
                }
                else
                {
                    $term = '2015';
                }                
            }
        ?>

        searchTerm('<?php echo $term; ?>');
        $('input[name="search"]').val('<?php echo $term; ?>');

    <?php endif; ?>

    // Search features
    function searchTerm(search)
    {
        $('#results').empty();
        $('#results_info').empty();
        $('#results_info').html('Fetching results ...');

        $('<div><div>')
            .attr('data-searching', 1)
            .addClass('ui-widget-overlay ui-front')
            .appendTo('body');
          
        $('<div><div>').appendTo('body')
            .attr('data-searching', 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('<div style="position: absolute; font-size: 8pt; top: 0; right: 4px;"><a href="#" name="cancel_search">Cancel</a></div><br />Searching...<br /><br /><img src="http://www.osaa.org/images/icons/ajax_loader3.gif" /><div style="font-size: 8pt; line-height: 105%; margin-top: 2em;">Getting results from the database...</div>');

        $('[name="cancel_search"]')
            .click(function(event)
            {   
                event.preventDefault();
                $('[data-searching]').remove();
                $('#results_info').html('Search was canceled.');

                jqxhr.abort();

            });

        var data = {
            term : search,
            options : {
                include_work : ($('input[name="include_work"]').is(':checked')) ? 1 : 0,
                include_wtdn : ($('input[name="include_wtdn"]').is(':checked')) ? 1 : 0
            }
        };


        // Get search results
        var jqxhr = $.ajax(
            {
                type : 'POST',
                url : '<?php echo url('/forms/ejection/search'); ?>',
                data : data,
                dataType : 'html'
            })
            .done(function (data)
            {                                                
                $('[data-searching]').remove();

                var results = $.parseJSON(data);
                var ejections = results.results;
                
                var html = 'Found ' + results.count + ' in ' + results.time.toPrecision(3) + ' sec. for "' + results.search + '" on ' + results.term + '.';

                $('#results_info').html(html);
                

                if (ejections.length == 0)
                {
                    $('#results').html('No ejection reports matched your search.');
                    return;
                }

                $.each(ejections, function(index, ejection)
                {
                    var html = '<div class="id">' + ejection.id + '</div>';
                    html += '<div class="activity">';

                    if (ejection.status_slug == 'APPL')
                    {
                        html += '<img src="<?php echo asset('/images/icons/alert_16px.png'); ?>" alt="" title="" style="vertical-align: middle; margin-right: 10px;">';
                    }

                    if (ejection.status_slug == 'RECD')
                    {
                        html += '<img src="<?php echo asset('/images/icons/accept_16px.png'); ?>" alt="" title="" style="vertical-align: middle; margin-right: 10px;">';
                    }

                    if (ejection.status_slug == 'SUBT')
                    {
                        html += '<img src="<?php echo asset('/images/icons/ajax_loader2.gif'); ?>" alt="" title="" style="vertical-align: middle; margin-right: 10px;">';
                    }

                    html += ejection.activity + '</div>';                    
                    html += '<div class="status">' + ejection.status + '</div>';
                    html += '<div class="school">' + ejection.school + '</div>';
                    html += '<div class="association">' + ejection.association + '</div>';
                    html += '<div class="school_year">' + ejection.year + '</div>';
                    html += '<div class="type">' + ejection.type + '</div>';
                    html += '<div class="reason">' + ejection.reason + '</div>';

                    $('<div></div>')
                        .addClass('item')
                        .attr('data-id', ejection.id)
                        .appendTo('#results')
                        .html(html);
                });
                
                $('.item')
                    .hover(function ()
                    {
                        $(this).addClass('item_hover');
                    }, function ()
                    {
                        $(this).removeClass('item_hover');
                    })
                    .click(function()
                    {
                        window.location.href = '<?php echo url('/forms/ejection'); ?>/' + $(this).attr('data-id');
                    });
                
            })
            .fail(function (jqXHR, status, error)
            {                                                   
                var response = jqXHR.responseText;
                var errorData = $.parseJSON(response);
                //console.log(errorData);
                alert("There was an error while searching.\n\n" + errorData.error.message + "\n\nThis page will be reloaded.");
                location.reload();
            });
    }


    $('#search').keypress(function(e)
    {
        if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 12))
        {
            $('.search_button').click();
        }
    })  

    $('.search_button')
        .button({'icons':{'primary':'ui-icon-search'}})
        .css({'font-size':'8pt'})       
        .click(function(event)
        {
            event.preventDefault();

            var search = $('#search').val();

            if (search == '')
            {
                alert("You didn't type in any search criteria.");
                return;
            }

            searchTerm(search);
        });    

    $('.item')
        .hover(function ()
        {
            $(this).addClass('item_hover');
        }, function ()
        {
            $(this).removeClass('item_hover');
        })
        .click(function()
        {
            window.location.href = '<?php echo url('/forms/ejection'); ?>/' + $(this).attr('data-id');
        });

    <?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>
        
        $('#summary_menu, #invoice_menu')
            .menu()
            .css({'font-size' : '9pt'})
            .hide()
        
        $(document).click(function(event)
        {
            $('#summary_menu, #invoice_menu').hide();
        });

        $('.summary_button')
            .button({'icons' : {'primary' : 'ui-icon-script',
                                'secondary' : 'ui-icon-triangle-1-s'}})
            .css({'font-size' : '9pt', 'margin-right' : '10px'})
            .click(function(event)
            {
                event.preventDefault();
                event.stopPropagation();

                var menu = $('#summary_menu');

                menu
                    .show()
                    .position({'my' : 'left top',
                               'at' : 'left bottom',
                               'of' : '.summary_button'});                    
            });

        $('.duplicate_button')
            .button({'icons' : {'primary' : 'ui-icon-pause'}})
            .css({'font-size' : '9pt', 'margin-right' : '10px'});

        $('.invoice_button')
            .button({'icons' : {'primary' : 'ui-icon-document',
                                'secondary' : 'ui-icon-triangle-1-s'}})
            .css({'font-size' : '9pt', 'margin-right' : '10px'})
            .click(function(event)
            {
                event.preventDefault();
                event.stopPropagation();

                var menu = $('#invoice_menu');

                menu
                    .show()
                    .position({'my' : 'left top',
                               'at' : 'left bottom',
                               'of' : '.invoice_button'});                    
            });

        $('.calculate_button')
            .button({'icons' : {'primary' : 'ui-icon-calculator'}})
            .css({'font-size' : '9pt', 'margin-right' : '10px'})
            .click(function (event)
            {
                event.preventDefault();

                var button = $(this);            
                button.blur();
                
                $('<div></div>')
                    .appendTo('body')
                    .dialog(
                    {                       
                        modal : true,
                        draggable : true,
                        resizable : false,
                        height : 425,
                        maxHeight : 600,
                        width : 450,                    
                        title : 'Confirm',
                        buttons: [
                            {
                                text : "Calculate",
                                'class' : "float_left calculate_button",
                                'name' : "dialog_calculate_button",
                                icons : { primary : 'ui-icon-check'},
                                click : function()
                                        {                                 
                                            var dialog_object = $(this);

                                            var test_mode = $('input[name="test_mode"]', dialog_object).is(':checked');

                                            var season = $('#calculate_season_select').val();

                                            var data = { 'season' : season,
                                                         'test' : test_mode };                                            

                                            $('<div><div>')
                                                .addClass('ui-widget-overlay ui-front loading')
                                                .appendTo('body');
                                              
                                            $('<div><div>').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 loading')
                                                .html('<br />Calculating...<br /><br /><img src="http://www.osaa.org/images/icons/ajax_loader3.gif" /><div style="font-size: 8pt; line-height: 105%; margin-top: 2em;">Please wait, this may take a while to process...</div>');

                                            // Submit the change
                                            var jqxhr = $.ajax(
                                                {
                                                    type : 'GET',
                                                    url : '<?php echo url('/invoices/calculate/eject'); ?>',
                                                    data : data,
                                                    dataType : 'html'
                                                })
                                                .done(function (data)
                                                {                                                
                                                    $('.loading').remove();
                                                    

                                                    $('[name="dialog_calculate_button"]').remove(); 

                                                    $('[name="dialog_cancel_button"]')
                                                        .button('option', 'icons', {'primary' : 'ui-icon-check'})
                                                        .button('option', 'label', 'Close');

                                                    if (data != 'Success')
                                                    {
                                                        dialog_object.dialog('option', 'title', 'Error: Unable to Calculate');
                                                        dialog_object.dialog('option', 'width', '650');
                                                        dialog_object.dialog('option', 'height', 'auto');

                                                        var html = data;
                                                    }
                                                    else
                                                    {                                                        
                                                        dialog_object.dialog('option', 'title', 'Success');
                                                        dialog_object.dialog('option', 'height', 'auto');

                                                        var html = '<div style="font-size: 10pt; margin: 1em 0;">';
                                                        html += '<img src="<?php echo asset('images/icons/calculator_48px.png'); ?>" alt="" title="" style="float: left; margin-right: 10px;" />';
                                                        html += '<br /><span class="ui-icon ui-icon-check" style="display: inline-block; vertical-align: middle; margin-right: 4px;"></span>';
                                                        html += '<b>Calculation was successful.</b>';                                                    
                                                    }

                                                    dialog_object.html(html);
                                                })
                                                .fail(function (jqXHR, status, error)
                                                {                                                   
                                                    var response = jqXHR.responseText;
                                                    var errorData = $.parseJSON(response);
                                                    //console.log(errorData);
                                                    alert("There was an error.\n\n" + errorData.error.message + "\n\nThis page will be reloaded.");
                                                    location.reload();
                                                });              
                                        }
                            },                        
                            {
                                text : "Cancel",
                                'class' : "float_right",
                                'name' : "dialog_cancel_button",
                                'data-autofocus' : "true",
                                icons : { primary : 'ui-icon-cancel'},
                                click : function()
                                        {
                                            // Close the dialog box
                                            $(this).dialog("close"); 
                                        }
                            }
                        ],
                        open : function ()
                            {  
                                var dialog_object = $(this);

                                var html = '<div style="font-size: 10pt; margin: 1em 0;">';
                                html += '<img src="<?php echo asset('images/icons/calculator_48px.png'); ?>" alt="" title="" style="float: left; margin-right: 10px;" />';
                                html += '<span class="ui-icon ui-icon-alert" style="display: inline-block; vertical-align: middle; margin-right: 4px;"></span>';
                                html += '<b>Are you sure you want to calculate/recalculate ejection fines for invoices?</b>';
                                html += '<br class="clear" /><br />';
                                html += '<div class="small gray">Calculating fines will take the current ejections on record and determine how much each school should be invoiced.  All ejections must be marked as DONE or deleted in order to proceed.<br /><br />This calculation should only be done once at the end of the season.  Any existing calculations will be deleted.</div><br />';
                                html += '<label for="calculate_season_select" style="font-weight: bold; margin-right: 10px;">Season</label>';
                                html += '<select id="calculate_season_select" name="calculate_season_select" style="margin-right: 25px;">';

                                <?php foreach (array('F' => 'Fall', 'W' => 'Winter', 'S' => 'Spring') as $slug => $name): ?>

                                    html += '<option value="<?php echo $slug; ?>"';

                                    <?php if (Helpers::strEqual($slug, Helpers::getCurrentSeason())): ?>
                                        html += 'selected="selected"';
                                    <?php endif; ?>

                                    html += '><?php echo $name; ?></option>';

                                <?php endforeach; ?>

                                html += '</select><span class="small gray note">Be sure to select the season.</span><br /><br />';
                                html += '<label><input type="checkbox" name="test_mode" id="test_mode" value="1" style="vertical-align: middle;" /> Test Mode</label><br /><span class="small gray note">(Check to ignore incomplete ejections for testing purposes.)</span>';

                                dialog_object.html(html);
                                
                                $('.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();
                            }                
                    });
            });

    <?php endif; ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_functions'); ?>  	

	<?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>

        <a href="#" class="summary_button" target="_blank">Summary</a>        
        <a href="<?php echo url('/forms/ejection/duplicates'); ?>" class="duplicate_button" target="_blank">Duplicates</a>
        <a href="<?php echo url('/invoices/render/eject'); ?>?season=F&view=true" class="invoice_button" target="_blank">Invoices</a>
        <a href="#" class="calculate_button">Calculate</a>          

    <?php endif; ?>

    <a href="<?php echo asset ('docs/osaainfo/OnlineEjectionReportInstructions.pdf'); ?>" class="help_button" target="_blank">Help</a>

	<a href="<?php echo url('/'); ?>" class="close_button">Close</a>
    
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content'); ?>    		

 	<?php /*  Success Bar  */ ?>
 	<?php if (Session::has('success')): ?>
		<div class="success_bar">
			<div class="message">				
				<?php echo Session::get('success'); ?>
			</div>			
		</div>
	<?php endif; ?> 

	<?php /*  Errors  */ ?>
    <?php if (Session::has('errors')): ?>                
        <div class="error ui-state-error" style="font-weight: bold; padding: 1em;">
            <span class="ui-icon ui-icon-alert box_icon"></span>
            <?php foreach ($errors->all() as $error): ?>
                <?php echo $error; ?>
            <?php endforeach; ?>
        </div>
    <?php endif; ?>

    <?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>
        <ul id="summary_menu">
            <li><a href="<?php echo url('/forms/ejection/summary/fall'); ?>" target="_blank">Fall</a></li>
            <li><a href="<?php echo url('/forms/ejection/summary/winter'); ?>" target="_blank">Winter</a></li>
            <li><a href="<?php echo url('/forms/ejection/summary/spring'); ?>" target="_blank">Spring</a></li>
        </ul>

        <ul id="invoice_menu">
            <li><a href="<?php echo url('/invoices/render/eject'); ?>?season=F&view=true" target="_blank">Fall</a></li>
            <li><a href="<?php echo url('/invoices/render/eject'); ?>?season=W&view=true" target="_blank">Winter</a></li>
            <li><a href="<?php echo url('/invoices/render/eject'); ?>?season=S&view=true" target="_blank">Spring</a></li>
        </ul>
    <?php endif; ?>

	<div class="float_left">

		<h1>Create a New Ejection Report</h1>

		<br />

		The OSAA needs to be informed of every high school player or coach ejection.  Online ejection reports are to be initially filled out by the official or commissioner.

		<br /><br />

		<?php if ($info['is_commissioner']): ?>
			 <div class="access_mode ui-corner-all commissioner">
			 	<div class="mode_type">Commissioner</div>
			 	Hello, <?php echo Auth::user()->first_name; ?>.  You are logged in as a Commissioner.
			 </div>
		<?php else: ?>
			<div class="access_mode ui-corner-all official">
				<div class="mode_type">Official</div>
				<?php if (Auth::check()): ?>
					Hello, <?php echo Auth::user()->first_name; ?>.  You are logged in, but not as a Commissioner.
				<?php else: ?>
					Welcome, guest.  You are not logged in as a Commissioner.
				<?php endif; ?>				
			</div>
		<?php endif; ?>

		<br class="clear" />

		<div class="columns">
			<div class="half">
				<?php echo Form::open(array('url'    => url('/forms/ejection/create'),
					                'method' => 'post',
					                'id'     => 'create_form')); ?>

					<?php if (!Auth::check()): ?>						
						<div class="g-recaptcha" data-sitekey="6Ld4QAsTAAAAAH3ogjvzOizw9dLVhVnIoreuLUZi" style="height: 78px;"></div>&nbsp;					
					<?php endif; ?>
					
					<br />

					<div id="next_button_div" style="position: relative; width: 150px;">

						<img src="<?php echo asset('/images/icons/waiver_action_icon_2_48px.png'); ?>" alt="" title="" style="position: absolute; right: 0; top: -0.25em;" class="action_item" />
						<a href="#" class="new_form">New Form</a>
						
					</div>

					<br class="clear" />

					<div class="small gray note">
						Start a new Ejection Report by clicking the button above.
					</div>

				<?php echo Form::close(); ?>
				
			</div>

			<div class="half">	

				<h2 style="margin-top: 0;">Ejection Report Form Process</h2>
				
				<ol class="small" style="line-height: 1.5em; margin-top: 0.5em;">
					
					<?php if ($info['is_commissioner']): ?>
						<li style="color: #81A881;"><b>Official</b> provides information to the Commissioner regarding an ejection.</li>
						<li style="position: relative;"><img src="<?php echo asset('/images/icons/waiver_action_icon_right_48px.png'); ?>" alt="" title="" class="current_step" /><b>Commissioner</b> fills out and submits an online Ejection Report.</li>
					<?php else: ?>
						<li style="position: relative;"><img src="<?php echo asset('/images/icons/waiver_action_icon_right_48px.png'); ?>" alt="" title="" class="current_step" /><b>Official</b> fills out a preliminary online Ejection Report.</li>						
						<li><b>Commissioner</b> is notified and reviews the form before submitting.</li>						
					<?php endif; ?> 

					<li><b>School</b> is notified of ejection and reviews information.</li>
					<li><b>OSAA</b> is notified if school is appealing the suspension/fine.</li>
					
				</ol>

			</div>

			<br class="clear" />
		</div>

	</div>
	
	<br class="clear" />


	<?php /*  OSAA Staff Tools  */ ?>
	<?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>
		
		<div class="columns" style="border-top: 2px solid #990000; margin: 2em 0 0 0; padding-top: 1em;">

            <div class="half" style="padding-right: 1%; width:51%;">
                <h1>OSAA Search</h1>

                <br />

                <label for="search" style="font-weight: bold;">Find</label>
                <input type="text" name="search" id="search" style="width: 250px;" />

                <button class="search_button" style="margin-left: 50px;">Search</button>

                <div style="float: right; font-size: 9pt; position: relative; top: -1.5em;">
                    Include:<br />
                    <label>
                        <input type="checkbox" name="include_work" value="1" style="vertical-align: middle;" />
                        WORK
                    </label>
                    <br />
                    <label>
                        <input type="checkbox" name="include_wtdn" value="1" style="vertical-align: middle;" />
                        WTDN
                    </label>
                </div>

                <br />

                <div class="small gray">Search by ID, activity, school, status, or staff</div>

                <div id="results_info" class="small gray"></div>

                <div id="results"></div>
                
            </div>  

            <div class="half" style="width: 43%; padding-left: 3%;">

                <h3>Instructions for OSAA Staff</h3>

                <div style="font-size: 10pt;">

                    To search ejections only for the sports you are responsible for, type in your name with an underscore (i.e. "_PETER").  This is the default search setting when the page is refreshed.

                    <br /><br />

                    By default, the search also excludes deleted ejections, "WTDN", and ejections that have been created but not yet submitted to the Commissioner, "WORK."  You can include those statuses by checking the appropriate check-box and re-searching.

                    <br /><br />

                    <b>Status &amp; Icon Meanings</b><br />

                    Ejections always have a single status (4 letters long):
                    <ul>
                        <li style="padding-top: 0.5em;"><u>WORK</u> - The report has been created by an anonymous official.  The official has not yet submitted the report to the Commissioner.  If the Commissioner started the form, this status is skipped.</li>
                        <li style="padding-top: 0.5em;"><u>CMSH</u> - The report is under Commissioner review.  The Commissioner has not submitted the report and the school has not been notified of the ejection, yet.  Some required information may be missing.</li>
                        <li style="padding-top: 0.5em;"><u>SUBT</u> - The Commissioner has submitted the report and the school has been notified.  The school needs to review the report and either accept the report or appeal the suspension/fine. <img src="<?php echo asset('/images/icons/ajax_loader2.gif'); ?>" alt="" title="" style="vertical-align: middle;"></li>
                        <li style="padding-top: 0.5em;"><u>RECD</u> - The school has accepted the ejection report without an appeal.  You must review the report as an OSAA staff member and mark it as complete. <img src="<?php echo asset('/images/icons/accept_16px.png'); ?>" alt="" title="" style="vertical-align: middle;"> <b>OSAA Action Required</b></li>
                        <li style="padding-top: 0.5em;"><u>APPL</u> - The school is appealing the ejection's suspension/fine.  You must review the form as an OSAA staff member, communicate with the Commissioner, and make a decision regarding the appeal in order to mark the report as complete. <img src="<?php echo asset('/images/icons/alert_16px.png'); ?>" alt="" title="" style="vertical-align: middle;"> <b>OSAA Action Required</b></li>
                        <li style="padding-top: 0.5em;"><u>DONE</u> - The ejection report is complete.  No further action is required.</li>
                        <li style="padding-top: 0.5em;"><u>WTDN</u> - Withdrawn, the ejection report has been deleted.</li>
                        <li style="padding-top: 0.5em;"><u>ARCH</u> - Archived, the ejection report has been archived for record keeping.  Archiving is done at the end of every school year.</li>
                    </ul>

                </div>

            </div>

		</div>

	<?php endif; ?>

	<img src="http://www.osaa.org/images/icons/ajax_loader3.gif" style="display: none;" />
	

<?php $__env->stopSection(); ?>
