Solved

Dreamweaver Navigation Bar

Posted on 2008-06-14
10
821 Views
Last Modified: 2011-10-19
When I insert a dreamweaver navigation bar on my results page it doesn't work. The results page has been set to a limit of 10 per page. If I set it to display "ALL" all the records are displayed correctly. The search is done by WebAssist but the results page is my own.

The first page displays correctly but when I click the next button I don't get any records. If I add another repeat region to the page an error message indicates I've already used recordset once. How do I overcome this issue?
0
Comment
Question by:rnicolais
  • 6
  • 4
10 Comments
 

Author Comment

by:rnicolais
ID: 21786141
Additional Info: When I add a the Navigation Status Bar it works. If I click "NEXT"  to load the next page that contains 10 tables (repeating) it goes from 1-10 to 11-20 indicating everything is ok EXCEPT the new page doesn't load!

If I use the repeating regiion with no limitiations and no Navigations Status Bar everything works fine. My table is of my own construction - 3 rows & 4 Columns
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21786416
Hi again rnicolais,

I'm going to guess that the WebAssist dynamic "WHERE" clause is screwing with the DW-generated $_GET array that controls the portion of the recordset visible.  There's also a bug in the WA stuff that can cause the PHP code to appear in the wrong place and that can screw up other server behaviors that are dependent on the search behavior to function.

Post the PHP code from the relevant page, please.  

Also, you say two different things...you "don't get any records" and  "the new page doesn't load"

Those indicate two different types of errors.  Are you mis-speaking and mean to say that you cannot get the repeat region to work or the whole page is coming up blank?
0
 

Author Comment

by:rnicolais
ID: 21786608
the page comes up but there are no repeating tables - Yes I've experienced the problem with WA - If you use there wizard you MUST use a page created from a template with a repeating region - I finally resloved the search issue using their search wizard but it took some time.

I will post the page that isn't working - as I said if I opt to put all the records on the page without limitation there isn't a problem
 
SEARCH PAGE
 

<?php require_once('Connections/IxHudConnect.php'); ?>

<?php

//WA Database Search Include

require_once("WADbSearch/HelperPHP.php");

?>

<?php

//WA Database Search (Copyright 2005, WebAssist.com)

//Recordset: property;

//Searchpage: BasicSearch.php;

//Form: form1;

$WADbSearch1_DefaultWhere = "";

if (!session_id()) session_start();

if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {

  $WADbSearch1 = new FilterDef;

  $WADbSearch1->initializeQueryBuilder("MYSQL","1");

  //keyword array declarations
 

  //comparison list additions

  $WADbSearch1->addComparison("Price","".WADS_stripCurrency($_POST["minPrice"])  ."","AND",">=",1);

  $WADbSearch1->addComparison("Price","".WADS_stripCurrency($_POST["maxPrice"])  ."","AND","<=",1);

  $WADbSearch1->addComparisonFromList("City","City","AND","=",0);

  $WADbSearch1->addComparisonFromList("Beds","Beds","AND","=",1);
 

  //save the query in a session variable

  if (1 == 1) {

    $_SESSION["WADbSearch1_BasicSearch"]=$WADbSearch1->whereClause;

  }

}

else     {

  $WADbSearch1 = new FilterDef;

  $WADbSearch1->initializeQueryBuilder("MYSQL","1");

  //get the filter definition from a session variable

  if (1 == 1)     {

    if (isset($_SESSION["WADbSearch1_BasicSearch"]) && $_SESSION["WADbSearch1_BasicSearch"] != "")     {

      $WADbSearch1->whereClause = $_SESSION["WADbSearch1_BasicSearch"];

    }

    else     {

      $WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;

    }

  }

  else     {

    $WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;

  }

}

$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);

$WADbSearch1whereClause = '';

?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 

