Contact updates
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 6 Mar 2015 21:54:33 +0000 (16:54 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 6 Mar 2015 21:54:33 +0000 (16:54 -0500)
for search in admin

Toolkit/LeadManager/Contact.php
admin/Contact/contact_setup.inc
admin/Contact/index.phtml
admin/Contact/query_contact.phtml

index 7e00306..a7e5f4c 100644 (file)
@@ -47,6 +47,8 @@ class Toolkit_LeadManager_Contact
     private $_eclub;
     private $_big_giveaway;
     private $_golfvacation;
+    private $_gender;
+    private $_handicap;
 
     /**
      * Contructor for class Contact Objects
@@ -69,7 +71,9 @@ class Toolkit_LeadManager_Contact
             ->setGiveaway($giveaway)
             ->setGolfvacation($golfvacation)
             ->setEclub($eclub)
-            ->setBig_giveaway($big_giveaway);
+            ->setBig_giveaway($big_giveaway)
+            ->setGender($gender)
+            ->setHandicap($handicap);
         if ($id) {
             $this->setId($id);
         }
@@ -364,5 +368,27 @@ class Toolkit_LeadManager_Contact
         return $this;
     }
 
+    function getGender()
+    {
+        return $this->_gender;
+    }
+
+    function getHandicap()
+    {
+        return $this->_handicap;
+    }
+
+    function setGender($gender)
+    {
+        $this->_gender = $gender;
+        return $this;
+    }
+
+    function setHandicap($handicap)
+    {
+        $this->_handicap = $handicap;
+        return $this;
+    }
+
 
 }
index 29f7502..97001b3 100755 (executable)
@@ -2,11 +2,11 @@
 
 /**
 * contact_setup.phtml
-* 
-* Config setting for the admin contact application 
-* 
+*
+* Config setting for the admin contact application
+*
 * PHP versions 4 and 5
-* 
+*
 * @category  Toolkit
 * @package   Contacts
 * @author    Steve Sutton <steve@gaslightmedia.com>
@@ -16,7 +16,7 @@
 * @link      <>
 */
 extract($_REQUEST);
-// The Contact Type array is now is one location and is used by the 
+// The Contact Type array is now is one location and is used by the
 // Toolkit_Contacts_Admin_EditContact class
 $conf = new Config;
 $contactRoot =& $conf->parseConfig(
@@ -67,7 +67,7 @@ $DB = new GLM_DB();
 if (!defined("HTML_EMAIL")) {
 
     /**
-    * HTML_EMAIL = ON or OFF 
+    * HTML_EMAIL = ON or OFF
     */
     define("HTML_EMAIL", "ON");
 }
@@ -83,18 +83,18 @@ if (!defined("NEWSLETTER")) {
     /**
     * NEWSLETTER 1 or true will allow newsletters
     */
-    define("NEWSLETTER", 1); //bool- does the contact database mail out a newsletter? 
+    define("NEWSLETTER", 1); //bool- does the contact database mail out a newsletter?
 }
 
 if (!function_exists("template_read")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param unknown $template Parameter description (if any) ...
-    * 
+    *
     * @return string  Return description (if any) ...
     */
     function template_read($template)
@@ -116,12 +116,12 @@ if (!function_exists("template_read")) {
 * insert an array into another array after position.
 * You can specify an associative array key or index key
 * to dictact the positioning of the new array
-* 
+*
 * @param array   &$array       array to be used
 * @param unknown $position     position to add array
 * @param unknown $insert_array array to be inserted
-* 
-* @return void   
+*
+* @return void
 */
 function array_insert(&$array, $position, $insert_array)
 {
@@ -144,12 +144,12 @@ if (!function_exists("explode_template")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param unknown $template Parameter description (if any) ...
     * @param unknown $data     Parameter description (if any) ...
-    * 
+    *
     * @return unknown Return description (if any) ...
     */
     function explode_template($template, $data)
@@ -167,12 +167,12 @@ if (!function_exists("template_replacement")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param unknown $template Parameter description (if any) ...
     * @param array   $fieldarr Parameter description (if any) ...
-    * 
+    *
     * @return unknown Return description (if any) ...
     */
     function template_replacement($template, $fieldarr)
@@ -191,12 +191,12 @@ if (!function_exists("add_image")) {
 
     /**
     * Short description for function
-    * 
+    *
     * Long description (if any) ...
-    * 
+    *
     * @param string $image Parameter description (if any) ...
     * @param string $align Parameter description (if any) ...
-    * 
+    *
     * @return string Return description (if any) ...
     */
     function add_image($image, $align)
@@ -225,7 +225,7 @@ if (is_array($cData)) {
         $int_array[$value['id']] = $value['header'];
     }
 }
-$contactTypesSetup = 
+$contactTypesSetup =
     $contactRoot->getItem('section', 'contact_types')
        ->toArray();
 $cType = $contactTypesSetup['contact_types'];
@@ -233,20 +233,20 @@ $cType = $contactTypesSetup['contact_types'];
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param string $name         Parameter description (if any) ...
 * @param string $search_where Parameter description (if any) ...
-* 
+*
 * @return string Return description (if any) ...
 */
 function search_where($name, $search_where)
 {
     $out = '
     <select name="'.$name.'">
-        <option value="1" '.( ( !isset( $search_type ) || $search_type == "0" ) ? 'selected' : '' ).'>Anywhere 
-        <option value="2" '.( ( $search_where == '1' ) ? 'selected' : '' ).'>Begining 
+        <option value="1" '.( ( !isset( $search_type ) || $search_type == "0" ) ? 'selected' : '' ).'>Anywhere
+        <option value="2" '.( ( $search_where == '1' ) ? 'selected' : '' ).'>Begining
         <option value="3" '.( ( $search_where == '2' ) ? 'selected' : '' ).'>Ending
     </select>';
     return $out;
@@ -256,19 +256,19 @@ function search_where($name, $search_where)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param string $name        Parameter description (if any) ...
 * @param string $search_type Parameter description (if any) ...
-* 
+*
 * @return string Return description (if any) ...
 */
 function search_type($name, $search_type)
 {
     $out = '
     <select name="'.$name.'">
-        <option value="2" '.( ( !isset( $search_type ) || $search_type == '2' ) ? 'selected' : '' ).'>And 
+        <option value="2" '.( ( !isset( $search_type ) || $search_type == '2' ) ? 'selected' : '' ).'>And
         <option value="3" '.( ( $search_type == '3' ) ? 'selected' : '' ).'>Or
         <option value="4" '.( ( $search_type == '4' ) ? 'selected' : '' ).'>Not
     </select>';
@@ -279,19 +279,19 @@ function search_type($name, $search_type)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param string $name        Parameter description (if any) ...
 * @param string $search_type Parameter description (if any) ...
-* 
+*
 * @return string Return description (if any) ...
 */
 function search_bool($name, $search_type)
 {
     $out = '
     <select name="'.$name.'">
-        <option value="n" '.( !isset( $search_type ) ? 'selected' : '' ).'>Don\'t Care 
+        <option value="n" '.( !isset( $search_type ) ? 'selected' : '' ).'>Don\'t Care
         <option value="1" '.( ( $search_type == '1' ) ? 'selected' : '' ).'>Yes
         <option value="0" '.( ( $search_type == '0' ) ? 'selected' : '' ).'>No
     </select>';
@@ -302,11 +302,11 @@ function search_bool($name, $search_type)
 
 /**
 * Short description for function
-* 
+*
 * Long description (if any) ...
-* 
+*
 * @param unknown $field Parameter description (if any) ...
-* 
+*
 * @return boolean Return description (if any) ...
 */
 function interest($field)
@@ -427,7 +427,9 @@ $sequence = $contactRoot->getItem('section', 'conf')
 * Description for define
 */
 define("SEQUENCE", $sequence);
-
+$config         = parse_ini_file(BASE .'Toolkit/Contacts/config.ini', true);
+$gender_sel     = $config['gender'];
+$handicap_sel   = $config['handicap'];
 /**
 * Description for define
 */
@@ -452,6 +454,7 @@ $DB_fields[] = array("name" => "phone",         "title" => "Phone",         "typ
 $DB_fields[] = array("name" => "fax",           "title" => "Fax",           "type" => "text");
 $DB_fields[] = array("name" => "email",         "title" => "Email",         "type" => "text");
 $DB_fields[] = array("name" => "mail_ok",       "title" => "Mail Ok?",      "type" => "radio");
+$DB_fields[] = array("name" => "golfvacation",  "title" => "Golf Vacation Planners?",      "type" => "radio");
 $DB_fields[] = array("name" => "interest",      "title" => "Interest",      "type" => "interest");
 $DB_fields[] = array("name" => "contact_type", "title" => "Contact Type", "type" => "drop", "drop" => $cType);
 
index 871b9c9..0428884 100755 (executable)
@@ -195,6 +195,22 @@ GLM_TOOLBOX::html_nav_table($nav,$navWidth);
   <option value="3" <?php echo ($search_type=="3")?"selected":""?>>Or
   <option value="4" <?php echo ($search_type=="4")?"selected":""?>>Not
   </select>
+    <b>Gender:</b><br>
+      <?php
+      echo GLM_TOOLBOX::build_picklist(
+        'gender',
+        $gender_sel,
+        $gender
+    );
+      ?>
+    <b>Handicap:</b><br>
+      <?php
+      echo GLM_TOOLBOX::build_picklist(
+        'handicap',
+        $handicap_sel,
+        $handicap
+    );
+      ?>
     </td>
       <td valign=top class=small width=25%>
       <b>Case Sensitivity:</b><br>
index 48c536c..ffdf651 100755 (executable)
@@ -238,6 +238,12 @@ if (!$query_no) {
     } else if ($contactToDate) {
         $query_string .= " AND create_date <= '{$contactToDate}'";
     }
+    if (isset($gender) && $gender != "''") {
+        $query_string .= " AND gender >= '$gender'";
+    }
+    if (isset($handicap) && $handicap != "''") {
+        $query_string .= " AND handicap >= '$handicap'";
+    }
 
     if (isset($fp_month)) {
         $fp_str = mktime(0,0,0,$fp_month,$fp_day,$fp_year);