<?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('/home/awardbath/domains/awardbathrooms.com.au/public_html/','','../','../../','../../../');
  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($google_analyticsRecords, $google_analyticsMetaData) = getRecords(array(
    'tableName'   => 'google_analytics',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $google_analyticsRecord = @$google_analyticsRecords[0]; // get first record
  
  // load records
  list($gallery_meta_tagsRecords, $gallery_meta_tagsMetaData) = getRecords(array(
    'tableName'   => 'gallery_meta_tags',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $gallery_meta_tagsRecord = @$gallery_meta_tagsRecords[0]; // get first record  
  
  // load records
  list($gallery_wordingRecords, $gallery_wordingMetaData) = getRecords(array(
    'tableName'   => 'gallery_wording',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $gallery_wordingRecord = @$gallery_wordingRecords[0]; // get first record
  
  // load records
  list($galleryRecords, $galleryMetaData) = getRecords(array(
    'tableName'   => 'gallery',
    'limit'       => '15',
    'allowSearch' => 0,

//    'where'       => whereRecordNumberInUrl(1),
  ));

  // show error message if no matching record is found
  if (!$google_analyticsRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>
<!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" xml:lang="en" lang="en">
<head>
<title><?php echo $gallery_meta_tagsRecord['page_title'] ?></title>
<meta name="keywords" content="<?php echo $gallery_meta_tagsRecord['keywords'] ?>" />
<meta name="description" content="<?php echo $gallery_meta_tagsRecord['description_tag'] ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<!--[if lt IE 7]>
   <script type="text/javascript" src="js/ie_png.js"></script>
   <script type="text/javascript">
       ie_png.fix('.png');
   </script>
<![endif]-->
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '<?php echo $google_analyticsRecord['code'] ?>']);
  _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';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<body id="page2">
<div class="header-bg">
  <div id="main">
    <!-- header -->
    <div id="header">
      <div>
        <!--Valid flash version 8.0-->
        <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="980" height="261">
          <param name="movie" value="flash/menu_v8.swf" />
          <param name="quality" value="high" />
          <param name="wmode" value="transparent" />
          <param name="swfversion" value="8.0.35.0" />
          <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
          <param name="expressinstall" value="Scripts/expressInstall.swf" />
          <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="flash/menu_v8.swf" width="980" height="261">
            <!--<![endif]-->
            <param name="quality" value="high" />
            <param name="wmode" value="transparent" />
            <param name="swfversion" value="8.0.35.0" />
            <param name="expressinstall" value="Scripts/expressInstall.swf" />
            <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
            <div>
              <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
              <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
            </div>
            <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object>
      </div>
    </div>
    <!-- content -->
    <div id="content">
      <div class="bg">
        <div class="indent">
          <div class="indent2">
            <div class="indent1">
              <h2>Award Bathrooms <span>Gallery</span></h2>
              <h3><?php echo $gallery_wordingRecord['title'] ?></h3>
              <p class="p1"><?php echo $gallery_wordingRecord['content'] ?></p>
            </div>
          </div>
          <div class="wrapper">
            <div class="col-1">
              <div class="box">
                <div class="inner">
                  <h2>Projects</h2>
                  <ul class="list1">
                      <?php foreach ($galleryRecords as $record): ?>
                    <li><a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></li>
                        <?php endforeach ?>
  <!-- /STEP2: Display Records -->
                  </ul>
                </div>
              </div>
            </div>
            <div class="col-2">
              <div class="box">
                <div class="inner">
                  <h2>Our <span>Gallery</span></h2>
                  <div>      <!-- STEP 2a: Display Uploads for field 'images' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($record['images'] as $upload): ?>
          <a href="<?php echo $upload['urlPath'] ?>" rel="lightbox[screenshots]" ><img src="<?php echo $upload['thumbUrlPath2'] ?>" alt="" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" border="0" /></a>    
                                    <?php break ?>   
                                    <?php endforeach ?><br /><br />


      <!-- STEP2a: /Display Uploads -->
                                    <?php foreach ($record['images'] as $upload): ?>     
                                    <?php if (@++$count == 1) { continue; } ?>
                                    <a href="<?php echo $upload['urlPath'] ?>" rel="lightbox[screenshots]" ><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="100" height="100" vspace="13" border="0" /></a>
                                    <?php endforeach ?>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- footer -->
    <div id="footer">
      <?php include("includes/footer.inc.php"); ?>
    </div>
  </div>
</div>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>
