<?php echo "<?xml version='1.0'?>\n"; ?>
<!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 List 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> (Most list pages only have title and link fields.)</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 -->



  <!-- STEP1: Load Record List (Paste this above other steps) -->
    <?php
      require_once "/home/first4zo/public_html/cmsAdmin/lib/viewer_functions.php";
      $productsOptions = array();                  // NOTE: see online documentation for more details on these options
      $productsOptions['tableName']  = 'products';  // (REQUIRED) MySQL tablename to list record from. Example: 'article';
      $productsOptions['titleField'] = '';    // (optional) MySQL fieldname used in viewer url for search engines. Example: 'title' would display: viewer.php/article_title_here-123
      $productsOptions['viewerUrl']  = 'productsPage.php'; // (optional) URL of viewer page. Example: '/articles/view.php';
      $productsOptions['perPage']    = '';         // (optional) The number of records to display per page. Example: '5'; Defaults to 10.
      $productsOptions['orderBy']    = 'name, num DESC';         // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
      $productsOptions['pageNum']    = '';         // (optional) Page number of results to display. Example: '1'; Defaults to ?page=# value, or 1 if undefined
      $productsOptions['where']      = '';         // (ADVANCED) Additional MySQL WHERE conditions. Example: 'fieldname = "value"'
      $productsOptions['useSeoUrls'] = '';         // (ADVANCED) Set this to '1' for search engine friendly urls: view.php/123 instead of view.php?123 (not supported on all web servers)
      list($productsRecordList, $productsListDetails) = getListRows($productsOptions);
    ?>
  <!-- /STEP1: Load Record List -->



  <!-- STEP2: Display Record List (Paste this where you want your records to be listed) -->
    <h1>Products List Viewer</h1>
    <?php foreach ($productsRecordList as $productsRecord): ?>
      Record Number: <?php echo $productsRecord['num'] ?><br/>
      Name: <?php echo $productsRecord['name'] ?><br/>
      Price: <?php echo $productsRecord['price'] ?><br/>
      Product ID/SKU: <?php echo $productsRecord['product_id_sku'] ?><br/>
      Order URL: <?php echo $productsRecord['order_url'] ?><br/>
      Summary: <?php echo $productsRecord['summary'] ?><br/>
      Description: <?php echo $productsRecord['description'] ?><br/>
      link : <a href="<?php echo $productsRecord['_link'] ?>"><?php echo $productsRecord['_link'] ?></a><br/>
    <hr/>
    <?php endforeach ?>

    <?php if ($productsListDetails['noRecordsFound']): ?>
      No records were found!<br/>
    <?php endif ?>

    <?php if ($productsListDetails['invalidPageNum']): ?>
      Results page '<?php echo $productsListDetails['page']?>' not found, <a href="<?php echo $productsListDetails['firstPageLink'] ?>">start over &gt;&gt;</a>.<br/>
    <?php endif ?><br/>
  <!-- /STEP2: Display Record List -->




  <!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
    <?php if ($productsListDetails['prevPage']): ?>
      <a href="<?php echo $productsListDetails['prevPageLink'] ?>">&lt;&lt; prev</a>
    <?php else: ?>
      &lt;&lt; prev
    <?php endif ?>

    - page <?php echo $productsListDetails['page'] ?> of <?php echo $productsListDetails['totalPages'] ?> -

    <?php if ($productsListDetails['nextPage']): ?>
      <a href="<?php echo $productsListDetails['nextPageLink'] ?>">next &gt;&gt;</a>
    <?php else: ?>
      next &gt;&gt;
    <?php endif ?>
  <!-- /STEP3: Display Page Links -->



<div style="float: right; font-size: 10px; color: #999999">
  <a href='http://www.interactivetools.com/'>Content Management</a> by interactivetools.com<br/><br/>
</div>

</body>
</html>
