Update forms and the contact admin
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 15 Jul 2014 16:49:36 +0000 (12:49 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 15 Jul 2014 16:55:54 +0000 (12:55 -0400)
Update the new contact admin to use the discover field for interest.
Update the enews form.

Toolkit/Contacts/Admin/EditContact.php
Toolkit/Contacts/ContactUs.php
Toolkit/LeadManager/Contact.php
admin/Contact/contact_setup.inc
static/10.phtml

index ef49dbb..b535447 100644 (file)
@@ -67,19 +67,19 @@ define('MISSING_CONTACT_TYPE', -5);
 class Toolkit_Contacts_Admin_EditContact
     extends Toolkit_FormBuilder implements Toolkit_Form
 {
-       //      {{{     properties
+    //  {{{ properties
 
     /**
      * Table in Database which holds the contact data
-        *
+     *
      * @var    string
      * @access public
      */
-       public $tableName = 'contact';
+    public $tableName = 'contact';
 
     /**
      * Primary Key for the table
-        *
+     *
      * @var    string
      * @access public
      */
@@ -87,7 +87,7 @@ class Toolkit_Contacts_Admin_EditContact
 
     /**
      * Sequence for the table
-        *
+     *
      * @var    string
      * @access public
      */
@@ -95,126 +95,126 @@ class Toolkit_Contacts_Admin_EditContact
 
     /**
      * Table meta data
-        *
-        * This is used when inserting/updating data for the records
-        * so the PDO's can use explicit data types for the parameters.
-        *
+     *
+     * This is used when inserting/updating data for the records
+     * so the PDO's can use explicit data types for the parameters.
+     *
      * @var    array
      * @access public
      */
-       public $tableMetaData = array();
+    public $tableMetaData = array();
 
     /**
      * The interests from the contact db
-        *
+     *
      * @var    array
      * @access protected
      */
-       protected $inquiries = array();
-
-       /**
-        * What do you want the error msg to be if the form doesn't validate
-        *
-        * @var string
-        * @access protected
-        */
-       protected $errorMsg
+    protected $inquiries = array();
+
+    /**
+     * What do you want the error msg to be if the form doesn't validate
+     *
+     * @var string
+     * @access protected
+     */
+    protected $errorMsg
         = '<div id="form-warning-top">
                 Warning: The form was not sent, please review the errors below.
            </div>';
 
-       /**
-        * What do you want the success msg to be if the form validates successfully
-        *
-        * @var string
-        * @access protected
-        */
-       protected $successMsg
+    /**
+     * What do you want the success msg to be if the form validates successfully
+     *
+     * @var string
+     * @access protected
+     */
+    protected $successMsg
         = '<div id="form-success-top">
                 The information below has been successfully submitted.
            </div>';
 
     /**
      * Include a captcha on the form or not
-        *
+     *
      * @var    boolean
      * @access protected
      */
-       protected $useCaptcha = false;
-
-       /**
-        * The default templates to inject into the form renderer
-        *
-        * @var string
-        * @access protected
-        */
-       protected $template;
-
-       /**
-        * The default rules to register for validating
-        *
-        * We have to register these rules, or any others we want, before
-        * we are able to use them in our forms.
-        *
-        * These rules can be removed in subclasses before the rules are configured
-        * if you want to omit any of them from validating input - just remember
-        * to not call them in your configured rules!
-        *
-        * Phone: validates input against US and CA style phone #'s
-        * <code>
-        * $rules[] = array('element'    => 'phone',
-        *                  'message'    => 'ERROR: Invalid Phone Format!',
-        *                  'type'       => 'phone',
-        *                  'format'     => null,
-        *                  'validation' => $this->validationType,
-        *                  'reset'      => true,
-        *                  'force'      => false);
-        * </code>
-        *
-        * Zip: Validates input against US and CA zip codes, if DB check is
-        *      set to true, validate zip codes against all the zip codes in the
-        *      DB.
-        * <code>
-        * $rules[] = array('element'    => 'zip',
-        *                  'message'    => 'ERROR: Invalid Zip!',
-        *                  'type'       => 'zip',
-        *                  'format'     => array('requireDBCheck' => true),
-        *                  'validation' => $this->validationType,
-        *                  'reset'      => true,
-        *                  'force'      => false);
-        * </code>
-        *
-        * Banwords: Make sure each each doesn't contain a banned word. Checking
-        *           against a DB of banned words.
-        *
-        * State: Validate input against US and CA region / province codes.  If DB
-        *        check is set to true, validate region / province against all the
-        *        regions / provinces in the DB.
-        * <code>
-        * $rules[] = array('element'    => 'state_id',
-        *                  'message'    => 'ERROR: Invalid State / Province!',
-        *                  'type'       => 'state',
-        *                  'format'     => array('requireDBCheck' => true),
-        *                  'validation' => $this->validationType,
-        *                  'reset'      => true,
-        *                  'force'      => false);
-        * </code>
-        *
-        * @var array
-        * @access protected
-        * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Zip.php
-        * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Phone.php
-        * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Banwords.php
-        * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/State.php
-        */
-       protected $registeredRules = array('phone', 'zip', 'state');
-
-       //      }}}
-       //      {{{     __construct()
-
-       /**
-        * Class constructor
-        *
+    protected $useCaptcha = false;
+
+    /**
+     * The default templates to inject into the form renderer
+     *
+     * @var string
+     * @access protected
+     */
+    protected $template;
+
+    /**
+     * The default rules to register for validating
+     *
+     * We have to register these rules, or any others we want, before
+     * we are able to use them in our forms.
+     *
+     * These rules can be removed in subclasses before the rules are configured
+     * if you want to omit any of them from validating input - just remember
+     * to not call them in your configured rules!
+     *
+     * Phone: validates input against US and CA style phone #'s
+     * <code>
+     * $rules[] = array('element'    => 'phone',
+     *                  'message'    => 'ERROR: Invalid Phone Format!',
+     *                  'type'       => 'phone',
+     *                  'format'     => null,
+     *                  'validation' => $this->validationType,
+     *                  'reset'      => true,
+     *                  'force'      => false);
+     * </code>
+     *
+     * Zip: Validates input against US and CA zip codes, if DB check is
+     *      set to true, validate zip codes against all the zip codes in the
+     *      DB.
+     * <code>
+     * $rules[] = array('element'    => 'zip',
+     *                  'message'    => 'ERROR: Invalid Zip!',
+     *                  'type'       => 'zip',
+     *                  'format'     => array('requireDBCheck' => true),
+     *                  'validation' => $this->validationType,
+     *                  'reset'      => true,
+     *                  'force'      => false);
+     * </code>
+     *
+     * Banwords: Make sure each each doesn't contain a banned word. Checking
+     *           against a DB of banned words.
+     *
+     * State: Validate input against US and CA region / province codes.  If DB
+     *        check is set to true, validate region / province against all the
+     *        regions / provinces in the DB.
+     * <code>
+     * $rules[] = array('element'    => 'state_id',
+     *                  'message'    => 'ERROR: Invalid State / Province!',
+     *                  'type'       => 'state',
+     *                  'format'     => array('requireDBCheck' => true),
+     *                  'validation' => $this->validationType,
+     *                  'reset'      => true,
+     *                  'force'      => false);
+     * </code>
+     *
+     * @var array
+     * @access protected
+     * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Zip.php
+     * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Phone.php
+     * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/Banwords.php
+     * @see app.gaslightmedia.com/glmPEAR/HTML/QuickForm/Rule/State.php
+     */
+    protected $registeredRules = array('phone', 'zip', 'state');
+
+    //  }}}
+    //  {{{ __construct()
+
+    /**
+     * Class constructor
+     *
      * @param object $pdo         PHP Data Object
      * @param string $formName    Form's name.
      * @param string $method      (optional)Form's method defaults to 'POST'
@@ -222,14 +222,14 @@ class Toolkit_Contacts_Admin_EditContact
      * @param string $target      (optional)Form's target defaults to '_self'
      * @param mixed  $attributes  (optional)Extra attributes for <form> tag
      * @param bool   $trackSubmit (optional)Whether to track if the form was
-        *                                                        submitted by adding a special hidden field
-        *
-        * @author Jamie Kahgee <jamie.kahgee@gmail.com>
-        * @access public
-        * @link   http://pear.php.net/package/HTML_QuickForm/docs/latest/HTML_QuickForm/HTML_QuickForm.html
-        * @see    HTML_QuickForm
-        */
-       public function __construct(
+     *                            submitted by adding a special hidden field
+     *
+     * @author Jamie Kahgee <jamie.kahgee@gmail.com>
+     * @access public
+     * @link   http://pear.php.net/package/HTML_QuickForm/docs/latest/HTML_QuickForm/HTML_QuickForm.html
+     * @see    HTML_QuickForm
+     */
+    public function __construct(
         PDO $pdo,
         $formName,
         $method = 'post',
@@ -238,7 +238,7 @@ class Toolkit_Contacts_Admin_EditContact
         $attributes = null,
         $trackSubmit = false
     ) {
-               parent::__construct(
+        parent::__construct(
             $formName,
             $method,
             $action,
@@ -249,95 +249,95 @@ class Toolkit_Contacts_Admin_EditContact
 
         $this->dbh = $pdo;
 
-               /**
-                * Where are the flexy templates stored at for this class.
-                */
-               define('TEMPLATES_DIR', BASE . 'Toolkit/Contacts/templates');
-
-               /**
-                * Where are the compiled flexy templates stored at for this class.
-                */
-               define('COMPILED_DIR', BASE . 'Toolkit/Contacts/templates/compiled');
-               $oldUmask = umask(0);
-               if (!is_dir(TEMPLATES_DIR)) {
-                       mkdir(TEMPLATES_DIR, 0770, true);
-               }
-               if (!is_dir(COMPILED_DIR)) {
-                       mkdir(COMPILED_DIR, 0770, true);
-               }
-               umask($oldUmask);
-
-               $this->flexyOptions                = $GLOBALS['flexyOptions'];
-               $this->flexyOptions['templateDir'] = TEMPLATES_DIR;
-               $this->flexyOptions['compileDir']  = COMPILED_DIR;
-
-       }
-
-       //      }}}
-
-       //      {{{ checkContactEmail()
-
-       /**
-        * Checks if the member name already exists in the database
-        *
-        * @param array $data The name of the member to check for.
+        /**
+         * Where are the flexy templates stored at for this class.
+         */
+        define('TEMPLATES_DIR', BASE . 'Toolkit/Contacts/templates');
+
+        /**
+         * Where are the compiled flexy templates stored at for this class.
+         */
+        define('COMPILED_DIR', BASE . 'Toolkit/Contacts/templates/compiled');
+        $oldUmask = umask(0);
+        if (!is_dir(TEMPLATES_DIR)) {
+            mkdir(TEMPLATES_DIR, 0770, true);
+        }
+        if (!is_dir(COMPILED_DIR)) {
+            mkdir(COMPILED_DIR, 0770, true);
+        }
+        umask($oldUmask);
+
+        $this->flexyOptions                = $GLOBALS['flexyOptions'];
+        $this->flexyOptions['templateDir'] = TEMPLATES_DIR;
+        $this->flexyOptions['compileDir']  = COMPILED_DIR;
+
+    }
+
+    //  }}}
+
+    //  {{{ checkContactEmail()
+
+    /**
+     * Checks if the member name already exists in the database
+     *
+     * @param array $data The name of the member to check for.
      *
-        * @return bool False on SQL Query error, otherwise true.
-        * @access      protected
-        */
-       public function checkContactEmail($data)
-       {
-               try {
-                       //      If we're editing a contact, they
-                       //      can save that member as its
-                       //      own name. so don't include that
-                       //      member in the check.
-                       if (ctype_digit($_REQUEST[$this->primaryKey])) {
-                               $and = "AND {$this->primaryKey} <> :id";
-                       }
-                       $sql = "
-                               SELECT count(*) AS total
-                                 FROM {$this->tableName}
-                                WHERE email = :email
-                                 $and";
-                       $stmt = $this->dbh->prepare($sql);
-                       $stmt->bindParam(':email', $data, PDO::PARAM_STR);
-                       if (ctype_digit($_REQUEST[$this->primaryKey])) {
-                               $stmt->bindParam(':id', $_REQUEST[$this->primaryKey], PDO::PARAM_STR);
-                       }
-                       $stmt->execute();
+     * @return bool False on SQL Query error, otherwise true.
+     * @access  protected
+     */
+    public function checkContactEmail($data)
+    {
+        try {
+            //  If we're editing a contact, they
+            //  can save that member as its
+            //  own name. so don't include that
+            //  member in the check.
+            if (ctype_digit($_REQUEST[$this->primaryKey])) {
+                $and = "AND {$this->primaryKey} <> :id";
+            }
+            $sql = "
+                SELECT count(*) AS total
+                  FROM {$this->tableName}
+                 WHERE email = :email
+                  $and";
+            $stmt = $this->dbh->prepare($sql);
+            $stmt->bindParam(':email', $data, PDO::PARAM_STR);
+            if (ctype_digit($_REQUEST[$this->primaryKey])) {
+                $stmt->bindParam(':id', $_REQUEST[$this->primaryKey], PDO::PARAM_STR);
+            }
+            $stmt->execute();
             $stmt->bindColumn('total', $valid);
-                       $stmt->fetch();
+            $stmt->fetch();
 
-                       return !(bool) $valid;
-               } catch (PDOException $e) {
-                       return Toolkit_Common::handleError($e);
-               }
-       }
+            return !(bool) $valid;
+        } catch (PDOException $e) {
+            return Toolkit_Common::handleError($e);
+        }
+    }
 
-       //      }}}
-       //      {{{     configureConstats()
+    //  }}}
+    //  {{{ configureConstats()
 
     /**
      * Constant variables for the form
-        *
-        * These values won't get overridden by POST or GET vars
+     *
+     * These values won't get overridden by POST or GET vars
      *
      * @return void
      * @access public
      */
-       public function configureConstants()
-       {
+    public function configureConstants()
+    {
         if (ctype_digit($_REQUEST['id'])) {
-                   $constants = array('id' => $_REQUEST['id']);
+            $constants = array('id' => $_REQUEST['id']);
         } else {
-                   $constants = array();
+            $constants = array();
         }
-               $this->setupConstants($constants);
-       }
+        $this->setupConstants($constants);
+    }
 
-       //      }}}
-       //      {{{     configureDefaults()
+    //  }}}
+    //  {{{ configureDefaults()
 
     /**
      * Initializes default form values
@@ -345,8 +345,8 @@ class Toolkit_Contacts_Admin_EditContact
      * @return void
      * @access public
      */
-       public function configureDefaults()
-       {
+    public function configureDefaults()
+    {
         if (ctype_digit($_REQUEST[$this->primaryKey])) {
             try {
                 $sql = "
@@ -396,11 +396,11 @@ class Toolkit_Contacts_Admin_EditContact
             );
         }
 
-               $this->setupDefaults($defaults);
-       }
+        $this->setupDefaults($defaults);
+    }
 
-       //      }}}
-       //      {{{     configureElements()
+    //  }}}
+    //  {{{ configureElements()
 
     /**
      * Form element definitions
@@ -408,35 +408,35 @@ class Toolkit_Contacts_Admin_EditContact
      * @return void
      * @access public
      */
-       public function configureElements()
-       {
-               $e = array();
-               $this->setInterestFields();
-               //      Grouped Elements are defined here.
-               $this->interestsGroups =& $this->getInterestFields();
+    public function configureElements()
+    {
+        $e = array();
+        $this->setInterestFields();
+        //  Grouped Elements are defined here.
+        $this->interestsGroups =& $this->getInterestFields();
 
         $contactTypesSetup
             = $this->config->getItem('section', 'contact_types')
                 ->toArray();
         $cType = $contactTypesSetup['contact_types'];
-               //      All Elements are created here.  This includes group element definitions.
+        //  All Elements are created here.  This includes group element definitions.
         $e[] = array(
             'type'    => 'hidden',
             'name'    => 'start',
             'display' => $_REQUEST['start']
         );
-               $e[] = array(
-                       'type'    => 'static',
-                       'req'     => false,
+        $e[] = array(
+            'type'    => 'static',
+            'req'     => false,
             'name'    => 'user_agent',
             'display' => 'User Agent'
-               );
-               $e[] = array(
-                       'type' => 'static',
-                       'req'  => false,
-                       'name' => 'remote_addr',
+        );
+        $e[] = array(
+            'type' => 'static',
+            'req'  => false,
+            'name' => 'remote_addr',
             'display' => 'Remote Address'
-               );
+        );
         if (ctype_digit($_REQUEST[$this->primaryKey])) {
             $e[] = array(
                 'type' => 'hidden',
@@ -444,18 +444,18 @@ class Toolkit_Contacts_Admin_EditContact
                 'name' => $this->primaryKey
             );
         }
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => 'fname',
-                       'display' => 'First Name'
-               );
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => 'lname',
-                       'display' => 'Last Name'
-               );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'fname',
+            'display' => 'First Name'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'lname',
+            'display' => 'Last Name'
+        );
         if ($this->tableName == 'customer') {
             $add1 = 'add1';
             $add2 = 'add2';
@@ -463,77 +463,186 @@ class Toolkit_Contacts_Admin_EditContact
             $add1 = 'address';
             $add2 = 'address2';
         }
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => $add1,
-                       'display' => 'Address 1'
-               );
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => $add2,
-                       'display' => 'Address 2'
-               );
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => 'city',
-                       'display' => 'City'
-               );
         $e[] = array(
-                       'type'    => 'select',
-                       'req'     => false,
-                       'name'    => 'state',
-                       'display' => 'State/Province',
-                       'opts'    => $GLOBALS['states']
-               );
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => $add1,
+            'display' => 'Address 1'
+        );
         $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => 'zip',
