<?php  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */  require_once "init.php";  list($listingRecords, $listingDetails) = getRecords(array(    'tableName'   => 'listings',    'joinTable'   => 'homepages',    'perPage'     => '10',  ));?><?php include "include_header.php"; ?><!-- show listings --><table width="980" border="0" cellspacing="0" cellpadding="0">  <tr>    <td>&nbsp;</td>    <td height="30" background="images/text-bkg.jpg"><!-- show prev/next page links -->  <div align="right" class="textmain_italic"><br/>    <?php if ($listingDetails['prevPage']): ?>      <a href="<?php echo $listingDetails['prevPageLink'] ?>">&lt;&lt; prev</a>    <?php else: ?>      &lt;&lt; prev    <?php endif ?>    - page <?php echo $listingDetails['page'] ?> of <?php echo $listingDetails['totalPages'] ?> -    <?php if ($listingDetails['nextPage']): ?>      <a href="<?php echo $listingDetails['nextPageLink'] ?>">next &gt;&gt;</a>    <?php else: ?>      next &gt;&gt;    <?php endif ?>  </div><!-- /show prev/next page links -->    </td>  </tr>  <tr>    <td colspan="2" align="center" valign="top"></td>  </tr>    <tr>    <td colspan="2" align="center" valign="top">    <table width="980" border="0" cellspacing="0"><?php foreach ($listingRecords as $listing): ?>      <tr>     <td colspan="2" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">         <tr>           <td bgcolor="#BDC5CB"><img src="images/1pixel.gif" width="1" height="2" /></td>         </tr>       </table>         <table width="100%" border="0" cellspacing="0" cellpadding="0">           <tr>             <td bgcolor="#C7DAE0"><img src="images/1pixel.gif" alt="" width="1" height="2" /></td>           </tr>       </table></td>   </tr>   <tr> <td align="right" valign="middle">  <?php if ($listing['banner_status'] == 'Sold') : ?><img src="http://www.dunhamrealestateservices.com/images/bnr-sold.jpg" width="312" height="25" /><?PHP endif ?>   <?php if ($listing['banner_status'] == 'Reduced') : ?><img src="http://www.dunhamrealestateservices.com/images/bnr-reduced.jpg" width="312" height="25" /><?PHP endif ?>   <?php if ($listing['banner_status'] == 'New') : ?><img src="http://www.dunhamrealestateservices.com/images/bnr-new-listing.jpg" width="312" height="25" /><?PHP endif ?>       </td>     <td align="left" valign="top" background="images/text-bkg.jpg"><table width="648" border="0" cellspacing="0" cellpadding="5">       <tr>         <td width="15">&nbsp;</td>         <td width="613">		   <h1><?php echo $listing['title'] ?></h1></td>       </tr>     </table></td>   </tr>   <tr>     <td colspan="2" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">         <tr>           <td bgcolor="#BDC5CB"><img src="images/1pixel.gif" width="1" height="2" /></td>         </tr>       </table>         <table width="100%" border="0" cellspacing="0" cellpadding="0">           <tr>             <td bgcolor="#C7DAE0"><img src="images/1pixel.gif" alt="" width="1" height="2" /></td>           </tr>       </table></td>   </tr>   <tr>    <td width="320" align="center" valign="top"><?php foreach ($listing['uploads'] as $upload): ?>      <?php if ($upload['hasThumbnail']): ?>      <table width="50" border="0" cellpadding="0" cellspacing="0" id="frame">        <tr>          <td><a href="<?php echo $listing['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="0" alt="<?php echo $upload['info1'] ?>" /></a></td>        </tr>      </table>      <?php break /* only show one image */ ?>      <?php endif; ?>      <?php endforeach ?>      <?php if (!$listing['uploads']): /* if no uploads show this: */ ?>      <table cellspacing="0" cellpadding="0" width="200" class="noPhoto" style="height: 100px">        <tr>          <td bgcolor="#333333" align="center"><img src="images/no_photo_available.jpg" width="225" height="150" /></td>        </tr>      </table>      <?php endif; ?>            <a href="<?php echo $listing['_link'] ?>" class="title" style="font-weight: bold"><img src="images/bnr-more-info.jpg" alt="more info on this property from dunham real estate services" width="302" height="17" /></a>	  </td>    <td width="660" align="left" valign="top" background="images/text-bkg.jpg">    <table width="648" border="0" cellspacing="0" cellpadding="2">    <tr>    <td colspan="2"><img src="images/1pixel.gif" width="1" height="8" /></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><h2><?php echo $listing['subtitle'] ?></h2></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><?php echo $listing['address'] ?></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><?php echo $listing['city'] ?>, <?php echo $listing['state'] ?></td>  </tr>    <tr>    <td colspan="2"><img src="images/1pixel.gif" width="1" height="8" /></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><img src="images/subt-summary.jpg" alt="Property Summary" width="580" height="20" /></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><?php echo $listing['summary'] ?></td>  </tr>  <tr>    <td colspan="2"><img src="images/1pixel.gif" width="1" height="8" /></td>    </tr>  <tr>    <td>&nbsp;</td>    <td><b>$<?php echo number_format($listing['price']) ?></b></td>  </tr>  <tr>    <td colspan="2"><img src="images/1pixel.gif" width="1" height="8" /></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><img src="images/subt-more-info.jpg" alt="More Property Info &amp; Photos" width="580" height="20" /></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><a href="<?php echo $listing['_link'] ?>" class="title" style="font-weight: bold; font-size: 18px; font-style: italic">Click Here for More Information & Photos!</a></td>  </tr>  <tr>    <td width="26">&nbsp;</td>    <td width="614" class="textmain_contact">Call Agent: <a href="<?php echo $listing['homepages._link'] ?>"><?php echo $listing['homepages.fullname'] ?></a> at <?php echo $listing['homepages.phone'] ?></td>  </tr></table></td>   </tr>   <tr>     <td align="center" valign="top">&nbsp;</td>     <td height="30" valign="top" background="images/text-bkg.jpg">&nbsp;</td>   </tr><?php endforeach ?></table>    </td>    </tr>    <tr>    <td>&nbsp;</td>    <td background="images/text-bkg.jpg">    <table width="602" border="0" cellpadding="0" cellspacing="0" class="textmain">  <tr>    <td width="31">&nbsp;</td>    <td width="571">    <p>  <!-- show errors -->  <?php if ($listingDetails['invalidPageNum']): ?>      Results page '<?php echo $listingDetails['page']?>' not found, <a href="<?php echo $listingDetails['firstPageLink'] ?>">start over &gt;&gt;</a>.<br/>      <br/>    <?php elseif (!$listingRecords): ?>      No listings were found! </p>      <p><a href="search.php">Search for another listing, click here!</a><br/>          <br/>          <?php endif ?>          </p>      <!-- /show errors --></td>  </tr></table><!-- show prev/next page links -->  <div align="right" class="textmain_italic"><br/>    <?php if ($listingDetails['prevPage']): ?>      <a href="<?php echo $listingDetails['prevPageLink'] ?>">&lt;&lt; prev</a>    <?php else: ?>      &lt;&lt; prev    <?php endif ?>    - page <?php echo $listingDetails['page'] ?> of <?php echo $listingDetails['totalPages'] ?> -    <?php if ($listingDetails['nextPage']): ?>      <a href="<?php echo $listingDetails['nextPageLink'] ?>">next &gt;&gt;</a>    <?php else: ?>      next &gt;&gt;    <?php endif ?>  </div><!-- /show prev/next page links -->    </td>  </tr>  <tr>    <td><img src="images/1pixel.gif" width="320" height="40" /></td>    <td background="images/text-bkg.jpg"><img src="images/1pixel.gif" alt="" width="660" height="40" /></td>  </tr></table><!-- /show listings --><?php include "include_footer.php"; ?>