|
DwZone Forum Welcome to the DwZone-it Forum
|
Advanced Search |
|
DwZone Forum Index -> Advanced Search Moderators:
Administrators, Moderators |
Mark all topics read |
Hint: For improved responsiveness, use Internet Explorer
4 (or above) with Javascript enabled, choose 'Dynamic' from
the View dropdown and hit 'Set Options' to save your changes. |
Subject |
Author
|
Date |
|
|
|
Gianluigi |
12:27 21 Mar 2012 |
|
|
CarlosSchnapauff |
12:36 21 Mar 2012 |
|
|
Gianluigi |
12:56 21 Mar 2012 |
|
|
CarlosSchnapauff |
13:21 21 Mar 2012 |
|
|
Gianluigi |
13:38 21 Mar 2012 |
|
|
|
John Merlino |
11:44 11 Dec 2011 |
|
|
Gianluigi |
11:49 11 Dec 2011 |
|
|
JohnMerlino |
12:23 11 Dec 2011 |
|
|
Gianluigi |
13:52 11 Dec 2011 |
|
|
JohnMerlino |
21:24 12 Dec 2011 |
|
OK I have tried time and time again to make this script work for me and my situation but it is not working. Furthermore the documentation is brief and incomplete. Also this forum does not allow any way to attach a file for viewing so I have pasted code here.
I have six variables I want to search which I have created a form for. Even explaining what I have had to create to do this is confusing. My variables are in a DB table called BF_comments. The ones I want to be able to search are ( lName, serverName, location, foodComment, ServerComment, a date range )
Here is the code for the page: I am just confused on how to make this all work. The widget does not even work correctly allowing me to not be able to select the form field I need to run the term search
<?php //***************** // Advanced Search //***************** require_once("../dwzSearch/dwzSearch.php"); ?> <?php require_once('../Connections/BFCONN.php'); ?> <?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; } }
mysql_select_db($database_BFCONN, $BFCONN); $query_distinctRS = "SELECT DISTINCT lName FROM vw_distinct"; $distinctRS = mysql_query($query_distinctRS, $BFCONN) or die(mysql_error()); $row_distinctRS = mysql_fetch_assoc($distinctRS); $totalRows_distinctRS = mysql_num_rows($distinctRS);
mysql_select_db($database_BFCONN, $BFCONN); $query_distinct0RS = "SELECT DISTINCT serverName FROM vw_distinct"; $distinct0RS = mysql_query($query_distinct0RS, $BFCONN) or die(mysql_error()); $row_distinct0RS = mysql_fetch_assoc($distinct0RS); $totalRows_distinct0RS = mysql_num_rows($distinct0RS);
mysql_select_db($database_BFCONN, $BFCONN); $query_distinct1RS = "SELECT DISTINCT updated FROM vw_distinct"; $distinct1RS = mysql_query($query_distinct1RS, $BFCONN) or die(mysql_error()); $row_distinct1RS = mysql_fetch_assoc($distinct1RS); $totalRows_distinct1RS = mysql_num_rows($distinct1RS);
mysql_select_db($database_BFCONN, $BFCONN); $query_commentsRS = "SELECT * FROM BF_comments"; $commentsRS = mysql_query($query_commentsRS, $BFCONN) or die(mysql_error()); $row_commentsRS = mysql_fetch_assoc($commentsRS); $totalRows_commentsRS = mysql_num_rows($commentsRS); ?> <?php //************************** // Advanced Search // http://www.DwZone-it.com // Version: 1.0.2 //************************** $dwzSearch_1 = new dwzSearch(); $dwzSearch_1->Init(); $dwzSearch_1->SetFormName("searchComments"); $dwzSearch_1->SetSubmitName("search"); $dwzSearch_1->AddFilter("", "All", "location", "location", "", "S", "0"); $dwzSearch_1->AddFilter("", "=", "serverName", "serverName", "", "S", "0"); $dwzSearch_1->AddFilter("", "Like", "serverComment", "serverComment", "", "S", "0"); $dwzSearch_1->AddFilter("", "Like", "foodComment", "foodComment", "", "S", "0"); $dwzSearch_1->AddFilter("", "Between", "updated", "updated", "updated", "S", "0"); $dwzSearch_1->AddFilter("", "=", "lName", "lName", "", "S", "0"); $dwzSearch_1->AddFilter("", "=", "daypart", "daypart", "", "S", "0"); $dwzSearch_1->SetRecordset($commentsRS, "commentsRS"); $dwzSearch_1->SetSql($query_commentsRS); $dwzSearch_1->SetConnection($hostname_BFCONN, $database_BFCONN, $username_BFCONN, $password_BFCONN); $dwzSearch_1->Create(); if($dwzSearch_1->HasFilter()){ $dwzSearch_1->FilterRecordset(); } //************************** // Advanced Search // End code //************************** ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Search Comments</title> </head>
<body><form id="searchComments" name="searchComments" method="post" action="newSearch.php"> <table width="100%" border="0" cellspacing="4" cellpadding="4"> <tr> <td width="49%" align="right">Date: Choose one or multiple <br /> dates from avialable dates by holding <br /> the Shift or control key while <br /> selecting date:</td> <td width="51%"><select name="updated" size="6" multiple="multiple" id="updated"> <?php do { ?> <option value="<?php echo $row_distinct1RS['updated']?>"><?php echo $row_distinct1RS['updated']?></option> <?php } while ($row_distinct1RS = mysql_fetch_assoc($distinct1RS)); $rows = mysql_num_rows($distinct1RS); if($rows > 0) { mysql_data_seek($distinct1RS, 0); $row_distinct1RS = mysql_fetch_assoc($distinct1RS); } ?> </select></td> </tr> <tr> <td align="right">Location: </td> <td><select name="location" id="location"> <option value="">SELECT A LOCATION</option> <option value="Ladera Ranch">Ladera Ranch</option> <option value="Irons in the Fire">Irons in the Fire</option> <option value="San Clemente">San Clemente</option> </select></td> </tr> <tr> <td align="right">Day Part: </td> <td><select name="daypart" id="daypart"> <option value="">SELECT A DAYPART</option> <option value="DAY">Day</option> <option value="EVE">Eve</option> </select></td> </tr> <tr> <td align="right">Customer Last name:</td> <td> <select name="lName" id="lName"> <option selected="selected" value="" <?php if (!(strcmp("", $_REQUEST['lName']))) {echo "selected=\"selected\"";} ?>>Last name</option> <?php do { ?> <option value="<?php echo $row_distinctRS['commentID']?>"<?php if (!(strcmp($row_distinctRS['commentID'], $_REQUEST['lName']))) {echo "selected=\"selected\"";} ?>><?php echo $row_distinctRS['lName']?></option> <?php } while ($row_row_distinctRS = mysql_fetch_assoc($row_distinctRS)); $rows = mysql_num_rows($raCat); if($rows > 0) { mysql_data_seek($row_distinctRS, 0); $row_row_distinctRS = mysql_fetch_assoc($row_distinctRS); } ?> </select> </td> </tr> <tr> <td align="right">Comments Food:</td> <td><input name="foodComment" type="text" id="foodComment" size="50" /></td> </tr> <tr> <td align="right">Comments Server: </td> <td><input name="serverComment" type="text" id="serverComment" size="50" /></td> </tr> <tr> <td align="right">Server name:</td> <td><select name="serverName" id="serverName"> <option value="value">SELECT A SERVER NAME</option> <?php do { ?> <option value="<?php echo $row_distinct0RS['serverName']?>"><?php echo $row_distinct0RS['serverName']?></option> <?php } while ($row_distinct0RS = mysql_fetch_assoc($distinct0RS)); $rows = mysql_num_rows($distinct0RS); if($rows > 0) { mysql_data_seek($distinct0RS, 0); $row_distinct0RS = mysql_fetch_assoc($distinct0RS); } ?> </select></td> </tr> <tr> <td align="right"> </td> <td> </td> </tr> <tr> <td align="right"> </td> <td><input type="submit" name="search" id="search" value="Commence Search" /></td> </tr> </table> </form> <hr /> <p><br /> </p> <p>Total Records: <?php echo $totalRows_Recordset1 ?></p> <table width="100%" border="0" cellspacing="3" cellpadding="2"> <tr> <td width="20%"><strong>Name</strong></td> <td width="26%"><strong>Server Comments</strong></td> <td width="21%"><strong>Food Comments</strong></td> <td width="17%"><strong>Day Part</strong></td> <td width="16%"><strong>Logged by</strong></td> </tr> <tr> <td colspan="5"><?php do { ?> <?php echo $row_commentsRS['fName']; ?> <?php echo $row_commentsRS['lName']; ?> <?php echo $row_commentsRS['serverName']; ?>, <?php echo $row_commentsRS['location']; ?> <?php echo $row_commentsRS['menuItems']; ?> <?php echo $row_commentsRS['daypart']; ?><a href="mailto:"><?php echo $row_commentsRS['email']; ?></a>, <?php echo $row_commentsRS['phone']; ?> <?php echo $row_commentsRS['serverComment']; ?> <?php echo $row_commentsRS['foodComment']; ?> <?php echo $row_commentsRS['updated']; ?> <?php echo $row_commentsRS['inputBy']; ?> <?php } while ($row_distinctRS = mysql_fetch_assoc($distinctRS)); ?></td> </tr> </table> <p> </p> </body> </html> <?php mysql_free_result($distinctRS); ?>
|
|
|
|
|
|
|
|
|
|
Read Message |
Unread message |
Read message [popular] |
Unread message [popular] |
Read message [locked] |
Unread message [locked] |
|
All times are GMT-1
|
|