<?php $__env->startSection('page_title'); ?>
    <?php echo $information['school']->short_name; ?>
<?php $__env->stopSection(); ?>

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

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

    <style type="text/css">    	

    	.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'); ?>

	/* Display any success messages */
    $('.success_message').delay(5000).fadeOut({'duration' : 2500});
    $('.success_message .ui-icon-close').click(function ()
    {
        $('.success_message').hide();
    });

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

	$('.tooltip').tooltip();
	$('.tooltip.above').tooltip({ position : {my: "left bottom-15", at: "left top", collision: "flipfit"}});

	$('.button').button();	
	$('.button.notext').button({text:false});
	$('.button.delete').button({ icons : { primary : 'ui-icon-closethick'}});
	$('.button.cancel').button({ icons : { primary : 'ui-icon-circle-close'}});
	$('.button.clipboard').button({ icons : { primary : 'ui-icon-clipboard'}});

	$('table tbody tr:even').css('background-color', '#f2f2f2');

	$('.color_sample').change(function ()
	{
		var id = $(this).attr('id');
		var sample = '#' + id + '_sample';

		hex = $('option:selected', this).attr('data-hex');

		$(sample).css('background-color', '#' + hex);
	});

	$('.color_sample').change();



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

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

	
    <?php /* <a href="<?php echo url('/schools/' . $information['school']->id . '/edit-contacts'); ?>" class="button clipboard tooltip" style="font-size:9pt;" title="Go to the editor for school staff and contact information.">Edit Staff/Contacts</a> */ ?>

    <a href="<?php echo url('/schools/' . $information['school']->id); ?>" class="button cancel tooltip" style="font-size:9pt;" title="Discard all unsaved changes and return to this school's information page.">Close</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; ?> 


	<div class="online_form_instructions ui-corner-all" style="padding:0.5em 1em;">
		<span class="ui-icon ui-icon-info" style="display:inline-block; position:relative; top:2px;"></span>
		<b>Instructions</b> <br />
		Use this form to edit your school's information.  You can edit, update, and add information as necessary.  Some school information cannot be changed using this form, like school logos or mascots.  If you would like to update information not accessible through this form, or if you are having trouble using this form, please contact <b><?php echo Helpers::obfuscateEmailLink ("support@osaa.org"); ?></b>.
	</div>	

	<h2>School Information</h2>	

	<?php echo Form::open(array('url' => url('/schools/edit'), 'class' => 'editSchool', 'id' => 'editSchool')); ?>

		<?php
			Session::flash('school_id', $information['school']->id);
		?>
		<?php echo Form::hidden('school_id', $information['school']->id); ?>

		<?php if (Session::has('errors')): ?>                
	        <div class="error ui-state-error"><span class="ui-icon ui-icon-alert box_icon"></span><?php foreach ($errors->all() as $error): ?><?php echo $error; ?> <?php endforeach; ?></div>
	    <?php endif; ?>

		<div class="columns">

			<div class="half">				
					
				<h3 style="color:#990000;">Phone Numbers</h3>
				
				<?php echo Form::label('w_phone_area',
							   'Business Phone',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>					
				<?php
					if ($information['w_phone'])
					{
						$area = substr($information['w_phone']->number, 0, 3);
						$number = substr($information['w_phone']->number, 3, 3) . '-' . substr($information['w_phone']->number, 6, 4);
						$ext = $information['w_phone']->extension;	
					}
					else
					{
						$area = '';
						$number = '';
						$ext = '';
					}

				?>			

				(
				<?php echo Form::text('w_phone_area',
							  $area,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:30px;',
							  	 	'maxlength' => '3',
							  	    'title'     => 'Business phone number\'s area code (3 digits)')); ?>
				)
				<?php echo Form::text('w_phone_number',
							  $number,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:80px;',
							  	 	'maxlength' => '8',
							  	    'title'     => 'Business phone number (7 digits)')); ?>
				x
				<?php echo Form::text('w_phone_ext',
							  $ext,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:50px;',
							  	 	'maxlength' => '5',
							  	    'title'     => 'Business phone number\'s optional extension (maximum 5 digits)')); ?>

				<br />
				<span class="small gray note">The main contact phone number for your school.</span>
				<br /><br />

				<?php echo Form::label('f_phone_area',
							   'Fax',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>					
				<?php
					if ($information['f_phone'])
					{
						$area = substr($information['f_phone']->number, 0, 3);
						$number = substr($information['f_phone']->number, 3, 3) . '-' . substr($information['f_phone']->number, 6, 4);
						$ext = $information['f_phone']->extension;	
					}
					else
					{
						$area = '';
						$number = '';
						$ext = '';
					}

				?>			

				(
				<?php echo Form::text('f_phone_area',
							  $area,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:30px;',
							  	 	'maxlength' => '3',
							  	    'title'     => 'Fax phone number\'s area code (3 digits)')); ?>
				)
				<?php echo Form::text('f_phone_number',
							  $number,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:80px;',
							  	 	'maxlength' => '8',
							  	    'title'     => 'Fax phone number (7 digits)')); ?>
				x
				<?php echo Form::text('f_phone_ext',
							  $ext,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:50px;',
							  	 	'maxlength' => '5',
							  	    'title'     => 'Fax phone number\'s optional extension (maximum 5 digits)')); ?>

				<br />
				<span class="small gray note">Your main fax line (if any.)</span>
				<br /><br />

				<?php echo Form::label('b_phone_area',
							   'Billing Phone',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>					
				<?php
					if ($information['b_phone'])
					{
						$area = substr($information['b_phone']->number, 0, 3);
						$number = substr($information['b_phone']->number, 3, 3) . '-' . substr($information['b_phone']->number, 6, 4);
						$ext = $information['b_phone']->extension;	
					}
					else
					{
						$area = '';
						$number = '';
						$ext = '';
					}

				?>			

				(
				<?php echo Form::text('b_phone_area',
							  $area,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:30px;',
							  	 	'maxlength' => '3',
							  	    'title'     => 'Billing phone number\'s area code (3 digits)')); ?>
				)
				<?php echo Form::text('b_phone_number',
							  $number,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:80px;',
							  	 	'maxlength' => '8',
							  	    'title'     => 'Billing phone number (7 digits)')); ?>
				x
				<?php echo Form::text('b_phone_ext',
							  $ext,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:50px;',
							  	 	'maxlength' => '5',
							  	    'title'     => 'Billing phone number\'s optional extension (maximum 5 digits)')); ?>

				<br />
				<span class="small gray note">If billing information should be directed to a number that is different from your school's business number, you can enter in a billing phone number.  Otherwise, leave it blank.</span>
				<br /><br />

				<?php echo Form::label('x_phone_area',
							   'Billing Fax',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>					
				<?php
					if ($information['x_phone'])
					{
						$area = substr($information['x_phone']->number, 0, 3);
						$number = substr($information['x_phone']->number, 3, 3) . '-' . substr($information['x_phone']->number, 6, 4);
						$ext = $information['x_phone']->extension;	
					}
					else
					{
						$area = '';
						$number = '';
						$ext = '';
					}

				?>			

				(
				<?php echo Form::text('x_phone_area',
							  $area,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:30px;',
							  	 	'maxlength' => '3',
							  	    'title'     => 'Billing fax phone number\'s area code (3 digits)')); ?>
				)
				<?php echo Form::text('x_phone_number',
							  $number,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:80px;',
							  	 	'maxlength' => '8',
							  	    'title'     => 'Billing fax phone number (7 digits)')); ?>
				x
				<?php echo Form::text('x_phone_ext',
							  $ext,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:50px;',
							  	 	'maxlength' => '5',
							  	    'title'     => 'Billing fax phone number\'s optional extension (maximum 5 digits)')); ?>

				<br />
				<span class="small gray note">If billing information should be faxed to a number that is different from your school's main fax number, you can enter in a billing fax phone number.  Otherwise, leave it blank.</span>
				<br /><br />

				<h3 style="color:#990000;">Website</h3>

				<?php echo Form::label('website',
							   'Address / URL',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>								
				
				<?php echo Form::text('website',
							  $information['school']->website,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:275px;',						  	 	
							  	    'title'     => 'For example, http://www.osaa.org')); ?>

				<br /><br />

				<h3 style="color:#990000;">School District</h3>

				<?php echo Form::label('school_district',
							   'Public School District',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>								
				
				<?php echo Form::select('school_district',
								$information['school_districts'],
								$information['school']->school_district,
								array('class' => '',
							  	 	  'style' => 'width:275px;',						  	 	
							  	      'title' => 'Select which public school district your school belongs to.')); ?>

				<br />
				<span class="small gray note">If your school does not belong to a public school district, select "None."  If your school district is not in the list, contact the OSAA to have it added.
				<br /><br />
				    			
			</div>

			<div class="half">
				<h3 style="color:#990000;">Addresses</h3>
				
				<div style="float:left; width:150px; height:125px;">
					<?php echo Form::label('p_address_line_1',
								   'Physical Address',
								   array('class' => 'input_label')); ?><br />
					<span class="small gray note">The physical location of your school.  This address is used to spot your school on a map.</span>
				</div>
				<?php
					if ($information['p_address'])
					{
						$line_1 = $information['p_address']->line_1;
						$line_2 = $information['p_address']->line_2;
						$city = $information['p_address']->city;
						$state = $information['p_address']->state;
						$zip = $information['p_address']->zip;
						if (!Helpers::strIsEmpty ($information['p_address']->zip_4)) $zip .= '-' . $information['p_address']->zip_4;
					}
					else
					{
						$line_1 = '';
						$line_2 = '';
						$city = '';
						$state = '';
						$zip = '';					
					}

				?>			

				<?php echo Form::text('p_address_line_1',
							  $line_1,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:250px;',						  	 	
							  	    'title'     => 'Physical address line 1')); ?>
				<span class="small gray note">Line 1</span><br /><br />			
				<?php echo Form::text('p_address_line_2',
							  $line_2,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:250px;',						  	 	
							  	    'title'     => 'Physical address line 2 (suite, building number, etc)')); ?>
				<span class="small gray note">Line 2</span><br /><br />			
				<?php echo Form::text('p_address_city',
							  $city,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:98px;',						  	 	
							  	    'title'     => 'Physical address city')); ?>			
				<div style="display:inline-block; width:10px;"></div>
				<?php echo Form::text('p_address_state',
							  $state,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:25px;',		
							  	 	'maxlength' => '2',						  	 					  	 	
							  	    'title'     => 'Physical address state')); ?>
				<div style="display:inline-block; width:10px;"></div>
				<?php echo Form::text('p_address_zip',
							  $zip,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:83px;',		
							  	 	'maxlength' => '10',						  	 					  	 	
							  	    'title'     => 'Physical address ZIP code (minimum 5 digits)')); ?>
				<span class="small gray note">City, State, ZIP</span>

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

				<div style="float:left; width:150px; height:125px;">
					<?php echo Form::label('m_address_line_1',
								   'Mailing Address',
								   array('class' => 'input_label')); ?><br />
					<span class="small gray note">Your school's mailing address.  If this address is the same as the physical address, you can leave it blank.</span>
				</div>
				<?php
					if ($information['m_address'])
					{
						$line_1 = $information['m_address']->line_1;
						$line_2 = $information['m_address']->line_2;
						$city = $information['m_address']->city;
						$state = $information['m_address']->state;
						$zip = $information['m_address']->zip;
						if (!Helpers::strIsEmpty ($information['m_address']->zip_4)) $zip .= '-' . $information['m_address']->zip_4;
					}
					else
					{
						$line_1 = '';
						$line_2 = '';
						$city = '';
						$state = '';
						$zip = '';					
					}

				?>			

				<?php echo Form::text('m_address_line_1',
							  $line_1,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:250px;',						  	 	
							  	    'title'     => 'Mailing address line 1')); ?>
				<span class="small gray note">Line 1</span><br /><br />			
				<?php echo Form::text('m_address_line_2',
							  $line_2,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:250px;',						  	 	
							  	    'title'     => 'Mailing address line 2 (suite, building number, etc)')); ?>
				<span class="small gray note">Line 2</span><br /><br />			
				<?php echo Form::text('m_address_city',
							  $city,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:98px;',						  	 	
							  	    'title'     => 'Mailing address city')); ?>			
				<div style="display:inline-block; width:10px;"></div>
				<?php echo Form::text('m_address_state',
							  $state,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:25px;',		
							  	 	'maxlength' => '2',						  	 					  	 	
							  	    'title'     => 'Mailing address state')); ?>
				<div style="display:inline-block; width:10px;"></div>
				<?php echo Form::text('m_address_zip',
							  $zip,
							  array('class'     => 'tooltip',
							  	 	'style'     => 'width:83px;',		
							  	 	'maxlength' => '10',						  	 					  	 	
							  	    'title'     => 'Mailing address ZIP code (minimum 5 digits)')); ?>
				<span class="small gray note">City, State, ZIP</span><br /><br />

				<br class="clear" />
				
				<h3 style="color:#990000;">School Colors</h3>

				<?php echo Form::label('color_1',
							   'Primary',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>	
				
				<?php echo Form::colorSelect('color_1',
									 $information['all_colors'],
									 (!is_null ($information['school']->color_1)) ? $information['school']->color_1 : 'None',
									 array('class' => 'color_sample')); ?>		    

				<div id="color_1_sample" style="display:inline-block; position:relative; top:8px; margin-left:15px; width:24px; height:24px; margin-right:4px; border:1px solid #d9e1e0;"></div>

				<br />
				
				<?php echo Form::label('color_2',
							   'Secondary',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>	
				
				<?php echo Form::colorSelect('color_2',
									 $information['all_colors'],
									 (!is_null ($information['school']->color_2)) ? $information['school']->color_2 : 'None',
									 array('class' => 'color_sample')); ?>		    

				<div id="color_2_sample" style="display:inline-block; position:relative; top:8px; margin-left:15px; width:24px; height:24px; margin-right:4px; border:1px solid #d9e1e0;"></div>

				<br />

				<?php echo Form::label('color_3',
							   'Tertiary',
							   array('class' => 'input_label',
							         'style' => 'width:175px;')); ?>	
				
				<?php echo Form::colorSelect('color_3',
									 $information['all_colors'],
									 (!is_null ($information['school']->color_1)) ? $information['school']->color_3 : 'None',
									 array('class' => 'color_sample')); ?>		    

				<div id="color_3_sample" style="display:inline-block; position:relative; top:8px; margin-left:15px; width:24px; height:24px; margin-right:4px; border:1px solid #d9e1e0;"></div>

				<br />
				<span class="small gray note" style="position:relative; top:0.5em;">Don't see a color you want, contact the OSAA to have it added to the list.</span>

				<br /><br />

			</div>

		</div>

		<br class="clear" />
		
		<?php echo Form::submit('Save', array('class' => 'button float_right tooltip', 'style' => 'position: relative; top: -0.5em;', 'title' => 'Save this form\'s information.')); ?>

		<p class="bold">
			To save your changes to this school information, click the "Save" button.
		</p>	

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

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