{

  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;    

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_property = "SELECT * FROM property";

setQueryBuilderSource($query_property,$WADbSearch1,false);

$property = mysql_query($query_property, $IxHudConnect) or die(mysql_error());

$row_property = mysql_fetch_assoc($property);

$totalRows_property = mysql_num_rows($property);
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_Price = "SELECT * FROM menuPrice";

$Price = mysql_query($query_Price, $IxHudConnect) or die(mysql_error());

$row_Price = mysql_fetch_assoc($Price);

$totalRows_Price = mysql_num_rows($Price);
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_Beds = "SELECT * FROM Beds";

$Beds = mysql_query($query_Beds, $IxHudConnect) or die(mysql_error());

$row_Beds = mysql_fetch_assoc($Beds);

$totalRows_Beds = mysql_num_rows($Beds);
 

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_City = "SELECT * FROM HudCities";

$City = mysql_query($query_City, $IxHudConnect) or die(mysql_error());

$row_City = mysql_fetch_assoc($City);

$totalRows_City = mysql_num_rows($City);

?><!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"><!-- InstanceBegin template="/Templates/BlankIndexPageBasedTemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>TheHudster Home Page</title>

<!-- InstanceEndEditable -->

<style type="text/css"> 

<!-- 

body  {

	font: 100% Verdana, Arial, Helvetica, sans-serif;

	background: #666666; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */

	padding: 0;

	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */

	color: #000000;

	margin: 0;

}

.twoColFixRtHdr #container {

	width: 780px;

	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */

	border: medium groove #FF0000;

	text-align: left; /* this overrides the text-align: center on the body element. */

	background-color: #000000;

} 

.twoColFixRtHdr #header {

	height: 90px;

	width: 780px;

	padding-top: 0;

	padding-bottom: 0;

} 

.twoColFixRtHdr #header h1 {

	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */

	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */

}

.twoColFixRtHdr #sidebar1 {

	float: right; /* since this element is floated, a width must be given */

	width: 150px;

	padding-top: 7px;

	padding-right: 10px;

	padding-bottom: 15px;

	padding-left: 10px;

	background-color: #333333;

	border-top-width: thick;

	border-right-width: thick;

	border-bottom-width: thick;

	border-left-width: thick;

	border-left-style: groove;

	border-top-color: #FF0000;

	border-right-color: #FF0000;

	border-bottom-color: #FF0000;

	border-left-color: #FF0000;

}

.twoColFixRtHdr #mainContent {

	margin-top: 0px;

	margin-right: 190px;

	margin-bottom: 0;

	margin-left: 5px;

	padding-top: 10px;

	padding-right: 20px;

	padding-bottom: 0;

	padding-left: 20px;

	background-color: #CCFFCC;

} 

.twoColFixRtHdr #footer { 

	padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */

	background:#DDDDDD; 

} 

.twoColFixRtHdr #footer p {

	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */

	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */

}

.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

	float: right;

	margin-left: 8px;

}

.fltlft { /* this class can be used to float an element left in your page */

	float: left;

	margin-right: 8px;

}

.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */

	clear:both;

    height:0;

    font-size: 1px;

    line-height: 0px;

}

--> 

</style>

<!--[if IE 5]>

<style type="text/css"> 

/* place css box model fixes for IE 5* in this conditional comment */

.twoColFixRtHdr #sidebar1 { width: 220px; }

</style>

<![endif]-->

<!--[if IE]>

<style type="text/css"> 

/* place css fixes for all versions of IE in this conditional comment */

.twoColFixRtHdr #sidebar1 { padding-top: 30px; }

.twoColFixRtHdr #mainContent { zoom: 1; }

/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */

</style>

<![endif]-->

<link href="HUDSTER.css" rel="stylesheet" type="text/css" />

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>

<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}
 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<style type="text/css">

<!--

