From: Steve Sutton Date: Thu, 5 May 2016 16:30:01 +0000 (-0400) Subject: Add new form X-Git-Tag: v1.5^2^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=fecd33a0c4223c03f0cd7bfd2020665a76db7977;p=web%2FGaylordGolfMecca.git Add new form Add new contact type 9 setup new field for last_access (date) --- diff --git a/NOTES.md b/NOTES.md new file mode 100644 index 0000000..41e4249 --- /dev/null +++ b/NOTES.md @@ -0,0 +1,23 @@ +# Gaylord Golf Mecca Task Notes + +## New form for Win A Round + +### Use the form from page 17 (static) + +1 Remove all fields below "comments" +2 Add new Contact Type: Win A Round +3 Date stamp the entries with last access date (not create date) +4 Send automatically to Communicator account with Double Opt-In +5 Setup a toolbox page for the form. Create Custom URL as the following: +gaylordgolfmecca.com/winaround + +Client wants this page accessible via link only. Cannot be placed live on website. + +Copy the form Toolkit_Contacts_GolfGiveaway +call it WinARound +setup new contact type 9 +This can be done in Toolkit/Contact/config.ini under the +[contact_types] part. + +Will have to add a new field to the contact table called last_access_date + diff --git a/Toolkit/Contacts/Database/addLastAccess.sql b/Toolkit/Contacts/Database/addLastAccess.sql new file mode 100644 index 0000000..c8972bc --- /dev/null +++ b/Toolkit/Contacts/Database/addLastAccess.sql @@ -0,0 +1,6 @@ +-- +-- adding new date +-- + +ALTER TABLE contacts.contact ADD last_access DATE; +UPDATE contacts.contact SET last_access = create_date; diff --git a/Toolkit/Contacts/WinARound.php b/Toolkit/Contacts/WinARound.php new file mode 100755 index 0000000..6c816bf --- /dev/null +++ b/Toolkit/Contacts/WinARound.php @@ -0,0 +1,343 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version CVS: $Id: ContactUs.php,v 1.36 2010/07/14 23:33:15 jamie Exp $ + * @link http://demo.gaslightmedia.com + */ + +/** + * Error codes for Toolkit_Contacts_ContactUs + * + * Codes are mapped to textual messaged by errorMessage() method, + * if you add a new code be sure to add a new message for it to errorMessage() + * + * @see Toolkit_Contacts_ContactUs::errorMessage() + */ + +/** + * GLM Contact Us form + * + * This form handles rendering and processing the contact us form. + * Controls the email functionality of the form, whether the client + * has a contact DB to store contact records and how to insert/update + * submitted form values. + * + * @category Toolkit + * @package Contacts + * @author Jamie Kahgee + * @copyright 2009 Jamie Kahgee + * @license http://www.gaslightmedia.com Gaslightmedia + * @link http://demo.gaslightmedia.com + * @see Toolkit_FormBuilder + */ +class Toolkit_Contacts_WinARound + extends Toolkit_Contacts_ContactUs +{ + /** + * Contact type to be inserted into the DB as when the form is submitted + * + * This property is only valid when the [hasContactDB] property is set + * to true. + * + * N.B. + * If you subclass this class out to other forms that are + * inserted into the contact db, be sure to make each one of their + * contactType properties unique. We don't check for duplicates. + * + * @var string + * @access protected + */ + protected $contactType = '9'; + /** + * Message to display if the form is successfully submitted + * + * @var string + * @access protected + */ + protected $successMsg = ' + +
+ Thank you for entering to win the Gaylord Golf Mecca "Win A Round"! +
'; + /** + * Email subject and

