close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

View Details and next/last page buttons not working

Thread began 2/23/2012 2:11 pm by hostmaster336780 | Last modified 2/24/2012 1:42 pm by hostmaster336780 | 2604 views | 10 replies

Jason ByrnesWebAssist

the code that needs to be moved is at lines 1001 - 1150:

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

<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAretailchart;
//Searchpage: Search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere "";
if (!
session_id()) session_start();
if ((isset(
$_GET["Search_x"]) && $_GET["Search_x"] != "")) {
  
$WADbSearch1 = new FilterDef;
  
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
  
//keyword array declarations

  //comparison list additions
  
$WADbSearch1->addComparisonFromEdit("Brand","S_Brand","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("RazorNumber","S_RazorNumber","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("Style","S_Style","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("OEMNumbers","S_OEMNumbers","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("Length","S_Length","AND","Includes",0);

  
//save the query in a session variable
  
if (== 1) {
    
$_SESSION["WADbSearch1_Results"]=$WADbSearch1->whereClause;
  }
}
else     {
  
$WADbSearch1 = new FilterDef;
  
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
  
//get the filter definition from a session variable
  
if (== 1)     {
    if (isset(
$_SESSION["WADbSearch1_Results"]) && $_SESSION["WADbSearch1_Results"] != "")     {
      
$WADbSearch1->whereClause $_SESSION["WADbSearch1_Results"];
    }
    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 ""
{
  if (
PHP_VERSION 6) {
    
$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;
}
}
?>
<?php
$currentPage 
$_SERVER["PHP_SELF"];
?>
<?php
$maxRows_WADAretailchart 
20;
$pageNum_WADAretailchart 0;
if (isset(
$_GET['pageNum_WADAretailchart'])) {
  
$pageNum_WADAretailchart $_GET['pageNum_WADAretailchart'];
}
$startRow_WADAretailchart $pageNum_WADAretailchart $maxRows_WADAretailchart;

mysql_select_db($database_razorretail$razorretail);
$query_WADAretailchart "SELECT Brand, RazorNumber, Style, OEMNumbers, Length, CenterHole, OuterHole, CtoC FROM retailchart";
setQueryBuilderSource($query_WADAretailchart,$WADbSearch1,false);
$query_limit_WADAretailchart sprintf("%s LIMIT %d, %d"$query_WADAretailchart$startRow_WADAretailchart$maxRows_WADAretailchart);
$WADAretailchart mysql_query($query_limit_WADAretailchart$razorretail) or die(mysql_error());
$row_WADAretailchart mysql_fetch_assoc($WADAretailchart);

if (isset(
$_GET['totalRows_WADAretailchart'])) {
  
$totalRows_WADAretailchart $_GET['totalRows_WADAretailchart'];
} else {
  
$all_WADAretailchart mysql_query($query_WADAretailchart);
  
$totalRows_WADAretailchart mysql_num_rows($all_WADAretailchart);
}
$totalPages_WADAretailchart ceil($totalRows_WADAretailchart/$maxRows_WADAretailchart)-1;
?>
<?php
$queryString_WADAretailchart 
"";
if (!empty(
$_SERVER['QUERY_STRING'])) {
  
$params explode("&"$_SERVER['QUERY_STRING']);
  
$newParams = array();
  foreach (
$params as $param) {
    if (
stristr($param"pageNum_WADAretailchart") == false && 
        
stristr($param"totalRows_WADAretailchart") == false) {
      
array_push($newParams$param);
    }
  }
  if (
count($newParams) != 0) {
    
$queryString_WADAretailchart "&" htmlentities(implode("&"$newParams));
  }
}
$queryString_WADAretailchart sprintf("&totalRows_WADAretailchart=%d%s"$totalRows_WADAretailchart$queryString_WADAretailchart);
?>
<?php
//WA AltClass Iterator
class WA_AltClassIterator     {
  var 
$DisplayIndex;
  var 
$DisplayArray;
  
  function 
WA_AltClassIterator($theDisplayArray = array(1)) {
    
$this->ClassCounter 0;
    
$this->ClassArray   $theDisplayArray;
  }
  
  function 
getClass($incrementClass)  {
    if (
sizeof($this->ClassArray) == 0) return "";
      if (
$incrementClass) {
      if (
$this->ClassCounter >= sizeof($this->ClassArray)) $this->ClassCounter 0;
      
$this->ClassCounter++;
    }
    if (
$this->ClassCounter 0)
      return 
$this->ClassArray[$this->ClassCounter-1];
    else
      return 
$this->ClassArray[0];
  }
}
?><?php
//WA Alternating Class
$WARRT_AltClass1 = new WA_AltClassIterator(explode("|""WADAResultsRowDark|"));
?>



i think that code being in the wrong place is part of the reason the details are empty

also, change the link to the details to us:
<a href="?S_RazorNumber=<?php echo(rawurlencode($row_WADAretailchart['RazorNumber'])); ?>&Search.x=53&Search.y=14&Search=Search#!/page_more27" >


the change for the other buttons will be the same change. Here is the original code for the next button:

php:
<a href="<?php printf("%s?pageNum_WADAretailchart=%d%s"$currentPagemin($totalPages_WADAretailchart$pageNum_WADAretailchart 1), $queryString_WADAretailchart); ?>" title="Next">




the changes i made, where to remove the first %s, so:
<?php printf("%s?pageNum....

was changed to:
<?php printf("?pageNum

i then deleted the currentPage variable reference:
$currentPage,

and added #!/page_more26 after the closing php tag, so
...?>" title="Next"...

became"
...?>#!/page_more26" title="Next"...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...