<?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 entries" style="font-size: 9pt;">Entries</div>
	        </div>
	        <div style="float: right; line-height: 32px; margin-left: 10px;">
	        	<div class="button submissions" style="font-size: 9pt;">Submissions</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

    <style type="text/css">
    	table {border-collapse: collapse; width: 100%;}
    	th {text-align: left;}
    	tr {height: 2em;}
    	.odd {background-color: #eeeeee;}
    	h3 { color: #990000 !important;}

    	/* Success Bar */
    	.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;
    	}

    </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.delete').button({ icons : { primary : 'ui-icon-closethick'}});	
	$('.button.add').button({ icons : { primary : 'ui-icon-plusthick'}});
	$('.button.save').button({ icons : { primary : 'ui-icon-disk'}});	
	$('.button.edit').button({ icons : { primary : 'ui-icon-pencil'}});	
	
	$('.button_set').buttonset();
	
	
	$('.tooltip').tooltip();	

	$('.accordion').accordion({active : false, collapsible : true, heightStyle : 'content'});
	
	
	$('.date_picker').datepicker({'dateFormat' : 'mm/dd/yy'});
								  
	
	$('[data-required="required"]').after('<span class="required_marker">*</span>');
	

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

	/* Limit input to letters only */	
	$('.alphas_only').bind('input', function()
	{
  	    $(this).val($(this).val().replace(/[^A-Za-z]/gi, ''));
	});
	
	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();


	$('[placeholder]').focus(function()
    {
        var input = $(this);
        if (input.val() == input.attr('placeholder'))
        {
            input.val('');
            input.removeClass('placeholder');
        }
    }).blur(function()
    {
        var input = $(this);
        if (input.val() == '' || input.val() == input.attr('placeholder'))
        {
            input.addClass('placeholder');
            input.val(input.attr('placeholder'));
        }
    }).blur();

    $('[placeholder]').parents('form').submit(function()
    {
        $(this).find('[placeholder]').each(function()
        {
            var input = $(this);
            if (input.val() == input.attr('placeholder'))
            {
                input.val('');
            }
        });
    });	
	

	/* Save information */
	$('.button.save').click(function ()
	{
		var form = $(this).parents('form');
		var input = $('<input />').attr('type', 'hidden').attr('name', 'save').val('true');
		$(form).append($(input));
		$(form).submit();
	});


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

    
    <?php /*  Include script for the league or school selection landing form  */ ?>
    <?php if (is_null($information['league']) and is_null($information['activity_program'])): ?>

	    /* 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' : 'SOL', '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 /*  Hide the school registration form if the user is not logged in  */ ?>
		<?php if (!Auth::check()): ?>		

			$('[data-form="school"] a').each(function ()
			{
				$(this).replaceWith($(this).text());
			});
			$('[data-form="school"] input').remove();		
			$('[data-form="school"]').addClass('ui-state-disabled');
			$('[data-form="school"] select').replaceWith('<div style="margin: 0.5em 0;">No schools to list.</div>');
			
			$('.main_content').append('<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-dialog-buttons ui-state-active" style="position: absolute; top: 250px; left: 600px; padding: 1em 0.5em; font-size: 10pt;">You must log in to access this form for schools.</div>');

		<?php endif; ?>

	<?php endif; ?>


	<?php /*  Include script for the league submission form  */ ?>
	<?php if (!is_null($information['league'])): ?>

		// Up and down sorting arrows
		var up_arrow = '<?php echo asset('/images/icons/bullet_arrow_up.png'); ?>';
		var down_arrow = '<?php echo asset('/images/icons/bullet_arrow_down.png'); ?>';

		// Bind a click event to table headers that are sortable
		$('thead').on('click', 'th[data-sortable="true"]', function()
		{
		    // Remove any sorting images
		    $('th[data-sortable="true"] img').remove();
		    
		    // Get the table and the set of rows
		    var table = $(this).parents('table').eq(0);
		    var rows = table.find('tr:gt(0)').toArray().sort(comparer($(this).index()));
		    
		    // Figure out sorting directions
		    this.asc = !this.asc;
		    var arrow = down_arrow;    	
		    if (!this.asc)
		    {
		    	rows = rows.reverse();	
		    	arrow = up_arrow;    	
		    }

		    // Recreate rows
		    for (var i = 0; i < rows.length; i++)
		    {
		    	table.append(rows[i]);
		    }

		    // Show sorting arrow
		    $(this).append('<img src=\'' + arrow + '\' style=\'position: absolute;\' />');

		    // Recolor the rows
		    colorRows();
		});

		// Bind hover events to the table headers that are sortable
		$('thead').on('mouseover', 'th[data-sortable="true"]', function ()
		{
			$(this).css('cursor', 'pointer');
		});
		
		$('thead').on('mouseout', 'th[data-sortable="true"]', function ()
		{
			$(this).css('cursor', 'auto');
		});
		
		// Compare string values
		function comparer(index)
		{
		    return function(a, b)
		    {
		        var valA = getCellValue(a, index);
		        var valB = getCellValue(b, index);
		        return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.localeCompare(valB);
		    }
		}
		
		// Get a table cell's value
		function getCellValue(row, index)
		{
			return $(row).children('td').eq(index).html();
		}





		/*
		 *
		 * Interactive grid prototype
		 *
		 */
		
		// Get the options for some drop-down lists
		var school_options = <?php echo $information['school_options']; ?>;
		var category_options = <?php echo $information['category_options']; ?>;
		var placement_options = <?php echo $information['placement_options']; ?>;

		/* rowMouseOverHandler
		 *
		 * This function handles the event when a table body row is hovered over
		 */
		function rowMouseOverHandler(row)
		{	
			// If this row is already being edited, do nothing
			if ($('tbody tr[data-editing]').size() > 0)
			{
				return false;
			}

			// Highlight this row
			row.addClass('ui-state-active')			   
			   .css('cursor', 'pointer')
			   .css('font-weight', 'normal');

			// Add a delete button
			$('td:nth-child(5)', row).append('<div class="button float_right"></div>');
			$('td:nth-child(5) .button', row).button(
											 {
											    text : false,
											    icons : { primary : 'ui-icon-closethick'}
											 })
											 .css({'margin-right' : '1em',
											       'position' : 'absolute',
											       'right' : '0',
											       'width' : '18px',
											       'height' : '18px'})
											 .hover(function ()
											 {												
											 	$(this).addClass('ui-state-active');
											 },
											 function ()
											 {
												$(this).removeClass('ui-state-active');											 
											 })
											 .click(function (event)
											 {
											 	 $('<div></div>').appendTo('body')
											 	 			     .html('<br /><img src="<?php echo asset('images/icons/delete_row_24px.png'); ?>" class="float_left" style="margin: 0.25em 1em 0.5em 0;" alt="" title="" />Are you sure you want to remove this row and delete this qualifier?')
											 	 			     .dialog(
											 	 			     {
																     autoOpen: true,
																     draggable: false,
																	 resizable: false,
																	 height:200,
																	 width: 400,
																	 title: 'Confirm Removal',
																	 modal: true,
																	 buttons: [
													      				{
													      					text : "Yes",
													      		   			'class' : "float_left",
													      		   			icons : { primary : 'ui-icon-check'},
													      		   		 	click : function()
													      		   		  		  {   						          
													      		   		  		  	  // Remove this row
													      		   		  		  	  row.remove();
																					  $(this).dialog( "close");
													      		   		  		  	  $(this).remove();

																					  // Recolor the rows
																					  colorRows();
																			       }
																		},
																		{
																			text : "No",
																			'class' : "float_right",
																			icons : { primary : 'ui-icon-cancel'},
																			click : function()
																					{
																			        	$(this).dialog( "close");;
													      		   		  		  	  	$(this).remove();
																			        }
																		}
																	 ],
															         open : function ()
																	 {  		         
																          $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt');
																          $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
																          $('.ui-dialog-titlebar').addClass('ui-state-highlight');
																      }
															    }); 
												
											     event.stopPropagation();
											 });
		}

		/* rowMouseOutHandler
		 *
		 * This function handles the event when a table body row is no longer hovered over
		 */
		function rowMouseOutHandler(row)
		{
			// If this row is being edited, do nothing
			if ($('tbody tr[data-editing]').size() > 0)
			{
				return false;
			}
			
			// Remove the highlight and delete button
			row.removeClass('ui-state-active');	
			$('td:nth-child(5) .button', row).remove();
		}

		/* rowClickHandler
		 *
		 * This function handles the event when a table body row is clicked
		 */
		function rowClickHandler(row)
		{
			// Get the cells of this row
			var first_name = $('td:nth-child(1)', row);
			var last_name = $('td:nth-child(2)', row);
			var school = $('td:nth-child(3)', row);
			var category = $('td:nth-child(4)', row);
			var placement = $('td:nth-child(5)', row);		
			
			// If the first cell is already a form field (i.e. already being edited), then skip it
			if ($('input', first_name).size() > 0)
			{
				return false;
			}

			// If no rows are being edited, then stop editing
			if ($('tbody tr[data-editing]').size() > 0)
			{
				stopEditing();
			}

			// Mark this row as being edited
			row.attr('data-editing', 'true');

			// Replace the cell values with form fields
			first_name.replaceWith("<td><input type='text' value='" + first_name.text() + "' style='width: 95%;' /></td>");
			last_name.replaceWith("<td><input type='text' value='" + last_name.text() + "' style='width: 95%;' /></td>");
			
			// Get the currently entered values for drop-down lists
			var selected_school = school.text();		
			var selected_category = category.text();
			var selected_placement = placement.text();
			
			school.replaceWith("<td><select style='max-width: 225px;'>" + school_options + "</select></td>");
			category.replaceWith("<td><select>" + category_options + "</select></td>");
			placement.replaceWith("<td><select>" + placement_options + "</select></td>");		

			// If a current school was selected, mark the option as selected in the drop-down list		
			if (selected_school != "")
			{		
				$('td:nth-child(3) option', row).each(function ()
				{
					var opt = $(this);
					if (opt.val() == selected_school)
					{
						opt.attr('selected', 'selected');
					}				
				});
			}

			// If a current category was selected, mark the option as selected in the drop-down list		
			if (selected_category != "")
			{
				$('td:nth-child(4) option', row).each(function ()
				{
					var opt = $(this);
					if (opt.val() == selected_category)
					{
						opt.attr('selected', 'selected');
					}				
				});
			}

			// If a current placement was selected, mark the option as selected in the drop-down list		
			if (selected_placement != "")
			{
				$('td:nth-child(5) option', row).each(function ()
				{
					var opt = $(this);
					if (opt.val() == selected_placement)
					{
						opt.attr('selected', 'selected');
					}				
				});
			}

			$('td:first input', row).focus();

			// Highlight this row
			row.addClass('ui-state-highlight');
		}

		/* stopEditing
		 *
		 * When called, this will remove the editing tag from a row and convert
		 * form inputs to text values.
		 */
		function stopEditing()
		{
			// Process each table row in the body
			$('tbody tr').each(function ()
			{
				var row = $(this);

				// Is this row being edited?
				if (row.is('[data-editing]'))
				{						
					// Remove the editing attribute and highlight
					row.removeClass('ui-state-highlight');
					row.removeAttr('data-editing');

					// Get the cells
					var first_name = $('td:nth-child(1)', row);
					var last_name = $('td:nth-child(2)', row);
					var school = $('td:nth-child(3)', row);
					var category = $('td:nth-child(4)', row);
					var placement = $('td:nth-child(5)', row);	

					// Replace the cells with their form values
					first_name.replaceWith("<td>" + $('input', first_name).val() + "</td>");
					last_name.replaceWith("<td>" + $('input', last_name).val() + "</td>");
					
					if ($('select', school).val().length > 35)
					{
						school.replaceWith("<td><small>" + $('select', school).val() + "</small></td>");
					}
					else
					{
						school.replaceWith("<td>" + $('select', school).val() + "</td>");
					}
					category.replaceWith("<td>" + $('select', category).val() + "</td>");
					placement.replaceWith("<td>" + $('select', placement).val() + "</td>");
				}

				// Remove any hover over effects
				row.removeClass('ui-state-active');
			});
		}

		// Click the add row button
		$('.button.add').on('click', function()
		{
			var add = 1;

			if ($(this).is('.five'))
			{
				add = 5;
			}

			for (var i = 0; i < add; i++)
			{

				// Add a newly created row
				var row = $('<tr><td></td><td></td><td></td><td></td><td>&nbsp;</td>');
				row.appendTo('tbody');
				
				// Bind the hover handlers
				row.hover(function ()
				{
					var row = $(this);
					rowMouseOverHandler(row);
				},
				function ()
				{
					var row = $(this);
					rowMouseOutHandler(row);
				});
				
				// Bind the click handler
				row.click(function (event)
				{		
					var row = $(this);

					rowClickHandler(row);
					
					// Prevent this click event from reaching higher levels
					event.stopPropagation();
				});
			}
			
			// Recolor the rows
			colorRows();
		});

		// Hover over an existing row in the table body
		$('tbody tr').hover(function ()
		{		
			var row = $(this);
			rowMouseOverHandler(row);		
		},
		function ()
		{
			var row = $(this);
			rowMouseOutHandler(row);		
		});	

		// Handle clicks anywhere on the page
		$(document).click(function (event)
		{
			stopEditing();				
		});


		// Handle clicks to a row in the table body
		$('tbody tr').click(function (event)
		{		
			var row = $(this);

			rowClickHandler(row);
			
			// Prevent this click event from reaching higher levels
			event.stopPropagation();		
		});


		$('input[type="submit"]').click(function (event)
		{
			event.preventDefault();

			var form = $(this).parent('form');

			$('<div></div>').appendTo('body')
				 			.html('<br /><img src="<?php echo asset('images/icons/help_24px.png'); ?>" class="float_left" style="margin: -0.25em 1em 0.5em 0;" alt="" title="" />Are you sure you want to submit this form?<div style="font-size: 9pt; margin-top: 2.25em;">Each time this form is submitted, e-mails will be sent to Kyle Stanfield of the OSAA, the district director, and to each qualifier\'s school.  It is recommended to submit this form only once, with all qualifiers listed from your district competition.</div>')
				 			.dialog(
				 			     {
							     autoOpen: true,
							     draggable: false,
								 resizable: false,
								 height: 300,
								 width: 400,
								 title: 'Confirm Submission',
								 modal: true,
								 buttons: [
				      				{
				      					text : "Yes",
				      		   			'class' : "float_left",
				      		   			icons : { primary : 'ui-icon-check'},
				      		   		 	click : function()
				      		   		  		  {   								      		   		  		  	  
												  $(this).dialog( "close");
				      		   		  		  	  $(this).remove();

				      		   		  		  	  $('<div><div>').addClass('ui-widget-overlay ui-front')
				      		   		  		  	  				 .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 ui-dialog-buttons')
				      		   		  		  	  				 .html('<br />Working...<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 and send e-mails.</div>');

				      		   		  		  	  form.submit();
										       }
									},
									{
										text : "No",
										'class' : "float_right",
										icons : { primary : 'ui-icon-cancel'},
										click : function()
												{
										        	$(this).dialog( "close");;
				      		   		  		  	  	$(this).remove();
										        }
									}
								 ],
						         open : function ()
								 {  		         
							          $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt');
							          $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
							          //$('.ui-dialog-titlebar').addClass('ui-state-highlight');
							      }
						    }); 
			 
			return false;				
		});
		

		// Handle form submission
		$('form').submit(function (event)
		{
			var form = $(this);
			var fields = new Array('first_name', 'last_name', 'school', 'category', 'placement');

			// Create an array of qualifiers
			var qualifiers = new Array();
			var i = 0;
			
			// Go through each row in the form
			$('tbody tr').each(function ()
			{
				var row = new Array();

				// Go through each column in this row and get its text value
				for (var j = 0; j < 5; j++)
				{
					row[j] = $('td:nth-of-type(' + (j + 1) + ')', this).text();					
				}							
				
				// Add this row's data to the array of qualifiers, if a first and last name was provided
				if (row[0] != "" && row[1] != '')
				{				
					qualifiers[i] = row;
					i = i + 1;
				}
				
			});
			
			// Go through all qualifiers and add them to the form's input
			for (i = 0; i < qualifiers.length; i++)
			{
				var qualifier = qualifiers[i];

				for (j = 0; j < qualifier.length; j++)
				{
					var input = $('<input>').attr('type', 'hidden')
											.attr('name', 'qualifiers[' + i + '][' + fields[j] + ']')
											.val(qualifier[j]);
					form.append($(input)); 
				}
			}
		});

	<?php endif; ?>

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


    	$('#submissions_report').dialog(
    		{
    			dialogClass : 'submission_content',
                autoOpen : false,                                  
                buttons : [ { text : 'Done', 'class' : 'float_right', click : function () { $(this).dialog('close'); }} ],
                draggable : true,                                                                   
                height : 600,                
                modal : false,                
              	resizable : false,
              	open : function ()
                	{      
                  		$('#submissions_report').html("<div class='ajax_loader' style='width:16px; height:11px; margin:4em auto; background-image: url(http://www.osaa.org/images/icons/ajax_loader2.gif); background-repeat:no-repeat;'></div>");                  

                  		var jqxhr = $.ajax(
                                {
                                    type : 'GET',
                                    url : '/reports/sol-registrations',
                                    dataType : 'html'
                                })
                               .done(function (data)
                                {
                                    $('#submissions_report').html(data);
                                })
                               .fail(function ()
                                {
                                    $('#submissions_report').html('There was an error.');
                                });
                  
                  		$('.submission_content .ui-dialog-buttonpane').css('padding', '0').css('font-size', '8pt');
                  		$('.submission_content .ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');  
              		},
              	show : { effect : 'highlight', delay : 0, duration : 400, easing : 'easeInOutSine' },
              	title : 'OSAA Solo Music District Submissions', 
              	width : 650              	
            }
        );
                 

        $('.button.submissions').click(function () { $('#submissions_report').dialog('open'); });      


        $('#entries_report').dialog(
    		{
    			dialogClass : 'entry_content',
                autoOpen : false,                                  
                buttons : [ { text : 'Done', 'class' : 'float_right', click : function () { $(this).dialog('close'); }} ],
                draggable : true,                                                                   
                height : 300,                
                modal : false,                
              	resizable : false,
              	open : function ()
                	{      
                  		$('#entries_report').html("<div class='ajax_loader' style='width:16px; height:11px; margin:4em auto; background-image: url(http://www.osaa.org/images/icons/ajax_loader2.gif); background-repeat:no-repeat;'></div>");                  

                  		var jqxhr = $.ajax(
                                {
                                    type : 'GET',
                                    url : '/reports/sol-entries',
                                    dataType : 'html'
                                })
                               .done(function (data)
                                {
                                    $('#entries_report').html(data);
                                })
                               .fail(function ()
                                {
                                    $('#entries_report').html('There was an error.');
                                });
                                   

                  		$('.entry_content .ui-dialog-buttonpane').css('padding', '0').css('font-size', '8pt');
                  		$('.entry_content .ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');  
              		},
              	show : { effect : 'highlight', delay : 0, duration : 400, easing : 'easeInOutSine' },
              	title : 'OSAA Solo Music Entries', 
              	width : 500              	
            }
        );
                 

        $('.button.entries').click(function () { $('#entries_report').dialog('open'); });  

    <?php endif; ?>

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

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

	<?php if (!is_null($information['league'])): ?>
		<a href="<?php echo url('/forms/registration/sol'); ?>" class="button back tooltip" style="font-size:9pt; margin-right: 8px;" title="Discard any unsaved changes and go back to the team selection page.">Back</a>						
	<?php else: ?>
		<a href="<?php echo url('/activities/sol'); ?>" class="button close tooltip" style="font-size:9pt; margin-right: 8px;" title="Discard any unsaved changes and close this form.">Close</a>		
	<?php endif; ?>

<?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 if ($information['is_past_due']): ?>
		<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>
			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; ?>

	

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

		<?php /*  Need to select an league or activity program  */ ?>
		
		<br />		

		<div class="columns" style="position: relative;">

			<div style="position: absolute; border-left: 1px solid #d9e1e0; height: 625px; left: 510px;"></div>

			<div class="half" data-form="district">

				<h1>District Results - For District Directors</h1>

				<br />

				<p>
					This form is for <b>District Directors</b> to submit district contest results identifying state qualifiers.
				</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>Begin by selecting the special district from the drop-down list.</li>
						<li>Then please enter the key code/password provided by the OSAA.</li>
						<li>Click <b>Next</b> to continue with the selection.</li>
						<li><b>Note:</b> All entries must be submitted by <?php echo date('g:i A l, F j, Y', strtotime('2016-03-14 16:00:00')); ?> 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 /><br />	
				
				<h2>Special Districts</h2>		
				
				<?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: 155px;">
							<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(); ?>

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

				<h2>Note to District Directors</h2>
				<p>
					Use this form to submit your district's results.  You may resubmit this form as many times as needed until the deadline.  To complete this form, you will need to supply the following information.
					<ul>
						<li>Your contact information (name, e-mail address, phone number)</li>
						<li>State qualifiers' information (name, school, category, placement)</li>
					</ul>

				</p>
			</div>


			<div class="half" style="padding: 0; margin-left: 20px;" data-form="school">
				<h1>Qualifier Registration - For Schools</h1>

				<br />

				<p>
					This form is for <b>Schools</b> to register their state qualifiers for the state championship.
				</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>You must be logged in and authorized to use this form.</li>
						<li>Begin by selecting your school from the drop-down list.</li>							
						<li>Click <b>Next</b> to continue with the selection.</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 /><br />	
				
				<h2>Schools</h2>		
				
				<?php echo Form::open(array('url'    => url('/forms/registration/' . strtolower($information['activity']->slug)),
								    'method' => 'get',
								    'id'     => 'select_school_form')); ?>							
					
					<b>School</b><br />
					<?php echo Form::select('activity_program',
								    $information['aps_list'],
								    null,
								    array('style' => 'margin-top: 0.5em; margin-right: 55px;')); ?>			
					
					<?php echo Form::submit('Next', array('class' => 'button',
												  'style' => 'font-size: 9pt;')); ?>
				<?php echo Form::close(); ?>
				
				<br />
				<div class="horizontal_divider" style="width: 100%;"></div>
				<br />

				<h2>Note to Schools</h2>
				<p>
					District Directors must submit their form to indicate which participants qualified for the state championship first.  However, schools must then follow through and register their qualified participants.  Just because a student qualified for state does not mean he or she is automatically registered for state.
				</p>				
				<p>
					Use this form to register your school's students.  You may resubmit this form as many times as needed until the deadline.
				</p>

			</div>
		</div>

		<br class="clear" />
		

	<?php elseif (!is_null($information['league'])): ?>
		
		<?php /*  A league is selected  */ ?>
		<br />

		<img src="<?php echo asset('images/icons/music_64px.png'); ?>" alt="" title="" style="float: left; width: 64px; height: 64px; position: relative; top: -1em; margin-right: 0.5em;" />
		

		<div class="float_right" style="width: 325px; height: 4em; position: relative; top: -1em; text-align: right; color: #7d7b7d;">
			<?php if (!is_null($information['submission'])): ?>

			
				Form entries created at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->created_at)); ?>.<br />
				Last updated at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->updated_at)); ?>.<br />

				<?php if ($information['submission']->data->complete): ?>
					<img src="<?php echo asset('images/icons/check_mark_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Complete</span>
				<?php else: ?>
					<img src="<?php echo asset('images/icons/incomplete_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Incomplete</span>
				<?php endif; ?>
			
			<?php else: ?>
				<img src="<?php echo asset('images/icons/incomplete_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Incomplete</span>
			<?php endif; ?>
		</div>

		<h1><?php echo $information['league']->name; ?> Solo Contest Qualifiers</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>Use this form to record the OSAA Solo Music State Championship qualifiers from the <?php echo $information['league']->name; ?> Solo Contest.</li>
				<li>Required fields are noted with a red asterisk<span class="required_marker" style="margin-left: 0;">*</span>.</li>
				<li>Additional instructions and hints are included before each section.</li>
				<li>Click <b>Save</b> at any time to save your entries without submitting the form.</li>			
				<li>When finished, click <b>Submit</b> to turn in this form with the entries provided.  E-mails will be sent to <?php echo $information['staff']->first_name; ?> <?php echo $information['staff']->last_name; ?>, the district director, and to the schools of the listed qualifiers.</li>			
				<li>You can go back to the league selection page by clicking the <b>Back</b> button.  You will lose all unsaved entries.</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: 2px 4px;">
				<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('activity', $information['activity']->slug); ?>
			<?php echo Form::hidden('league', $information['league']->slug); ?>			
									
                                        
			
			<div class="columns">

				<div class="half">
					
					<h2>District Director</h2>	
					<p class="gray note">Who is the district director?</p>
					<dl>
					
						<dt><?php echo Form::label('director[name]', 'Name'); ?></dt>
						<dd><?php echo Form::text('director[name]',
									      (is_null($information['submission'])) ? null : $information['submission']->data->director->name,
									      array('style' => 'width: 175px;', 'data-required' => 'required', 'placeholder' => 'First Last')); ?></dd>

						<dt><?php echo Form::label('director[email]', 'E-mail'); ?></dt>
						<dd><?php echo Form::text('director[email]',
										  (is_null($information['submission'])) ? null : $information['submission']->data->director->email,
										  array('style' => 'width: 225px;', 'placeholder' => 'E-mail address', 'data-required' => 'required')); ?></dd>

						<dt><?php echo Form::label('director[phone]', 'Phone'); ?></dt>
						<dd><?php echo Form::text('director[phone]',
									      (is_null($information['submission'])) ? null : preg_replace('/[^0-9]/', '', $information['submission']->data->director->phone),
									      array('class' => 'numbers_only', 'style' => 'width: 100px;', 'placeholder' => '##########', 'data-required' => 'required')); ?></dd>

					</dl>

					<div class="button save float_right" style="font-size: 9pt;">Save</div>
				</div>

				<div class="third" style="margin-left: 15%; padding: 0;">
					
					<h3>Schools in <?php echo $information['league']->name; ?></h3>	
					
					<div style="font-size: 10pt;">
						<?php if (count($information['league_aps']) > 7): ?>
							<div class="columns">
								<div class="half">
						<?php endif; ?>

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

							<?php if ($i > 6): ?>
								</div>
								<div class="half">
							<?php endif; ?>
						
							<?php echo $ap->name; ?><br />

						<?php endforeach; ?>


						<?php if (count($information['league_aps']) > 7): ?>
								</div>
							</div>
						<?php endif; ?>
					</div>

				</div>

			</div>			

			<br class="clear" />			

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

			<h2>Qualifiers</h2>

			<p class="gray note">
				Contest judges must choose the three top 1‐rated soloists in each category whom they feel are of Solo State Championships quality and list them in order of preference (First Place, Second Place, and Third Place.)  No ties are accepted. It is not possible to send the top‐rated contestant in a category if no one in that category received a one rating.
			</p>
			<p class="gray note">
				Add all qualifiers to the grid below, click the <b>Add Row</b> or <b>Add 5 Rows</b> buttons to add additional rows.  Columns can be sorted by clicking the column header. Click a row to edit its values.  To delete a row, hover over the row and click the <b>X</b> button on the right.
			</p>
			<p class="gray note">
				You must provide the qualifier's first name, last name, school, music category, and placement.  Partial qualifier entries will not be saved.  Empty rows will be ignored.
			</p>

			<table style="border-bottom: 1px solid #7d7b7d;">
				<thead style="border-bottom: 2px solid #b0dcff;">
					<tr>
						<th style="width: 160px; position: relative;" data-sortable="true">First Name <span class="required_marker" style="margin-left: 0;">*</span></th>
						<th style="width: 160px; position: relative;" data-sortable="true">Last Name <span class="required_marker" style="margin-left: 0;">*</span></th>
						<th style="width: 235px; position: relative;" data-sortable="true">School <span class="required_marker" style="margin-left: 0;">*</span></th>
						<th style="width: 205px; position: relative;" data-sortable="true">Category <span class="required_marker" style="margin-left: 0;">*</span></th>						
						<th style="width: 260px; position: relative;" data-sortable="true">Placement <span class="required_marker" style="margin-left: 0;">*</span></th>
					</tr>
				</thead>			

				<tbody>				
					
					<?php if (!is_null($information['submission']) and count($information['submission']->data->qualifiers) > 0): ?>
						
						<?php foreach ($information['submission']->data->qualifiers as $qualifier): ?>

							<tr>
								<td><?php echo $qualifier->first_name; ?></td>
								<td><?php echo $qualifier->last_name; ?></td>
								<td><?php echo $qualifier->school; ?></td>
								<td><?php echo $qualifier->category; ?></td>
								<td><?php echo $qualifier->placement; ?></td>
							</tr>

						<?php endforeach; ?>

					<?php endif; ?>					

				</tbody>

			</table>

			<br class="clear" />

			<div class="button add float_left" style="font-size: 9pt;">Add Row</div>
			<div class="button add five float_left" style="font-size: 9pt; margin-left: 10px;">Add 5 Rows</div>


			<div class="button save float_right" style="font-size: 9pt;">Save</div>
			
			<br class="clear" />			

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

			
			<div style="float: right; width: 80%; padding-top: 0.5em;">
				Click <b>Submit</b> to turn in your district contest's state qualifiers and to send notification e-mails.
			</div>


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

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

	<?php elseif (!is_null($information['activity_program'])): ?>

		<?php /*  An activity program is selected  */ ?>

		<br />
		
		<img src="<?php echo asset('images/icons/music_64px.png'); ?>" alt="" title="" style="float: left; width: 64px; height: 64px; position: relative; top: -1em; margin-right: 0.5em;" />

		<div class="float_right" style="width: 325px; height: 4em; position: relative; top: -1em; text-align: right; color: #7d7b7d;">
			<?php if (!is_null($information['submission'])): ?>

			
				Form entries created at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->created_at)); ?>.<br />
				Last updated at <?php echo date('g:i a m/d/Y', strtotime($information['submission']->updated_at)); ?>.<br />

				<img src="<?php echo asset('images/icons/check_mark_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Saved</span>				
			
			<?php else: ?>
				<img src="<?php echo asset('images/icons/incomplete_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Never Saved</span>
			<?php endif; ?>
		</div>

		<h1>Register Solo Participants for <?php echo $information['activity_program']->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>Use this form to register your school's contestants for state.</li>
				<li>Each student must be registered separately.</li>
				<li>Only district qualifiers will appear on this form.</li>
				<li>Required fields are noted with a red asterisk<span class="required_marker" style="margin-left: 0;">*</span>.</li>
				<li>Additional instructions and hints are included before each section.</li>
				<li>Click <b>Save</b> at any time to save your entries.  Every time you save your form, you will receive an e-mail indicating which qualifiers are registered or not.</li>							
				<li><b>Note:</b> All registrants must be saved 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 ($information['league_submitted']): ?>			
			
			<h2>Qualifiers</h2>

			<br />

			<?php echo Form::open(array('url'    => url('/forms/submit'),
						    	'method' => 'post',
						    	'class'  => 'registration_form',
						    	'style'  => 'position: relative;')); ?>

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


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

					<div class="button save float_right" style="font-size: 9pt; position: absolute; top: -3.5em; right: 0;">Save</div>

					<div class="qualifiers accordion">

						<?php foreach ($information['ap_qualifiers'] as $i => $qualifier): ?>

							<h4>
								<?php if ($qualifier->registered): ?>
									<img src="<?php echo asset('/images/icons/check_24px.png'); ?>" alt="" title="" style="float: left; position: relative; top: -3px; margin-right: 4px;" />
									<div class="float_right">
										Registered
									</div>
								<?php else: ?>
									<img src="<?php echo asset('/images/icons/circle_x_24px.png'); ?>" alt="" title="" style="float: left; position: relative; top: -3px; margin-right: 4px;" />
									<div class="float_right">
										Not Registered
									</div>
								<?php endif; ?>
								<?php echo $qualifier->first_name; ?> <?php echo $qualifier->last_name; ?> - <?php echo $qualifier->category; ?>
							</h4>
							
							<div style="font-size: 10pt; background-image: url('<?php echo asset('/images/icons/sol_arrow_bg.png'); ?>'); background-repeat: no-repeat; background-position: 100% 49%;">

								<h3>Student Qualifier</h3>

								<p class="small gray note">
									Spelling corrections for qualifier names can be sent to <?php echo $information['staff']->first_name; ?> <?php echo $information['staff']->last_name; ?> via <?php echo Helpers::obfuscateEmailLink ($information['staff']->email); ?>.
								</p>

								<div class="columns">

									<div class="fourth">										
										
										<?php echo Form::label('participants[' . $i . '][first_name]',
													   'First Name',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][first_name]',
													  $qualifier->first_name,
													  array('readonly' => 'readonly',
													  		'data-required' => 'required',
													  		'style' => 'background-color: #d9e1e0;')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][category]',
													   'Category',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][category]',
													  $qualifier->category,
													  array('readonly' => 'readonly',
													  		'data-required' => 'required',
													  		'style' => 'background-color: #d9e1e0;')); ?>
									</div>

									<div class="fourth">
										<?php echo Form::label('participants[' . $i . '][last_name]',
												       'Last Name',
												       array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][last_name]',
													  $qualifier->last_name,
													  array('readonly' => 'readonly',
													  		'data-required' => 'required',
													  		'style' => 'background-color: #d9e1e0;')); ?>


										<br /><br />

										<?php echo Form::label('participants[' . $i . '][placement]',
												       'Placement',
												       array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][placement]',
													  $qualifier->placement,
													  array('readonly' => 'readonly',
													  		'data-required' => 'required',
													  		'style' => 'background-color: #d9e1e0;')); ?>

									</div>

									<div class="fourth">										
										
										<?php echo Form::label('participants[' . $i . '][grade]',
													   'Grade',
													   array('style' => 'display: inline-block; width: 41px; font-weight: bold; text-align: right; margin-right: 1em;')); ?><br />
										<?php echo Form::select('participants[' . $i . '][grade]',
													    array('' => '', '9' => '9', '10' => '10', '11' => '11', '12' => '12'),
													    $qualifier->grade,
													    array('data-required' => 'required')); ?>										
									</div>

									<div class="fourth text_center ui-corner-all ui-state-highlight" style="padding: 1em 0; border:1px solid #e17009;">										
														
										<?php echo Form::label('participants[' . $i . '][registered]', 'Register for State?', array('style' => 'font-weight: bold;')); ?>
										<?php echo Form::checkbox('participants[' . $i . '][registered]', true, $qualifier->registered); ?>
										<br />
										<span class="small gray">
											Check this box to register this qualifier<br />for state consideration.
										</span>

									</div>

								</div>

								<br class="clear" />

								<div class="columns">

									<div class="half">
										<h3>Director</h3>

										<?php echo Form::label('participants[' . $i . '][director_first_name]',
													   'First Name',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][director_first_name]',
													  $qualifier->director_first_name,
													  array('data-required' => '!required')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][director_last_name]',
													   'Last Name',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][director_last_name]',
													  $qualifier->director_last_name,
													  array('data-required' => '!required')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][director_phone]',
													   'Phone Number',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][director_phone]',
													  $qualifier->director_phone,
													  array('data-required' => '!required')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][director_email]',
													   'E-Mail',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][director_email]',
													  $qualifier->director_email,
													  array('data-required' => '!required')); ?>

										<br /><br />
										
									</div>

									<div class="half">

										<h3>Accompanist</h3>

										<?php echo Form::label('participants[' . $i . '][accompanist_first_name]',
													   'First Name',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][accompanist_first_name]',
													  $qualifier->accompanist_first_name,
													  array('data-required' => '!required')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][accompanist_last_name]',
													   'Last Name',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][accompanist_last_name]',
													  $qualifier->accompanist_last_name,
													  array('data-required' => '!required')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][accompanist_phone]',
													   'Phone Number',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][accompanist_phone]',
													  $qualifier->accompanist_phone,
													  array('data-required' => '!required')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][accompanist_email]',
													   'E-Mail',
													   array('style' => 'display: inline-block; width: 115px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][accompanist_email]',
													  $qualifier->accompanist_email,
													  array('data-required' => '!required')); ?>									

									</div>
								</div>

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

								<div class="columns">

									<div class="half">
										<h3>Selections</h3>

										<div style="margin-left: 130px; display: inline-block;">
											<b>Title</b>
										</div>
										<div style="margin-left: 115px; display: inline-block;">											
											<b>Composer</b>
										</div>

										<?php echo Form::label('participants[' . $i . '][selection_1_title]',
													   '1st Selection',
													   array('style' => 'display: inline-block; width: 100px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][selection_1_title]',
													  $qualifier->selection_1_title,
													  array('style' => 'width: 150px;')); ?>
										<?php echo Form::text('participants[' . $i . '][selection_1_composer]',
													  $qualifier->selection_1_composer,
													  array('style' => 'width: 150px;')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][selection_2_title]',
													   '2nd Selection',
													   array('style' => 'display: inline-block; width: 100px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][selection_2_title]',
													  $qualifier->selection_2_title,
													  array('style' => 'width: 150px;')); ?>
										<?php echo Form::text('participants[' . $i . '][selection_2_composer]',
													  $qualifier->selection_2_composer,
													  array('style' => 'width: 150px;')); ?>

										<br /><br />

										<?php echo Form::label('participants[' . $i . '][selection_3_title]',
													   '3rd Selection',
													   array('style' => 'display: inline-block; width: 100px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
										<?php echo Form::text('participants[' . $i . '][selection_3_title]',
													  $qualifier->selection_3_title,
													  array('style' => 'width: 150px;')); ?>
										<?php echo Form::text('participants[' . $i . '][selection_3_composer]',
													  $qualifier->selection_3_composer,
													  array('style' => 'width: 150px;')); ?>

									</div>

									<div class="half">
										<h3>Comments</h3>

										<?php echo Form::textarea('participants[' . $i . '][comments]',
													  	  $qualifier->comments,
													  	  array('style' => 'height: 9em;')); ?>

									</div>

								</div>

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



							</div>

						<?php endforeach; ?>

					</div>


					<br />

					<div class="button save float_right" style="font-size: 9pt;">Save</div>

				<?php else: ?>


					There are no district qualifiers from <?php echo $information['activity_program']->name; ?>.

				<?php endif; ?>

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

			<h2>Missing District Results</h2>

			<p>
				The results from the <?php echo $information['activity_program']->league; ?> District Contest have not been submitted, yet.  The district director must use the results form and supply the state qualifiers before you can register your students for state.
			</p>

		<?php endif; ?>	



	<?php endif; ?>


	

	<div id="submissions_report" style="display: none;"></div>

	<div id="entries_report" style="display: none;"></div>

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

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

