<?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 style="float: right; line-height: 32px; margin-left: 10px;">
	        	<div class="button download all_entries" style="font-size: 9pt;" target="_blank">Download All Entries</div>
	        </div>	       

	        <div style="float: right; line-height: 32px; margin-left: 10px;">
	        	<div class="button download choir_program" style="font-size: 9pt;" target="_blank">Choir Program</div>
	        </div>      

	        <div style="float: right; line-height: 32px; margin-left: 10px;">
	        	<div class="button download band-orchestra_program" style="font-size: 9pt;" target="_blank">Band/Orchestra Program</div>
	        </div>  

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

<?php $__env->startSection('page_sub_title'); ?>    
	Application to Participate in the Music State Championships

	<?php if (!is_null($info['division'])): ?>

		<a href="<?php echo url('/forms/registration/music'); ?>" class="button back">Back</a>

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

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

    <style type="text/css">
    	
    	h1 { line-height: 18pt; }
    	h3 { color: #990000 !important;}

    	.page_functions {
    		width: auto !important;
    	}

    	table.applications {
    		width: 100%;
    		border-collapse: collapse;
    		font-size: 9pt;
    	}

    	table.applications thead th {
    		text-align: left;
    		vertical-align: bottom;
    	}

    	table.applications tbody td {
    		/*line-height: 1em;*/
    		/*padding-right: 15px;*/
    	}

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

    	table.applications tbody tr.not_selected {
    		text-decoration: line-through;
    	}

    	
    	table.music {
    		width: 100%;
    		border-collapse: collapse;
    	}

    	table.music thead th {
    		text-align: left;
    		vertical-align: bottom;
    	}

    	table.music tbody td {
    		line-height: 2em;
    		padding-right: 15px;
    	}

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

    	table.music tbody td input {
    		width: 100%;
    	}

    	.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;
    	}

    	/* Help Dialog */
        .help_dialog {
            font-size: 10pt;
        }

        .help_dialog h1 {
            font-size: 14pt;
            color: #005fa9;
            margin: 1em 0 1em 0;
        }

        .help_dialog h2 {
            font-size: 12pt;
            color: #990000;
            margin: 1em 0 0.5em 0;
        }

        .help_dialog h3 {
            font-size: 10pt;
            color: #000000 !important;
            margin: 0.75em 0 0em 0;
        }

        .help_dialog ul, ol {
            margin-left: 28px;
        }

        .help_dialog dl dt {
            float: left;
            width: 200px;
            text-align: right;
            margin-right: 20px;
            font-weight: bold;
            clear: both;
        } 

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

