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

<?php $__env->startSection('tool_box'); ?>
	<?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>
		<div id="tool_box" style="font-size: 10pt;">
	        <img src="<?php echo asset('images/icons/shield_32px.png'); ?>" alt="" title="You are logged in as an OSAA Staff Member." class="tooltip" width="32" height="32" />        

	        <div class="float_left" style="line-height: 34px;">
	        		        	
	        	<img src="<?php echo asset('images/icons/bullet_green_32px.png'); ?>" alt="" title="" class="" style="float: none; width: 16px; height: 16px; margin: 0 0.25em 0 1em;" />
	        	<b>Open:</b> <?php echo date('g:ia n/j/y', strtotime($information['activity_form']->open_at)); ?>
	        	
				<img src="<?php echo asset('images/icons/bullet_yellow_32px.png'); ?>" alt="" title="" class="" style="float: none; width: 16px; height: 16px; margin: 0 0.25em 0 1em;" />
	        	<b>Due:</b> <?php echo date('g:ia n/j/y', strtotime($information['activity_form']->due_at)); ?>	        	

	        	<img src="<?php echo asset('images/icons/bullet_red_32px.png'); ?>" alt="" title="" class="" style="float: none; width: 16px; height: 16px; margin: 0 0.25em 0 1em;" />
	        	<b>Close:</b> <?php echo date('g:ia n/j/y', strtotime($information['activity_form']->close_at)); ?>
	        </div>

	        <div style="float: right; line-height: 32px; margin-left: 10px;">
	        	<div class="button download entries team_summary" style="font-size: 9pt;">Teams Summary</div>
	        </div>	              



	    </div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
	<?php echo $information['form_name']; ?>
<?php $__env->stopSection(); ?>

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

    <script src="<?php echo asset('/scripts/jquery.maskedinput.min.js'); ?>" type="text/javascript"></script>	

	<style type="text/css">
    	table.participation_numbers {
    		border-collapse: collapse;	
    	}

    	table.participation_numbers th {
    		text-align: left;
    	}

    	table.participation_numbers tbody tr {
    		line-height: 1.75em;
    	}

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

    	table.participation_numbers tbody tr td {
    		padding-right: 15px;
    	}

    	h3 {
    		color: #990000 !important;
    	}

		.page_functions {
    		width: auto !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;
    	}

    	.form_meta_notes {
        	position: absolute;
        	top: 0;
        	right: 0;
        	text-align: right;        	
        	font-size: 8pt;
        	line-height: 115%;
        }


        label, .label {
            font-weight: bold;
            width: 125px;
            text-align: right;
            margin-right: 25px;
            display: inline-block;
            position: relative;
            vertical-align: top;
        }     
        
        .required {
            color: #990000;
            font-weight: bold;
            font-size: 14pt;
            position: relative;
            top: 4px;
            margin-left: 5px;
        }

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

<?php $__env->startSection('jquery_init'); ?>
	$('.button').button();
	$('.button.notext').button({text:false});
	$('.button.close').button({ icons : { primary : 'ui-icon-circle-close'}});
	$('.button.switch').button({ icons : { primary : 'ui-icon-transferthick-e-w'}});
	$('.button.back').button({ icons : { primary : 'ui-icon-arrowthick-1-w'}});	
	$('.button.add').button({ icons : { primary : 'ui-icon-plusthick'}});
	
	$('.button.download')
		.button({ icons : { primary : ' ui-icon-circle-arrow-s' }});
	$('.button.disabled').button('disable');
	$('.tooltip').tooltip();	



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


	// Required field marker
    $('[data-required]').after('<span class="required">*</span>'); 

    // Name fields (do not allow any special characters) 
    $('[data-format="name"]').bind('input', function()
    {
        $(this).val($(this).val().replace(/[^A-Za-z \-'\.,]/gi, ''));
    });

    // Phone field
    $('[data-phone-field]').mask("(999) 999-9999");

    // Date picker
    $('[data-date-picker]').datepicker({'dateFormat':'mm/dd/yy'});

	/* Limit input to numbers only */	
	$('[data-format="numbers_only"]').bind('input', function()
	{
  	    $(this).val($(this).val().replace(/[^0-9]/gi, ''));
	});	

	/* Limit input to numbers only or NP */	
	$('[data-format="place"]').bind('input', function()
	{
  	    $(this).val($(this).val().replace(/[^0-9NP]/gi, ''));
	});

	/* Limit input to numbers only or NS */	
	$('[data-format="score"]').bind('input', function()
	{
  	    $(this).val($(this).val().replace(/[^0-9NS]/gi, ''));
	});

	/* alertRequiredField
     *
     * Shows an alert box when attempting to save a blank value to a required field.
     */
    function alertRequiredField()
    {
        $('<div></div>')
            .appendTo('body')
            .dialog(
            {                       
                modal : true,
                draggable : false,
                resizable : false,                    
                height : 275,                    
                width : 415,                    
                title : 'Required Field',                    
                buttons: [
                    {
                        text : "OK",
                        'class' : "float_right",
                        icons : { primary : 'ui-icon-check'},
                        click : function()
                                {                                                       
                                    // Close the dialog box
                                    $(this).dialog("close"); 
                                }
                    }
                ],
                open : function ()
                    {  
                        var dialog_object = $(this);

                        dialog_object.html('<br />You\'ve entered in a blank value for a required field.  Required fields cannot be empty.<div style="font-size: 9pt; margin-top: 1em;" class="small gray note">The original value has been restored.</div>');
                        
                        $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
                        $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
                        $('.ui-dialog-buttonpane .ui-dialog-buttonset').append('<div style="font-size: 8pt; line-height: 1.25em; margin-top: 0.5em;">Still having trouble?<br />(503) 682-6722 x228</div>');
                    },                    
                close : function ()
                    {
                        var dialog_object = $(this);
                        $(dialog_object).remove();
                    }                
            });
    }

    <?php 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 = <?php echo $information['submission']->id; ?>;

    			$('<div></div>')
	                .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 : '<?php echo 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('<br />Are you sure you want to reset this form and clear out all of the entered data?<div style="font-size: 9pt; margin-top: 1em;" class="small gray note">This will delete all entries and start the form from scratch.</div><div class="ui-state-error small" style="padding: 0.5em;">This cannot be undone.</div>');
	                                                        
	                            $('.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 = <?php echo $information['submission']->id; ?>;

	        $('*').css({'cursor':'wait'});

	        var jqxhr = $.ajax(
	        {
	            type : 'POST',            			
	            url : '<?php echo 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);
	        }         
	    });



    <?php endif; ?>
	
	$('input.participation_number').bind('change blur', function ()
	{				
		var v = parseInt($(this).val());
		
		if (v < 0)
		{
			$(this).val('');
		}		
		
		updateTotals();
	});		

	function updateTotals()
	{			
		total = 0;
		
		$('input.participation_number').each(function ()
		{
			var v = parseInt($(this).val());

			if (v >= 0)
			{	
				total = total + v;
			}
			
		});		

		/* Display the total number of participants */
		$('#total_participation').html(total);	
	}

	updateTotals();
	

	function colorRows ()
	{		
		$('table').each(function ()
		{
			var i = 0;

			$('tbody tr:visible', $(this)).each(function ()
			{
				if (i % 2 == 1)
				{
					$(this).addClass('odd');
				}
				else
				{
					$(this).removeClass('odd');
				}
				i = i + 1;
			});		


		});
	}

	colorRows();


	


    <?php /*  Include script for the league or school selection landing form  */ ?>
    <?php 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' : 'BGF', '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;
			}
		});	

	<?php endif; ?>	

	
		

	$('input[data-ribbon]').blur(function ()
	{	
		var p = $(this).val();						
		
		var count = 0;
		$('input[data-ribbon]').each(function ()
		{		
			if ($(this).val() != '')
			{
				var pn = parseInt($(this).val());

				if (pn == p)
				{
					count++;
				}
			}
		});		

		var row = $(this).parents('tr');

		$(row).find('img[place]').hide();

		if (p != '')
		{
			var place = parseInt(p);

			if (place >= 1 || place <= 20)
			{
				$(row).find('img[place=' + place + ']').fadeIn();
			}

		}
		
	});	
	$('input[data-ribbon]').blur();

	
	

    <?php if (Auth::check() and Auth::user()->isOsaaUser()): ?>    
    	 
		/* Enable the next button */
	    $('#select_league_form input[type="submit"]').button('enable')
	    											 .removeClass('ui-state-error');

	    $('.button.download.entries.team_summary').click(function ()
		{
			window.open('<?php echo url('/reports/gf-entries/teams-summary'); ?>');
		});
	

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

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

	<?php if (!is_null($information['league'])): ?>		

		<a href="<?php echo url('/forms/registration/' . strtolower($information['activity']->slug)); ?>" class="button back tooltip" style="font-size:9pt; float: right;" title="Go back to the league selection page.">Back</a>		

		<?php if (Helpers::strEqual(substr($information['league']->slug, 0, 2), array('6A', '5A'))): ?>

			<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
				<a href="<?php echo url('/forms/registration/ggf?league=' . $information['league']->slug); ?>" class="float_right button switch tooltip" style="font-size: 9pt; margin-right: 10px;" title="Switch to the Girls Golf form.">Switch to Girls</a>	
			<?php else: ?>
				<a href="<?php echo url('/forms/registration/bgf?league=' . $information['league']->slug); ?>" class="float_right button switch tooltip" style="font-size: 9pt; margin-right: 10px;" title="Switch to the Boys Golf form.">Switch to Boys</a>	
			<?php endif; ?>

		<?php endif; ?>
		
		<a href="#" class="reset_form tooltip" style="float: right; margin-right: 10px;" title="Clear this form by deleting all entries.">Reset Form</a>

	<?php else: ?>
		<a href="<?php echo $information['return_url']; ?>" class="button close tooltip" style="font-size:9pt;" title="Discard any unsaved changes and close this form.">Close</a>		
	<?php endif; ?>

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


