From b5a65d8203838b59a1e751caf549cf33a24c98a4 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 2 Mar 2015 20:33:17 -0500 Subject: [PATCH] Update forms Adding form for the Vacation Planner. Bring in the config ini file used for options. --- Toolkit/Contacts/GolfGiveaway.php | 87 +++------- .../{VisitorGuide.php => VacationPlanner.php} | 163 +++++++++++++----- Toolkit/Contacts/cdb-form.ini | 107 ++++++++++++ Toolkit/Contacts/config.ini | 107 ++++++++++++ static/3.phtml | 12 ++ 5 files changed, 366 insertions(+), 110 deletions(-) rename Toolkit/Contacts/{VisitorGuide.php => VacationPlanner.php} (66%) mode change 100755 => 100644 create mode 100644 Toolkit/Contacts/cdb-form.ini create mode 100644 static/3.phtml diff --git a/Toolkit/Contacts/GolfGiveaway.php b/Toolkit/Contacts/GolfGiveaway.php index 2886e7d..75b5dc8 100755 --- a/Toolkit/Contacts/GolfGiveaway.php +++ b/Toolkit/Contacts/GolfGiveaway.php @@ -129,7 +129,16 @@ class Toolkit_Contacts_GolfGiveaway */ public function configureElements() { - $e = array(); + $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. @@ -231,25 +240,14 @@ class Toolkit_Contacts_GolfGiveaway 'req' => false, 'name' => 'gender', 'display' => 'Gender', - 'opts' => array( - '' => '', - 'Male' => 'Male', - 'Female' => 'Female' - ) + 'opts' => $gender ); $e[] = array( 'type' => 'select', 'req' => false, 'name' => 'age', 'display' => 'Age', - 'opts' => array( - '' => '', - '18-25' => '18-25', - '26-34' => '26-34', - '35-44' => '35-44', - '45-55' => '45-55', - 'OVER 55' => 'OVER 55' - ) + 'opts' => $age ); $e[] = array( 'type' => 'static', @@ -272,8 +270,6 @@ class Toolkit_Contacts_GolfGiveaway 'opts' => 'Yes, Register me to WIN the Gaylord Golf Giveaway!', 'val' => array(0, 1) ); - - $e[] = array( 'type' => 'advcheckbox', 'req' => false, @@ -297,59 +293,26 @@ class Toolkit_Contacts_GolfGiveaway 'display' => 'Comments or Questions' ); - $e[] = array( - 'type' => 'select', - 'req' => false, - 'name' => 'referred_by', - 'display' => 'How did you hear about the Gaylord Area?', - 'opts' => array( - '' => '', - 'golf_shows' => 'Golf Shows', - 'michigan_travel_ideas' => 'Michigan Travel Ideas', - 'michigan_golf' => 'Michigan Golf', - 'golfing_in_mich' => 'Golfing in Michigan', - 'aaa_living' => 'AAA Living', - 'ohio_golf_living' => 'Ohio-Golf Living', - 'newspaper' => 'Newspaper', - 'radio' => 'Radio', - 'postcard_mailing' => 'Postcard Mailing', - 'travel_planner' => 'Travel Planner', - 'search_engine' => 'Search Engine', - 'michigan_living' => 'Michigan Living', - 'fairways_golf_travel' => 'Fairways Golf Travel', - 'referred_by_friend' => 'Referred by Friend', - 'ohio_golf_pub' => 'Ohio Golf Publication', - 'great_lakes_golf' => 'Great Lakes Golf', - 'score_golf' => 'SCORE Golf', - 'golf_mag' => 'Golf Magazine', - 'miles_of_golf' => 'Miles of Golf' - ) + $e[] = array( + 'type' => 'select', + 'req' => false, + 'name' => 'referred_by', + 'display' => 'How did you hear about the Gaylord Area?', + 'opts' => $referredBy ); $e[] = array( 'type' => 'select', 'req' => false, 'name' => 'how_many', 'display' => 'How many golf vacations do you take per year?', - 'opts' => array( - '' => '', - '1' => '1', - '2' => '2', - '3-5' => '3-5', - '6 or more' => '6 or more' - ) + 'opts' => $howMany ); $e[] = array( 'type' => 'select', 'req' => false, 'name' => 'handicap', 'display' => 'Do you have a USGA Handicap', - 'opts' => array( - '' => '', - '6-7' => '6-7', - '8-12' => '8-12', - '13-18' => '13-18', - 'Over 18' => 'Over 18' - ) + 'opts' => $handicap ); $e[] = array( @@ -409,15 +372,7 @@ class Toolkit_Contacts_GolfGiveaway 'req' => false, 'name' => 'round_year', 'display' => 'How many rounds of golf do you play per year?', - 'opts' => array( - '' => '', - '0-10' => '0-10', - '11-20' => '11-20', - '21-30' => '21-30', - '31-40' => '31-40', - '41-50' => '41-50', - '51 or more' => '51 or more' - ) + 'opts' => $roundYear ); $e[] = array( 'type' => 'group', diff --git a/Toolkit/Contacts/VisitorGuide.php b/Toolkit/Contacts/VacationPlanner.php old mode 100755 new mode 100644 similarity index 66% rename from Toolkit/Contacts/VisitorGuide.php rename to Toolkit/Contacts/VacationPlanner.php index 2755e94..92e51dc --- a/Toolkit/Contacts/VisitorGuide.php +++ b/Toolkit/Contacts/VacationPlanner.php @@ -39,7 +39,7 @@ * @link http://demo.gaslightmedia.com * @see Toolkit_FormBuilder */ -class Toolkit_Contacts_VisitorGuide +class Toolkit_Contacts_VacationPlanner extends Toolkit_Contacts_ContactUs { /** @@ -150,6 +150,14 @@ class Toolkit_Contacts_VisitorGuide 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. @@ -222,29 +230,81 @@ class Toolkit_Contacts_VisitorGuide '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' => 'Email' + 'display' => 'E-mail' ); $e[] = array( 'type' => 'email', 'req' => true, 'name' => 'email_rmv', - 'display' => 'Verify Email' + 'display' => 'Verify E-mail' ); $e[] = array( - 'type' => 'tel', + 'type' => 'select', 'req' => false, - 'name' => 'phone', - 'display' => 'Phone' + 'name' => 'gender', + 'display' => 'Gender', + 'opts' => $gender ); $e[] = array( - 'type' => 'tel', + 'type' => 'select', 'req' => false, - 'name' => 'fax', - 'display' => 'Fax' + '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' => 'planner', + 'display' => '', + 'opts' => 'Golf Vacation Planner', + 'val' => array(0, 1) + ); + $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' => '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', @@ -252,40 +312,54 @@ class Toolkit_Contacts_VisitorGuide 'name' => 'comments', 'display' => 'Comments' ); - if ($this->hasContactDB) { - $e[] = array( - 'type' => 'advcheckbox', - 'req' => false, - 'name' => 'mail_ok', - 'display' => 'I would like to receive Email Newsletters', - 'opts' => 'Yes, ', - 'val' => array(0, 1) - ); - if (defined("MEMBERS_DB") && MEMBERS_DB) { - $e[] = array( - 'type' => 'advcheckbox', - 'req' => false, - 'name' => 'members', - 'display' => 'I would like to receive information via e-mail from '.SITENAME.' Members', - '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 - ); - } - } + $e[] = array( + 'type' => 'select', + 'req' => false, + 'name' => 'referred_by', + 'display' => 'How did you hear about the Gaylord Area?', + 'opts' => $referredBy + ); + $e[] = array( + 'type' => 'select', + 'req' => false, + 'name' => 'how_many', + 'display' => 'How many golf vacations do you take per year?', + 'opts' => $howMany + ); + $e[] = array( + 'type' => 'select', + 'req' => false, + 'name' => 'handicap', + 'display' => 'Do you have a USGA Handicap', + 'opts' => $handicap + ); + + $e[] = array( + 'type' => 'group', + 'req' => false, + 'name' => 'travel_golf_group', + 'label' => 'Have you visited Gaylord area before?', + 'seperator' => ' ', + 'appendName' => false, + 'group' => array( + array( + 'type' => 'radio', + 'name' => 'travel_golf_group', + 'display' => 'Yes', + 'opts' => '', + 'att' => 1, + 'val' => 1 + ), + array( + 'type' => 'radio', + 'name' => 'travel_golf_group', + 'display' => 'No', + 'opts' => '', + 'att' => 0, + 'val' => 0 + ) + ) + ); $e[] = array( 'type' => 'CAPTCHA_Image', 'req' => false, @@ -303,7 +377,8 @@ class Toolkit_Contacts_VisitorGuide 'type' => 'submit', 'req' => false, 'name' => 'submit_rmv', - 'display' => 'Submit Form' + 'display' => 'Submit Form', + 'opts' => array('class' => 'button') ); $this->setupElements($e); diff --git a/Toolkit/Contacts/cdb-form.ini b/Toolkit/Contacts/cdb-form.ini new file mode 100644 index 0000000..701eec5 --- /dev/null +++ b/Toolkit/Contacts/cdb-form.ini @@ -0,0 +1,107 @@ +; ini file for the setup of the How did you hear about us +; used in the contact form and the vacation guide form. +; these are comments +; Don't change the names to the left + + +[referred_by] +'NULL' = "" +golf_shows = "Golf Shows" +michigan_travel_ideas = "Michigan Travel Ideas" +michigan_golf = "Michigan Golf" +golfing_in_mich = "Golfing in Michigan" +aaa_living = "AAA Living" +ohio_golf_living = "Ohio-Golf Living" +newspaper = "Newspaper" +radio = "Radio" +postcard_mailing = "Postcard Mailing" +travel_planner = "Travel Planner" +search_engine = "Search Engine" +michigan_living = "Michigan Living" +fairways_golf_travel = "Fairways Golf Travel" +referred_by_friend = "Referred by Friend" +ohio_golf_pub = "Ohio Golf Publication" +great_lakes_golf = "Great Lakes Golf" +score_golf = "SCORE Golf" +golf_mag = "Golf Magazine" +miles_of_golf = "Miles of Golf" + +[gender] +'NULL' = "" +Male = "Male" +Female = "Female" + +[age] +'NULL' = "" +18-25 = "18-25" +26-34 = "26-34" +35-44 = "35-44" +45-55 = "45-55" +OVER 55 = "OVER 55" + +[handicap] +'NULL' = "" +6-7 = "6-7" +8-12 = "8-12" +13-18 = "13-18" +Over 18 = "Over 18" + +[how_many] +'NULL' = "" +1 = "1" +2 = "2" +3-5 = "3-5" +6+ = "6 or More" + +[group_how_many] +'NULL' = "" +1 = "1" +2 = "2" +3 = "3" +4 = "4" +5 = "5" +6 = "6" +7 = "7" +8 = "8" +9 = "9" +10 = "10" +11 = "11" +12 = "12" +13 = "13" +14 = "14" +15 = "15" +16 = "16" +17 = "17" +18 = "18" +19 = "19" +20 = "20+" + +[round_year] +'NULL' = "" +0-10 = "0-10" +11-20 = "11-20" +21-30 = "21-30" +31-40 = "31-40" +41-50 = "41-50" +51+ = "51 or more" + +[pass_type] +89 = "$89.00 Internet Special" +75 = "$75.00 AAA Member Special" +;85 = "$85 Holiday Special" + +[qty] +1 = "1" +2 = "2" +3 = "3" +4 = "4" +5 = "5" +6 = "6" +7 = "7" +8 = "8" +9 = "9" +10 = "10" + +[cc_type] +Visa = "Visa" +Mastercard = "Mastercard" diff --git a/Toolkit/Contacts/config.ini b/Toolkit/Contacts/config.ini index 5de8b18..4d10320 100644 --- a/Toolkit/Contacts/config.ini +++ b/Toolkit/Contacts/config.ini @@ -15,3 +15,110 @@ sequence = "contact_id_seq" 5 = "Great Big Gaylord Golf Giveaway" 6 = "2 for 1 Passport order" 7 = "golf Giveaway" + +; ini file for the setup of the How did you hear about us +; used in the contact form and the vacation guide form. +; these are comments +; Don't change the names to the left + +[referred_by] +'' = "" +golf_shows = "Golf Shows" +michigan_travel_ideas = "Michigan Travel Ideas" +michigan_golf = "Michigan Golf" +golfing_in_mich = "Golfing in Michigan" +aaa_living = "AAA Living" +ohio_golf_living = "Ohio-Golf Living" +newspaper = "Newspaper" +radio = "Radio" +postcard_mailing = "Postcard Mailing" +travel_planner = "Travel Planner" +search_engine = "Search Engine" +michigan_living = "Michigan Living" +fairways_golf_travel = "Fairways Golf Travel" +referred_by_friend = "Referred by Friend" +ohio_golf_pub = "Ohio Golf Publication" +great_lakes_golf = "Great Lakes Golf" +score_golf = "SCORE Golf" +golf_mag = "Golf Magazine" +miles_of_golf = "Miles of Golf" + +[gender] +'' = "" +Male = "Male" +Female = "Female" + +[age] +'' = "" +18-25 = "18-25" +26-34 = "26-34" +35-44 = "35-44" +45-55 = "45-55" +OVER 55 = "OVER 55" + +[handicap] +'' = "" +6-7 = "6-7" +8-12 = "8-12" +13-18 = "13-18" +Over 18 = "Over 18" + +[how_many] +'' = "" +1 = "1" +2 = "2" +3-5 = "3-5" +6+ = "6 or More" + +[group_how_many] +'' = "" +1 = "1" +2 = "2" +3 = "3" +4 = "4" +5 = "5" +6 = "6" +7 = "7" +8 = "8" +9 = "9" +10 = "10" +11 = "11" +12 = "12" +13 = "13" +14 = "14" +15 = "15" +16 = "16" +17 = "17" +18 = "18" +19 = "19" +20 = "20+" + +[round_year] +'' = "" +0-10 = "0-10" +11-20 = "11-20" +21-30 = "21-30" +31-40 = "31-40" +41-50 = "41-50" +51+ = "51 or more" + +[pass_type] +89 = "$89.00 Internet Special" +75 = "$75.00 AAA Member Special" +;85 = "$85 Holiday Special" + +[qty] +1 = "1" +2 = "2" +3 = "3" +4 = "4" +5 = "5" +6 = "6" +7 = "7" +8 = "8" +9 = "9" +10 = "10" + +[cc_type] +Visa = "Visa" +Mastercard = "Mastercard" diff --git a/static/3.phtml b/static/3.phtml new file mode 100644 index 0000000..e983729 --- /dev/null +++ b/static/3.phtml @@ -0,0 +1,12 @@ +configureForm(); + $cf->useCaptcha(true); + echo $cf->toHtml(); +} -- 2.17.1