<?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 "/services/webpages/a/x/axislighting.com/public/cmsAdmin/lib/viewer_functions.php";

  list($itemsRecords, $itemsMetaData) = getRecords(array(
    'tableName'   => 'items',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
 
  $itemsRecord = @$itemsRecords[0]; // get first record
  
  list($typesRecords, $typesMetaData) = getRecords(array(
    'tableName'   => 'types',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $typesRecord = @$typesRecords[0]; // get first record
  
  list($brandsRecords, $brandsMetaData) = getRecords(array(
    'tableName'   => 'brands',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $brandsRecord = @$brandsRecords[0]; // get first record


  // show error message if no matching record is found
  if (!$itemsRecord) {
    header("HTTP/1.0 404 Not Found");
    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>
<?php include("header.php"); ?><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="18"></td>
  </tr>
  <tr>
    <td height="30" bgcolor="#16191e"><div class="breadcrumbs">Products >> <a href="search.php?<?php echo $itemsRecord['type'] ?>"><?php echo $itemsRecord['type'] ?></a> >> 
    <a href="<?php echo $brandsRecord['link'] ?>"><?php echo $itemsRecord['brands'] ?></a> >> <?php echo $itemsRecord['name'] ?></div></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="231" valign="top" bgcolor="#2d343d"><div class="tree">
          <script type="text/javascript" src="axis_tree_menu.js"></script>
        </div></td>
        <td bgcolor="#2d343d"><br/>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="287" height="76"><?php foreach ($itemsRecord['logo'] as $upload): ?>
                <?php if ($upload['isImage']): ?>
                <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" />
                <?php endif ?>
                <?php endforeach ?>Record Number: <?php echo $itemsRecord['num'] ?><br/>
      Name: <?php echo $itemsRecord['name'] ?><br/>
      Content: <?php echo $itemsRecord['content'] ?><br/>
      Brands: <?php echo $itemsRecord['brands'] ?><br/>
      Type: <?php echo $itemsRecord['type'] ?><br/>
      Link: <?php echo $itemsRecord['link'] ?><br/>
      _link : <a href="<?php echo $itemsRecord['_link'] ?>"><?php echo $itemsRecord['_link'] ?></a><br/>
</td>
              <td valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><?php foreach ($itemsRecord['tab1'] as $upload): ?>
                   
                    <?php if ($upload['isImage']): ?>
                    <a href="<?php echo $itemsRecord['link_tab_1'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" border="0" /></a>
                    <?php endif ?>
                    <?php endforeach ?></td>
                  <td width="5"><img src="images/tab_spacer.gif" alt="" width="5" height="31" /></td>
                  <td><?php foreach ($itemsRecord['tab2'] 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 ?></td>
                  <td width="5"><img src="images/tab_spacer.gif" alt="" width="5" height="31" /></td>
                  <td><?php foreach ($itemsRecord['tab3'] 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 ?></td>
                  <td width="5"><img src="images/tab_spacer.gif" alt="" width="5" height="31" /></td>
                  <td width="86"><?php foreach ($itemsRecord['tab4'] 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 ?></td>
                  <td width="5"><img src="images/tab_spacer.gif" alt="" width="5" height="31" /></td>
                  <td><?php foreach ($itemsRecord['tab5'] 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 ?></td>
                  <td width="13">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="76" valign="top"><?php foreach ($itemsRecord['main_image'] as $upload): ?>
                <?php if ($upload['isImage']): ?>
                <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" />
                <?php endif ?>
                <?php endforeach ?></td>
              <td valign="bottom"><?php echo $itemsRecord['content'] ?></td>
            </tr>
          </table></td>
      </tr>
    </table>
  


      <!-- 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 ($itemsRecord['images'] 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 -->

  <?php if (!$itemsRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->

  <a href="<?php echo $itemsMetaData['_listPage']; ?>">&lt;&lt; Back to list page</a> - 
  <a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
  <?php include("footer.php"); ?>
</body>
</html>