-                       'display' => 'ZIP/Postal Code'
-               );
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => true,
-                       'name'    => 'email',
-                       'display' => 'Email'
-               );
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => 'phone',
-                       'display' => 'Phone'
-               );
-               $e[] = array(
-                       'type'    => 'text',
-                       'req'     => false,
-                       'name'    => 'fax',
-                       'display' => 'Fax'
-               );
-               $e[] = array(
-                       'type'    => 'advcheckbox',
-                       'req'     => false,
-                       'name'    => 'mail_ok',
-                       'display' => 'Mail Ok?',
-                       'opts'    => 'Yes',
-                       'val'     => array(0, 1)
-               );
-        if (is_array($this->interestsGroups)) {
-            foreach ($this->interestsGroups as $group => $gData) {
-                $this->myGroups[] = $gData;
-                $e[] = array(
-                    'type'       => 'group',
-                    'req'        => false,
-                    'name'       => 'interest['.$group.']',
-                    'group'         => $gData,
-                    'label'      => $group,
-                    'seperator'  => ' ',
-                    'appendName' => true
-                );
-            }
-        }
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => $add2,
+            'display' => 'Address 2'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'city',
+            'display' => 'City'
+        );
+        $e[] = array(
+            'type'    => 'select',
+            'req'     => false,
+            'name'    => 'state',
+            'display' => 'State/Province',
+            'opts'    => $GLOBALS['states']
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'zip',
+            'display' => 'ZIP/Postal Code'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'phone',
+            'display' => 'Phone'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'alt_phone',
+            'display' => 'Alternate Phone'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'fax',
+            'display' => 'Fax'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => true,
+            'name'    => 'email',
+            'display' => 'Email'
+        );
+        $e[] = array(
+            'type'    => 'advcheckbox',
+            'req'     => false,
+            'name'    => 'mail_ok',
+            'display' => 'Mail Ok?',
+            'opts'    => 'Yes',
+            'val'     => array(0, 1)
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'arrival',
+            'display' => 'Arrival'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'departure',
+            'display' => 'Departure'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'golfers',
+            'display' => 'Golfers'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'nongolfers',
+            'display' => 'Non golfers'
+        );
+        $e[] = array(
+            'type'    => 'advcheckbox',
+            'req'     => false,
+            'name'    => 'pquote',
+            'display' => 'From Price Quote',
+            'opts'    => 'Yes',
+            'val'     => array(0, 1)
+        );
+        $lodging = array(
+            '' => '',
+            'Trout Creek Condominiums' => 'Trout Creek Condominiums',
+            'Hamlet Village Condominiums' => 'Hamlet Village Condominiums'
+        );
+        $e[] = array(
+            'type'    => 'select',
+            'req'     => false,
+            'name'    => 'lodging',
+            'display' => 'Lodging',
+            'opts'    => $lodging
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'couples',
+            'display' => 'Couples'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'singles',
+            'display' => 'Singles'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'bathrooms',
+            'display' => 'Bathrooms'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'rooms',
+            'display' => 'Rooms'
+        );
+        $e[] = array(
+            'type'    => 'text',
+            'req'     => false,
+            'name'    => 'beds',
+            'display' => 'Beds'
+        );
+        $e[] = array(
+            'type'    => 'advcheckbox',
+            'req'     => false,
+            'name'    => 'twinsok',
+            'display' => 'Twin Ok',
+            'opts'    => 'Yes',
+            'val'     => array(0, 1)
+        );
+        $e[] = array(
+            'type'    => 'advcheckbox',
+            'req'     => false,
+            'name'    => 'sleepersofaok',
+            'display' => 'Sleeper Sofa Ok',
+            'opts'    => 'Yes',
+            'val'     => array(0, 1)
+        );
+        $e[] = array(
+            'type'    => 'textarea',
+            'req'     => false,
+            'name'    => 'comments',
+            'display' => 'Comments'
+        );
+        $e[] = array(
+            'type'    => 'select',
+            'req'     => false,
+            'name'    => 'discover',
+            'display' => 'Discover Big Fore',
+            'opts'    => array('' => '') + $this->getDiscoverFields()
+        );
+//        if (is_array($this->interestsGroups)) {
+//            foreach ($this->interestsGroups as $group => $gData) {
+//                $this->myGroups[] = $gData;
+//                $e[] = array(
+//                    'type'       => 'group',
+//                    'req'        => false,
+//                    'name'       => 'interest['.$group.']',
+//                    'group'      => $gData,
+//                    'label'      => $group,
+//                    'seperator'  => ' ',
+//                    'appendName' => true
+//                );
+//            }
+//        }
         $e[] = array(
             'type'    => 'select',
             'req'     => false,
@@ -542,113 +651,127 @@ class Toolkit_Contacts_Admin_EditContact
             'opts'    => $cType,
             'att'     => array('multiple' => 'multiple')
         );
