<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/var/www/vhosts/gourmetguy.biz/httpdocs/cms/lib/viewer_functions.php";

  list($home_pageRecords, $home_pageMetaData) = getRecords(array(
    'tableName'   => 'home_page',
  ));
  $home_pageRecord = @$home_pageRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$home_pageRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }
  list($headersRecords, $headersMetaData) = getRecords(array(
    'tableName'   => 'headers',
    'where'       => 'num = 3',
    'limit'       => '1',
  ));
  $headersRecord = @$headersRecords[0]; // get first record
  list($quotesRecords, $quotesMetaData) = getRecords(array(
    'tableName'   => 'quotes',
    'orderBy'     => 'RAND()',
    'limit'       => '1',
  )); 
  list($bottom_navigationRecords, $bottom_navigationMetaData) = getRecords(array(
    'tableName'   => 'bottom_navigation',
  ));
    list($blogRecords, $blogMetaData) = getRecords(array(
    'tableName'   => 'blog',
    'perPage'     => '5',
    'orderBy'     => 'date DESC, title',
    'loadUploads' => '0',
  ));
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  
<title><?php echo $headersRecord['title_text'] ?></title>
<meta name="keywords" content="<?php echo $headersRecord['meta_keywords'] ?>" />
<meta name="description" content="<?php echo $headersRecord['meta_description'] ?>" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<!-- Google Analytics Tracking Asynchronous Tracking Code -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-947987-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();

</script>
<div id="wrapper">
	<div id="header-wrapper">
	<div id="header">
		<div id="logo">
			<br/><h1><a href="#">GourmetGuy</a></h1>
			&nbsp&nbsp&nbsp&nbsp&nbsp<p>Vancouver Personal Chef Services</a></p>
		</div>
	</div>
	</div>
	<!-- end #header -->
	<div id="menu">
		<ul>
			<li class="current_page_item"><a href="http://www.gourmetguy.biz/index3.php">Home</a></li>
			<li><a href="http://www.gourmetguy.biz/ask_the_chef.php">Ask the Chef</a></li>
			<li><a href="http://www.gourmetguy.biz/menu_plans.php">Menu Plans</a></li>
			<li><a href="http://www.gourmetguy.biz/chef_blog_list.php"><strong>The Chef's Blog</strong></a></li>
			<li><a href="http://www.gourmetguy.biz/menu_examples.php">Menu Examples</a></li>
			<li><a href="#">Contact the Chef</a></li>
		</ul>
	</div>
	<!-- end #menu -->
	<div id="page">
	<div id="page-bgtop">
	<div id="page-bgbtm">
		<div id="content">
			<div class="post">
                            <?php foreach ($blogRecords as $record): ?>
			    <?php if ($record['live']): ?><h2 class="title"><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></h2>
    <p class="meta">Posted on <?php echo date("D, M jS, Y", strtotime($record['date'])) ?></p>
    <div class="entry"><?php echo $record['summary'] ?></div>
			    <?php endif ?>
			    <?php endforeach ?>
    <?php if (!$blogRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
<center>
<div style="padding:40px;">
  <?php if ($blogMetaData['prevPage']): ?>
      <a href="<?php echo $blogMetaData['prevPageLink'] ?>">&lt;&lt; prev</a>
    <?php else: ?>
      &lt;&lt; prev
    <?php endif ?>

    - page <?php echo $blogMetaData['page'] ?> of <?php echo $blogMetaData['totalPages'] ?> -

    <?php if ($blogMetaData['nextPage']): ?>
      <a href="<?php echo $blogMetaData['nextPageLink'] ?>">next &gt;&gt;</a>
    <?php else: ?>
      next &gt;&gt;
    <?php endif ?>
</div>
</center>		
		<div id="navmenu" float="right"> 
		<ul> 
	<?php foreach ($bottom_navigationRecords as $record): ?>
      <li><a href="<?php echo $record['url'] ?>"> <?php echo $record['title'] ?></a></li>
      
    <?php endforeach ?>
		</ul>
    <?php if (!$bottom_navigationRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
	</div>						
			</div>
		<div style="clear: both;">&nbsp;</div>
				</div>
		<!-- end #content -->
		<div id="sidebar">
			<ul>
				
					<h2>Satisfied Customers!</h2>					
					<?php foreach ($quotesRecords as $record): ?>    
      <?php echo $record['pullQuote'] ?><br/>
      <div id="qcredit"><p><?php echo $record['name'] ?><br/>
      <strong><a href="<?php echo $record['website'] ?>"><?php echo $record['company'] ?></a></strong><br/></div></p>
      

      <hr/>
    <?php endforeach ?>

    <?php if (!$quotesRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>			
				</li>
				<li>
					<h2>Latest Posts</h2>
					 
				</li>
			</ul>
<ul><?php include("test.php"); ?></ul>
		</div>
		<!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>

	<!-- end #page -->
</div>
<div id="footer-wrapper">
	<div id="footer">
		<p>Copyright (c) 2010 GourmetGuy.biz. All rights reserved. Design by <a href="http://www.veria.ca">Veria Search Marketing</a> based on a template by <a href="http://www.freecsstemplates.org" rel="nofollow">FreeCSStemplates.org</a>. Content Management Solution provided by <a href ="http://www.interactivetools.com" rel="nofollow">interactivetools.com</a>.</p>
	</div>
	<!-- end #footer -->
</div>
</body>
</html>
