fixing error where I had accidentally removed the search variable being set
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 13 Mar 2017 20:40:48 +0000 (16:40 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 13 Mar 2017 20:40:48 +0000 (16:40 -0400)
from imploding the options array. adding a no results found div instead of a table
if no results found

css/front.css
models/front/obits/search.php
views/front/obits/searchResults.html

index 0361b74..32dd68c 100644 (file)
@@ -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
index ed6c82f..8840390 100644 (file)
@@ -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;
             }
 
index 8683336..9e32bb8 100644 (file)
                 <option value="100">100</option>
                 <option value="500">500</option>
             </select>
+        {if $obits}
            <table class="footable results-table" data-paging="false">
              <thead>
                   <tr>
                     <th>Maiden Name</th>
                   </tr>
               </thead>
-               {if $obits}
+              
                 {foreach from=$obits item=i}
                     <tr>
                         <td>{$i.b_yr_range}</td>
                         <td>{$i.maiden_other}</td>
                     </tr>
                 {/foreach}
-              {else}
-                 <tr>
-                      No Results
-                 </tr>
-                 
-              {/if}
             </table>
+            {else}
+                <div class="no-results">No Results Found</div>
+            {/if}
         </div>
     </form>
 </div>