From: Anthony Talarico Date: Mon, 13 Mar 2017 20:40:48 +0000 (-0400) Subject: fixing error where I had accidentally removed the search variable being set X-Git-Tag: v1.0.0^2~26 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e26d6a20906cc344995ddbaa434ee60f15f522c2;p=WP-Plugins%2Fglm-member-db-obits.git fixing error where I had accidentally removed the search variable being set from imploding the options array. adding a no results found div instead of a table if no results found --- diff --git a/css/front.css b/css/front.css index 0361b74..32dd68c 100644 --- a/css/front.css +++ b/css/front.css @@ -168,4 +168,8 @@ input.sidebar-criteria{ } .glm-alpha-link-selected{ display: none; +} +.no-results{ + font-weight: bold; + text-align: center; } \ No newline at end of file diff --git a/models/front/obits/search.php b/models/front/obits/search.php index ed6c82f..8840390 100644 --- a/models/front/obits/search.php +++ b/models/front/obits/search.php @@ -106,7 +106,7 @@ class GlmMembersFront_obits_search extends GlmDataObits // only execute search if the search button is clicked or there are search params in the url if ( isset( $_REQUEST['searchButton'] ) || !empty( $_GET['alpha'] ) || !empty( $_GET['pageSelect'] ) ){ - + $form_data = $_POST; // build array of potential search fields , will be used in the paging urls @@ -202,11 +202,11 @@ class GlmMembersFront_obits_search extends GlmDataObits } // generate the WHERE clause string from the array of options - implode($clause, $search_fields); + $search = implode($clause, $search_fields); // check the GET variables for sql queries with paging if( empty( $search ) && empty( $alpha_key) && empty($get_values) ){ - + $where = ""; } else if( !empty( $alpha_key ) ) { @@ -214,7 +214,7 @@ class GlmMembersFront_obits_search extends GlmDataObits $where = "last_name LIKE '$alpha_key%'"; } else if( !empty( $get_values ) ){ - + foreach($get_values as $key=>$value){ if($value !== ''){ @@ -225,8 +225,8 @@ class GlmMembersFront_obits_search extends GlmDataObits // remove the last AND or OR statement from the query string $where = substr($where, 0, -5); - }else { - + } else { + $where = $search; } diff --git a/views/front/obits/searchResults.html b/views/front/obits/searchResults.html index 8683336..9e32bb8 100644 --- a/views/front/obits/searchResults.html +++ b/views/front/obits/searchResults.html @@ -234,6 +234,7 @@ + {if $obits} @@ -247,7 +248,7 @@ - {if $obits} + {foreach from=$obits item=i} @@ -260,13 +261,10 @@ {/foreach} - {else} - - No Results - - - {/if}
Maiden Name
{$i.b_yr_range}{$i.maiden_other}
+ {else} +
No Results Found
+ {/if}