<?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 "/home/www/waittandco.com/admin/lib/viewer_functions.php";

  list($home_pageRecords, $home_pageMetaData) = getRecords(array(
    'tableName'   => 'home_page',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $home_pageRecord = @$home_pageRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$home_pageRecord) {
    print "Record not found!";
    exit;
  }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <style type="text/css">
    body          { font-family: arial; }
    .instructions { border: 3px solid #000; background-color: #EEE; padding: 10px; text-align: left; margin: 25px}
  </style>
 </head>
<body>

  <!-- INSTRUCTIONS -->
    <div class="instructions">
      <b>Sample Detail Page Viewer - Instructions:</b>
      <ol>
        <?php /*><li style="color: red; font-weight: bold">Rename this file to have a .php extension!</li><x */ ?>
        <li><b>Remove any fields you don't want displayed.</b></li>
        <li>Rearrange remaining fields to suit your needs.</li>
        <li>Copy and paste code into previously designed page (or add design to this page).</li>
      </ol>
    </div>
  <!-- /INSTRUCTIONS -->

  <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
    <h1>Home Page - Detail Page Viewer</h1>
      Record Number: <?php echo $home_pageRecord['num'] ?><br/>
      Title: <?php echo $home_pageRecord['title'] ?><br/>
      metaDescription: <?php echo $home_pageRecord['metadescription'] ?><br/>
      metaKeywords: <?php echo $home_pageRecord['metakeywords'] ?><br/>
      Heading: <?php echo $home_pageRecord['heading'] ?><br/>
      English Text: <?php echo $home_pageRecord['english_text'] ?><br/>
      French Text: <?php echo $home_pageRecord['french_text'] ?><br/>
      Dutch Text: <?php echo $home_pageRecord['dutch_text'] ?><br/>
      German Text: <?php echo $home_pageRecord['german_text'] ?><br/>
      Russian Text: <?php echo $home_pageRecord['russian_text'] ?><br/>
      Polish Text: <?php echo $home_pageRecord['polish_text'] ?><br/>
      Contact Us: <?php echo $home_pageRecord['contact_us'] ?><br/>
      _link : <a href="<?php echo $home_pageRecord['_link'] ?>"><?php echo $home_pageRecord['_link'] ?></a><br/>


      <!-- STEP 2a: Display Uploads for field 'image' (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 ($home_pageRecord['image'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

          <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

          <?php else: ?>
            <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

          <?php endif ?>
        <?php endforeach ?>
      <!-- STEP2a: /Display Uploads -->


      <hr/>
    <?php if (!$home_pageRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->

  <a href="<?php echo $home_pageMetaData['_listPage']; ?>">&lt;&lt; Back to list page</a> - 
  <a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>
</body>
</html>