.style3 {color: #FFFFFF}

.Copy10PointBlack {font-size: 10pt}

.style8 {font-size: 8pt}

.style10 {

	font-size: 100%;

	color: #0000FF;

}

.style11 {color: #00FF00}

-->

</style>

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->

</head>
 

<body class="twoColFixRtHdr" onload="MM_preloadImages('Images/Partners/Home Warranty Rollover.jpg','Images/Partners/Financing Rollover.jpg','Images/Partners/Home Inpsection Rollover.jpg','Images/Partners/Carpet Cleaning Rollover.jpg','Images/Partners/New Carpet Rollover.jpg','Images/Partners/Heating Rollover.jpg')">
 

<div id="container">

  <div id="header"><!-- end #header -->

    <img src="Images/WebPageImages/Header.jpg" width="780" height="90" /></div>

  <div class="RedHorizontalBar"></div>

    <div id="HorizontalMenuContainer"><div id="HorizontalMenu">

    <ul id="MenuBar1" class="MenuBarHorizontal">

        <li>

          <div align="center"><a href="#">Home</a> </div>

        </li>

        <li><a href="SearchInput.php" class="MenuBarItemSubmenu">Owner Occupant</a>

          <ul>

            <li><a href="#">Search</a></li>

          </ul>

        </li>

        <li>

          <div align="center"><a href="InvestorsHomePage.php" class="MenuBarItemSubmenu">Investors</a>

            <ul>

              <li><a href="#">Financing</a></li>

            </ul>

          </div>

        </li>

        <li>

          <div align="center"><a href="BrokerAd.php">Brokers</a> </div>

        </li>

          <li>

            <div align="center"><a href="PartnerPage.php">Advertising</a></div>

        </li>

        <li>

          <div align="center"><a href="#">Contact Us</a></div>

        </li>

    </ul>

    <div class="RedHorizontalBar"></div>

  </div></div>

  

 

  <div id="sidebar1">

   <h3 align="center" class="style3">Buyers Service Center</h3>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Finance','','Images/Partners/Financing Rollover.jpg',1)"><img src="Images/Partners/Financing Up.jpg" name="Finance" width="150" height="90" border="0" id="Finance" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeInspection','','Images/Partners/Home Inpsection Rollover.jpg',1)"><img src="Images/Partners/Home Inspection Up.jpg" alt="Home Inspection" name="HomeInspection" width="150" height="90" border="0" id="HomeInspection" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeWarranty','','Images/Partners/Home Warranty Rollover.jpg',1)"><img src="Images/Partners/Home Warranty Up.jpg" alt="Home Warranty" name="HomeWarranty" width="150" height="90" border="0" id="HomeWarranty" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('CarpetCleaning','','Images/Partners/Carpet Cleaning Rollover.jpg',1)"><img src="Images/Partners/Carpet Cleaning Up.jpg" alt="Carpet Cleaning" name="CarpetCleaning" width="150" height="90" border="0" id="CarpetCleaning" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('NewCarpet','','Images/Partners/New Carpet Rollover.jpg',1)"><img src="Images/Partners/New Carpet Up.jpg" alt="New Carpet" name="NewCarpet" width="150" height="90" border="0" id="NewCarpet" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Heating','','Images/Partners/Heating Rollover.jpg',1)"><img src="Images/Partners/Heating and AC Up.jpg" alt="Heating &amp; Air Conditioning" name="Heating" width="150" height="90" border="0" id="Heating" /></a></div>

   <p align="center" class="style3">&nbsp;</p>

  </div><div class="style3" id="HudHomePlusFHALoan">

    <h2><em>Hud Homes + FHA Loans = <span class="style11">Opportunity</span></em><span class="style11"></em></span><em><span class="style11">!</span></em></h2>

  </div>

    <div id="mainContent"><!-- InstanceBeginEditable name="EditGreenRegion" -->

    <form name="form1" action="Results.php" method="post">

      <div align="center">

        <table cellpadding="2" cellspacing="0" border="1">

          <tr>

            <td colspan="2" align="right" bordercolor="#000000" bgcolor="#FFFF00"><div align="center">Basic Search</div></td>

          </tr>

          <tr>

            <td align="right" bgcolor="#00FFFF" class="Copy10PointBlack"><label for="minPrice">

              <div align="right">Price Range:

                </label>

            </div></td>

            <td bgcolor="#00FFFF">

              <div align="center">

                <select name="minPrice">

                  <option value="0">Select Minimum Price</option>

                  <?php

do {  

?>

                  <option value="<?php echo $row_Price['PriceValue']?>"><?php echo $row_Price['PriceLabel']?></option>

                  <?php

} while ($row_Price = mysql_fetch_assoc($Price));

  $rows = mysql_num_rows($Price);

  if($rows > 0) {

      mysql_data_seek($Price, 0);

	  $row_Price = mysql_fetch_assoc($Price);

  }

?>

                </select>

                &nbsp;

                <label for="maxPrice">

                To:                </label>

              &nbsp;

              <select name="maxPrice">

                <option value="1000000">Maximum Price</option>

                <?php

do {  

?>

                <option value="<?php echo $row_Price['PriceValue']?>"><?php echo $row_Price['PriceLabel']?></option>

                <?php

} while ($row_Price = mysql_fetch_assoc($Price));

  $rows = mysql_num_rows($Price);

  if($rows > 0) {

      mysql_data_seek($Price, 0);

	  $row_Price = mysql_fetch_assoc($Price);

  }

?>

              </select>

              </div></td>

          </tr>

          <tr>

            <td align="right" bgcolor="#00FFFF"><label for="City">

              <div align="right"><span class="Copy10PointBlack">Select a City</span>:</div></td>

            <td bgcolor="#00FFFF">

              

              <div align="left">

                <select name="City">

                  <option value="a">Select A City</option>

<?php

do {  

?><option value="<?php echo $row_City['Cities']?>"><?php echo $row_City['Cities']?></option>

                  <?php

} while ($row_City = mysql_fetch_assoc($City));

  $rows = mysql_num_rows($City);

  if($rows > 0) {

      mysql_data_seek($City, 0);

	  $row_City = mysql_fetch_assoc($City);

  }

?>

                </select>

              </div></td>

          </tr>

          <tr>

            <td align="right" bgcolor="#00FFFF"><label for="Beds">

              <div align="right"><span class="Copy10PointBlack">Minimum # Bdrms:</span>

                </label>

              </div></td>

            <td bgcolor="#00FFFF">

              

              <div align="left">

                  <select name="Beds">

                    <option value="1">Choose Minium Bedrooms</option>

                    <?php

do {  

?><option value="<?php echo $row_Beds['BedValue']?>"><?php echo $row_Beds['BedLabel']?></option>

                    <?php

} while ($row_Beds = mysql_fetch_assoc($Beds));

  $rows = mysql_num_rows($Beds);

  if($rows > 0) {

      mysql_data_seek($Beds, 0);

	  $row_Beds = mysql_fetch_assoc($Beds);

  }

?>

                  </select>

              </div></td>

          </tr>

          <tr>

            <td align="center" colspan="2"><input type="submit" name="WADbSearch1" value="Submit" /></td>

          </tr>

        </table>

      </div>

    </form>

    <!-- InstanceEndEditable -->

      <div id="FairHousing">

      <div align="justify"><span class="style8">We are pledged to the letter and spirit of  U.S. policy for the achievement of equal housing opportunity throughout the  Nation. We encourage and support an affirmative advertising and marketing  program in which there are no barriers to obtaining housing because of race,  color, religion, sex, handicap, familial status, or national origin. All real  estate advertised herein is subject to the Federal Fair Housing Act, which  makes it illegal to advertise &quot;any preference, limitation, or discrimination  because of race, color, religion, sex, handicap, familial status, or national  origin, or intention to make any such preference, limitation, or discrimination.&quot;  We will not knowingly accept any advertising for real estate which is in  violation of the law. All persons are hereby informed that all dwellings  advertised are available on an equal opportunity basis</span>.</div>

    </div>

    </div>

  <div id="footer">

    <p align="justify">&nbsp;</p>

  <!-- end #footer --></div>

<!-- end #container --></div>
 

<script type="text/javascript">

<!--

var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});

