<?php include "../common/includes/php_header.inc"; ?>
<?php

    list($site_pagesRecords, $site_pagesMetaData) = getRecords(array(
    'tableName'   => 'site_pages',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $site_pagesRecord = @$site_pagesRecords[0]; // get first record
  
    // load records
  list($finalistsRecords, $finalistsMetaData) = getRecords(array(
    'tableName'   => 'finalists',
    'loadUploads' => '0',
  ));

  // load records
  list($photosRecords, $photosMetaData) = getRecords(array(
    'tableName'   => 'photos',
  ));


?>
<!DOCTYPE html PUBLIC "~//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml/DTD/xhtmll-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../common/css/style.css" />
<script type="text/javascript" src="../common/jquery/jquery-1.7.2.min.js"></script>
<script src="../common/jquery/lightbox.js"></script>
<link href="../common/css/lightbox.css" rel="stylesheet" />

<!--[if lte IE 6]><link rel="stylesheet" href="../common/css/iefix.css" /><![endif]-->

<title>Webster Memorial Trophy Competition</title>

<script>
  !function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(
  arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
  d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
  insertBefore(d,q)}(window,document,'script','_gs');

  _gs('GSN-390023-I');
</script>

</head>
<body>
<div id="outercontainer">
<div id="header">

</div>
<div id="innercontainer">
<div id="sidebar">
<div id="menu">
<?php include "../common/includes/sidebarMenu.inc" ?>
</div>
<hr>
<br />
<?php
  list($site_pagesRecords, $site_pagesMetaData) = getRecords(array(
    'tableName'   => 'site_pages',
  ));
?>
 <ul>
 	<li>
 		<?php foreach ($site_pagesRecords as $record): ?>
 		<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a><br /><br />
    		<?php endforeach; ?>
 	</li>
 </ul>


</div>
<div id="main">

<h2><?php echo $site_pagesRecord['title'] ?></h2>

<?php if ($site_pagesRecord['title'] == 'Award Ceremony Photos'): ?>
   <?php foreach ($photosRecords as $record): ?>
   <h3><?php echo $record['album'] ?></h3>

<?php foreach ($record['pictures'] as $upload): ?>

<?php if ($upload['hasThumbnail']): ?>

<a href="<?PHP echo $upload['urlPath'] ?>" title="<?PHP echo $upload['info1'] ?>" rel="lightbox[<?php echo $record['album'] ?>]" />
<img src="<?PHP echo $upload['urlPath'] ?>" height="75" width="100" style="border:none;" /></a>

<?php elseif ($upload['isImage']): ?>

<a href="<?PHP echo $upload['urlPath'] ?>" title="<?PHP echo $upload['info1'] ?>" rel="lightbox[<?php echo $record['album'] ?>]"/>
<img src="<?PHP echo $upload['urlPath'] ?>" width="100" border="0"/></a>

<?PHP endif ?>

<?PHP endforeach ?>
<br />
<?php endforeach ?>

<?php endif ?>

<?php if ($site_pagesRecord['title'] == 'Regional Finalists'): ?>
	<form name="finalists" action="finalistsDetails.php?title=" method="post">
	Choose a finalist year to view:<br /><br />
	<select name="title" size="1" style="width: 160px;">
	<?php foreach ($finalistsRecords as $record): ?>
	<option value="<?php echo $record['title'] ?>"><?php echo $record['title'] ?></option>
	<?php endforeach; ?>
	</select>
	<input type="submit" value="Submit">
	</form>
	
<?php else: ?>

		<?php echo $site_pagesRecord['content'] ?><br />


        
        <?php foreach ($site_pagesRecord['file_upload'] as $index => $upload): ?>  
            <a href="<?php echo $upload['urlPath'] ?>"><?php echo $upload['info1'] ?></a><br/>

        <?php endforeach ?>
        <br />
        
<?php endif ?>

<?php if ($site_pagesRecord['title'] == 'Information Package and Application Form'): ?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="T3NUBGVWHD8QJ">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<br /><br />
        <?php endif ?>
<center><a href="#top">back to top</a></center>
</div>
</div>

<div id="innercontainerbottom">&nbsp;</div>
<div id="footer"></div>

</body>
</html>