<!DOCTYPE html>
<html lang="en-US">
	<head>
		<meta charset="utf-8">
		<style type="text/css">
			* {margin:0; padding:0;}
			body {font-family:Lucida Grande,Lucida Sans,Arial,sans-serif; font-size: 9pt; line-height:120%; color:#151515; background:#ffffff; width:800px;}

			h1 {font-size: 18pt; width: 800px; padding-bottom: 4px; border-bottom: 2px solid #1c43a6; color: #1c43a6;}
			h2 {font-weight: bold; font-size: 14pt; color: #990000;}
			h3 {font-weight: bold; font-size: 11pt; color: #0d2458; margin: 0 0 0.5em 0;}
			h4 {font-weight: bold; font-size: 10pt; color: #151515; margin: 0;}

			table {border-collapse: collapse;}

			.line  {border-bottom: 1px solid #7d7b7d;}
		</style>
	</head>
	<body>		

		<h1>OSAA Online Forms</h1>	

		<h2>
			Results for <?php echo Helpers::getActivityName ($info['activity_form']->activity); ?> <?php echo preg_replace('/( \(.*\))/', '', $info['league']->slug); ?> <?php echo $info['league']->name; ?>
		</h2>

		<h3>
			District/League Results Received
		</h3>
		<p>
			Thank you for submitting the results for the <?php echo $info['league']->name; ?> District Contest.  Please reply to this e-mail with any spelling corrections. 
		</p>

		<table style="width: 800px;">
			<tr>
				<td style="width: 35%; vertical-align: top;">
					<h3>Meet Tournament Director</h3>
					<p>			
						<?php echo $info['data']->meet->director->name; ?><br />
						<?php echo $info['data']->meet->director->phone; ?><br />
						<a href="mailto:<?php echo $info['data']->meet->director->email; ?>"><?php echo $info['data']->meet->director->email; ?></a>
					</p>
				</td>				

				<td style="width: 30%; vertical-align: top;">				
					<h3>Form Status - Complete</h3>
					<p>			
						Created at <?php echo date('g:i a n/j/Y', strtotime($info['submission']->created_at)); ?><br />
						Last updated at <?php echo date('g:i a n/j/Y', strtotime($info['submission']->updated_at)); ?><br />
						Submitted at <?php echo date('g:i a n/j/Y', strtotime($info['submission']->submitted_at)); ?>
					</p>					
				</td>
			</tr>
		</table>	
		

		<br /><br />


		<h3 class="line">Team Participation</h3>		
		<table style="width: 400px;">
			<?php $i = 0; ?>
			
			<?php foreach ($info['data']->meet->teams as $team): ?>				
				<?php
					$ap = activityprogram::findOrFail($team->ap_id);
				?>

				<tr <?php if ($i++ % 2 == 1): ?> style="background-color: #ededed;" <?php endif; ?>>					
					<td style="width: 75%;">
						<b><?php echo $ap->name; ?></b>
					</td>
					<td style="width: 25%;">
						<?php echo $team->number; ?> participants
					</td>
				</tr>
			<?php endforeach; ?>
		</table>

		<br /><br />

		<h3 class="line">Singles Qualifiers</h3>
				
		<table style="width: 700px;">
			<tr style="font-weight: bold; color: #999999;">				
				<td>Place</td>
				<td>Seed</td>
				<td>Name</td>
				<td>Grade</td>
				<td>Team</td>				
			</tr>

			<?php $count = 0; ?>
			<?php foreach ($info['data']->meet->qualifiers->singles as $i => $participant): ?>
				<tr <?php if ($count++ % 2 == 0): ?> style="background-color: #ededed;" <?php endif; ?>>					
					<td><?php echo ($i + 1); ?></td>
					<td><?php echo strtoupper($participant->seed); ?></td>
					<td><?php echo $participant->name; ?></td>
					<td><?php echo $participant->grade; ?></td>
					<?php
						$ap = activityprogram::findOrFail($participant->ap_id);						
					?>
					<td><?php echo $ap->name; ?></td>					
				</tr>				
			<?php endforeach; ?>
		</table>		
		
		<br /><br />

		<h3 class="line">Doubles Qualifiers</h3>
				
		<table style="width: 700px;">
			<tr style="font-weight: bold; color: #999999;">				
				<td>Place</td>
				<td>Seed</td>
				<td>Names</td>
				<td>Grades</td>
				<td>Team</td>				
			</tr>

			<?php $count = 0; ?>
			<?php foreach ($info['data']->meet->qualifiers->doubles as $i => $participant): ?>
				<tr <?php if ($count++ % 2 == 0): ?> style="background-color: #ededed;" <?php endif; ?>>					
					<td><?php echo ($i + 1); ?></td>
					<td><?php echo strtoupper($participant->seed); ?></td>
					<td><?php echo $participant->name_1; ?><br /><?php echo $participant->name_2; ?></td>
					<td><?php echo $participant->grade_1; ?><br /><?php echo $participant->grade_2; ?></td>
					<?php
						$ap = activityprogram::findOrFail($participant->ap_id);						
					?>
					<td><?php echo $ap->name; ?></td>					
				</tr>				
			<?php endforeach; ?>
		</table>		
		
		<br /><br />
		
		<br />
		
		Regards,<br /><br />
		Oregon School Activities Association<br />
		<a href="<?php echo url('/'); ?>">www.osaa.org</a>

		<br /><br />	

		<p style="font-size: 8pt; line-height: 110%;">
			This is an automatically generated message and was sent to <?php echo Helpers::arrayToList ($info['to']); ?>			
			<?php if (count($info['cc']) > 0): ?>
				and copied to <?php echo Helpers::arrayToList ($info['cc']); ?>
			<?php endif; ?>
		</p>	
		
	</body>
</html>