//-->

</script>

</body>

<!-- InstanceEnd --></html>

<?php

mysql_free_result($property);
 

mysql_free_result($Price);
 

mysql_free_result($Beds);
 

mysql_free_result($City);

?>
 
 

**RESULTS PAGE (THE PROBLEM)**
 

<?php require_once('Connections/IxHudConnect.php'); ?>

<?php

if (!function_exists("GetSQLValueString")) {

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 

{

  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 

  switch ($theType) {

    case "text":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;    

    case "long":

    case "int":

      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

      break;

    case "double":

      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

      break;

    case "date":

      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

      break;

    case "defined":

      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

      break;

  }

  return $theValue;

}

}
 

$currentPage = $_SERVER["PHP_SELF"];
 

$maxRows_Rslts = 10;

$pageNum_Rslts = 0;

if (isset($_GET['pageNum_Rslts'])) {

  $pageNum_Rslts = $_GET['pageNum_Rslts'];

}

$startRow_Rslts = $pageNum_Rslts * $maxRows_Rslts;
 

$varCity_Rslts = "-1";

if (isset($_POST['City'])) {

  $varCity_Rslts = (get_magic_quotes_gpc()) ? $_POST['City'] : addslashes($_POST['City']);

}

$varmaxPrice_Rslts = "1";

if (isset($_POST['maxPrice'])) {

  $varmaxPrice_Rslts = (get_magic_quotes_gpc()) ? $_POST['maxPrice'] : addslashes($_POST['maxPrice']);

}

$varminPrice_Rslts = "1";

