From 1573bc21bcfbbe0f267546b742a7993c5474f15e Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 15 Mar 2017 16:24:51 -0400 Subject: [PATCH] adding admin search fields --- css/admin.css | 23 ++++++++++- models/admin/management/obitImport.php | 1 - models/admin/obits/list.php | 39 +++++++++++++++++- views/admin/obits/list.html | 57 ++++++++++++++++++++------ 4 files changed, 104 insertions(+), 16 deletions(-) diff --git a/css/admin.css b/css/admin.css index 3ddcfb8..2352fe2 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1,3 +1,24 @@ .newspaper-record{ float: left; -} \ No newline at end of file +} +.glm-obit-admin-search input{ + margin-bottom: 5px; + font-size: 14px; + width: 100%; +} +#glm-admin-content-container #searchForm .obit-search-btn{ + margin-top: 10px; +} +.glm-obit-search-label{ + margin: 0 0 2px 0; +} +.obit-admin-column{ + max-width: 190px; +} +.glm-obit-admin-search{ + width: 100%; +} +.less-padding{ + padding-left: 0px; + padding-right: 10px; +} diff --git a/models/admin/management/obitImport.php b/models/admin/management/obitImport.php index 19e2e35..9b2ae8d 100644 --- a/models/admin/management/obitImport.php +++ b/models/admin/management/obitImport.php @@ -177,7 +177,6 @@ class GlmMembersAdmin_management_obitImport $wpdb->insert($table, $insert); } -// echo '
', print_r($insert), '
'; $resultMessage = "
Start: $start
"; $start += $limit; diff --git a/models/admin/obits/list.php b/models/admin/obits/list.php index 2d120da..7dc1374 100644 --- a/models/admin/obits/list.php +++ b/models/admin/obits/list.php @@ -224,10 +224,45 @@ class GlmMembersAdmin_obits_list extends GlmDataObits $where = 'true'; // Check if we have a Text Search string - if (isset($_REQUEST['textSearch']) && trim($_REQUEST['textSearch']) != '') { - $textSearch = trim($_REQUEST['textSearch']); + if (isset($_REQUEST['last_name']) && trim($_REQUEST['last_name']) != '') { + $textSearch = trim($_REQUEST['last_name']); $where .= " AND last_name LIKE '%$textSearch%'"; } + // Check if we have a Text Search string + if (isset($_REQUEST['first_mid']) && trim($_REQUEST['first_mid']) != '') { + $textSearch = trim($_REQUEST['first_mid']); + $where .= " AND first_mid LIKE '%$textSearch%'"; + } + // Check if we have a Text Search string + if (isset($_REQUEST['spouse_partner']) && trim($_REQUEST['spouse_partner']) != '') { + $textSearch = trim($_REQUEST['spouse_partner']); + $where .= " AND spouse_partner LIKE '%$textSearch%'"; + } + // Check if we have a Text Search string + if (isset($_REQUEST['maiden_other']) && trim($_REQUEST['maiden_other']) != '') { + $textSearch = trim($_REQUEST['maiden_other']); + $where .= " AND maiden_other LIKE '%$textSearch%'"; + } + // Check if we have a Text Search string + if (isset($_REQUEST['b_year']) && trim($_REQUEST['b_year']) != '') { + $textSearch = trim($_REQUEST['b_year']); + $where .= " AND b_year LIKE '%$textSearch%'"; + } + // Check if we have a Text Search string + if (isset($_REQUEST['d_year']) && trim($_REQUEST['d_year']) != '') { + $textSearch = trim($_REQUEST['d_year']); + $where .= " AND d_year LIKE '%$textSearch%'"; + } + // Check if we have a Text Search string + if (isset($_REQUEST['d_yr_range']) && trim($_REQUEST['d_yr_range']) != '') { + $textSearch = trim($_REQUEST['d_yr_range']); + $where .= " AND d_yr_range LIKE '%$textSearch%'"; + } + // Check if we have a Text Search string + if (isset($_REQUEST['b_yr_range']) && trim($_REQUEST['b_yr_range']) != '') { + $textSearch = trim($_REQUEST['b_yr_range']); + $where .= " AND b_yr_range LIKE '%$textSearch%'"; + } // Get the total number of obits listed $numbObits = $this->getStats($where); diff --git a/views/admin/obits/list.html b/views/admin/obits/list.html index e07b141..b0d062e 100644 --- a/views/admin/obits/list.html +++ b/views/admin/obits/list.html @@ -13,18 +13,51 @@ -
-

- - From Date: - To Date: - - - Text Search: - - -

-

+
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ +

Total found: {$numbObits}  

-- 2.17.1