From: Steve Sutton Date: Wed, 27 Aug 2014 15:35:33 +0000 (-0400) Subject: Update contact report form X-Git-Tag: v1.0^2~45 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=98ba8f315bbbae06e0c858812e09403aff6a29b9;p=web%2FStIgnaceBudgetHost.git Update contact report form update on date searches. Use jquery ui datepicker. So it is easier for the client to select one date to search by. --- diff --git a/admin/Contact/index.phtml b/admin/Contact/index.phtml index 737ea2a..49beb60 100755 --- a/admin/Contact/index.phtml +++ b/admin/Contact/index.phtml @@ -17,6 +17,8 @@ $qs = "SELECT count(*) as total if (TABLE == CUSTOMER_TABLE) { $qs .= " WHERE (fname != '-Guest-' OR fname is null)"; } +$GLOBALS['styleSheets'][] = JQUERY_UI_CDN_CSS; +$GLOBALS['bottomScripts'][] = JQUERY_UI_CDN_JS; $res = $DB->db_auto_get_data($qs); $total = $res[0]['total']; GLM_TOOLBOX::top("Contact Database","help/contact.phtml?key=search","SteveContactsDatabase_1.0"); @@ -132,8 +134,10 @@ GLM_TOOLBOX::html_nav_table($nav,$navWidth); -
Created From:
-
Created To:
+
Created From:
+ >
+
Created To:
+ >
diff --git a/admin/Contact/query_contact.phtml b/admin/Contact/query_contact.phtml index 66b1a75..48c536c 100755 --- a/admin/Contact/query_contact.phtml +++ b/admin/Contact/query_contact.phtml @@ -212,6 +212,33 @@ if (!$query_no) { $query_string .= ' and ('.implode(" $compare ",$cstring).') '; } } + $contactFromDate = filter_var( + $_REQUEST['contact_from_date'], + FILTER_VALIDATE_REGEXP, + array( + 'options' => + array( + 'regexp' => '%[0-9]{2}/[0-9]{2}/[0-9]{4}%') + ) + ); + $contactToDate = filter_var( + $_REQUEST['contact_to_date'], + FILTER_VALIDATE_REGEXP, + array( + 'options' => + array( + 'regexp' => '%[0-9]{2}/[0-9]{2}/[0-9]{4}%') + ) + ); + if ($contactFromDate && $contactToDate) { + $query_string .= " AND create_date >= '{$contactFromDate}'" + . " AND create_date <= '{$contactToDate}'"; + } else if ($contactFromDate) { + $query_string .= " AND create_date >= '{$contactFromDate}'"; + } else if ($contactToDate) { + $query_string .= " AND create_date <= '{$contactToDate}'"; + } + if (isset($fp_month)) { $fp_str = mktime(0,0,0,$fp_month,$fp_day,$fp_year); $tp_str = mktime(0,0,0,$tp_month,$tp_day,$tp_year);