
|
Single Search box to search all fields June 25, 2009 09:01PM |
Registered: 3 years ago Posts: 32 |
|
June 27, 2009 05:43PM |
Admin Registered: 7 years ago Posts: 1,103 |
|
Re: Single Search box to search all fields June 27, 2009 08:29PM |
Registered: 3 years ago Posts: 32 |
|
Re: Single Search box to search all fields June 27, 2009 08:53PM |
Registered: 3 years ago Posts: 32 |
|
June 27, 2009 09:12PM |
Admin Registered: 7 years ago Posts: 1,103 |
|
Re: Single Search box to search all fields June 27, 2009 09:26PM |
Registered: 3 years ago Posts: 32 |
|
June 28, 2009 12:40AM |
Admin Registered: 7 years ago Posts: 1,103 |
|
Re: Single Search box to search all fields July 07, 2009 06:47PM |
Registered: 3 years ago Posts: 32 |
{ //this if statement prevents the Quick Search form to show up on the Advanced Search page
|
Re: Single Search box to search all fields July 13, 2009 06:23PM |
Registered: 3 years ago Posts: 32 |
|
Re: Single Search box to search all fields March 29, 2012 08:18PM |
Registered: 1 year ago Posts: 1 |
<?php if ($_GET["function"] != "show_search_form"{ //this if statement prevents the Quick Search form to show up on the Advanced Search page ?> <?php // query to get the fields names to include in the search - specify which types in the where clause // remove the where part of the sql line if you want to include ALL your fields //$sqlcols = "SELECT name_field FROM ".$prefix_internal_table.$table_name." WHERE type_field IN ('text','textarea','rich_editor')"; //This line searches only specific fields in the database that are specifide by the field name. To use it Uncomment it and comment the line above. Change the fields names to the names in your database. //$sqlcols = "SELECT name_field FROM ".$prefix_internal_table.$table_name." WHERE name_field IN ('author_english','author_hebrew','title_english,'title_hebrew')"; //This line searches all fields. $sqlcols = "SELECT name_field FROM ".$prefix_internal_table.$table_name.""; $searchall = execute_db($sqlcols, $conn); // as long as column names are found meeting criteria above, construct form fields while ($searchfield = fetch_row_db($searchall)){ // This line not required -- used to get list of column names into array that can be printed to screen to verify columns it has found $allfields .= $searchfield[0].' '; // sets the search select type to 'contains' for each column included in search request $allseltypes .= '<input name="'.$searchfield[0].$select_type_select_suffix.'" type="hidden" value="contains">'; // creates a hidden form field for each column included in search request $fieldterm .= '<input name="'.$searchfield[0].'" type="hidden" value="">'; // writes onSubmit values to form open tag to set the value for each hidden field defined above $submitline .= 'document.searchall.'.$searchfield[0].'.value = document.searchall.allterm.value;'; } // end while column names are found // uncomment to display database table columns found which will be included in search form echo '<pre>'; print_r($allfields); echo '</pre>'; ?> <form name="searchall" class="noformpad" style="padding-bottom:5px;" method="POST" action="<?php echo $dadabik_main_file; ?>?table_name=<?php echo urlencode($table_name); ?>&page=0&function=search&execute_search=1" enctype="multipart/form-data" accept-charset="Windows-1255" onSubmit="javascript:<?php echo $submitline; ?>return true;"> Quick Search: <input type="hidden" name="operator" value="or"> <?php echo $allseltypes; ?> <input name="allterm" type="text" size="10" maxlength="100"> <?php echo $fieldterm; ?> <input type="submit" value="<?php echo $submit_buttons_ar["search_short"]; ?>" class="submit"> </form> <?php } //closing bracket for the if ($_GET["function"] != "show_search_form"
?>
|
April 01, 2012 09:07PM |
Admin Registered: 7 years ago Posts: 1,103 |
|
Re: Single Search box to search all fields April 17, 2012 07:56AM |
Registered: 4 years ago Posts: 14 |
|
Re: Single Search box to search all fields April 17, 2012 12:24PM |
Registered: 4 years ago Posts: 14 |
|
April 20, 2012 12:15AM |
Admin Registered: 7 years ago Posts: 1,103 |
|
Re: Single Search box to search all fields April 22, 2012 09:42AM |
Registered: 4 years ago Posts: 14 |
|
April 22, 2012 04:31PM |
Admin Registered: 7 years ago Posts: 1,103 |
|
Re: Single Search box to search all fields April 23, 2012 07:43AM |
Registered: 4 years ago Posts: 14 |
|
April 24, 2012 01:00AM |
Admin Registered: 7 years ago Posts: 1,103 |
$allseltypes .= '<input name="'.$searchfield[0].'_select_type" type="hidden" value="contains">';
$allseltypes .= '<input name="'.$searchfield[0].$select_type_select_suffix.'" type="hidden" value="contains">'; OR $allseltypes .= '<input name="'.$searchfield[0].'__select_type" type="hidden" value="contains">';
|
Re: Single Search box to search all fields April 24, 2012 03:28PM |
Registered: 4 years ago Posts: 14 |
|
April 24, 2012 07:41PM |
Admin Registered: 7 years ago Posts: 1,103 |
AND present_search_form_field != 0