<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "C:/Program Files/wamp/www/DressShop/cmsAdmin/lib/viewer_functions.php";
  
  list($dressgallery03Records, $dressgallery03MetaData) = getRecords(array(
    'tableName' => 'dressgallery03',
	'where' 	=> 'dress_category = "Weddings"',  
	'orderBy' 	=> 'createdDate DESC ', 	
	'perPage'   => '3',
	//'limit' => 2, 

	)); 
?> 

<!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>
 <script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <style type="text/css">
<!--
.content01 {
	float: left;
	height: 175px;
	width: 200px;
}
-->
  </style>
</head>
<body>

  <!-- Display Records (Paste this where you want your records to be listed) -->
    <h1>DressGallery03 - Weddings List Page</h1>
	Search Help Documents:<br>
	<a href="http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html">
	http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html</a> <br><br>
	
	<br>
	<select name="searchPrice" style="background-color:#FFFFFF; border-style:1px; font-size: 11; color: #344E69; font-family: helvetica, arial; width: 170px;" onChange="MM_jumpMenu('self',this,1)">
          <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php" selected>Search By Price:</option>
          <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php?price_min=0&price_max=199">$50 to $200</option>
          <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php?price_min=200&price_max=399">$200 to $400</option>
		  <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php?price_min=401&price_max=799">$400 to $800</option>
	 	  <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php?price_min=800&price_max=40799">$800 and Up</option>
</select>
	
	<br><br>
<select name="searchSize" style="background-color:#FFFFFF; border-style:1px; font-size: 11; color: #344E69; font-family: helvetica, arial; width: 170px;" onChange="MM_jumpMenu('self',this,1)">
          <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.phpp" selected>Search By Size:</option>
          <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php?size_min=10&size_max=12">10-12</option>
          <option value="http://localhost/DressShop/ForumSampleDressPageNumbers.php?size_min=13&size_max=15">13-15</option>
</select>
<br><br><br>	
<FORM METHOD="GET" ACTION="http://localhost/DressShop/ForumSampleDressPageNumbers.php">
<INPUT TYPE="submit"  VALUE="Clear Search" >
</FORM><br><br>

	<!-- Display Page Links (Paste anywhere below "Load Record List") -->
    <?php if ($dressgallery03MetaData['prevPage']): ?>
      &laquo; &laquo; <a href="<?php echo $dressgallery03MetaData['prevPageLink'] ?>"> prev</a>&nbsp;
    <?php else: ?>
     &laquo; &laquo; prev&nbsp;
    <?php endif ?>
 <!--- page <?php /*OLD LISTING Blank 01of02    echo $dressgallery03MetaData['page'] ?> of <?php echo $dressgallery03MetaData['totalPages'] */ ?> - -->
	<!-- Display Numbers Links for each page within the records -->
	<?php foreach (range(1,$dressgallery03MetaData['totalPages']) as $page): ?>
	<a href="ForumSampleDressPageNumbers.php?page=<?php echo $page; ?>">&nbsp;<?php echo $page; ?></a>&nbsp; 
	<?php endforeach; ?>&nbsp;
    <?php if ($dressgallery03MetaData['nextPage']): ?><a href="<?php echo $dressgallery03MetaData['nextPageLink'] ?>">next</a> &raquo; &raquo;
    <?php else: ?>next &raquo; &raquo;
    <?php endif ?>
    <hr align="left" width="250">
    <br />
    <br/>
    <table width="800" height="85" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="167" height="20" align="center" valign="middle" bgcolor="#666666" scope="col"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">       Title<br/>
        </div>        
        </font></td>
        <td width="68" align="center" valign="middle" bgcolor="#666666" scope="col"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Category: </font></td>
        <td width="98" align="center" valign="middle" bgcolor="#666666" scope="col"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Number: </font></td>
        <td width="76" align="center" valign="middle" bgcolor="#666666" scope="col"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Size:</font></td>
        <td width="78" align="center" valign="middle" bgcolor="#666666" scope="col" onclick='window.location="?dress_catgory=Weddings&sortBy=price"'><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><a href="#">Price: </a></font></td>
        <td width="183" align="center" valign="middle" bgcolor="#666666" scope="col"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
        <!-- Display Uploads for field 'dress_image' (Paste this anywhere 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 -->
        Link</font></td>
        <td width="130" align="center" valign="middle" bgcolor="#666666" scope="col"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Image </font></td>
      </tr>
      <tr>
        <td align="left" valign="top" bgcolor="#E4E4E4" scope="col"><br/>
          <?php foreach ($dressgallery03Records as $record): ?>
          <?php if ($record['sold'] == "1")
	  echo "<b><font color='#990000'>SOLD!</font>&nbsp;&nbsp;</b>"; 
	else
	 echo ""; 
				?><br/>
          <b><?php echo $record['dress_title'] ?></b></td>
        <td bgcolor="#E4E4E4" scope="col"><?php echo $record['dress_category'] ?></td>
        <td bgcolor="#E4E4E4" scope="col"><div align="center"><?php echo $record['item_number'] ?></div></td>
        <td bgcolor="#E4E4E4" scope="col"><div align="center"><?php echo $record['size'] ?></div></td>
        <td bgcolor="#E4E4E4" scope="col">$<?php echo $record['price'] ?></td>
        <td bgcolor="#E4E4E4" scope="col"><div align="center"><a href="<?php echo $record['_link'] ?>">Section Link Details</a></div></td>
        <td bgcolor="#E4E4E4" scope="col"><?php foreach ($record['dress_image'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
          <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
          <?php endif ?>
          <?php endforeach ?></td>
      </tr>
      <tr>
        <td height="10" align="left" valign="top" bgcolor="#FFFFFF" scope="col">&nbsp;</td>
        <td bgcolor="#FFFFFF" scope="col">&nbsp;</td>
        <td bgcolor="#FFFFFF" scope="col">&nbsp;</td>
        <td bgcolor="#FFFFFF" scope="col">&nbsp;</td>
        <td bgcolor="#FFFFFF" scope="col">&nbsp;</td>
        <td bgcolor="#FFFFFF" scope="col">&nbsp;</td>
        <td bgcolor="#FFFFFF" scope="col">&nbsp;</td>
      </tr>
      <tr>
        <td align="left" valign="top" bgcolor="#E4E4E4" scope="col"><?php endforeach ?></td>
        <td scope="col">&nbsp;</td>
        <td scope="col">&nbsp;</td>
        <td scope="col">&nbsp;</td>
        <td scope="col">&nbsp;</td>
        <td scope="col">&nbsp;</td>
        <td scope="col">&nbsp;</td>
      </tr>
    </table>
<br />
    <br />

<br />
    <?php if ($dressgallery03MetaData['invalidPageNum']): ?>
      Results page '<?php echo $dressgallery03MetaData['page']?>' not found, <a href="<?php echo $dressgallery03MetaData['firstPageLink'] ?>">start over &gt;&gt;</a>.<br/><br/>
    <?php elseif (!$dressgallery03Records): ?>
      No records were found! <a href="http://localhost/DressShop/ForumSampleDressPageNumbers.php">Clear Search</a>.<br/><br/>
      <?php endif ?>
</body>
</html>
