<?php
	$round_names = array('1'  => 'Round 1',						 
						 'QF' => 'Quarterfinals',
						 'SF' => 'Semifinals',
						 'F'  => 'Final');

?>

<div style="width: 200px; height: 50px; position: absolute; bottom: 50px; right: 250px; background-image: url(<?php echo asset('images/logos/USBank_200x50px.png'); ?>); background-repeat: no-repeat;"></div>

<div style="width: 200px; height: 50px; position: absolute; bottom: 50px; right: 25px; background-image: url(<?php echo asset('images/logos/LesSchwab_200x50px.png'); ?>); background-repeat: no-repeat;">
</div>

<div style="width: 250px; height: 130px; position: absolute; top:150px; right: 25px;; background-image: url(<?php echo asset('images/logos/OSAAStateChampionship_250x130px.png'); ?>); background-repeat: no-repeat;">
</div>

<!-- Area Container -->
<div style="height: 1250px; overflow: hidden;">
	

	<!-- Round 0 (1) -->
	<div class="round left" style="height: 500px; padding: 0 8px; margin-left: 118px;">
		
		<!-- Round Info -->
		<div class="info" style="margin-top: 16px; margin-bottom: 47px;">
			<div class="title">
				<?php echo $round_names[$information['bracket']->rounds[0]->round->round_type]; ?>
			</div>
			<div class="date">
				<?php echo date('M. j', strtotime($information['bracket']->rounds[0]->event->start_at)); ?>
			</div>
		</div>

		<!-- Matchups -->
		<?php for ($i = 0; $i < 4; $i++): ?>

			<?php if ($i == 0): ?>				
				<div class="connector right top" style="margin-top: 78px; height: 74px;"></div>				
			<?php elseif ($i % 2 == 0): ?>								
				<div class="connector right top" style="margin-top: 41px; height: 74px;"></div>				
			<?php else: ?>							
				<div class="connector right bottom" style="margin-top: -33px; height: 74px;"></div>				
			<?php endif; ?>			

			<?php echo BracketsController::getMatchup('right', $information['bracket']->matchups[$i]); ?>
			
			<?php if ($i == 0 or $i == 2): ?>
				<div class="spacer" style="height: 360px;"></div>
			<?php else: ?>
				<div class="spacer" style="height: 64px;"></div>
			<?php endif; ?>

		<?php endfor; ?>

	</div>

	<!-- Round 1 (QF) -->
	<div class="round left" style="height: 500px; padding: 0 8px;">
		
		<!-- Round Info -->
		<div class="info" style="margin-top: 16px; margin-bottom: 121px;">
			<div class="title">
				<?php echo $round_names[$information['bracket']->rounds[1]->round->round_type]; ?>
			</div>
			<div class="date">
				<?php echo date('M. j', strtotime($information['bracket']->rounds[1]->event->start_at)); ?>
			</div>
		</div>

		<!-- Matchups -->
		<?php for ($i = 4; $i < 8; $i++): ?>

			<?php if ($i == 4): ?>
				<div class="connector left bottom" style="margin-top: 152px;"></div>
				<div class="connector right top" style="margin-top: 152px; height: 141px;"></div>
			<?php elseif ($i % 2 == 0): ?>				
				<div class="connector left bottom" style="margin-top: 41px;"></div>
				<div class="connector right top" style="margin-top: 41px; height: 141px;"></div>				
			<?php else: ?>			
				<div class="connector left bottom" style="margin-top: 41px;"></div>
				<div class="connector right bottom" style="margin-top: -112px; height: 153px;"></div>				
			<?php endif; ?>			

			<?php echo BracketsController::getMatchup('right', $information['bracket']->matchups[$i]); ?>
			
			<div class="spacer" style="height: 212px;"></div>

		<?php endfor; ?>

	</div>

	<!-- Round 2 (SF) -->
	<div class="round left" style="height: 500px; padding: 0 8px;">
		
		<!-- Round Info -->
		<div class="info" style="margin-top: 16px; margin-bottom: 262px;">
			<div class="title">
				<?php echo $round_names[$information['bracket']->rounds[2]->round->round_type]; ?>
			</div>
			<div class="date">
				<?php echo date('M. j', strtotime($information['bracket']->rounds[2]->event->start_at)); ?>
			</div>
		</div>

		<!-- Matchups -->
		<?php for ($i = 8; $i < 10; $i++): ?>

			<?php if ($i == 8): ?>
				<div class="connector left bottom" style="margin-top: 293px;"></div>
				<div class="connector right top" style="margin-top: 293px; height: 298px;"></div>				
			<?php elseif ($i % 2 == 0): ?>				
				<div class="connector left bottom" style="margin-top: 41px;"></div>
				<div class="connector right top" style="margin-top: 41px; height: 298px;"></div>				
			<?php else: ?>			
				<div class="connector left bottom" style="margin-top: 41px;"></div>
				<div class="connector right bottom" style="margin-top: -253px; height: 294px;"></div>				
			<?php endif; ?>
			

			<?php echo BracketsController::getMatchup('right', $information['bracket']->matchups[$i]); ?>
			
			<div class="spacer" style="height: 510px;"></div>

		<?php endfor; ?>

	</div>

	<!-- Round 3 (F) -->
	<div class="round left" style="height: 500px; padding: 0 8px;">
		
		<!-- Round Info -->
		<div class="info" style="margin-top: 16px; margin-bottom: 560px;">
			<div class="title">
				<?php echo $round_names[$information['bracket']->rounds[3]->round->round_type]; ?>
			</div>
			<div class="date">
				<?php echo date('M. j', strtotime($information['bracket']->rounds[3]->event->start_at)); ?>
			</div>
		</div>

		<!-- Matchups -->
		<?php for ($i = 10; $i < 11; $i++): ?>
					
			<div class="connector left bottom" style="margin-top: 591px;"></div>						

			<?php echo BracketsController::getMatchup('right', $information['bracket']->matchups[$i]); ?>		
			
		<?php endfor; ?>

	</div>

</div>