if (isset($_POST['minPrice'])) {

  $varminPrice_Rslts = (get_magic_quotes_gpc()) ? $_POST['minPrice'] : addslashes($_POST['minPrice']);

}

$varBeds_Rslts = "1";

if (isset($_POST['Beds'])) {

  $varBeds_Rslts = (get_magic_quotes_gpc()) ? $_POST['Beds'] : addslashes($_POST['Beds']);

}

mysql_select_db($database_IxHudConnect, $IxHudConnect);

$query_Rslts = sprintf("SELECT * FROM property WHERE City = %s AND price <= %s AND price >= %s AND Beds >= %s ORDER BY property.Price ASC", GetSQLValueString($varCity_Rslts, "text"),GetSQLValueString($varmaxPrice_Rslts, "int"),GetSQLValueString($varminPrice_Rslts, "int"),GetSQLValueString($varBeds_Rslts, "int"));

$query_limit_Rslts = sprintf("%s LIMIT %d, %d", $query_Rslts, $startRow_Rslts, $maxRows_Rslts);

$Rslts = mysql_query($query_limit_Rslts, $IxHudConnect) or die(mysql_error());

$row_Rslts = mysql_fetch_assoc($Rslts);
 

if (isset($_GET['totalRows_Rslts'])) {

  $totalRows_Rslts = $_GET['totalRows_Rslts'];

} else {

  $all_Rslts = mysql_query($query_Rslts);

  $totalRows_Rslts = mysql_num_rows($all_Rslts);

}

$totalPages_Rslts = ceil($totalRows_Rslts/$maxRows_Rslts)-1;
 

$queryString_Rslts = "";

if (!empty($_SERVER['QUERY_STRING'])) {

  $params = explode("&", $_SERVER['QUERY_STRING']);

  $newParams = array();

  foreach ($params as $param) {

    if (stristr($param, "pageNum_Rslts") == false && 

        stristr($param, "totalRows_Rslts") == false) {

      array_push($newParams, $param);

    }

  }

  if (count($newParams) != 0) {

    $queryString_Rslts = "&" . htmlentities(implode("&", $newParams));

  }

}

$queryString_Rslts = sprintf("&totalRows_Rslts=%d%s", $totalRows_Rslts, $queryString_Rslts);

?>

<?php

	// RepeatSelectionCounter_1 Initialization

	$RepeatSelectionCounter_1 = 0;

	$RepeatSelectionCounterBasedLooping_1 = false;

	$RepeatSelectionCounter_1_Iterations = "10";

?>

<!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"><!-- InstanceBegin template="/Templates/GreenBackground.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>TheHudster Home Page</title>

<!-- InstanceEndEditable -->

<style type="text/css"> 

<!-- 

body  {

	font: 100% Verdana, Arial, Helvetica, sans-serif;

	background: #666666; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */

	padding: 0;

	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */

	color: #000000;

	margin: 0;

}

.twoColFixRtHdr #container {

	width: 780px;

	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */

	border: medium groove #FF0000;

	text-align: left; /* this overrides the text-align: center on the body element. */

	background-color: #000000;

} 

.twoColFixRtHdr #header {

	height: 90px;

	width: 780px;

	padding-top: 0;

	padding-bottom: 0;

} 

.twoColFixRtHdr #header h1 {

	margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */

	padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */

}

.twoColFixRtHdr #sidebar1 {

	float: right; /* since this element is floated, a width must be given */

	width: 150px;

	padding-top: 7px;

	padding-right: 10px;

	padding-bottom: 15px;

	padding-left: 10px;

	background-color: #333333;

	border-top-width: thick;

	border-right-width: thick;

	border-bottom-width: thick;

	border-left-width: thick;

	border-left-style: groove;

	border-top-color: #FF0000;

	border-right-color: #FF0000;

	border-bottom-color: #FF0000;

	border-left-color: #FF0000;

}

.twoColFixRtHdr #mainContent {

	margin-top: 0px;

	margin-right: 190px;

	margin-bottom: 0;

	margin-left: 5px;

	padding-top: 10px;

	padding-right: 20px;

	padding-bottom: 0;

	padding-left: 20px;

	background-color: #CCFFCC;

} 

.twoColFixRtHdr #footer { 

	padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */

	background:#DDDDDD; 

} 

.twoColFixRtHdr #footer p {

	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */

	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */

}

