<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/hsphere/local/home/f1077a/packemin.com.au/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load records
  list($showsRecords, $showsMetaData) = getRecords(array(
    'tableName'   => 'shows',
    'where'       => whereRecordNumberInUrl(1),
//    'where'       => 'shows.current = 1',
    'orderBy'     => 'RAND()',
    'limit'       => '1',
  ));
  $showsRecord = @$showsRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$showsRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

  // load records
  list($rightbarRecords, $rightbarMetaData) = getRecords(array(
    'tableName'   => 'rightbar',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $rightbarRecord = @$rightbarRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$rightbarRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<title>Packemin Productions :: Leaders in Pro-Am entertainment</title>
<?php include("includes/head.php"); ?>
</head>

<body>

<div class="wrapper">

<div class="wide top">
</div><!-- /wide top -->

	<DIV id=menuwrap>
		<DIV id=menu>
		<?php include("includes/menu.php"); ?>
		</DIV><!-- /menu -->
	</DIV><!-- /menuwrap -->


<div class="outer">

   <div class="float-wrap">

	<div class="center">
	<?php include("includes/home.php"); ?>
	<div style="background:#EEEEFF; padding-bottom:1px;">
<hr size="1" color="#DDDDDD"><br>
<table margin="0">
  <tr>
    <td width="180" valign="top">
<p><a href="current.php">
<?php foreach ($showsRecord['logo160'] as $upload): ?>
          <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $upload['info1'] ?>" align="left" style="padding-bottom:10px;" />
        <?php endforeach ?></a></p>
    </td>
    <td valign="top">
<h2><?php echo $showsRecord['title'] ?></H2>
<H3><?php echo $showsRecord['venue'] ?></H3>
<p><b><?php echo $showsRecord['season'] ?></b></p>
    </td>
  </tr>
</table>

<?php echo $showsRecord['sdesc'] ?>
<?php echo $showsRecord['tix'] ?>
<p><a href="current.php">Click here for more info</a></p>
<hr size="1" color="#DDDDDD">
    <?php if (!$showsRecord): ?>
      No record found!
    <?php endif ?>
	</div>
	</div> <!-- center -->

	<div class="left">
	<?php include("includes/leftbar.php"); ?>
	</div> <!-- left -->

   </div><!-- float-wrap -->

   <div class="right">
	<div class="container-right">
	<?php echo $rightbarRecord['content'] ?>
	</div><!-- container-right -->
   </div> <!-- right -->

<br class="clear" />  <!-- using a <br /> here is less buggy than other choices -->

</div><!-- outer -->

<div class="wide bottom clear">
<?php include("includes/footer.php"); ?>
</div><!-- /wide bottom clear -->

</div><!-- /wrapper -->

<script type="text/javascript" language="javascript">

var fo = new FlashObject("images/booknow.swf", "booknow", "190", "200", "8", "#000000");
fo.addParam("wmode", "transparent");
fo.write("fbooknow");

</script>

<?php include("includes/stat.php"); ?>

</body>
</html>