header in email + * + * It gets set in the constructor if you leave empty here, but you + * can set it to something different here to override that if you desire. + * + * @var string + * @access protected + */ + public $subject = "New Entry for Golf Giveaway"; + + /** + * Class constructor + * + * @param object $pdo PHP Data Object + * @param string $formName Form's name. + * @param string $method (optional)Form's method defaults to 'POST' + * @param string $action (optional)Form's action + * @param string $target (optional)Form's target defaults to '_self' + * @param mixed $attributes (optional)Extra attributes for
tag + * @param bool $trackSubmit (optional)Whether to track if the form was + * submitted by adding a special hidden field + * + * @author Jamie Kahgee + * @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', + $action = '', + $target = '', + $attributes = null, + $trackSubmit = false + ) { + parent::__construct( + $pdo, + $formName, + $method, + $action, + $target, + $attributes, + $trackSubmit + ); + $this->email = OWNER_EMAIL; + } + // {{{ configureElements() + + /** + * Form element definitions + * + * @return void + * @access public + */ + public function configureElements() + { + $e = array(); + $config = parse_ini_file('config.ini', true); + $referredBy = $config['referred_by']; + $gender = $config['gender']; + $age = $config['age']; + $handicap = $config['handicap']; + $howMany = $config['how_many']; + $grpHowMany = $config['group_how_many']; + $roundYear = $config['round_year']; + + if ($this->hasContactDB) { + $this->setInterestFields(); + // Grouped Elements are defined here. + $this->interestsGroups =& $this->getInterestFields(); + } + + // All Elements are created here. This includes group element definitions. + $e[] = array( + 'type' => 'hidden', + 'req' => false, + 'name' => 'user_agent' + ); + $e[] = array( + 'type' => 'hidden', + 'req' => false, + 'name' => 'remote_addr' + ); + $e[] = array( + 'type' => 'header', + 'name' => 'firstHdr_rmv', + 'display' => '' + ); + $e[] = array( + 'type' => 'text', + 'req' => true, + 'name' => 'fname', + 'display' => 'First Name' + ); + $e[] = array( + 'type' => 'text', + 'req' => true, + 'name' => 'lname', + 'display' => 'Last Name' + ); + if ($this->tableName == 'customer') { + $add1 = 'add1'; + $add2 = 'add2'; + } else { + $add1 = 'address'; + $add2 = 'address2'; + } + $e[] = array( + 'type' => 'text', + 'req' => true, + 'name' => $add1, + 'display' => 'Address 1' + ); + $e[] = array( + 'type' => 'text', + 'req' => false, + 'name' => $add2, + 'display' => 'Address 2' + ); + $e[] = array( + 'type' => 'text', + 'req' => true, + 'name' => 'city', + 'display' => 'City' + ); + $e[] = array( + 'type' => 'select', + 'req' => true, + 'name' => 'state', + 'display' => 'State/Province', + 'opts' => $GLOBALS['states'] + ); + $e[] = array( + 'type' => 'text', + 'req' => true, + 'name' => 'zip', + 'display' => 'ZIP/Postal Code' + ); + $e[] = array( + 'type' => 'tel', + 'req' => false, + 'name' => 'phone', + 'display' => 'Telephone number' + ); + $e[] = array( + 'type' => 'tel', + 'req' => false, + 'name' => 'fax', + 'display' => 'Fax number' + ); + $e[] = array( + 'type' => 'email', + 'req' => true, + 'name' => 'email', + 'display' => 'E-mail' + ); + $e[] = array( + 'type' => 'email', + 'req' => true, + 'name' => 'email_rmv', + 'display' => 'Verify E-mail' + ); + $e[] = array( + 'type' => 'select', + 'req' => false, + 'name' => 'gender', + 'display' => 'Gender', + 'opts' => $gender + ); + $e[] = array( + 'type' => 'select', + 'req' => false, + 'name' => 'age', + 'display' => 'Age', + 'opts' => $age + ); + $e[] = array( + 'type' => 'static', + 'name' => 'sendHdr_rmv', + 'display' => 'Please send me information on the following' + ); + $e[] = array( + 'type' => 'advcheckbox', + 'req' => false, + 'name' => 'mail_ok', + 'display' => '', + 'opts' => 'Yes, it is ok to send me email?', + 'val' => array(0, 1) + ); + $e[] = array( + 'type' => 'advcheckbox', + 'req' => false, + 'name' => 'giveaway', + 'display' => '', + 'opts' => 'Yes, Register me to WIN the Gaylord Golf Giveaway!', + 'val' => array(0, 1) + ); + $e[] = array( + 'type' => 'advcheckbox', + 'req' => false, + 'name' => 'eclub', + 'display' => '', + 'opts' => 'Yes, I would like to sign up for the Gaylord Golf Mecca E-club', + 'val' => array(0, 1) + ); + $e[] = array( + 'type' => 'advcheckbox', + 'req' => false, + 'name' => 'members', + 'display' => '', + 'opts' => 'Yes, I would like to receive information from any of your members', + 'val' => array(0, 1) + ); + $e[] = array( + 'type' => 'textarea', + 'req' => false, + 'name' => 'comments', + 'display' => 'Comments or Questions' + ); + $e[] = array( + 'type' => 'CAPTCHA_Image', + 'req' => false, + 'name' => 'captcha_question', + 'display' => 'Verification code', + 'opts' => $this->captchaOptions + ); + $e[] = array( + 'type' => 'text', + 'req' => true, + 'name' => 'captcha_rmv', + 'display' => 'Enter verification code' + ); + $e[] = array( + 'type' => 'submit', + 'req' => false, + 'name' => 'submit_rmv', + 'display' => 'Submit Form', + 'opts' => array('class' => 'button') + ); + + $this->setupElements($e); + } + + // }}} + /** + * confirmation + * + * Send out the Confirmation email with subject and using template + * + * @access public + * @return void + */ + public function confirmation() + { + return false; + /* + + $email = $this->getSubmitValue('email'); + if (GLM_TOOLBOX::valid_email($email)) { + $this->sendConfirmation( + $email, // Email to + 'Win A Round', // Email Subject + 'giveawayConfEmail.tpl' // Email Template File + ); + } + */ + } +} diff --git a/Toolkit/Page.php b/Toolkit/Page.php index 93f34c9..b235782 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -734,6 +734,9 @@ class Toolkit_Page $lv2 = $lv3 = $lv4 = 0; foreach ($c as $subId => $level) { + if ($subId == 65) { + continue; + } $getData->bindParam(':id', $subId, PDO::PARAM_INT); $getData->execute(); $subPage = $getData->fetch(PDO::FETCH_ASSOC); diff --git a/static/65.phtml b/static/65.phtml new file mode 100644 index 0000000..d672c77 --- /dev/null +++ b/static/65.phtml @@ -0,0 +1,12 @@ +configureForm(); + $cf->useCaptcha(true); + echo $cf->toHtml(); +}