<?php $__env->startSection('main_content'); ?>    
	
	<?php if (Session::has('success')): ?>

		<div class="success_bar">
			<div class="message">				
				<?php echo Session::get('success'); ?>
			</div>			
		</div>

	<?php endif; ?>

	<?php if ($information['is_past_due']): ?>
		<div class="online_form_late ui-state-error ui-corner-all" style="width: 80%;">
			<span class="ui-icon ui-icon-alert" style="display:inline-block; position:relative; top:2px;"></span>
			This form was due by <?php echo date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)); ?> and is now past the deadline.  Please submit your entries now before the form closes and becomes unavailable.
		</div>
	<?php endif; ?>

	<br />

	<?php if (is_null($information['league'])): ?>	

		<?php /*  Need to select a league  */ ?>

		<h1>Select League or Special District</h1>

		<br />

		<p>
			This form is for <b>District Directors</b> and <b>Regional Tournament Directors</b> to submit results from district and regional tournaments.
		</p>

		<div class="online_form_instructions ui-corner-all">
			<span class="ui-icon ui-icon-info" style="display:inline-block; position:relative; top:2px;"></span>
			<b>Instructions</b> <br />
			<ol>
				<li>Select the special district from the drop-down list.</li>
				<li>Type in the registration password provided by the OSAA.</li>
				<li>Click <b>Next</b> to continue with submitting entries.</li>				
				<li>You can switch to the 
					<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
						Girls
					<?php else: ?>
						Boys
					<?php endif; ?>
					Golf form by clicking the <b>Switch to
					<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
						Girls
					<?php else: ?>
						Boys
					<?php endif; ?>
					</b> button.</li>
				<li><b>Note:</b> All entries must be submitted by <?php echo date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)); ?> using this online form.</li>
			</ol>

			<br />

			For questions, contact <?php echo $information['staff']->first_name; ?> <?php echo $information['staff']->last_name; ?> at (503) 682-6722 x239 or by e-mail to <?php echo Helpers::obfuscateEmailLink ($information['staff']->email); ?>.  For technical assistance, you can email <?php echo Helpers::obfuscateEmailLink ("support@osaa.org"); ?>.
		</div>		

		<br />

		<h2><?php echo Helpers::getActivityName($information['activity']->slug); ?> Leagues &amp; Special Districts</h2>

		<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
			<a href="<?php echo url('/forms/registration/ggf'); ?>" class="float_right button switch tooltip" style="font-size:9pt; margin-top: 2em;" title="Switch to the Girls Golf form.">Switch to Girls</a>	
		<?php else: ?>
			<a href="<?php echo url('/forms/registration/bgf'); ?>" class="float_right button switch tooltip" style="font-size:9pt; margin-top: 2em;" title="Switch to the Boys Golf form.">Switch to Boys</a>	
		<?php endif; ?>

		
		<?php echo Form::open(array('url' => url('/forms/registration/' . strtolower($information['activity']->slug)),
					        'method' => 'get',
					        'id'     => 'select_league_form')); ?>		
					
			<div class="columns">
				<div class="third" style="width: 270px;">
					<b>District</b><br />
					<?php echo Form::select('league',
								    $information['leagues_list'],
								    null,
								    array('style' => 'margin-top: 0.5em;')); ?>
				</div>

				<div class="third" style="width: 200px;">
					<b>Key Code/Password</b><br />
					<?php echo Form::text('code',
								  (Auth::check() and Auth::user()->isOsaaUser()) ? 'STATEREGISTRATION' : null,
								  array('style' => 'margin-top: 0.5em;')); ?>

					<img src="<?php echo asset('/images/icons/ajax_loader2.gif'); ?>" alt="" title="" />
				</div>

				<div class="third" style="width: 60px;">
					<br />
					<?php echo Form::submit('Next', array('class' => 'button',
												  'style' => 'font-size: 9pt; margin-top: 0.5em;')); ?>
				</div>
			</div>					

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

	<?php else: ?>
		
		<?php /*  A League is selected  */ ?>
		<br />

		<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
			<img src="<?php echo asset('images/icons/bgf_64px.png'); ?>" alt="" title="" style="float: left; width: 64px; height: 64px; position: relative; top: -1em;" />
		<?php else: ?>			
			<img src="<?php echo asset('images/icons/ggf_64px.png'); ?>" alt="" title="" style="float: left; width: 64px; height: 64px; position: relative; top: -1em;" />
		<?php endif; ?>

		<div class="form_meta_notes">
			Form ID <?php echo $information['submission']->id; ?><br />
			Created at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->created_at)); ?><br />
			Updated at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->updated_at)); ?><br />
			<?php if (!is_null($information['submission']->submitted_at)): ?>
				Submitted at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->submitted_at)); ?><br />
			<?php endif; ?>
			<?php 
				if ($information['submission']->data->complete)
				{
					$registration_text = 'Form is complete';			
					$registration_icon = asset('images/icons/finished_16px.png');
				}				
				else
				{
					$registration_text = 'Form is incomplete';			
					$registration_icon = asset('images/icons/never_started_16px.png');
				}				
			?>
			<img src="<?php echo $registration_icon; ?>" alt="" title="" style="width: 12px; vertical-align: middle;" /> <?php echo $registration_text; ?>
		</div>

		<h1><?php echo preg_replace('/( \(.*\))/', '', $information['league']->slug); ?> <?php echo $information['league']->name; ?></h1>

		<br />

		<div class="online_form_instructions ui-corner-all">
			<span class="ui-icon ui-icon-info" style="display:inline-block; position:relative; top:2px;"></span>
			<b>Instructions</b> <br />
			<ol>
				<li>Required fields are noted with a red asterisk<span data-required="true"></span>, once a value is provided for a required field, it cannot be removed.</li>
				<li>Type names in "First Last" format.</li>
				<li>Additional instructions and hints are included before each section.</li>
				<li>Changes are automatically saved after a field's value is confirmed (i.e. clicking outside of a text box or tabbing to another field.)  If you refresh the page, you're saved information will be retained.  Some fields force the page to reload.</li>
				<li>Click the <b>Reset Form</b> button to erase all entries and start over from scratch.</li>
				<li>You can go back to the league selection page by clicking the <b>Back</b> button.</li>
				<?php if (Helpers::strEqual(substr($information['league']->slug, 0, 2), array('6A', '5A'))): ?>
					<li>Click the <b>Switch to
						<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
							Girls
						<?php else: ?>
							Boys
						<?php endif; ?>
						</b> button to switch over to the <?php echo preg_replace('/( \(.*\))/', '', $information['league']->slug); ?> <?php echo $information['league']->name; ?>
						<?php if (Helpers::strEqual($information['activity']->slug, 'BGF')): ?>
							Girls
						<?php else: ?>
							Boys
						<?php endif; ?>
						Golf form.</li>
				<?php endif; ?>
				<li>When finished, click <b>Submit</b> to turn in this form with the entries provided.  You will be able to edit the form after submitting.  You can re-submit the form as many times as necessary until the deadline.</li>			
				<li><b>Note:</b> All entries must be submitted by <?php echo date('g:i A l, F j, Y', strtotime($information['activity_form']->due_at)); ?> using this online form.</li>
			</ol>

			<br />

			For questions, contact <?php echo $information['staff']->first_name; ?> <?php echo $information['staff']->last_name; ?> at (503) 682-6722 x239 or by e-mail to <?php echo Helpers::obfuscateEmailLink ($information['staff']->email); ?>.  For technical assistance, you can email <?php echo Helpers::obfuscateEmailLink ("support@osaa.org"); ?>.
		</div>		

		<br />			

		<?php if (Session::has('errors')): ?>                
            <div class="ui-state-error" style="padding: 0.5em;">
				<span class="ui-icon ui-icon-alert" style="display:inline-block; position:relative; top:2px;"></span>
            	<?php foreach ($errors->all() as $error): ?><?php echo $error; ?> <?php endforeach; ?>
            </div>
            <br />
        <?php endif; ?>        
		
		<?php echo Form::open(array('url'    => url('/forms/submit'),
						    'method' => 'post',
						    'class'  => 'registration_form')); ?>

			<?php echo Form::hidden('form', 'REGISTRATION'); ?>
			<?php echo Form::hidden('league', $information['league']->slug); ?>
			<?php echo Form::hidden('activity', $information['activity']->slug); ?>
			<?php echo Form::hidden('league_form_id', $information['submission']->id); ?>

			<h1><?php echo preg_replace('/( \(.*\))/', '', $information['league']->slug); ?> <?php echo $information['league']->name; ?> (League) Tournament</h1>

			<div class="columns">

				<div class="half">
					<h2>Event</h2>
					<p class="gray note">When was the district (league) tournament and where was it held?  If your tournament spanned more than one day, just enter the last day.</p>
					
					<?php echo Form::label('district_event_date', 'Date'); ?>
					<?php echo Form::text('district_event_date',
								  date('m/d/Y', strtotime($information['submission']->data->district->event->date)),
								  array('data-required' => true,
								  		'data-date-picker' => true,
								  		'data-autosave' => true,
										'data-field' => 'data->district->event->date',
										'data-type' => 'date',
										'data-original' => date('m/d/Y', strtotime($information['submission']->data->district->event->date)),
								        'style' => 'width: 90px;')); ?>

					<br /><br />

					<?php echo Form::label('district_event_location', 'Location'); ?>
					<?php echo Form::text('district_event_location',
								  $information['submission']->data->district->event->location,
								  array('data-required' => true,								  		
								  		'data-autosave' => true,
										'data-field' => 'data->district->event->location',
										'data-type' => 'string',
										'data-original' => $information['submission']->data->district->event->location,
								        'style' => 'width: 300px;')); ?>

				</div>

				<div class="half">
					<h2>District Director</h2>	
					<p class="gray note">This information will not be published, OSAA staff will use this information to contact you if there are any questions.</p>
					
					<?php echo Form::label('director_name', 'Name'); ?>
					<?php echo Form::text('director_name',
								  $information['submission']->data->district->director->name,
								  array('data-required' => true,
								  		'data-format' => 'name',
								  		'data-autosave' => true,
										'data-field' => 'data->district->director->name',
										'data-type' => 'string',
										'data-original' => $information['submission']->data->district->director->name,
								        'style' => 'width: 175px;')); ?>

					<br /><br />

					<?php echo Form::label('director_phone', 'Mobile Phone'); ?>
					<?php echo Form::text('director_phone',
								  $information['submission']->data->district->director->phone,
								  array('data-required' => true,								  		
								  		'data-phone-field' => true,
								  		'data-autosave' => true,
										'data-field' => 'data->district->director->phone',
										'data-type' => 'string',
										'data-original' => $information['submission']->data->district->director->phone,
								        'style' => 'width: 110px;')); ?>

					<br /><br />

					<?php echo Form::label('director_email', 'E-Mail'); ?>
					<?php echo Form::text('director_email',
								  $information['submission']->data->district->director->email,
								  array('data-required' => true,
								  		'data-autosave' => true,
										'data-field' => 'data->district->director->email',
										'data-type' => 'string',
										'data-original' => $information['submission']->data->district->director->email,
								        'style' => 'width: 250px;')); ?>
					

				</div>

			</div>			

			<br class="clear" />						

			<h2>Team Participation</h2>

			<p class="gray note">For each team listed below, please enter in the number of varsity participants that competed at the district (league) tournament.</p>

			<?php
				$teams_select = array(' ' => '');
			?>

			<?php if (count($information['league_aps']) > 0): ?>

				<table class="teams">

					<thead>
						<tr>
							<th>Name</th>
							<th>Participants</th>
							<th>Athletic Director</th>
							<th>Coach Name</th>							
							<th>Coach E-mail</th>
							<th>Coach Mobile Phone</th>						
						</tr>
					</thead>

					<tbody>						

						<?php foreach ($information['league_aps'] as $index => $ap): ?>

							<?php
								$teams_select[$ap->id] = $ap->name;

								$ad_name = null;
								$name = null;
								$email = null;
								$phone = null;

								$school = School::findOrFail($ap->host_school);

								if (!is_null($school))
								{
									$coach = $school->getActivityProgramStaff($information['activity']->slug, 'Coach', 'V')->first();
									$ad = $school->getSchoolStaff('AD');									
								}
							?>

							<tr data-ap-id="<?php echo $ap->id; ?>">
								<td><b><?php echo $ap->name; ?></b></td>
								<td>
									<?php /*  Form::text('teams[' . $ap->id . '][number]',
											      (is_null($information['submission'])) ? null : $information['submission']->data->teams->{$ap->id}->number,
											      array('class' => 'participation_number numbers_only',
											      	    'style' => 'width: 50px;',
											      	    'data-required' => 'required',
											      	    'placeholder' => '#'))  */ ?>

									<?php echo Form::text('district_team_' . $index,
				       				   			  $information['submission']->data->district->teams[$index]->number,
				       				   			  array('class' => 'participation_number',
				       				   			  		'data-required' => true,
				       				  	 	            'data-format' => 'numbers_only',								  		
				       				  	 	            'data-autosave' => true,
				       					 	            'data-field' => 'data->district->teams[' . $index . ']->number',
				       					 	            'data-type' => 'int',
				       					 	            'data-original' => $information['submission']->data->district->teams[$index]->number,
				       				                    'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php if (!is_null($ad)): ?>
										<?php echo $ad->getDisplayName(); ?>
									<?php else: ?>
										No AD Listed
									<?php endif; ?>
								</td>
								<td>
									<?php if (!is_null($coach)): ?>
										<?php echo $coach->school_staff->getDisplayName(); ?>
									<?php else: ?>
										No Coach Listed
									<?php endif; ?>
								</td>							
								<td>
									<?php if (!is_null($coach) and !Helpers::strIsEmpty($coach->school_staff->email)): ?>
										<?php echo $coach->school_staff->email; ?>
									<?php else: ?>
										<img src="<?php echo asset('/images/icons/no_form_data_16px.png'); ?>" alt="" title="" style="vertical-align: middle;" /> Not Provided
									<?php endif; ?>
								</td>
								<td>
									<?php if (!is_null($coach) and !Helpers::strIsEmpty($coach->school_staff->mobile_phone)): ?>
										<?php echo Helpers::displayCombinedPhone($coach->school_staff->mobile_phone); ?>
									<?php else: ?>
										<img src="<?php echo asset('/images/icons/no_form_data_16px.png'); ?>" alt="" title="" style="vertical-align: middle;" /> Not Provided
									<?php endif; ?>
								</td>
							</tr>

						<?php endforeach; ?>

					</tbody>
				</table>

				<div class="small" style="margin-top: 0.25em;">
					Total number of varsity participants: <span id="total_participation"></span>
				</div>

			<?php else: ?>
				<div class="online_form_late ui-state-error ui-corner-all">
					<span class="ui-icon ui-icon-alert" style="display:inline-block; position:relative; top:2px;"></span>		
						No teams are assigned to this league.  This is a problem.  Contact <?php echo $information['staff']->first_name; ?> <?php echo $information['staff']->last_name; ?> for correcting this issue.
				</div>
			<?php endif; ?>			
			
			<br />

			<?php /*  6A Golf  */ ?>
			<?php if (Helpers::strEqual($information['league']->slug, array('6A-SD1 (2014-2017)', '6A-SD2 (2014-2017)', '6A-SD3 (2014-2017)'))): ?>


				<?php foreach ($information['regional_leagues'] as $index => $regional_league_object): ?>

					<h2><?php echo $regional_league_object->league->name; ?> Automatic Qualifying Team</h2>

					<p class="gray note">
						Select the automatically qualifying team from the <?php echo $regional_league_object->league->name; ?>.  Provide entries for their participants (up to 5) and be sure to spell names correctly.  If an entrant did not participate in the district tournament, enter "NS" for scores and "NP" for place.
					</p>

					<?php echo Form::label('district_qualifiers_team_' . $index, 'Team', array('style' => 'width: auto; vertical-align: middle;')); ?>
					<select name="district_qualifiers_team_<?php echo $index; ?>"							
							style="font-size: 12pt; margin-bottom: 0.5em;"
							data-required="true"
							data-autosave="true"
							data-field="data->district->qualifiers->teams[<?php echo $index; ?>]->ap_id"
							data-type="int"
							data-original="<?php echo $information['submission']->data->district->qualifiers->teams[$index]->ap_id; ?>">
						<option value=""></option>
						<?php foreach ($regional_league_object->aps as $ap): ?>
							<option	
								<?php if ($ap->id == $information['submission']->data->district->qualifiers->teams[$index]->ap_id): ?>
									selected="selected"
								<?php endif; ?>
								value="<?php echo $ap->id; ?>">
								<?php echo $ap->name; ?>
							</option>
						<?php endforeach; ?>
					</select>
	
					<table class="entries">

						<thead>
							<tr>
								<th style="width: 20px;">#</th>
								<th style="width: 10%;">Participant Name</th>								
								<th style="width: 50px;">Grade</th>
								<th style="width: 75px;">Rnd. 1 Score</th>
								<th style="width: 75px;">Rnd. 2 Score</th>
								<th style="width: 50px;">Place</th>
								<th style="width: 150px;"></th>								
							</tr>
						</thead>

						<tbody>											
							<?php for ($i = 0; $i < 5; $i++): ?>	
								<tr>
									<td><?php echo ($i + 1); ?></td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_name',
				       				   			      $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->name,
				       				   			  	  array('data-format' => 'name',				       				  	 	                
				       				  	 	                'data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->name',
				       					 	                'data-type' => 'string',
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->name,
				       				                        'style' => 'width: 200px; margin-right: 25px;')); ?>
									</td>									
									<td>
										<?php echo Form::select('district_qualifiers_team_' . $index . '_participant_' . $i . '_grade',
														$information['grades_list'],
														$information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->grade,
														array('data-autosave' => true,
				       					 	                  'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->grade',
				       					 	                  'data-type' => 'int',
				       					 	                  'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->grade,
				       				                          'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_score_1',
													  $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_1,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->score_1',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_1,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_score_2',
													  $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_2,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->score_2',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_2,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_place',
													  $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->place,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->place',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'place',
				       					 	                'data-ribbon' => true,
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->place,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php for ($j = 1; $j <= 20; $j++): ?>
											<img src="<?php echo asset('images/icons/ribbons/ribbon_' . $j . '_24px.png'); ?>" alt="" title="" class="ribbon_icon" style="display: none;" place="<?php echo $j; ?>" />
										<?php endfor; ?>
									</td>									
								</tr>						
							<?php endfor; ?>
						</tbody>
					</table>

					<br />

				<?php endforeach; ?>


				<h2>District Automatic Qualifying Individuals</h2>

				<p class="gray note">
					Select the two automatically qualifying individuals from the <?php echo $information['regional_leagues'][0]->league->name; ?> and two from the <?php echo $information['regional_leagues'][1]->league->name; ?>.  These individual should not be from an automatically qualifying team.
				</p>

				<table class="entries">

					<thead>
						<tr>
							<th style="width: 20px;">#</th>
							<th style="width: 10%;">Participant Name</th>								
							<th style="width: 50px;">Grade</th>
							<th style="width: 75px;">Rnd. 1 Score</th>
							<th style="width: 75px;">Rnd. 2 Score</th>
							<th style="width: 50px;">Place</th>
							<th style="width: 50px;"></th>
							<th style="width: 100px;">Team</th>								
						</tr>
					</thead>

					<tbody>																	
						<?php for ($i = 0; $i < 4; $i++): ?>	
							<?php if ($i == 0 or $i == 2): ?>
							<tr>
								<td colspan="8">
									<h3 style="margin: 0; padding: 0;"><?php echo $information['regional_leagues'][floor($i / 2)]->league->name; ?></h3>
								</td>
							</tr>

							<?php endif; ?>

							<tr>
								<td><?php echo ($i % 2) + 1; ?></td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_name',
			       				   			      $information['submission']->data->district->qualifiers->individuals[$i]->name,
			       				   			  	  array('data-format' => 'name',				       				  	 	                
			       				  	 	                'data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->name',
			       					 	                'data-type' => 'string',
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->name,
			       				                        'style' => 'width: 200px; margin-right: 25px;')); ?>
								</td>									
								<td>
									<?php echo Form::select('district_qualifiers_individual_' . $i . '_grade',
													$information['grades_list'],
													$information['submission']->data->district->qualifiers->individuals[$i]->grade,
													array('data-autosave' => true,
			       					 	                  'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->grade',
			       					 	                  'data-type' => 'int',
			       					 	                  'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->grade,
			       				                          'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_score_1',
												  $information['submission']->data->district->qualifiers->individuals[$i]->score_1,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->score_1',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->score_1,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_score_2',
												  $information['submission']->data->district->qualifiers->individuals[$i]->score_2,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->score_2',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->score_2,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_place',
												  $information['submission']->data->district->qualifiers->individuals[$i]->place,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->place',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'place',
			       					 	                'data-ribbon' => true,
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->place,
			       				                        'style' => 'width: 50px;')); ?>
								</td>								
								<td>
									<?php for ($j = 1; $j <= 20; $j++): ?>
										<img src="<?php echo asset('images/icons/ribbons/ribbon_' . $j . '_24px.png'); ?>" alt="" title="" class="ribbon_icon" style="display: none;" place="<?php echo $j; ?>" />
									<?php endfor; ?>
								</td>									
								<td>
									<select name="district_qualifiers_individual_<?php echo $i; ?>_"											
											style="width: 100px;"
											data-autosave="true"
											data-field="data->district->qualifiers->individuals[<?php echo $i; ?>]->ap_id"
											data-type="int"
											data-original="<?php echo $information['submission']->data->district->qualifiers->individuals[$i]->ap_id; ?>">
										<option value=""></option>
										<?php foreach ($information['regional_leagues'][floor($i / 2)]->aps as $ap): ?>
											<option	
												<?php if ($ap->id == $information['submission']->data->district->qualifiers->individuals[$i]->ap_id): ?>
													selected="selected"
												<?php endif; ?>
												value="<?php echo $ap->id; ?>">
												<?php echo $ap->name; ?>
											</option>
										<?php endforeach; ?>
									</select>
								</td>
							</tr>						
						<?php endfor; ?>
					</tbody>
				</table>

				<br />

				<div class="horizontal_divider" style="width: 100%;"></div>
				<br />

				<h1><?php echo $information['submission']->data->regional->name; ?></h1>				

				<div class="columns">

					<div class="half">
						<h2>Event</h2>
						<p class="gray note">Enter the date of the regional tournament and its location.  If the regional tournament spans more than one day, please enter the last day of the tournament.</p>
						
						<?php echo Form::label('regional_event_date', 'Date'); ?>
						<?php echo Form::text('regional_event_date',
									  date('m/d/Y', strtotime($information['submission']->data->regional->event->date)),
									  array('data-required' => true,
									  		'data-date-picker' => true,
									  		'data-autosave' => true,
											'data-field' => 'data->regional->event->date',
											'data-type' => 'date',
											'data-original' => date('m/d/Y', strtotime($information['submission']->data->regional->event->date)),
									        'style' => 'width: 90px;')); ?>

						<br /><br />

						<?php echo Form::label('regional_event_location', 'Location'); ?>
						<?php echo Form::text('regional_event_location',
									  $information['submission']->data->regional->event->location,
									  array('data-required' => true,								  		
									  		'data-autosave' => true,
											'data-field' => 'data->regional->event->location',
											'data-type' => 'string',
											'data-original' => $information['submission']->data->regional->event->location,
									        'style' => 'width: 300px;')); ?>

					</div>

					<div class="half">
						<h2>Regional Director</h2>	
						<p class="gray note">This information will not be published, OSAA staff will use this information to contact you if there are any questions.</p>
						
						<?php echo Form::label('regional_director_name', 'Name'); ?>
						<?php echo Form::text('regional_director_name',
									  $information['submission']->data->regional->director->name,
									  array('data-required' => true,
									  		'data-format' => 'name',
									  		'data-autosave' => true,
											'data-field' => 'data->regional->director->name',
											'data-type' => 'string',
											'data-original' => $information['submission']->data->regional->director->name,
									        'style' => 'width: 175px;')); ?>

						<br /><br />

						<?php echo Form::label('regional_director_phone', 'Mobile Phone'); ?>
						<?php echo Form::text('regional_director_phone',
									  $information['submission']->data->regional->director->phone,
									  array('data-required' => true,								  		
									  		'data-phone-field' => true,
									  		'data-autosave' => true,
											'data-field' => 'data->regional->director->phone',
											'data-type' => 'string',
											'data-original' => $information['submission']->data->regional->director->phone,
									        'style' => 'width: 110px;')); ?>

						<br /><br />

						<?php echo Form::label('regional_director_email', 'E-Mail'); ?>
						<?php echo Form::text('regional_director_email',
									  $information['submission']->data->regional->director->email,
									  array('data-required' => true,
									  		'data-autosave' => true,
											'data-field' => 'data->regional->director->email',
											'data-type' => 'string',
											'data-original' => $information['submission']->data->regional->director->email,
									        'style' => 'width: 250px;')); ?>
						

					</div>

				</div>			

				<br class="clear" />	

				<h2>Team Participation</h2>
				
				<p class="gray note">				
					Select the three teams from the <?php echo $information['regional_leagues'][0]->league->name; ?> and the three teams from the <?php echo $information['regional_leagues'][1]->league->name; ?> that are participating in the At-Large Regional Tournament.  None of these teams should be an automatically qualifying team.  Please also provide the number of varsity participants that represented each team at the regional tournament.
				</p>
				
				<div class="columns">

					<?php for ($i = 0; $i < 2; $i++): ?>
						<div class="half">
							<h3><?php echo $information['regional_leagues'][$i]->league->name; ?></h3>

							<?php for ($j = 0; $j < 3; $j++): ?>

								<?php echo Form::label('regional_' . $i . '_team_' . $j . '_id', 'Team', array('style' => 'width: auto;')); ?>
								<select name="regional_team_<?php echo (($i * 3) + $j); ?>_"
										style="width: 150px;"
										data-required="true"
										data-autosave="true"
										data-field="data->regional->teams[<?php echo (($i * 3) + $j); ?>]->ap_id"
										data-type="int"
										data-reload="true"
										data-original="<?php echo $information['submission']->data->regional->teams[(($i * 3) + $j)]->ap_id; ?>">
									<?php if (is_null($information['submission']->data->regional->teams[(($i * 3) + $j)]->ap_id)): ?>
										<option value=""></option>
									<?php endif; ?>
									<?php foreach ($information['regional_leagues'][$i]->aps as $ap): ?>
										<option	
											<?php if ($ap->id == $information['submission']->data->regional->teams[(($i * 3) + $j)]->ap_id): ?>
												selected="selected"
											<?php endif; ?>
											value="<?php echo $ap->id; ?>">
											<?php echo $ap->name; ?>
										</option>
									<?php endforeach; ?>
								</select>

								<?php echo Form::label('regional_' . $i . '_team_' . $j . '_number', '#', array('style' => 'width: auto; margin-left: 40px;')); ?>
								<?php echo Form::text('regional_' . $i . '_team_' . $j . '_number',
											  $information['submission']->data->regional->teams[(($i * 3) + $j)]->number,
											  array('data-format' => 'number',
											        'data-autosave' => true,
											        'data-field' => 'data->regional->teams[' . (($i * 3) + $j) . ']->number',
											        'data-type' => 'int',
											        'data-original' => $information['submission']->data->regional->teams[(($i * 3) + $j)]->number,
											        'style' => 'width: 50px;')); ?>
											  



								<br /><br />	

							<?php endfor; ?>
						</div>
					<?php endfor; ?>

				</div>

				<br class="clear" />


				<h2>Qualifying Teams from Regional</h2>				

				<p class="gray note">
					Select the two qualifying teams from the <?php echo $information['submission']->data->regional->name; ?>.  Provide entries for their participants (up to 5) and be sure to spell names correctly.  Provide scores from the district (league) tournament as well as the score from the regional tournament.  Enter "NS" if there are no scores for a column or "NP" if the individual has no placement at the regional tournament.
				</p>

				<?php for ($i = 0; $i < 2; $i++): ?>

					<?php echo Form::label('regional_qualifiers_team_' . $i, 'Team', array('style' => 'width: auto; vertical-align: middle;')); ?>
					<select name="regional_qualifiers_team_<?php echo $i; ?>"							
							style="font-size: 12pt; margin-bottom: 0.5em;"
							data-required="true"
							data-autosave="true"
							data-field="data->regional->qualifiers->teams[<?php echo $i; ?>]->ap_id"
							data-type="int"
							data-original="<?php echo $information['submission']->data->regional->qualifiers->teams[$i]->ap_id; ?>">
						<option value=""></option>
						<?php foreach ($information['regional_participating_aps'] as $regional_ap): ?>
							<option	
								<?php if ($regional_ap->id == $information['submission']->data->regional->qualifiers->teams[$i]->ap_id): ?>
									selected="selected"
								<?php endif; ?>
								value="<?php echo $regional_ap->id; ?>">
								<?php echo $regional_ap->name; ?>
							</option>
						<?php endforeach; ?>
					</select>

					<?php if (count($information['regional_participating_aps']) < 1): ?>
						<span class="gray note">
							This list will populate from the team participation selections.
						</span>
					<?php endif; ?>
	
					<table class="entries">

						<thead>
							<tr>
								<th style="width: 20px; vertical-align: bottom;">#</th>
								<th style="width: 10%; vertical-align: bottom;">Participant Name</th>								
								<th style="width: 50px; vertical-align: bottom;">Grade</th>
								<th style="width: 75px; vertical-align: bottom;">League Score<br />Round 1</th>
								<th style="width: 75px; vertical-align: bottom;">League Score<br />Round 2</th>
								<th style="width: 75px; vertical-align: bottom; padding-left: 10px;">Regional<br />Score</th>
								<th style="width: 50px; vertical-align: bottom;">Regional<br />Place</th>
								<th style="width: 150px; vertical-align: bottom;"></th>								
							</tr>
						</thead>

						<tbody>											
							<?php for ($j = 0; $j < 5; $j++): ?>	
								<tr>
									<td><?php echo ($j + 1); ?></td>
									<td>
										<?php echo Form::text('regional_qualifiers_team_' . $i . '_participant_' . $j . '_name',
				       				   			      $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->name,
				       				   			  	  array('data-format' => 'name',				       				  	 	                
				       				  	 	                'data-autosave' => true,
				       					 	                'data-field' => 'data->regional->qualifiers->teams[' . $i . ']->participants[' . $j . ']->name',
				       					 	                'data-type' => 'string',
				       					 	                'data-original' => $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->name,
				       				                        'style' => 'width: 200px; margin-right: 25px;')); ?>
									</td>									
									<td>
										<?php echo Form::select('regional_qualifiers_team_' . $i . '_participant_' . $j . '_grade',
														$information['grades_list'],
														$information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->grade,
														array('data-autosave' => true,
				       					 	                  'data-field' => 'data->regional->qualifiers->teams[' . $i . ']->participants[' . $j . ']->grade',
				       					 	                  'data-type' => 'int',
				       					 	                  'data-original' => $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->grade,
				       				                          'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('regional_qualifiers_team_' . $i . '_participant_' . $j . '_score_1',
													  $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->score_1,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->regional->qualifiers->teams[' . $i . ']->participants[' . $j . ']->score_1',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->score_1,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('regional_qualifiers_team_' . $i . '_participant_' . $j . '_score_2',
													  $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->score_2,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->regional->qualifiers->teams[' . $i . ']->participants[' . $j . ']->score_2',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->score_2,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td style="border-left: 1px solid gray; padding-left: 10px;">
										<?php echo Form::text('regional_qualifiers_team_' . $i . '_participant_' . $j . '_score_3',
													  $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->score_3,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->regional->qualifiers->teams[' . $i . ']->participants[' . $j . ']->score_3',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->score_3,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('regional_qualifiers_team_' . $i . '_participant_' . $j . '_place',
													  $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->place,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->regional->qualifiers->teams[' . $i . ']->participants[' . $j . ']->place',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'place',
				       					 	                'data-ribbon' => true,
				       					 	                'data-original' => $information['submission']->data->regional->qualifiers->teams[$i]->participants[$j]->place,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php for ($k = 1; $k <= 20; $k++): ?>
											<img src="<?php echo asset('images/icons/ribbons/ribbon_' . $k . '_24px.png'); ?>" alt="" title="" class="ribbon_icon" style="display: none;" place="<?php echo $k; ?>" />
										<?php endfor; ?>
									</td>									
								</tr>						
							<?php endfor; ?>
						</tbody>
					</table>

					<br />

				<?php endfor; ?>

				<h2>Qualifying Individuals from Regional</h2>

				<p class="gray note">
					Select the five qualifying individuals from the <?php echo $information['submission']->data->regional->name; ?>.  These individuals should not be from an automatically qualifying team or a regionally qualified team.  Provide scores from the district (league) tournament as well as the score from the regional tournament.  Enter "NS" if there are no scores for a column or "NP" if the individual has no placement at the regional tournament.
				</p>

				<table class="entries">

					<thead>
						<tr>
							<th style="width: 20px; vertical-align: bottom;">#</th>
							<th style="width: 10%; vertical-align: bottom;">Participant Name</th>								
							<th style="width: 50px; vertical-align: bottom;">Grade</th>
							<th style="width: 75px; vertical-align: bottom;">League Score<br />Round 1</th>
							<th style="width: 75px; vertical-align: bottom;">League Score<br />Round 2</th>
							<th style="width: 75px; vertical-align: bottom; padding-left: 10px;">Regional<br />Score</th>
							<th style="width: 50px; vertical-align: bottom;">Regional<br />Place</th>
							<th style="width: 50px; vertical-align: bottom;"></th>
							<th style="width: 100px; vertical-align: bottom;">Team</th>								
						</tr>
					</thead>

					<tbody>											
						<?php for ($i = 0; $i < 5; $i++): ?>	
							<tr>
								<td><?php echo ($i + 1); ?></td>
								<td>
									<?php echo Form::text('regional_qualifiers_individual_' . $i . '_name',
			       				   			      $information['submission']->data->regional->qualifiers->individuals[$i]->name,
			       				   			  	  array('data-format' => 'name',				       				  	 	                
			       				  	 	                'data-autosave' => true,
			       					 	                'data-field' => 'data->regional->qualifiers->individuals[' . $i . ']->name',
			       					 	                'data-type' => 'string',
			       					 	                'data-original' => $information['submission']->data->regional->qualifiers->individuals[$i]->name,
			       				                        'style' => 'width: 200px; margin-right: 25px;')); ?>
								</td>									
								<td>
									<?php echo Form::select('regional_qualifiers_individual_' . $i . '_grade',
													$information['grades_list'],
													$information['submission']->data->regional->qualifiers->individuals[$i]->grade,
													array('data-autosave' => true,
			       					 	                  'data-field' => 'data->regional->qualifiers->individuals[' . $i . ']->grade',
			       					 	                  'data-type' => 'int',
			       					 	                  'data-original' => $information['submission']->data->regional->qualifiers->individuals[$i]->grade,
			       				                          'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('regional_qualifiers_individual_' . $i . '_score_1',
												  $information['submission']->data->regional->qualifiers->individuals[$i]->score_1,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->regional->qualifiers->individuals[' . $i . ']->score_1',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->regional->qualifiers->individuals[$i]->score_1,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('regional_qualifiers_individual_' . $i . '_score_2',
												  $information['submission']->data->regional->qualifiers->individuals[$i]->score_2,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->regional->qualifiers->individuals[' . $i . ']->score_2',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->regional->qualifiers->individuals[$i]->score_2,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td style="border-left: 1px solid gray; padding-left: 10px;">
									<?php echo Form::text('regional_qualifiers_individual_' . $i . '_score_3',
												  $information['submission']->data->regional->qualifiers->individuals[$i]->score_3,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->regional->qualifiers->individuals[' . $i . ']->score_3',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->regional->qualifiers->individuals[$i]->score_3,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('regional_qualifiers_individual_' . $i . '_place',
												  $information['submission']->data->regional->qualifiers->individuals[$i]->place,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->regional->qualifiers->individuals[' . $i . ']->place',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'place',
			       					 	                'data-ribbon' => true,
			       					 	                'data-original' => $information['submission']->data->regional->qualifiers->individuals[$i]->place,
			       				                        'style' => 'width: 50px;')); ?>
								</td>								
								<td>
									<?php for ($j = 1; $j <= 20; $j++): ?>
										<img src="<?php echo asset('images/icons/ribbons/ribbon_' . $j . '_24px.png'); ?>" alt="" title="" class="ribbon_icon" style="display: none;" place="<?php echo $j; ?>" />
									<?php endfor; ?>
								</td>									
								<td>
									<select name="regional_qualifiers_individual_<?php echo $i; ?>_"											
											style="width: 100px;"
											data-autosave="true"
											data-field="data->regional->qualifiers->individuals[<?php echo $i; ?>]->ap_id"
											data-type="int"
											data-original="<?php echo $information['submission']->data->regional->qualifiers->individuals[$i]->ap_id; ?>">
										<option value=""></option>
										<?php foreach ($information['league_aps'] as $ap): ?>
											<option	
												<?php if ($ap->id == $information['submission']->data->regional->qualifiers->individuals[$i]->ap_id): ?>
													selected="selected"
												<?php endif; ?>
												value="<?php echo $ap->id; ?>">
												<?php echo $ap->name; ?>
											</option>
										<?php endforeach; ?>
									</select>
								</td>
							</tr>						
						<?php endfor; ?>
					</tbody>
				</table>

				
				<div class="horizontal_divider" style="width: 100%;"></div>
				<br />

			<?php /*  Other 6A Golfs  */ ?>
			<?php else: ?>

				<h2>Qualifying Teams</h2>

				<p class="gray note">
					Select the <?php echo count($information['submission']->data->district->qualifiers->teams); ?> qualifying teams from the <?php echo preg_replace('/( \(.*\))/', '', $information['league']->slug); ?> <?php echo $information['league']->name; ?>.  Provide entries for their participants (up to 5) and be sure to spell names correctly.  If an entrant did not participate in the district tournament, enter "NS" for scores and "NP" for place.
				</p>

				<?php for ($index = 0; $index < count($information['submission']->data->district->qualifiers->teams); $index++): ?>
				

					<?php echo Form::label('district_qualifiers_team_' . $index, 'Team', array('style' => 'width: auto; vertical-align: middle;')); ?>
					<select name="district_qualifiers_team_<?php echo $index; ?>"							
							style="font-size: 12pt; margin-bottom: 0.5em;"
							data-required="true"
							data-autosave="true"
							data-field="data->district->qualifiers->teams[<?php echo $index; ?>]->ap_id"
							data-type="int"
							data-original="<?php echo $information['submission']->data->district->qualifiers->teams[$index]->ap_id; ?>">
						<option value=""></option>
						<?php foreach ($information['league_aps'] as $ap): ?>
							<option	
								<?php if ($ap->id == $information['submission']->data->district->qualifiers->teams[$index]->ap_id): ?>
									selected="selected"
								<?php endif; ?>
								value="<?php echo $ap->id; ?>">
								<?php echo $ap->name; ?>
							</option>
						<?php endforeach; ?>
					</select>
	
					<table class="entries">

						<thead>
							<tr>
								<th style="width: 20px;">#</th>
								<th style="width: 10%;">Participant Name</th>								
								<th style="width: 50px;">Grade</th>
								<th style="width: 75px;">Rnd. 1 Score</th>
								<th style="width: 75px;">Rnd. 2 Score</th>
								<th style="width: 50px;">Place</th>
								<th style="width: 150px;"></th>								
							</tr>
						</thead>

						<tbody>											
							<?php for ($i = 0; $i < 5; $i++): ?>	
								<tr>
									<td><?php echo ($i + 1); ?></td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_name',
				       				   			      $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->name,
				       				   			  	  array('data-format' => 'name',				       				  	 	                
				       				  	 	                'data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->name',
				       					 	                'data-type' => 'string',
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->name,
				       				                        'style' => 'width: 200px; margin-right: 25px;')); ?>
									</td>									
									<td>
										<?php echo Form::select('district_qualifiers_team_' . $index . '_participant_' . $i . '_grade',
														$information['grades_list'],
														$information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->grade,
														array('data-autosave' => true,
				       					 	                  'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->grade',
				       					 	                  'data-type' => 'int',
				       					 	                  'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->grade,
				       				                          'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_score_1',
													  $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_1,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->score_1',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_1,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_score_2',
													  $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_2,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->score_2',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'score',
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->score_2,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php echo Form::text('district_qualifiers_team_' . $index . '_participant_' . $i . '_place',
													  $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->place,
													  array('data-autosave' => true,
				       					 	                'data-field' => 'data->district->qualifiers->teams[' . $index . ']->participants[' . $i . ']->place',
				       					 	                'data-type' => 'string',
				       					 	                'data-format' => 'place',
				       					 	                'data-ribbon' => true,
				       					 	                'data-original' => $information['submission']->data->district->qualifiers->teams[$index]->participants[$i]->place,
				       				                        'style' => 'width: 50px;')); ?>
									</td>
									<td>
										<?php for ($j = 1; $j <= 20; $j++): ?>
											<img src="<?php echo asset('images/icons/ribbons/ribbon_' . $j . '_24px.png'); ?>" alt="" title="" class="ribbon_icon" style="display: none;" place="<?php echo $j; ?>" />
										<?php endfor; ?>
									</td>									
								</tr>						
							<?php endfor; ?>
						</tbody>
					</table>

					<br /><br />

				<?php endfor; ?>


				<h2>Qualifying Individuals</h2>

				<p class="gray note">
					Select the other top <?php echo count($information['submission']->data->district->qualifiers->individuals); ?> qualifying individuals.  These individual should not be from an automatically qualifying team and must have placed in the top <?php echo count($information['submission']->data->district->qualifiers->individuals); ?>.
				</p>

				<table class="entries">

					<thead>
						<tr>
							<th style="width: 20px;">#</th>
							<th style="width: 10%;">Participant Name</th>								
							<th style="width: 50px;">Grade</th>
							<th style="width: 75px;">Rnd. 1 Score</th>
							<th style="width: 75px;">Rnd. 2 Score</th>
							<th style="width: 50px;">Place</th>
							<th style="width: 50px;"></th>
							<th style="width: 100px;">Team</th>								
						</tr>
					</thead>

					<tbody>																	
						<?php for ($i = 0; $i < count($information['submission']->data->district->qualifiers->individuals); $i++): ?>	
							
							<tr data-place="<?php echo ($i + 1); ?>">
								<td><?php echo ($i + 1); ?></td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_name',
			       				   			      $information['submission']->data->district->qualifiers->individuals[$i]->name,
			       				   			  	  array('data-format' => 'name',				       				  	 	                
			       				  	 	                'data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->name',
			       					 	                'data-type' => 'string',
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->name,
			       				                        'style' => 'width: 200px; margin-right: 25px;')); ?>
								</td>									
								<td>
									<?php echo Form::select('district_qualifiers_individual_' . $i . '_grade',
													$information['grades_list'],
													$information['submission']->data->district->qualifiers->individuals[$i]->grade,
													array('data-autosave' => true,
			       					 	                  'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->grade',
			       					 	                  'data-type' => 'int',
			       					 	                  'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->grade,
			       				                          'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_score_1',
												  $information['submission']->data->district->qualifiers->individuals[$i]->score_1,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->score_1',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->score_1,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_score_2',
												  $information['submission']->data->district->qualifiers->individuals[$i]->score_2,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->score_2',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'score',
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->score_2,
			       				                        'style' => 'width: 50px;')); ?>
								</td>
								<td>
									<?php echo Form::text('district_qualifiers_individual_' . $i . '_place',
												  $information['submission']->data->district->qualifiers->individuals[$i]->place,
												  array('data-autosave' => true,
			       					 	                'data-field' => 'data->district->qualifiers->individuals[' . $i . ']->place',
			       					 	                'data-type' => 'string',
			       					 	                'data-format' => 'place',
			       					 	                'data-ribbon' => true,
			       					 	                'data-original' => $information['submission']->data->district->qualifiers->individuals[$i]->place,
			       				                        'style' => 'width: 50px;')); ?>
								</td>								
								<td>
									<?php for ($j = 1; $j <= 20; $j++): ?>
										<img src="<?php echo asset('images/icons/ribbons/ribbon_' . $j . '_24px.png'); ?>" alt="" title="" class="ribbon_icon" style="display: none;" place="<?php echo $j; ?>" />
									<?php endfor; ?>
								</td>									
								<td>
									<select name="district_qualifiers_individual_<?php echo $i; ?>_"											
											style="width: 100px;"
											data-autosave="true"
											data-field="data->district->qualifiers->individuals[<?php echo $i; ?>]->ap_id"
											data-type="int"
											data-original="<?php echo $information['submission']->data->district->qualifiers->individuals[$i]->ap_id; ?>">
										<option value=""></option>
										<?php foreach ($information['league_aps'] as $ap): ?>
											<option	
												<?php if ($ap->id == $information['submission']->data->district->qualifiers->individuals[$i]->ap_id): ?>
													selected="selected"
												<?php endif; ?>
												value="<?php echo $ap->id; ?>">
												<?php echo $ap->name; ?>
											</option>
										<?php endforeach; ?>
									</select>
								</td>
							</tr>						
						<?php endfor; ?>
					</tbody>
				</table>

				<br />

				<div class="horizontal_divider" style="width: 100%;"></div>
				<br />				
				

			<?php endif; ?>
			
			

			<?php echo Form::submit('Submit', array('class' => 'button float_left',
										    'style' => 'font-size: 12pt;')); ?>

			<div style="float: left; margin-left: 50px;">
				<?php echo Form::label('test_mode', 'Enable Test Mode', array('style' => 'width: auto;')); ?>
				
				<?php echo Form::checkbox('test_mode', true, true, array('style' => 'vertical-align: middle;')); ?>					
								
				<div class="small gray note">
					If Test Mode is enabled, submitting the form will not send any e-mails.  This will allow you to check your form's submission without impacting anyone.
				</div>

			</div>

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

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

	<?php endif; ?>

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