.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */

	float: right;

	margin-left: 8px;

}

.fltlft { /* this class can be used to float an element left in your page */

	float: left;

	margin-right: 8px;

}

.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */

	clear:both;

    height:0;

    font-size: 1px;

    line-height: 0px;

}

--> 

</style>

<!--[if IE 5]>

<style type="text/css"> 

/* place css box model fixes for IE 5* in this conditional comment */

.twoColFixRtHdr #sidebar1 { width: 220px; }

</style>

<![endif]-->

<!--[if IE]>

<style type="text/css"> 

/* place css fixes for all versions of IE in this conditional comment */

.twoColFixRtHdr #sidebar1 { padding-top: 30px; }

.twoColFixRtHdr #mainContent { zoom: 1; }

/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */

</style>

<![endif]-->

<link href="HUDSTER.css" rel="stylesheet" type="text/css" />

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>

<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">

<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}
 

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->

</script>

<style type="text/css">

<!--

.style3 {color: #FFFFFF}

.Copy10PointBlack {font-size: 10pt}

.style8 {font-size: 8pt}

.style10 {

	font-size: 100%;

	color: #0000FF;

}

.style11 {color: #00FF00}

-->

</style>

<!-- InstanceBeginEditable name="head" -->

<style type="text/css">

<!--

.style13 {font-size: 9pt}

-->

</style><!-- InstanceEndEditable -->

</head>
 

<body class="twoColFixRtHdr" onload="MM_preloadImages('Images/Partners/Home Warranty Rollover.jpg','Images/Partners/Financing Rollover.jpg','Images/Partners/Home Inpsection Rollover.jpg','Images/Partners/Carpet Cleaning Rollover.jpg','Images/Partners/New Carpet Rollover.jpg','Images/Partners/Heating Rollover.jpg')">
 

<div id="container">

  <div id="header"><!-- end #header -->

    <img src="Images/WebPageImages/Header.jpg" width="780" height="90" /></div>

  <div class="RedHorizontalBar"></div>

    <div id="HorizontalMenuContainer"><div id="HorizontalMenu">

    <ul id="MenuBar1" class="MenuBarHorizontal">

        <li>

          <div align="center"><a href="#">Home</a> </div>

        </li>

        <li><a href="SearchInput.php" class="MenuBarItemSubmenu">Owner Occupant</a>

          <ul>

            <li><a href="#">Search</a></li>

          </ul>

        </li>

        <li>

          <div align="center"><a href="InvestorsHomePage.php" class="MenuBarItemSubmenu">Investors</a>

            <ul>

              <li><a href="#">Financing</a></li>

            </ul>

          </div>

        </li>

        <li>

          <div align="center"><a href="BrokerAd.php">Brokers</a> </div>

        </li>

          <li>

            <div align="center"><a href="PartnerPage.php">Advertising</a></div>

        </li>

        <li>

          <div align="center"><a href="#">Contact Us</a></div>

        </li>

    </ul>

    <div class="RedHorizontalBar"></div>

  </div></div>

  

 

  <div id="sidebar1">

   <h3 align="center" class="style3">Buyers Service Center</h3>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Finance','','Images/Partners/Financing Rollover.jpg',1)"><img src="Images/Partners/Financing Up.jpg" name="Finance" width="150" height="90" border="0" id="Finance" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeInspection','','Images/Partners/Home Inpsection Rollover.jpg',1)"><img src="Images/Partners/Home Inspection Up.jpg" alt="Home Inspection" name="HomeInspection" width="150" height="90" border="0" id="HomeInspection" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HomeWarranty','','Images/Partners/Home Warranty Rollover.jpg',1)"><img src="Images/Partners/Home Warranty Up.jpg" alt="Home Warranty" name="HomeWarranty" width="150" height="90" border="0" id="HomeWarranty" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('CarpetCleaning','','Images/Partners/Carpet Cleaning Rollover.jpg',1)"><img src="Images/Partners/Carpet Cleaning Up.jpg" alt="Carpet Cleaning" name="CarpetCleaning" width="150" height="90" border="0" id="CarpetCleaning" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('NewCarpet','','Images/Partners/New Carpet Rollover.jpg',1)"><img src="Images/Partners/New Carpet Up.jpg" alt="New Carpet" name="NewCarpet" width="150" height="90" border="0" id="NewCarpet" /></a></div>

   <div class="Partners"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Heating','','Images/Partners/Heating Rollover.jpg',1)"><img src="Images/Partners/Heating and AC Up.jpg" alt="Heating &amp; Air Conditioning" name="Heating" width="150" height="90" border="0" id="Heating" /></a></div>

   <p align="center" class="style3">&nbsp;</p>

  </div><div class="style3" id="HudHomePlusFHALoan">

    <h2><em>Hud Homes + FHA Loans = <span class="style11">Opportunity</span></em><span class="style11"></em></span><em><span class="style11">!</span></em></h2>

  </div>

    <div id="mainContent"><!-- InstanceBeginEditable name="EditGreenRegion" -->

    <div id="Summary">

      <?php do { ?>

        <table width="98%" border="1" align="center" cellpadding="2" cellspacing="2">

          <tr>

            <td width="18%" rowspan="4">&nbsp;</td>

            <td width="18%"><div align="center"><span class="style8"><?php echo $row_Rslts['Price']; ?></span></div></td>

            <td colspan="2" class="style8"><div align="center"><?php echo $row_Rslts['Address']; ?>&nbsp; <?php echo $row_Rslts['City']; ?>,&nbsp; <?php echo $row_Rslts['State']; ?>&nbsp; <?php echo $row_Rslts['Zip']; ?></div></td>

          </tr>

          <tr>

            <td class="style8"><div align="center"><a href="ResultsDetail.php?CaseNbr=<?php echo $row_Rslts['CaseNbr']; ?>"><?php echo $row_Rslts['CaseNbr']; ?></a></div></td>

            <td colspan="2" class="style8"><div align="center"><span class="style8"><?php echo $row_Rslts['Beds']; ?></span> Bdrm(s)&nbsp;&nbsp; <?php echo $row_Rslts['Baths']; ?> Bath(s)&nbsp; <?php echo $row_Rslts['SqFt']; ?> Sq. Ft.</div></td>

          </tr>

          <tr>

            <td rowspan="2">&nbsp;</td>

            <td width="34%" class="style8"><div align="center">Owner Occupant Deadline</div></td>

            <td width="30%" class="style8"><div align="center">Investors</div></td>

          </tr>

          <tr>

            <td class="style8"><div align="center"><?php echo $row_Rslts['OwnerOcc']; ?></div></td>

            <td class="style8"><div align="center"><?php echo $row_Rslts['Investor']; ?></div></td>

          </tr>

                  </table>

        <?php } while ($row_Rslts = mysql_fetch_assoc($Rslts)); ?><table border="0">

  <tr>

    <td><?php if ($pageNum_Rslts > 0) { // Show if not first page ?>

        <a href="<?php printf("%s?pageNum_Rslts=%d%s", $currentPage, 0, $queryString_Rslts); ?>">First</a>

        <?php } // Show if not first page ?>

    </td>

    <td><?php if ($pageNum_Rslts > 0) { // Show if not first page ?>

        <a href="<?php printf("%s?pageNum_Rslts=%d%s", $currentPage, max(0, $pageNum_Rslts - 1), $queryString_Rslts); ?>">Previous</a>

        <?php } // Show if not first page ?>

    </td>

    <td><?php if ($pageNum_Rslts < $totalPages_Rslts) { // Show if not last page ?>

        <a href="<?php printf("%s?pageNum_Rslts=%d%s", $currentPage, min($totalPages_Rslts, $pageNum_Rslts + 1), $queryString_Rslts); ?>">Next</a>

        <?php } // Show if not last page ?>

    </td>

    <td><?php if ($pageNum_Rslts < $totalPages_Rslts) { // Show if not last page ?>

        <a href="<?php printf("%s?pageNum_Rslts=%d%s", $currentPage, $totalPages_Rslts, $queryString_Rslts); ?>">Last</a>

        <?php

	// RepeatSelectionCounter_1 Begin Loop

	$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;

	while($RepeatSelectionCounter_1_IterationsRemaining--){

		if($RepeatSelectionCounterBasedLooping_1 || $row_Rslts){

?>

        <?php

	} // RepeatSelectionCounter_1 Begin Alternate Content

	else{

?>

        <?php } // RepeatSelectionCounter_1 End Alternate Content

		if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){

			if(!$row_Rslts && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}

			$row_Rslts = mysql_fetch_assoc($Rslts);

		}

		$RepeatSelectionCounter_1++;

	} // RepeatSelectionCounter_1 End Loop

?>

        <?php } // Show if not last page ?>

    </td>

  </tr>