<?php $__env->startSection('jquery_init'); ?>
	$('.tooltip').tooltip();

	$('.button').button();
	$('.button.apply')
		.css({'font-size' : '10pt', 'margin' : '0.5em 0'});
	$('.button.back')
		.button({icons : { primary : ' ui-icon-arrowthick-1-w'} })
		.css({'font-size' : '9pt', 'float' : 'right', 'position' : 'relative', 'top' : '-0.5em'});
	$('.button.map_link')
		.button({ icons : { primary : 'ui-icon-pin-s' }});
	$('.button.download')
		.button({ icons : { primary : ' ui-icon-circle-arrow-s' }});
	
	/* Save information */	
	$('.button.save')
		.button({ icons : { primary : 'ui-icon-disk'}})
		.click(function ()
		{
			var form = $(this).parents('form');
			var input = $('<input />').attr('type', 'hidden').attr('name', 'save').val('true');
			$(form).append($(input));
			$(form).submit();
		});	

	<?php /*  TEMPORARY DISABLE FORM  */ ?>
	<?php if (!Auth::check() or !Helpers::isGibby()): ?>
		$('.button.apply').button('disable');
	<?php else: ?>
		<?php if (strtotime($info['due_dates']['concert-band']) < time()): ?>
			$('.button.apply[data-division="concert-band"]').button('disable');
		<?php endif; ?>
		<?php if (strtotime($info['due_dates']['concert-choir']) < time()): ?>
			$('.button.apply[data-division="concert-choir"]').button('disable');
		<?php endif; ?>
		<?php if (strtotime($info['due_dates']['string-orchestra']) < time()): ?>
			$('.button.apply[data-division="string-orchestra"]').button('disable');
		<?php endif; ?>
		<?php if (strtotime($info['due_dates']['full-orchestra']) < time()): ?>
			$('.button.apply[data-division="full-orchestra"]').button('disable');
		<?php endif; ?>

	<?php endif; ?>	

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

            var topic = 'edit';            

            $('<div></div>')
                .appendTo('body')
                .dialog(
                {                       
                    draggable : true,
                    resizable : true,
                    height : 725,
                    minHeight : 400,
                    width : 615,
                    minWidth : 330,
                    modal : false,
                    title : 'Help',                    
                    open : function ()
                        {  
                            var dialog_object = $(this);

                            dialog_object.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 : '<?php echo url('forms/music/help'); ?>?topic=' + topic,
                                          dataType : 'html'
                                      })
                                      .done(function (returned_data)
                                      {                               
                                          dialog_object.html(returned_data);
                                      })
                                      .fail(function (jqXHR, status, error)
                                      {                                                   
                                          var response = jqXHR.responseText;
                                          var errorData = $.parseJSON(response);
                                          console.log(errorData);
                                          alert ("There was an error looking up help information.\n\nThis page will be reloaded.");
                                          location.reload();
                                      })
                                      .complete(function ()
                                      {
                                           
                                      });                            
                            
                        },
                    close : function ()
                        {
                            var dialog_object = $(this);

                            $(dialog_object).remove();
                        }                
                });


        });



	$('.date_picker').datepicker({'dateFormat' : 'mm/dd/yy'});
								  
	
	$('[data-required="required"]').after('<span class="required_marker">*</span>');
	
	$('[data-numbers-only]').bind('input', function()
	{
  	    $(this).val($(this).val().replace(/[^0-9]/gi, ''));
	});	

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


		});

		$('.applications td[data-status="yes"]').css({'background-color' : '#b0ffbe'});
		$('.applications .odd td[data-status="yes"]').css({'background-color' : '#a7f2b4'});

		$('.applications td[data-status="no"]').css({'background-color' : '#ffb0b0'});
		$('.applications .odd td[data-status="no"]').css({'background-color' : '#f2a7a7'});

		$('.applications td[data-complete="Complete"]').css({'background-color' : '#3EC557'});
		$('.applications .odd td[data-complete="Complete"]').css({'background-color' : '#25AF3E'});

		$('.applications td[data-complete="Incomplete"]').css({'background-color' : '#FF5959'});
		$('.applications .odd td[data-complete="Incomplete"]').css({'background-color' : '#DD5353'});
	}

	colorRows();

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

	/*
	$('.applications td[data-status="yes"]').css({'background-color' : '#b0ffbe'});
	$('.applications .odd td[data-status="yes"]').css({'background-color' : '#a7f2b4'});

	$('.applications td[data-status="no"]').css({'background-color' : '#ffb0b0'});
	$('.applications .odd td[data-status="no"]').css({'background-color' : '#f2a7a7'});

	$('.applications td[data-complete="Complete"]').css({'background-color' : '#3EC557'});
	$('.applications .odd td[data-complete="Complete"]').css({'background-color' : '#25AF3E'});

	$('.applications td[data-complete="Incomplete"]').css({'background-color' : '#FF5959'});
	$('.applications .odd td[data-complete="Incomplete"]').css({'background-color' : '#DD5353'});
	*/

	$('.applications tr[data-selected="false"]').addClass('not_selected');

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

		$('.button.download.all_entries').click(function ()
		{
			window.open('<?php echo url('/reports/music-all-entries'); ?>');
		});

		$('.button.download.choir_program').click(function ()
		{
			window.open('<?php echo url('/reports/music-all-entries?program=cho'); ?>');
		});

		$('.button.download.band-orchestra_program').click(function ()
		{
			window.open('<?php echo url('/reports/music-all-entries?program=bnd-orc'); ?>');
		});





		$('.applications tbody tr').hover(function ()
		{
			$(this).css({'outline' : '2px solid #1C43A6',
						 'cursor' : 'pointer'});
			$('td:nth-child(2)', $(this)).css({'color' : '#005fa9',
											   'font-weight' : 'bold'});
		},
		function ()
		{
			$(this).css({'outline' : '',
						 'cursor' : 'auto'});
			$('td:nth-child(2)', $(this)).css({'color' : '',
											   'font-weight' : ''});
		}).click(function ()
		{
			var form_id = $(this).attr('data-form-id');
			var ap_id = $(this).attr('data-ap-id');
			var category = $(this).attr('data-category');

			$('<div></div>')
				.appendTo('body')
				.dialog({
					autoOpen: true,
					draggable: false,
					resizable: false,
					minheight: 375,
					width: 575,
					title: 'Music Application Editor',
					modal: true,
					buttons: [
	      			    {
	      					text : "Save",
	      		   			'class' : "float_left",
	      		   			icons : { primary : 'ui-icon-disk'},
	      		   		 	click : function()
	      		   		  		  {
	      		   		  		  	  $('<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', this).submit();

	      		   		  		  	  $(this).dialog( "close");
	      		   		  		  	  $(this).remove();	      		   		  		  	  
							       }
						},
						{
	      					text : "Edit Form",
	      		   			'class' : "float_left",
	      		   			'style' : 'margin-left: 20px;',
	      		   			icons : { primary : 'ui-icon-pencil'},
	      		   		 	click : function()
	      		   		  		  {   								      		   		  		  	  
									  window.location = 'http://www.osaa.org/forms/registration/music/' + category + '?ap=' + ap_id;
							      }
						},
						{
	      					text : "Toggle Selected Status",
	      		   			'class' : "float_left",
	      		   			'style' : 'margin-left: 20px;',
	      		   			icons : { primary : 'ui-icon-shuffle'},
	      		   		 	click : function()
	      		   		  		  {   								      		   		  		  	  
									   var jqxhr = $.ajax(
	                          			{
		                          			type : 'POST',
		                          			url : '/forms/toggle-music-form',
		                          			data : { 'form_id' : form_id}
		                          		})
		                                .done(function (data)
		                                {		                                	
		                                	location.reload();
		                                })
		                                .fail(function ()
		                                {
		                                	alert('There was an error toggling this form\'s selected status.');
		                                }); 
							      }
						},
						{
							text : "Cancel",							
							'class' : "float_right",
							'autofocus' : 'true',
							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', '9pt');
				          $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');

				          
                          $(this).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 info = $(this);

                          var jqxhr = $.ajax(
                          		{
                          			type : 'GET',
                          			url : '/forms/edit-music-form/' + form_id,
                          			dataType : 'html'
                          		})
                                .done(function (data)
                                {
                                	$(info).html(data);
                                    $('.button').button();
                                })
                                .fail(function ()
                                {
                                	$(info).html('There was an error.');
                                });

                          $(this).parent().find('[autofocus]').focus();
				      }
			    }); 
				 
		});

	<?php else: ?>
		
		$('.applications tbody tr').hover(function ()
		{
			$(this).css({'outline' : '2px solid #1C43A6'});						 
			$('td:nth-child(2)', $(this)).css({'color' : '#005fa9',
											   'font-weight' : 'bold'});
		},
		function ()
		{
			$(this).css({'outline' : ''});						 
			$('td:nth-child(2)', $(this)).css({'color' : '',
											   'font-weight' : ''});
		});
	<?php endif; ?>


	function filter_division ()
	{
		var band = $('#filter_band').is(':checked');
		var choir = $('#filter_choir').is(':checked');
		var orchestra = $('#filter_orchestra').is(':checked');

		if (!band)
		{
			$('table.applications tr[data-category="concert-band"]').fadeOut(300).promise().done(function () { colorRows(); });
		}
		else
		{
			$('table.applications tr[data-category="concert-band"]').fadeIn(300).promise().done(function () { colorRows(); });	
		}

		if (!choir)
		{
			$('table.applications tr[data-category="concert-choir"]').fadeOut(300).promise().done(function () { colorRows(); });
		}
		else
		{
			$('table.applications tr[data-category="concert-choir"]').fadeIn(300).promise().done(function () { colorRows(); });	
		}

		if (!orchestra)
		{
			$('table.applications tr[data-category="string-orchestra"]').fadeOut(300).promise().done(function () { colorRows(); });
			$('table.applications tr[data-category="full-orchestra"]').fadeOut(300).promise().done(function () { colorRows(); });
		}
		else
		{
			$('table.applications tr[data-category="string-orchestra"]').fadeIn(300).promise().done(function () { colorRows(); });	
			$('table.applications tr[data-category="full-orchestra"]').fadeIn(300).promise().done(function () { colorRows(); });	
		}

		
	}

	filter_division();

	$('.division_filter :checkbox').click(function ()
	{
		filter_division();
	});

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

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

	<a href="#" class="help_button">Help</a>

<?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 /*  No division/category is selected  */ ?>
	<?php if (is_null($info['division'])): ?>

		<br />	

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

		<h1>Online Application Form for Bands, Choirs, and Orchestras</h1>	

		<br />

		<h2>Instructions</h2>
		<p>
			To submit an application to participate in the OSAA Music State Championships, you must use one of the following registration forms below: one for each division.  Schools may apply for participation in more than one division, but only one per division.  No school may apply for more than one concert choir, one concert band, one string orchestra, and one full orchestra to participate in the state championships.
		</p>
		<?php if (!Auth::check()): ?>
			<div class="ui-state-error" style="padding: 0.5em 1em;">
				<span class="ui-icon ui-icon-alert" style="display:inline-block; position:relative; top:2px;"></span>
            	You are not logged in.
            </div>
            <br />

			<p>
				You must have an OSAA website account that is also associated with your school's corresponding activity in order to proceed with the application process.  Click the apply button below a division to begin the registration process.  You may have to <a href="<?php echo url('/account/login?redirect=/forms/registration/music'); ?>">login</a> first. 
			</p>
		<?php else: ?>
			<p>
				Your account must be associated with your school's corresponding activity in order to proceed with the application process.  Click the "Apply" button below a division to begin the registration process.
			</p>
		<?php endif; ?>
		<a href="<?php echo asset('/docs/handbooks/musichandbook.pdf'); ?>" target="_blank">&raquo; OSAA Music Handbook</a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo url('/help/music-registration'); ?>" target="_blank">&raquo; Get Help with Logging in or Creating an Account</a>

		<br /><br />

		<p>
			Your school's activity group must have performed in a state qualifying music contest.  The contest director is responsible for submitting the contest or event's scores.  Only schools that have been included on a large ensemble report and qualified for state will be allowed to register.
		</p>

		<br />

		<?php if (Session::has('errors')): ?>                
            <div class="ui-state-error" style="padding: 0.5em 1em;">
				<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; ?>  

		<h2>Divisions</h2>

		<br />

		<div class="columns">
			<div class="fourth text_center">
				<img src="<?php echo asset('/images/icons/band_64px.png'); ?>" alt="" title="" /><br />
				<h3>Concert Band</h3>
				<a href="<?php echo url('/forms/registration/music/concert-band'); ?>" class="button apply" data-division="concert-band">Apply</a>
				<br /><br />
				<p class="text_left">
					<b>Due:</b> <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates']['concert-band'])); ?>
				</p>
				<p class="small text_justify">
					There are five subdivisions: 6A, 5A, 4A, 3A, 2A/1A. There are no restrictions on group size.
				</p>
			</div>
			<div class="fourth text_center">
				<img src="<?php echo asset('/images/icons/choir_64px.png'); ?>" alt="" title="" /><br />
				<h3>Concert Choir</h3>
				<a href="<?php echo url('/forms/registration/music/concert-choir'); ?>" class="button apply" data-division="concert-choir">Apply</a>
				<br /><br />
				<p class="text_left">
					<b>Due:</b> <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates']['concert-choir'])); ?>
				</p>
				<p class="small text_justify">
					There are five subdivisions: 6A, 5A, 4A, 3A, 2A/1A. There are no restrictions on group size for 4A, 3A, 2A/1A subdivisions.  6A and 5A schools must qualify and compete with their large concert ensemble; chamber choirs are not permitted.
				</p>
			</div>
			<div class="fourth text_center">
				<img src="<?php echo asset('/images/icons/string_orchestra_64px.png'); ?>" alt="" title="" /><br />
				<h3>String Orchestra</h3>
				<a href="<?php echo url('/forms/registration/music/string-orchestra'); ?>" class="button apply" data-division="string-orchestra">Apply</a>
				<br /><br />
				<p class="text_left">
					<b>Due:</b> <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates']['string-orchestra'])); ?>
				</p>
				<p class="small text_justify">
					There is one combined subdivision of 6A/5A/4A/3A/2A/1A. There are no restrictions on group size.
				</p>
			</div>
			<div class="fourth text_center">
				<img src="<?php echo asset('/images/icons/full_orchestra_64px.png'); ?>" alt="" title="" /><br />
				<h3>Full Orchestra</h3>
				<a href="<?php echo url('/forms/registration/music/full-orchestra'); ?>" class="button apply" data-division="full-orchestra">Apply</a>
				<br /><br />
				<p class="text_left">
					<b>Due:</b> <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates']['full-orchestra'])); ?>
				</p>
				<p class="small text_justify">
					There is one combined subdivision of 6A/5A/4A/3A/2A/1A. There are no restrictions on group size.
				</p>
			</div>
		</div>

		<br class="clear" />

		<?php /*  Filter Options  */ ?>		
		<?php
			$filter = array('band' 		=> 'checked="checked"',
							'choir'     => 'checked="checked"',
							'orchestra' => 'checked="checked"');

			if (Input::has('filter') and !Helpers::strIsEmpty(Input::get('filter')))
			{
				$f = Input::get('filter');

				foreach ($filter as $key => $value)
				{
					if (Helpers::strContains($key, $f))
					{
						$filter[$key] = null;
					}
				}
			}
		?>
		
		<div class="division_filter" style="float: right; position: relative; top: 1em; font-size: 9pt;">
			<div style="font-weight: bold; margin-right: 10px; display: inline-block;">Include Division:</div>

			<label for="filter_band">Band</label>
			<input type="checkbox" id="filter_band" name="filter_band" value="1" style="position: relative; top: 3px; margin-right: 10px; border-radius: 2px;" <?php echo $filter['band']; ?>/>

			<label for="filter_choir">Choir</label>
			<input type="checkbox" id="filter_choir" name="filter_choir" value="1" style="position: relative; top: 3px; margin-right: 10px; border-radius: 2px;" <?php echo $filter['choir']; ?>/>

			<label for="filter_orchestra">Orchestra</label>
			<input type="checkbox" id="filter_orchestra" name="filter_orchestra" value="1" style="position: relative; top: 3px; border-radius: 2px;" <?php echo $filter['orchestra']; ?>/>

		</div>		

		<h2>List of Submitted Applications &amp; Status by School</h2>
		<?php if (count ($info['applications']) > 0): ?>

			<table class="applications">
				<thead>
					<tr>						
						<th colspan="2" style="width: 200px;">School</th>
						<th style="width: 95px;">Division</th>
						<th style="width: 74px;">Subdivision</th>
						<th style="width: 75px;">Qualification</th>
						<th style="text-align: center;">Completed Form</th>
						<th style="text-align: center;">Required Selection</th>
						<th style="text-align: center;">Roster Received</th>
						<th style="text-align: center;">Scores Received</th>
						<th style="text-align: center;">Tape/CD/DVD Received</th>						
						<th style="width: 75px; text-align: center;">Status</th>
						<th style="width: 100px; text-align: right;">Updated</th>
					</tr>
				</thead>

				<tbody>

					<?php foreach ($info['applications'] as $app): ?>

						<?php
							$selected = (property_exists($app, 'selected')) ? $app->selected : true;
						?>

						<tr
							data-form-id="<?php echo $app->form_id; ?>"
							data-ap-id="<?php echo $app->ap_id; ?>"
							data-category="<?php echo $app->form_category; ?>"
							<?php if (!$selected): ?>
								data-selected="false"
							<?php else: ?>
								data-selected="true"
							<?php endif; ?>
						>
							<td>
								<?php if (!$selected): ?>
									<img src="<?php echo asset('/images/icons/not_selected_16px.png'); ?>" alt="" title="" style="position: relative; top: 2px; margin-right: 4px;" />
								<?php elseif (Helpers::strEqual($app->status, 'complete')): ?>
									<img src="<?php echo asset('/images/icons/finished_16px.png'); ?>" alt="" title="" style="position: relative; top: 2px; margin-right: 4px;" />
								<?php elseif ($app->items->form): ?>
									<img src="<?php echo asset('/images/icons/pending_16px.png'); ?>" alt="" title="" style="position: relative; top: 2px; margin-right: 4px;" />
								<?php else: ?>
									<img src="<?php echo asset('/images/icons/never_started_16px.png'); ?>" alt="" title="" style="position: relative; top: 2px; margin-right: 4px;" />
								<?php endif; ?>
							</td>
							<td style="width: 179px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; display: block; vertical-align: middle;"><?php echo $app->ap_name; ?></td>
							<td><?php echo $app->division; ?></td>							
							<td><?php echo str_replace('6A/5A/4A/3A/2A/1A', 'Comb.', $app->subdivision); ?></td>
							<td><?php echo $app->qualify; ?></td>
							<td <?php if ($app->items->form): ?> data-status="yes" <?php else: ?> data-status="no" <?php endif; ?> style="text-align: center !important;">
								<?php echo ($app->items->form) ? 'Yes' : 'No'; ?>
							</td>
							<td <?php if ($app->items->selection): ?> data-status="yes" <?php else: ?> data-status="no" <?php endif; ?> style="text-align: center !important;">
								<?php echo ($app->items->selection) ? 'Yes' : 'No'; ?>
							</td>
							<td <?php if ($app->items->roster): ?> data-status="yes" <?php else: ?> data-status="no" <?php endif; ?> style="text-align: center !important;">
								<?php echo ($app->items->roster) ? 'Yes' : 'No'; ?>
							</td>
							<td <?php if ($app->items->scores): ?> data-status="yes" <?php else: ?> data-status="no" <?php endif; ?> style="text-align: center !important;">
								<?php echo ($app->items->scores) ? 'Yes' : 'No'; ?>
							</td>
							<td <?php if (Helpers::strEqual($app->qualify, 'automatic')): ?> data-status="na" <?php elseif ($app->items->tape): ?> data-status="yes" <?php else: ?> data-status="no" <?php endif; ?> style="text-align: center !important;">
								<?php if (Helpers::strEqual($app->qualify, 'automatic')): ?>
									N/A
								<?php else: ?>
									<?php echo ($app->items->tape) ? 'Yes' : 'No'; ?>
								<?php endif; ?>
							</td>
							<td style="text-align: center;" data-complete="<?php echo $app->status; ?>"><b><?php echo $app->status; ?></b></td>
							<td style="text-align: right;"><?php echo date('n/j/y g:ia', strtotime($app->updated_at)); ?></td>
						</tr>

					<?php endforeach; ?>

				</tbody>
			</table>


		<?php else: ?>
			<p>
				There are no school applications to display.
			</p>
		<?php endif; ?>

	
	<?php /*  A specific music division/category form is selceted  */ ?>
	<?php else: ?>

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

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

					<?php if (Helpers::strEqual($info['submission']->data->status, 'complete')): ?>
						<img src="<?php echo asset('images/icons/finished_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Complete</span>
					<?php elseif (Helpers::strEqual($info['submission']->data->status, 'submitted')): ?>
						<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;"> Submitted</span>
					<?php elseif (Helpers::strEqual($info['submission']->data->status, 'incomplete')): ?>
						<img src="<?php echo asset('images/icons/pending_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/never_started_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Never Saved</span>
				<?php endif; ?>

			<?php endif; ?>

		</div>

		<img src="<?php echo asset('/images/icons/' . strtolower(str_replace('-', '_', str_replace('concert-', '', $info['division']))) . '_64px.png'); ?>" alt="" title="" style="float: left; width: 64px; height: 64px; position: relative; top: -0.5em; margin-right: 0.5em;" />

		<?php if (is_null($info['ap'])): ?>		
			<h1>State <?php echo ucwords(str_replace('-', ' ', str_replace('concert-', '', $info['division']))); ?> Registration Form</h1>	
		<?php else: ?>
			<h1>State <?php echo ucwords(str_replace('-', ' ', str_replace('concert-', '', $info['division']))); ?> Registration Form for <?php echo $info['ap']->name; ?></h1>	
		<?php endif; ?>

		<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>								
				<?php if (is_null($info['ap'])): ?>					
					<li>Select your school from the drop-down list.</li>
					<li>Click <b>Next</b> to continue.</li>
					<li>You can go back to the main music application page by clicking the <b>Back</b> button.</li>
				<?php else: ?>
					<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.</li>
					<li>You can go back to the main music application page by clicking the <b>Back</b> button.  You will lose all unsaved entries.</li>
				<?php endif; ?>
			</ol>

			<br />
			
			<b>Note:</b> This online application as well as any required recordings or other support materials must be received by the OSAA by <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates'][$info['division']])); ?>.  Late entry forms or support materials will not be accepted.
			
			<br /><br />

			For questions, contact <?php echo $info['staff']->name; ?> at <?php echo $info['staff']->phone; ?> or by e-mail to <?php echo Helpers::obfuscateEmailLink ($info['staff']->email); ?>.  For technical assistance, refer to <a href="<?php echo url('/help/music-registration'); ?>" target="_blank">www.osaa.org/help/music-registration</a> or 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 /*  Need to select an activity program  */ ?>
        <?php if (is_null($info['ap'])): ?>

        	<?php echo Form::open(array('url'    => url('/forms/registration/music/' . $info['division']),
							    'method' => 'get',
							    'class'  => 'registration_form')); ?>

				<h2>Select your school</h2>
				<?php echo Form::select('ap', $info['ap_list'], null, array('style' => 'font-size: 12pt; margin-right: 25px; width: 300px;')); ?>

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

				<?php if (count($info['ap_list']) < 1): ?>
					<br /><br />
					<p>
						<b>Note:</b><br />
						If your school does not appear in the drop-down list, then your school is either not offering <?php echo strtolower(Helpers::getActivityName($info['activity'])); ?> or you are not authorized.  Users must be logged in with access rights associated with a role of <?php echo Helpers::getActivityName($info['activity']); ?>/Head Coach or School/Administrator.
					</p>
					<p>
						To check if your school is offering <?php echo strtolower(Helpers::getActivityName($info['activity'])); ?>, find your school from the list of schools at <a href="<?php echo url('/schools/full-members'); ?>">www.osaa.org/schools/full-members</a> and look if <b><?php echo Helpers::getActivityName($info['activity']); ?></b> is listed under <b>Sports / Activities</b>.  If you do not see the activity listed, then your school needs to contact the OSAA office to add an activity.
					</p>
					<p>
						For additional assistance, please refer to <a href="<?php echo url('/help/music-registration'); ?>">www.osaa.org/help/music-registration</a>.
					</p>
				<?php endif; ?>
			
			
			<?php echo Form::close(); ?>


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

			<?php if (is_null($info['submission'])): ?>

				<div class="ui-state-highlight ui-corner-all" style="padding: 0 0.5em 1em 0.5em; margin-bottom: 1em;">

					<h3>Your Registration Is Incomplete</h3>
					<p>
						The following items are required for your registration process to be completed.  <b>All of these items must be received by the OSAA by <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates'][$info['division']])); ?>.  Late submissions will not be accepted.</b>
						<ul>
							<li>This registration <b>form</b> must be submitted online (not just saved.)</li>
							<li>At least <b>one required music selection</b> must be indicated on this online form.</li>
							<li>An alphabetized <b>roster</b> of your group members must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
							<li>One legible copy of your <b>score sheet(s)</b> on which your qualifying ratings are recorded must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
							<?php if (Helpers::strEqual($info['activity'], array('BND', 'ORC'))): ?>
								<li>A CD, audio tape, or other electronic storage device with an <b>audio recording</b> of your group's qualifying performance and its <b>sheet music</b> must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
							<?php elseif (Helpers::strEqual($info['activity'], array('CHO'))): ?>
								<li>A DVD, videotape, or other electronic storage device with a <b>video recording</b> of your group's qualifying performance must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
							<?php endif; ?>

						</ul>
					</p>						
								
					<div class="columns">
						<div class="fourth">
							<b>Email:</b> <?php echo Helpers::obfuscateEmailLink ($info['staff']->email); ?>
						</div>
						<div class="fourth">
							<b>Fax:</b> (503) 682-0960
						</div>
						<div class="third">	
							<b>Mail/Deliver:</b> 25200 SW Parkway Ave Ste 1<br />
							<a href="https://maps.google.com/maps?q=25200+SW+Parkway+Ave+Suite+1+Wilsonville,+Oregon+97070&amp;hl=en&amp;sll=44.145447,-120.583402&amp;sspn=6.818841,14.27124&amp;t=h&amp;hnear=25200+SW+Parkway+Ave+%231,+Wilsonville,+Washington,+Oregon+97070&amp;z=17" target="_blank" class="button map_link" style="font-size:8pt; margin-right:20px;">Map</a>
							<span style="display: inline-block; width: 10px;"></span>Wilsonville, OR 97070
						</div>
					</div>

					<br class="clear" />

				</div>
			
			<?php elseif (!Helpers::strEqual($info['submission']->data->status, 'complete')): ?>

				<div class="ui-state-highlight ui-corner-all" style="padding: 0 0.5em 1em 0.5em; margin-bottom: 1em;">

					<h3>Your Registration Is Still Incomplete!</h3>
					<p>
						The following items are required for your registration process to be completed.  <b>All of these items must be received by the OSAA by <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates'][$info['division']])); ?>.  Late submissions will not be accepted.</b>
						<ul>
							<?php if (!$info['submission']->data->items->form): ?>
								<li>This registration <b>form</b> must be submitted online (not just saved.)</li>
							<?php endif; ?>
							<?php if (!$info['submission']->data->items->selection): ?>
								<li>At least <b>one required music selection</b> must be indicated on this online form.</li>
							<?php endif; ?>
							<?php if (!$info['submission']->data->items->roster): ?>
								<li>An alphabetized <b>roster</b> of your group members must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
							<?php endif; ?>
							<?php if (!$info['submission']->data->items->scores): ?>
								<li>One legible copy of your <b>score sheet(s)</b> on which your qualifying ratings are recorded must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
							<?php endif; ?>
							<?php if (!$info['submission']->data->items->tape): ?>
								<?php if (Helpers::strEqual($info['activity'], array('BND', 'ORC'))): ?>
									<li>A CD, audio tape, or other electronic storage device with an <b>audio recording</b> of your group's qualifying performance and its <b>sheet music</b> must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
								<?php elseif (Helpers::strEqual($info['activity'], array('CHO'))): ?>
									<li>A DVD, videotape, or other electronic storage device with a <b>video recording</b> of your group's qualifying performance must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
								<?php endif; ?>
							<?php endif; ?>

						</ul>
					</p>						
								
					<div class="columns">
						<div class="fourth">
							<b>Email:</b> <?php echo Helpers::obfuscateEmailLink ($info['staff']->email); ?>
						</div>
						<div class="fourth">
							<b>Fax:</b> (503) 682-0960
						</div>
						<div class="third">	
							<b>Mail/Deliver:</b> 25200 SW Parkway Ave Ste 1<br />
							<a href="https://maps.google.com/maps?q=25200+SW+Parkway+Ave+Suite+1+Wilsonville,+Oregon+97070&amp;hl=en&amp;sll=44.145447,-120.583402&amp;sspn=6.818841,14.27124&amp;t=h&amp;hnear=25200+SW+Parkway+Ave+%231,+Wilsonville,+Washington,+Oregon+97070&amp;z=17" target="_blank" class="button map_link" style="font-size:8pt; margin-right:20px;">Map</a>
							<span style="display: inline-block; width: 10px;"></span>Wilsonville, OR 97070
						</div>
					</div>

					<br class="clear" />

				</div>

			<?php else: ?>

				<div class="ui-state-active ui-corner-all" style="padding: 0 0.5em 1em 0.5em; margin-bottom: 1em;">

					<h3 class="text_center" style="color: #0d581b !important;">Your Registration Is Complete!</h3>						

				</div>


			<?php endif; ?>


			<?php echo Form::open(array('url'    => url('/forms/submit-music-form'),
							    'method' => 'post',
							    'class'  => 'registration_form')); ?>

				<?php echo Form::hidden('ap', $info['ap']->id); ?>	
				<?php echo Form::hidden('category', $info['division']); ?>						

				<h2>Registration Information</h2>

				<h3>School / Coop</h3>
				<?php echo Form::label('school[name]',
							   'Name',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('school[name]',
							  $info['ap']->name,
							  array('disabled' => 'disabled',
							  		'style' => 'width: 250px;')); ?>

				<br /><br />

				<?php echo Form::label('school[subdivision]',
							   'Subdivision',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('school[subdivision]',
							  $info['ap']->division,
							  array('disabled' => 'disabled',
							  		'style' => 'width: 150px;')); ?>

				<br /><br />

				<?php echo Form::label('school[league]',
							   'League',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('school[league]',
							  $info['ap']->league . ' ' . $info['ap']->league_name,
							  array('disabled' => 'disabled',
							  		'style' => 'width: 250px;')); ?>

				<br /><br />


				<h3>Submitter</h3>
				<p>
					Enter in the name of the individual preparing this form.  This person will be sent correspondence when supplemental materials are received.  If there are any questions about this form, OSAA staff will contact this individual listed.
				</p>

				<?php echo Form::label('submitter[name]',
							   'Name',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('submitter[name]',
							  (!is_null($info['submission'])) ? $info['submission']->data->submitter->name : null,
							  array('data-required' => 'required',
							        'style' => 'width: 150px;')); ?>
				
				<br /><br />

				<?php echo Form::label('submitter[phone]',
							   'Phone',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('submitter[phone]',
							  (!is_null($info['submission'])) ? $info['submission']->data->submitter->phone : null,
							  array('data-required' => 'required',
							        'style' => 'width: 125px;')); ?>


				<br /><br />

				<?php echo Form::label('submitter[email]',
							   'E-mail',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('submitter[email]',
							  (!is_null($info['submission'])) ? $info['submission']->data->submitter->email : null,
							  array('data-required' => 'required',
							        'style' => 'width: 200px;')); ?>

				<br /><br />

				<?php echo Form::label('submitter[role]',
							   'Title / Role',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('submitter[role]',
							  (!is_null($info['submission'])) ? $info['submission']->data->submitter->role : null,
							  array('style' => 'width: 175px;')); ?>
				<div class="small gray note" style="margin-left: 155px;">What is your role in relation to this group?  (i.e. Director, Activities Director, Instructor, Secretary, etc.)</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 />



				<h2>Qualifying Event</h2>
				<p>
					To qualify for state, each group must have attended a prior qualifying event and met the <b>minimum performance time requirements</b> at that event.  Each group must also have performed <b>one required selection</b> from the appropriate level current required state music lists or a substitute selection that was pre-approved by exception of the State Championships Director.
					<?php if ($info['activity'] == 'BND'): ?>						
						<ul class="small">
							<li>6A, 5A, and 4A bands must have performed <b>at least 18 minutes</b> of music at the qualifying event.</li>
							<li>3A and 2A/1A bands must have performed <b>at least 15 minutes</b> of music at the qualifying event.</li>
						</ul>
					<?php elseif ($info['activity'] == 'CHO'): ?>
						<ul class="small">
							<li>Choirs must have performed <b>at least 12 minutes</b> of music at the qualifying event.</li>
						</ul>

					<?php elseif ($info['activity'] == 'ORC'): ?>						
						<ul class="small">
							<li>Orchestras must have performed <b>at least 15 minutes</b> of music at the qualifying event.</li>
						</ul>
					<?php endif; ?>					
				</p>

				<h3>Event Information</h3>

				<?php echo Form::label('event[name]',
							   'Name',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('event[name]',
							  (!is_null($info['submission'])) ? $info['submission']->data->event->name : null,
							  array('data-required' => 'required',
							  	    'style' => 'width: 250px;')); ?>

				<br /><br />

				<?php echo Form::label('event[league]',
							   'Sponsoring League',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('event[league]',
							  (!is_null($info['submission'])) ? $info['submission']->data->event->league : null,
							  array('data-required' => 'required',
							        'style' => 'width: 200px;')); ?>
				
				<br /><br />

				<?php echo Form::label('event[location]',
							   'Location',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('event[location]',
							  (!is_null($info['submission'])) ? $info['submission']->data->event->location : null,
							  array('data-required' => 'required',
							        'style' => 'width: 250px;')); ?>


				<br /><br />

				<?php echo Form::label('event[date]',
							   'Date',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('event[date]',
							  (!is_null($info['submission'])) ? $info['submission']->data->event->date : null,
							  array('data-required' => 'required',
							        'style' => 'width: 80px;',
							        'class' => 'date_picker')); ?>

				<br /><br />

				<?php echo Form::label('event[school]',
							   'Host School',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::select('event[school]',
								$info['ap_list'],
								(!is_null($info['submission'])) ? $info['submission']->data->event->school : null,
								array('data-required' => 'required',
							        'style' => 'width: 275px;',
							        'class' => 'date_picker')); ?>

				<br /><br />

				<h3>Qualification Criteria</h3>
				<p>
					This group is qualified to participate in the State Music Championships or qualified for inclusion in the Tape Pool by satisfying the minimum performance requirements listed above and by (select one):
				</p>
				
				<?php if (Helpers::strEqual($info['activity'], array('BND', 'ORC'))): ?>
					<span class="required_marker" style="position: relative; top: 130px;">*</span>
					<div style="position: relative;">					
						<?php echo HTML::decode(
						       Form::label('qualify[automatic]',
										   '<b>The group <u>automatically qualified</u> by meeting ALL of the requirements established in the OSAA Music Handbook 3.3.2(b):</b><ul class="small" style="margin-top: 1em;"><li>Winning an OSAA League Contest (NOT OMEA District), AND</li><li>Satisfying the minimum score requirements established in the OSAA Music Handbook 3.3.2(b)(2).</li></ul>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[automatic]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, 'automatic')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>

					</div>

					<br />

					<div style="position: relative;">

						<?php echo HTML::decode(
						       Form::label('qualify[leagueWinner]',
										   '<b>The group qualified for the <u>tape pool</u> by winning an OSAA League Contest (NOT OMEA District,) but did not meet all of the automatic qualification standards above; per OSAA Music Handbook 3.3.3(b)(2).</b>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[leagueWinner]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, 'leagueWinner')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>
					</div>

					<br />

					<div style="position: relative;">

						<?php echo HTML::decode(
						       Form::label('qualify[twoScores]',
										   '<b>The group qualified for the <u>tape pool</u> by receiving qualifying scores from two or more certified adjudicators at the same qualifying contest; per OSAA Music Handbook 3.3.3(b)(1).</b>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[twoScores]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, 'twoScores')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>
					</div>

					<br />

					<div style="position: relative;">

						<?php echo HTML::decode(
						       Form::label('qualify[321score]',
										   '<b>The group qualified for the <u>tape pool</u> by receiving the top score among 3A or 2A/1A groups at a qualifying event; per OSAA Music Handbook 3.3.3(b)(3).</b>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[321score]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, '321score')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>
					</div>
					
				<?php elseif (Helpers::strEqual($info['activity'], array('CHO'))): ?>
					<span class="required_marker" style="position: relative; top: 110px;">*</span>
					<div style="position: relative;">					
						<?php echo HTML::decode(
						       Form::label('qualify[automatic]',
										   '<b>The choir <u>automatically qualified</u> by meeting ALL of the requirements established in the OSAA Music Handbook 3.3.2(a):</b><ul class="small" style="margin-top: 1em;"><li>Winning an OSAA League Contest (NOT OMEA District), AND</li><li>Receiving at least two "1" ratings (81 or higher) from certified adjudicators using the appropriate evaluation scale for the school classification at the OSAA League Contest, AND</li><li>Receiving an average score of 85 or higher from three certified adjudicators at the OSAA League Contest.</li></ul>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[automatic]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, 'automatic')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>

					</div>

					<br />

					<div style="position: relative;">

						<?php echo HTML::decode(
						       Form::label('qualify[leagueWinner]',
										   '<b>The choir qualified for the <u>tape pool</u> by winning an OSAA League Contest (NOT OMEA District,) but did not meet all of the automatic qualification standards above; per OSAA Music Handbook 3.3.3(a)(2).</b>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[leagueWinner]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, 'leagueWinner')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>
					</div>

					<br />

					<div style="position: relative;">

						<?php echo HTML::decode(
						       Form::label('qualify[tape]',
										   '<b>The choir qualified for the <u>tape pool</u> by receiving at least two "1" ratings (81 or higher) from certified adjudicators at a qualifying contest; per OSAA Music Handbook 3.3.3(a)(1).</b>',
								   			array('style' => 'margin-left: 155px; display: block;'))
							); ?>
						<?php echo Form::checkbox('qualify[tape]',
										  true,
										  (!is_null($info['submission']) and Helpers::strEqual($info['submission']->data->qualify, 'tape')),
										  array('style' => 'position: absolute; left: 128px; top: 2px;')); ?>
					</div>

				<?php endif; ?>								
				
				<br />
				<div class="button save float_right" style="font-size: 9pt;">Save</div>
				<br class="clear" />
				<div class="horizontal_divider" style="width: 100%;"></div><br />

				<h2>Program Information</h2>
				<p>
					Please type the information as you wish it to appear in the program.
				</p>

				<h3>Group Information</h3>

				<?php echo Form::label('group_name',
							   'Group Name',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('group_name',
							  (!is_null($info['submission'])) ? $info['submission']->data->group_name : null,
							  array('data-required' => 'required',
							  	    'style' => 'width: 250px;')); ?>

				<br /><br />

				<?php echo Form::label('director',
							   'Director',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('director',
							  (!is_null($info['submission'])) ? $info['submission']->data->director : null,
							  array('data-required' => 'required',
							        'style' => 'width: 150px;')); ?>
				
				<br /><br />

				<?php echo Form::label('assistant_director',
							   'Assistant Director',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('assistant_director',
							  (!is_null($info['submission'])) ? $info['submission']->data->assistant_director : null,
							  array('style' => 'width: 150px;')); ?>

				<br />

				<?php if (Helpers::strEqual($info['activity'], 'CHO')): ?>
					<br />

					<?php echo Form::label('accompanist',
								   'Accompanist',
								   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
					<?php echo Form::text('accompanist',
								  (!is_null($info['submission'])) ? $info['submission']->data->accompanist : null,
								  array('style' => 'width: 150px;')); ?>

					<br /><br />

					<?php echo Form::label('soloists',
								   'Soloist(s)',
								   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
					<?php echo Form::text('soloists',
								  (!is_null($info['submission'])) ? $info['submission']->data->soloists : null,
								  array('style' => 'width: 400px;')); ?>
					<div class="small gray note" style="margin-left: 155px;">
						Separate soloists' names with a comma, if necessary.
					</div>
				<?php endif; ?>

				<br />

				<?php echo Form::label('participants',
							   'Num. of Performers',
							   array('style' => 'display: inline-block; width: 140px; font-weight: bold; text-align: right; margin-right: 1em;')); ?>
				<?php echo Form::text('participants',
							  (!is_null($info['submission'])) ? $info['submission']->data->participants : null,
							  array('data-required' => 'required',
							        'style' => 'width: 30px;',
							        'data-numbers-only' => 'true')); ?>

				<br /><br />

				<h3>Music Selection</h3>
				<p>
					Include the composer's full name and publisher information for each selection.  Indicate which selections are from the required list or that are pre-approved by checking the corresponding box in the last column.
				</p>

				<table class="music">
					<thead>
						<tr>
							<th>Order</th>
							<th>Title</th>
							<th>Composer</th>
							<th>Publisher</th>
							<th style="text-align: center; width: 150px;">Required List<br />or Pre-Approved<span class="required_marker">*</span></th>
						</tr>
					</thead>

					<tbody>
						<?php for($i = 1; $i <= 6; $i++): ?>

							<tr>
								<td>Selection <?php echo $i; ?></td>
								<td>
									<?php echo Form::text('selections[' . $i . '][title]',
											      (!is_null($info['submission'])) ? $info['submission']->data->selections[$i - 1]->title : null); ?>
								</td>
								<td>
									<?php echo Form::text('selections[' . $i . '][composer]',
											      (!is_null($info['submission'])) ? $info['submission']->data->selections[$i - 1]->composer : null); ?>
								</td>
								<td>
									<?php echo Form::text('selections[' . $i . '][publisher]',
											      (!is_null($info['submission'])) ? $info['submission']->data->selections[$i - 1]->publisher : null); ?>
								</td>
								<td>
									<?php echo Form::checkbox('selections[' . $i . '][listed]',
													  true,
													  (!is_null($info['submission']) and $info['submission']->data->selections[$i - 1]->listed)); ?>
								</td>


							</tr>

						<?php endfor; ?>						
					</tbody>


				</table>

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

				<h2>Submit</h2>
				<p>
					You may revise this form multiple time if needed prior to the deadline of <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates'][$info['division']])); ?>.  Only the most recent submission will be used for registration.  An e-mail confirmation will be sent to the form submitter.
				</p>
				
				<div class="float_right" style="width: 325px; height: 4em; position: relative; top: -1em; text-align: right; color: #7d7b7d;">
					<?php if (!is_null($info['submission'])): ?>
					
						Form entries created at <?php echo date('g:i a m/d/Y', strtotime($info['submission']->created_at)); ?>.<br />
						Last updated at <?php echo date('g:i a m/d/Y', strtotime($info['submission']->updated_at)); ?>.<br />
						Last saved by <?php echo $info['submission']->updated_by_user_name; ?>.<br />

						<?php if (Helpers::strEqual($info['submission']->data->status, 'complete')): ?>
							<img src="<?php echo asset('images/icons/finished_16px.png'); ?>" alt="" title="" style="width: 16px; margin-left: 10px; position: relative; top: 2px;" /><span style="font-weight: bold;"> Complete</span>
						<?php elseif (Helpers::strEqual($info['submission']->data->status, 'submitted')): ?>
							<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;"> Submitted</span>
						<?php elseif (Helpers::strEqual($info['submission']->data->status, 'incomplete')): ?>
							<img src="<?php echo asset('images/icons/pending_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/never_started_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>

				<br />

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

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

				<?php if (is_null($info['submission'])): ?>

					<div class="ui-state-highlight ui-corner-all" style="padding: 0 0.5em 1em 0.5em; margin-bottom: 1em;">

						<h3>Your Registration Is Incomplete</h3>
						<p>
							The following items are required for your registration process to be completed.  <b>All of these items must be received by the OSAA by <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates'][$info['division']])); ?>.  Late submissions will not be accepted.</b>
							<ul>
								<li>This registration <b>form</b> must be submitted online (not just saved.)</li>
								<li>At least <b>one required music selection</b> must be indicated on this online form.</li>
								<li>An alphabetized <b>roster</b> of your group members must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
								<li>One legible copy of your <b>score sheet(s)</b> on which your qualifying ratings are recorded must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
								<?php if (Helpers::strEqual($info['activity'], array('BND', 'ORC'))): ?>
									<li>A CD, audio tape, or other electronic storage device with an <b>audio recording</b> of your group's qualifying performance and its <b>sheet music</b> must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
								<?php elseif (Helpers::strEqual($info['activity'], array('CHO'))): ?>
									<li>A DVD, videotape, or other electronic storage device with a <b>video recording</b> of your group's qualifying performance must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
								<?php endif; ?>

							</ul>
						</p>						
									
						<div class="columns">
							<div class="fourth">
								<b>Email:</b> <?php echo Helpers::obfuscateEmailLink ($info['staff']->email); ?>
							</div>
							<div class="fourth">
								<b>Fax:</b> (503) 682-0960
							</div>
							<div class="third">	
								<b>Mail/Deliver:</b> 25200 SW Parkway Ave Ste 1<br />
								<a href="https://maps.google.com/maps?q=25200+SW+Parkway+Ave+Suite+1+Wilsonville,+Oregon+97070&amp;hl=en&amp;sll=44.145447,-120.583402&amp;sspn=6.818841,14.27124&amp;t=h&amp;hnear=25200+SW+Parkway+Ave+%231,+Wilsonville,+Washington,+Oregon+97070&amp;z=17" target="_blank" class="button map_link" style="font-size:8pt; margin-right:20px;">Map</a>
								<span style="display: inline-block; width: 10px;"></span>Wilsonville, OR 97070
							</div>
						</div>

						<br class="clear" />

					</div>
				
				<?php elseif (!Helpers::strEqual($info['submission']->data->status, 'complete')): ?>

					<div class="ui-state-highlight ui-corner-all" style="padding: 0 0.5em 1em 0.5em; margin-bottom: 1em;">

						<h3>Your Registration Is Still Incomplete!</h3>
						<p>
							The following items are required for your registration process to be completed.  <b>All of these items must be received by the OSAA by <?php echo date('g:ia, D F j, Y', strtotime($info['due_dates'][$info['division']])); ?>.  Late submissions will not be accepted.</b>
							<ul>
								<?php if (!$info['submission']->data->items->form): ?>
									<li>This registration <b>form</b> must be submitted online (not just saved.)</li>
								<?php endif; ?>
								<?php if (!$info['submission']->data->items->selection): ?>
									<li>At least <b>one required music selection</b> must be indicated on this online form.</li>
								<?php endif; ?>
								<?php if (!$info['submission']->data->items->roster): ?>
									<li>An alphabetized <b>roster</b> of your group members must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
								<?php endif; ?>
								<?php if (!$info['submission']->data->items->scores): ?>
									<li>One legible copy of your <b>score sheet(s)</b> on which your qualifying ratings are recorded must be received by the OSAA (via E-mail, Fax, Mail, or Hand Delivery.)</li>
								<?php endif; ?>
								<?php if (!$info['submission']->data->items->tape): ?>
									<?php if (Helpers::strEqual($info['activity'], array('BND', 'ORC'))): ?>
										<li>A CD, audio tape, or other electronic storage device with an <b>audio recording</b> of your group's qualifying performance and its <b>sheet music</b> must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
									<?php elseif (Helpers::strEqual($info['activity'], array('CHO'))): ?>
										<li>A DVD, videotape, or other electronic storage device with a <b>video recording</b> of your group's qualifying performance must be received by the OSAA (via Mail or Hand Delivery.) [Applies only if in the Tape Pool]</li> 
									<?php endif; ?>
								<?php endif; ?>

							</ul>
						</p>						
									
						<div class="columns">
							<div class="fourth">
								<b>Email:</b> <?php echo Helpers::obfuscateEmailLink ($info['staff']->email); ?>
							</div>
							<div class="fourth">
								<b>Fax:</b> (503) 682-0960
							</div>
							<div class="third">	
								<b>Mail/Deliver:</b> 25200 SW Parkway Ave Ste 1<br />
								<a href="https://maps.google.com/maps?q=25200+SW+Parkway+Ave+Suite+1+Wilsonville,+Oregon+97070&amp;hl=en&amp;sll=44.145447,-120.583402&amp;sspn=6.818841,14.27124&amp;t=h&amp;hnear=25200+SW+Parkway+Ave+%231,+Wilsonville,+Washington,+Oregon+97070&amp;z=17" target="_blank" class="button map_link" style="font-size:8pt; margin-right:20px;">Map</a>
								<span style="display: inline-block; width: 10px;"></span>Wilsonville, OR 97070
							</div>
						</div>

						<br class="clear" />

					</div>

				<?php else: ?>

					<div class="ui-state-active ui-corner-all" style="padding: 0 0.5em 1em 0.5em; margin-bottom: 1em;">

						<h3 class="text_center" style="color: #0d581b !important;">Your Registration Is Complete!</h3>						

					</div>


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

		<?php endif; ?>

	<?php endif; ?>

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