-               $e[] = array(
-                       'type'    => 'submit',
-                       'req'     => false,
-                       'name'    => 'submit_rmv',
+        $e[] = array(
+            'type'    => 'submit',
+            'req'     => false,
+            'name'    => 'submit_rmv',
             'display' => 'Submit Form'
-               );
+        );
 
-               $this->setupElements($e);
-       }
+        $this->setupElements($e);
+    }
 
-       //      }}}
-       //      {{{     configureRules()
+    //  }}}
+    public function getDiscoverFields()
+    {
+        $discover = array();
+        $sql = "
+           SELECT *
+             FROM contact_inq
+            WHERE groupid = 1
+         ORDER BY header";
+        $stmt = $this->dbh->query($sql);
+        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
+            $discover[$row['header']] = $row['header'];
+        }
+        return $discover;
+    }
+    //  {{{ configureRules()
 
     /**
      * Form rule definitions
      *
-        * Adds validation rules for the given fields
+     * Adds validation rules for the given fields
      *
      * @return void
      * @access public
      */
-       public function configureRules()
-       {
-               $r = array();
-               //      Form Rules
-               $r[] = array(
-                       'element'    => 'email',
-                       'message'    => 'ERROR: Invalid Email Format!',
-                       'type'       => 'email',
-                       'format'     => array('use_rfc822' => true),
-                       'validation' => $this->validationType,
-                       'reset'      => true,
-                       'force'      => false
+    public function configureRules()
+    {
+        $r = array();
+        //  Form Rules
+        $r[] = array(
+            'element'    => 'email',
+            'message'    => 'ERROR: Invalid Email Format!',
+            'type'       => 'email',
+            'format'     => array('use_rfc822' => true),
+            'validation' => $this->validationType,
+            'reset'      => true,
+            'force'      => false
         );
-               $r[] = array(
-                       'element'    => 'phone',
-                       'message'    => 'ERROR: Invalid number (xxx) xxx-xxxx!',
-                       'type'       => 'phone',
-                       'format'     => null,
-                       'validation' => $this->validationType,
-                       'reset'      => true,
-                       'force'      => false
+        $r[] = array(
+            'element'    => 'phone',
+            'message'    => 'ERROR: Invalid number (xxx) xxx-xxxx!',
+            'type'       => 'phone',
+            'format'     => null,
+            'validation' => $this->validationType,
+            'reset'      => true,
+            'force'      => false
         );
-               $r[] = array(
-                       'element'    => 'fax',
-                       'message'    => 'ERROR: Invalid number (xxx) xxx-xxxx!',
-                       'type'       => 'phone',
-                       'format'     => null,
-                       'validation' => $this->validationType,
-                       'reset'      => true,
-                       'force'      => false
+        $r[] = array(
+            'element'    => 'fax',
+            'message'    => 'ERROR: Invalid number (xxx) xxx-xxxx!',
+            'type'       => 'phone',
+            'format'     => null,
+            'validation' => $this->validationType,
+            'reset'      => true,
+            'force'      => false
         );
-               $r[] = array(
-                       'element'    => 'zip',
-                       'message'    => 'ERROR: Invalid Zip!',
-                       'type'       => 'zip',
-                       'format'     => array('requireDBCheck' => false),
-                       'validation' => $this->validationType,
-                       'reset'      => true,
-                       'force'      => false
+        $r[] = array(
+            'element'    => 'zip',
+            'message'    => 'ERROR: Invalid Zip!',
+            'type'       => 'zip',
+            'format'     => array('requireDBCheck' => false),
+            'validation' => $this->validationType,
+            'reset'      => true,
+            'force'      => false
         );
-               $r[] = array(
-                       'element'    => 'mail_ok',
-                       'message'    => 'ERROR: Invalid Value!',
-                       'type'       => 'numeric',
-                       'format'     => null,
-                       'validation' => $this->validationType,
-                       'reset'      => true,
-                       'force'      => false
+        $r[] = array(
+            'element'    => 'mail_ok',
+            'message'    => 'ERROR: Invalid Value!',
+            'type'       => 'numeric',
+            'format'     => null,
+            'validation' => $this->validationType,
+            'reset'      => true,
+            'force'      => false
         );
-               $r[] = array(
-                       'element'    => 'email',
-                       'message'    => 'ERROR: There is an existing account with this name!',
-                       'type'       => 'callback',
-                       'format'     => array($this, 'checkContactEmail'),
-                       'validation' => $this->validationType,
-                       'reset'      => false,
-                       'force'      => false
-               );
-
-               $this->setupRules($r);
-       }
-
-       //      }}}
-       //      {{{     configureFilters()
+        $r[] = array(
+            'element'    => 'email',
+            'message'    => 'ERROR: There is an existing account with this name!',
+            'type'       => 'callback',
+            'format'     => array($this, 'checkContactEmail'),
+            'validation' => $this->validationType,
+            'reset'      => false,
+            'force'      => false
+        );
+
+        $this->setupRules($r);
+    }
+
+    //  }}}
+    //  {{{ configureFilters()
 
     /**
      * Form filter definitions
      *
-        * Applies a data filter for the given fields when the form is submitted
+     * Applies a data filter for the given fields when the form is submitted
      *
      * @return void
      * @access public
      */
-       public function configureFilters()
-       {
+    public function configureFilters()
+    {
         $f = array();
 
-               $f[] = array(
+        $f[] = array(
             'element' => '__ALL__',
             'filter' => 'trim'
         );
 
         $this->setupFilters($f);
-       }
+    }
 
-       //      }}}
+    //  }}}
     //  {{{ configureForm()
 
     /**
@@ -679,72 +802,72 @@ class Toolkit_Contacts_Admin_EditContact
      */
     protected function contactExists($email)
     {
-               //      Check if a contact w/ the submitted email already exists.
-               //      if so, then we need to update, if not then do a fresh insert.
-               try {
-                       $sql = "
-                               SELECT count(*) AS count
-                                 FROM {$this->tableName}
-                                WHERE email   = :email";
-
-                       $stmt = $this->dbh->prepare($sql);
-                       $stmt->bindParam(':email', $email, PDO::PARAM_STR);
-                       $stmt->execute();
-                       $stmt->bindColumn('count', $contactExists);
-                       $stmt->fetch();
+        //  Check if a contact w/ the submitted email already exists.
+        //  if so, then we need to update, if not then do a fresh insert.
+        try {
+            $sql = "
+                SELECT count(*) AS count
+                  FROM {$this->tableName}
+                 WHERE email   = :email";
+
+            $stmt = $this->dbh->prepare($sql);
+            $stmt->bindParam(':email', $email, PDO::PARAM_STR);
+            $stmt->execute();
+            $stmt->bindColumn('count', $contactExists);
+            $stmt->fetch();
 
             return (bool) $contactExists;
-               } catch (PDOException $e) {
-                       return Toolkit_Common::handleError($e);
-               }
+        } catch (PDOException $e) {
+            return Toolkit_Common::handleError($e);
+        }
     }
 
     //  }}}
 
-       //      {{{     error()
+    //  {{{ error()
 
     /**
      * Display errors with the form to the user
      *
      * @param object $error PEAR Error Object
-        *
+     *
      * @return void
      * @access public
      */
-       public function error($error)
-       {
-               //      make the variables static so that is only has to do the defining
-               //      on the first call.
-               static $errorMessages;
-               static $className;
-
-               //      define the various error messages
-               if (!isset($errorMessages)) {
-                       $className     = get_class($this);
-                       $errorMessages = array(
-                               FORM_OK                      => 'No error',
-                               FORM_ERROR                   => 'Unknown error',
-                               NO_RECORD                    => 'Setting both properties (email and hasContactDB) to false in the <i>' . $className . '</i> class will result in no email record being sent and no record being inserted into the database.  There will be no record that this form was ever filled out.',
-                               INVALID_DB                   => 'Please set the property hasContactDB to a boolean value in the class <i>' . $className . '</i> before continuing',
-                               MISSING_CONSTANT     => 'You have failed to set a CONSTANT for the class <i>' . $className . '</i> to function properly',
-                               MISSING_CONTACT_TYPE => 'Please set the property contactType in the class <i>'. $className . '</i> before continuing',);
-               }
-
-               if (!is_null($error->message)) {
-                       $message = $error->message;
-               } elseif (isset($errorMessages[$error->code])) {
-                       $message = $errorMessages[$error->code];
-               } else {
-                       $message = $errorMessages[$error->code];
-                       $message = $errorMessages[FORM_ERROR];
-               }
-
-               echo "<div id=\"form-warning-top\">{$message}</div>";
-       }
-
-       //      }}}
-
-       //      {{{     getInterestFields()
+    public function error($error)
+    {
+        //  make the variables static so that is only has to do the defining
+        //  on the first call.
+        static $errorMessages;
+        static $className;
+
+        //  define the various error messages
+        if (!isset($errorMessages)) {
+            $className     = get_class($this);
+            $errorMessages = array(
+                FORM_OK              => 'No error',
+                FORM_ERROR           => 'Unknown error',
+                NO_RECORD            => 'Setting both properties (email and hasContactDB) to false in the <i>' . $className . '</i> class will result in no email record being sent and no record being inserted into the database.  There will be no record that this form was ever filled out.',
+                INVALID_DB           => 'Please set the property hasContactDB to a boolean value in the class <i>' . $className . '</i> before continuing',
+                MISSING_CONSTANT     => 'You have failed to set a CONSTANT for the class <i>' . $className . '</i> to function properly',
+                MISSING_CONTACT_TYPE => 'Please set the property contactType in the class <i>'. $className . '</i> before continuing',);
+        }
+
+        if (!is_null($error->message)) {
+            $message = $error->message;
+        } elseif (isset($errorMessages[$error->code])) {
+            $message = $errorMessages[$error->code];
+        } else {
+            $message = $errorMessages[$error->code];
+            $message = $errorMessages[FORM_ERROR];
+        }
+
+        echo "<div id=\"form-warning-top\">{$message}</div>";
+    }
+
+    //  }}}
+
+    //  {{{ getInterestFields()
 
     /**
      * Returns the field definitions of the contact db interest fields
@@ -752,9 +875,9 @@ class Toolkit_Contacts_Admin_EditContact
      * @return array     Group definitions for the interest fields
      * @access protected
      */
-       protected function getInterestFields()
-       {
-               if (is_array($this->inquiries)) {
+    protected function getInterestFields()
+    {
+        if (is_array($this->inquiries)) {
             foreach ($this->inquiries as $group => $data) {
                 foreach ($data as $k => $v) {
                     $interests[$group][] = array(
@@ -764,34 +887,34 @@ class Toolkit_Contacts_Admin_EditContact
                          'opts' => $v
                      );
                 }
-                       }
-               }
+            }
+        }
 
-               return $interests;
-       }
+        return $interests;
+    }
 
-       //      }}}
+    //  }}}
 
-       //      {{{     processData()
+    //  {{{ processData()
 
     /**
      * Handles how to process the form when submitted
      *
      * @param array $values Form submitted values
-        *
+     *
      * @return array     Result of Insert / Update function
      * @access protected
      */
-       public function processData($values)
-       {
-               //      Form data used for the insert/update sql queries and
-               //      the form email.
-               $e = array(
-                       'user_agent',
-                       'remote_addr',
-                       'contact_type',
-               );
-               $this->setFormData($e);
+    public function processData($values)
+    {
+        //  Form data used for the insert/update sql queries and
+        //  the form email.
+        $e = array(
+            'user_agent',
+            'remote_addr',
+            'contact_type',
+        );
+        $this->setFormData($e);
         $this->start = $values['start'];
         unset($values['start']);
         //  Get rid of any elements in the values array that
@@ -818,11 +941,11 @@ class Toolkit_Contacts_Admin_EditContact
             $values['contact_type'] = '';
         }
 
-               if ($isUpdate) {
+        if ($isUpdate) {
             $this->Action = 'Contact Updated';
-               } else {
+        } else {
             $this->Action = 'Contact Added';
-               }
+        }
         $values['create_date'] = date('m/d/Y');
         // build a contact or customer class object with the values from
         // the Contact form
@@ -845,9 +968,9 @@ class Toolkit_Contacts_Admin_EditContact
 
         $contact->save($this->dbh, false);
         return true;
-       }
+    }
 
-       //      }}}
+    //  }}}
     // {{{ setConfig()
     /**
      * setConfig
@@ -861,7 +984,7 @@ class Toolkit_Contacts_Admin_EditContact
     {
         $this->config = $c;
     }// }}}
-       //      {{{     setInterestFields()
+    //  {{{ setInterestFields()
 
     /**
      * Contact DB interests
@@ -869,26 +992,26 @@ class Toolkit_Contacts_Admin_EditContact
      * @return void
      * @access protected
      */
-       protected function setInterestFields()
-       {
-               try {
-                       $sql = "
+    protected function setInterestFields()
+    {
+        try {
+            $sql = "
                 SELECT contact_inq.*, inq_group.name
                   FROM contact_inq LEFT OUTER JOIN inq_group ON (contact_inq.groupid = inq_group.id)
                  ORDER BY groupid, pos";
 
             $i = array();
-                       foreach ($this->dbh->query($sql) as $row) {
-                               $i[$row['name']][$row['id']] = $row['header'];
-                       }
+            foreach ($this->dbh->query($sql) as $row) {
+                $i[$row['name']][$row['id']] = $row['header'];
+            }
 
-                       $this->inquiries = $i;
-               } catch (PDOException $e) {
-                       Toolkit_Common::handleError($e);
-               }
-       }
+            $this->inquiries = $i;
+        } catch (PDOException $e) {
+            Toolkit_Common::handleError($e);
+        }
+    }
 
-       //      }}}
+    //  }}}
     // {{{ setPrimaryKey()
     /**
      * setPrimaryKey
@@ -916,7 +1039,7 @@ class Toolkit_Contacts_Admin_EditContact
         $this->tableName = $tableName;
     }// }}}
 
-       //      {{{     setupRenderers()
+    //  {{{ setupRenderers()
     //  @codeCoverageIgnoreStart
 
     /**
@@ -925,17 +1048,17 @@ class Toolkit_Contacts_Admin_EditContact
      * @return void
      * @access protected
      */
-       protected function setupRenderers()
-       {
-               parent::setupRenderers();
-               $renderer =& $this->defaultRenderer();
-               $required = '<!-- BEGIN required -->
+    protected function setupRenderers()
+    {
+        parent::setupRenderers();
+        $renderer =& $this->defaultRenderer();
+        $required = '<!-- BEGIN required -->
             <span class="req"> * </span>
             <!-- END required -->';
-               $error    = '<!-- BEGIN error -->
+        $error    = '<!-- BEGIN error -->
             <div class="req"> {error} </div>
             <!-- END error -->';
-               $renderer->setElementTemplate(
+        $renderer->setElementTemplate(
             '<tr>
                <td colspan="2" class="fieldcell checkbox">
                '.$required.'{label}'.$error.'{element}
@@ -953,7 +1076,7 @@ class Toolkit_Contacts_Admin_EditContact
                     '{element}',
                     'interest['.$group.']'
                 );
-                       $renderer->setElementTemplate(
+                $renderer->setElementTemplate(
                     '<tr>
                        <td colspan="2">'.$required.'{label}'.$error.'{element}
                        </td>
@@ -962,11 +1085,11 @@ class Toolkit_Contacts_Admin_EditContact
                  );
             }
         }
-               $renderer->setElementTemplate(
+        $renderer->setElementTemplate(
             '<tr><td colspan="2">'.$required.'{label}'.$error.'{element}</td></tr>',
             'comments'
         );
-               $renderer->setElementTemplate(
+        $renderer->setElementTemplate(
             '<tr align="center">
                 <td colspan="2">'.$required.'{label}'.$error.'{element}
                     </td>
@@ -974,7 +1097,7 @@ class Toolkit_Contacts_Admin_EditContact
             'submit'
         );
 
-               $renderer->setElementTemplate(
+        $renderer->setElementTemplate(
             '<tr>
                <td class="labelcell">
                  <label>{label}</label>
@@ -984,7 +1107,7 @@ class Toolkit_Contacts_Admin_EditContact
                </td>
              </tr>',
             'captcha_question');
-               $renderer->setElementTemplate(
+        $renderer->setElementTemplate(
             '<tr>
                 <td class="labelcell">
                   '.$required.'<label>{label}</label>
@@ -999,42 +1122,42 @@ class Toolkit_Contacts_Admin_EditContact
               </tr>',
             'captcha_rmv'
         );
-       }
+    }
 
     //  @codeCoverageIgnoreEnd
-       //      }}}
-       //      {{{     toHtml()
+    //  }}}
+    //  {{{ toHtml()
 
     /**
      * Handles how to display the current step the user is at in the form
      *
-        * destroying and resetting the captcha value dis-allows someone from
-        * re-sending a form on a previous captcha.
-        *
+     * destroying and resetting the captcha value dis-allows someone from
+     * re-sending a form on a previous captcha.
+     *
      * @return string form HTML state
      * @access public
      */
-       public function toHtml()
-       {
-               $this->setupRenderers();
-               if ($this->validate()) {
-                       $this->cleanForm();
-                       if ($this->process(array(&$this, 'processData'), $this->mergeFiles)) {
-                               $this->freeze();
-                               $output = $this->successMsg;
+    public function toHtml()
+    {
+        $this->setupRenderers();
+        if ($this->validate()) {
+            $this->cleanForm();
+            if ($this->process(array(&$this, 'processData'), $this->mergeFiles)) {
+                $this->freeze();
+                $output = $this->successMsg;
                 header("Location: list_contact.phtml?back=1&start="
                     . $this->start . "&Action=" . $this->Action);
                 exit;
-                       }
-               } elseif ($this->isSubmitted()) {
-                       $output  = $this->errorMsg;
-                       $output .= parent::toHTML();
-               } else {
-                       $output = parent::toHTML();
-               }
-               return $output;
-       }
-
-       //      }}}
+            }
+        } elseif ($this->isSubmitted()) {
+            $output  = $this->errorMsg;
+            $output .= parent::toHTML();
+        } else {
+            $output = parent::toHTML();
+        }
+        return $output;
+    }
+
+    //  }}}
 
 }
index 5a52256..5cc2b6f 100755 (executable)
@@ -524,20 +524,20 @@ class Toolkit_Contacts_ContactUs
                 );
             }
         }
-        if (is_array($this->interestsGroups)) {
-            foreach ($this->interestsGroups as $group => $gData) {
-                $this->myGroups[] = $gData;
-                $e[] = array(
-                    'type'       => 'group',
-                    'req'        => false,
-                    'name'       => 'interest['.$group.']',
-                    'group'         => $gData,
-                    'label'      => $group,
-                    'seperator'  => ' ',
-                    'appendName' => true
-                );
-            }
-        }
+//        if (is_array($this->interestsGroups)) {
+//            foreach ($this->interestsGroups as $group => $gData) {
+//                $this->myGroups[] = $gData;
+//                $e[] = array(
+//                    'type'       => 'group',
+//                    'req'        => false,
+//                    'name'       => 'interest['.$group.']',
+//                    'group'         => $gData,
+//                    'label'      => $group,
+//                    'seperator'  => ' ',
+//                    'appendName' => true
+//                );
+//            }
+//        }
         $e[] = array(
             'type'    => 'CAPTCHA_Image',
             'req'     => false,
index d1d8493..483ed65 100644 (file)
@@ -43,6 +43,21 @@ class Toolkit_LeadManager_Contact
     private $_discover;
     private $_password;
     private $_verify_password;
+    private $_arrival;
+    private $_departure;
+    private $_golfers;
+    private $_nongolfers;
+    private $_lodging;
+    private $_couples;
+    private $_singles;
+    private $_bathrooms;
+    private $_rooms;
+    private $_beds;
+    private $_twinok;
+    private $_sleepersofaok;
+    private $_alt_phone;
+    private $_pquote_create_date;
+    private $_pquote;
 
     /**
      * Contructor for class Contact Objects
@@ -61,7 +76,21 @@ class Toolkit_LeadManager_Contact
             ->setMembers($members)
             ->setMemberOk($member_ok)
             ->setPassword($password)
-            ->setVerifyPassword($verify_password);
+            ->setVerifyPassword($verify_password)
+            ->setArrival($arrival)
+            ->setDeparture($departure)
+            ->setGolfers($golfers)
+            ->setNongolfers($nongolfers)
+            ->setLodging($lodging)
+            ->setCouples($couples)
+            ->setSingles($singles)
+            ->setBathrooms($bathrooms)
+            ->setBeds($beds)
+            ->setTwinok($twinok)
+            ->setSleepersofaok($sleepersofaok)
+            ->setAltPhone($alt_phone)
+            ->setPquoteCreateDate($pquote_create_date)
+            ->setPquote($pquote);
         if ($id) {
             $this->setId($id);
         }
@@ -309,6 +338,172 @@ class Toolkit_LeadManager_Contact
     public function setVerifyPassword($verifyPassword)
     {
         $this->_verify_password = $verifyPassword;
+        return $this;
+    }
+
+    public function getArrival()
+    {
+        return $this->_arrival;
+    }
+
+    public function getDeparture()
+    {
+        return $this->_departure;
+    }
+
+    public function getGolfers()
+    {
+        return $this->_golfers;
+    }
+
+    public function getNongolfers()
+    {
+        return $this->_nongolfers;
+    }
+
+    public function getLodging()
+    {
+        return $this->_lodging;
+    }
+
+    public function getCouples()
+    {
+        return $this->_couples;
+    }
+
+    public function getSingles()
+    {
+        return $this->_singles;
+    }
+
+    public function getBathrooms()
+    {
+        return $this->_bathrooms;
+    }
+
+    public function getRooms()
+    {
+        return $this->_rooms;
+    }
+
+    public function getBeds()
+    {
+        return $this->_beds;
+    }
+
+    public function getTwinok()
+    {
+        return $this->_twinok;
+    }
+
+    public function getSleepersofaok()
+    {
+        return $this->_sleepersofaok;
+    }
+
+    public function getAltPhone()
+    {
+        return $this->_alt_phone;
+    }
+
+    public function getPquoteCreateDate()
+    {
+        return $this->_pquote_create_date;
+    }
+
+    public function getPquote()
+    {
+        return $this->_pquote;
+    }
+
+    public function setArrival($arrival)
+    {
+        $this->_arrival = $arrival;
+        return $this;
+    }
+
+    public function setDeparture($departure)
+    {
+        $this->_departure = $departure;
+        return $this;
+    }
+
+    public function setGolfers($golfers)
+    {
+        $this->_golfers = (int)$golfers;
+        return $this;
+    }
+
+    public function setNongolfers($nongolfers)
+    {
+        $this->_nongolfers = (int)$nongolfers;
+        return $this;
+    }
+
+    public function setLodging($lodging)
+    {
+        $this->_lodging = $lodging;
+        return $this;
+    }
+
+    public function setCouples($couples)
+    {
+        $this->_couples = (int)$couples;
+        return $this;
+    }
+
+    public function setSingles($singles)
+    {
+        $this->_singles = (int)$singles;
+        return $this;
+    }
+
+    public function setBathrooms($bathrooms)
+    {
+        $this->_bathrooms = (int)$bathrooms;
+        return $this;
+    }
+
+    public function setRooms($rooms)
+    {
+        $this->_rooms = (int)$rooms;
+        return $this;
+    }
+
+    public function setBeds($beds)
+    {
+        $this->_beds = (int)$beds;
+        return $this;
+    }
+
+    public function setTwinok($twinok)
+    {
+        $this->_twinok = (bool)$twinok;
+        return $this;
+    }
+
+    public function setSleepersofaok($sleepersofaok)
+    {
+        $this->_sleepersofaok = (bool)$sleepersofaok;
+        return $this;
+    }
+
+    public function setAltPhone($alt_phone)
+    {
+        $this->_alt_phone = $alt_phone;
+        return $this;
+    }
+
+    public function setPquoteCreateDate($pquote_create_date)
+    {
+        $this->_pquote_create_date = $pquote_create_date;
+        return $this;
+    }
+
+    public function setPquote($pquote)
+    {
+        $this->_pquote = (bool)$pquote;
+        return $this;
     }
 
 
index 39ad2a8..943b553 100755 (executable)
@@ -449,7 +449,7 @@ if (TABLE == 'customer') {
 }
 $lodging = array(
     '' => "Don't Care",
-    'Trout Creek Condominiums' => 'Trout Creek Condominiumns',
+    'Trout Creek Condominiums' => 'Trout Creek Condominiums',
     'Hamlet Village Condominiums' => 'Hamlet Village Condominiums'
 );
 $DB_fields[] = array("name" => "city",          "title" => "City",          "type" => "text");
index 705e836..7411872 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if ($catid = filter_input(INPUT_GET, 'catid', FILTER_VALIDATE_INT)) {
-       $cf = new Toolkit_Contacts_ContactUs(
+       $cf = new Toolkit_Contacts_ENewsSignup(
                Toolkit_Database::getInstance(),
                'contact_form',
                'post',