</table>

    </div>

    <!-- InstanceEndEditable -->

      <div id="FairHousing">

      <div align="justify"><span class="style8">We are pledged to the letter and spirit of  U.S. policy for the achievement of equal housing opportunity throughout the  Nation. We encourage and support an affirmative advertising and marketing  program in which there are no barriers to obtaining housing because of race,  color, religion, sex, handicap, familial status, or national origin. All real  estate advertised herein is subject to the Federal Fair Housing Act, which  makes it illegal to advertise &quot;any preference, limitation, or discrimination  because of race, color, religion, sex, handicap, familial status, or national  origin, or intention to make any such preference, limitation, or discrimination.&quot;  We will not knowingly accept any advertising for real estate which is in  violation of the law. All persons are hereby informed that all dwellings  advertised are available on an equal opportunity basis</span>.</div>

    </div>

  </div>

  <div id="footer">

    <p align="justify">&nbsp;</p>

  <!-- end #footer --></div>

<!-- end #container --></div>
 

<script type="text/javascript">

<!--

var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});

//-->

</script>

</body>

<!-- InstanceEnd --></html>

<?php

mysql_free_result($Rslts);

?>

Open in new window

0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21787007
>> If you use there wizard you MUST use a page created from a template with a repeating region

Actually, I've had better results using the search wizard on a totally blank page and then moving the end product over to a "live" page.

Okay, "Jason's 1st WASearch Workaround"

Change line 13 above from:

$WADbSearch1_DefaultWhere = "";

to

$WADbSearch1_DefaultWhere = " 0 != 0 ";

and report back.
0
 

Author Comment

by:rnicolais
ID: 21788584
I must have changed the file after I posted. I've attached both the search page and the results page as a text file. In addition I've uploaded those files live so you can actually see what's happening. Go to "the hudster.com" click on the top picture and that will take you to the search page - select as a city either Denver or Aurora as they will give you the widest choice - you can leave all the other pages set to the default. Let me know when you've seen the live page - then I can reset it.
thanks
RLN
SEARCH-PAGE.txt
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 21789935
Okay, so I'm confused again.

Do you want to use the WebAssist or not?

If you do, you need to either have the repeat region on the same page as the search form OR you need to apply the search behavior to the results page.  The WebAssist behavior alters the WHERE clause of your query on the fly based on the form submission, so you need to have the code on the same page as the recordset being filtered.

If you do not want to use it, I would remove all of the WA code to simplify things.  Right now, the query on the results page doesn't work properly:

SELECT * FROM property WHERE City = %s AND price <= %s AND price >= %s AND Beds >= %s ORDER BY property.Price ASC

Because you are using AND, every condition has to evaluate to true before any results will come it.  If any field is left blank, the query fails.  You need to either switch the AND to OR (which will lose accuracy) or you need to validate the form so that no field can be blank.  

If I use all fields, I do get results, so now moving on to the navigation issue.  

Because your results page requires $_POST values from the previous page, when you go to the "Next" set in sequence, you are reloading the page.  Reloading the page causes the PHP to re-evaluate the recordset and it does not find a posted form, so the recordset returns null.

The easiest workaround would be to change the form on the search page from POST to GET and change the recordset on the results page to use $_GET instead of $_POST.  That will preserve the search variables and the recordset paging stuff will get appended to the query string.
0
 

Author Comment

by:rnicolais
ID: 21795676
Ok, I will try these solutions -- I only use web assist because I can't get the multiple search fields to work any other way.

I'll try you soluitions and see what I come up with. I'm neutral on webassist - if I can get it to work fine but I'm not married to it -- I'll try both ways.
0
 

Author Comment

by:rnicolais
ID: 21804122
How do I apply the search behavior to the results page? I think your analysis is spot on I just have to figure out how to implement it.
R Nicolais
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 21805906
The easiest way I've found is to first apply it successfully to the page with the form on it.  Then cut the relevant PHP code (WA stuff plus recordset) and paste it to the results page.

The behavior really wants the form and the repeat region on the same page, but since it works with $_POST variables, you can move the PHP after it is generated.  Make sure you also grab the include statements.
0
 

Author Closing Comment

by:rnicolais
ID: 31467189
Got me pointed to the eventual solution
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now