setSubmitButton('Send'); $form->setupDatabase('localhost','carolinabeachdata','capefearforms','!cape!fear!','tourguide'); $form->setupEmail('mwall@capefearcoast.com','mwall@capefearcoast.com','Carolina Beach - Group Tour Guide Request',true); // When completed, redirect the user or say a message? $form->setRedirect('/secondary/thankyou.html'); //$form->setThankYouText('Thank you!'); // Optional - add the current date/time to the database row $form->addDateColumn('Date'); $form->addField(array( 'name' => 'subject', 'type' => 'hidden', 'defaultValue' => 'Carolina Beach - Group Tour Guide Request' )); $form->addField(array( 'name' => 'picvb', 'type' => 'hidden', 'defaultValue' => 'T', 'columnName' => 'PICVB' )); $form->addField(array( 'name' => 'first_name', 'label' => '*First Name:', 'type' => 'text', 'errorMessage' => 'Please enter your first name.', 'required' => true, 'defaultValue' => '', 'columnName' => 'FirstName' )); $form->addField(array( 'name' => 'last_name', 'label' => '*Last Name:', 'type' => 'text', 'errorMessage' => 'Please enter your last name.', 'required' => true, 'defaultValue' => '', 'columnName' => 'LastName' )); $form->addField(array( 'name' => 'title', 'label' => '*Title:', 'type' => 'text', 'errorMessage' => 'Please enter your title.', 'required' => true, 'defaultValue' => '', 'columnName' => 'Title' )); $form->addField(array( 'name' => 'organization', 'label' => '*Organization:', 'type' => 'text', 'errorMessage' => 'Please enter your organization name.', 'required' => true, 'defaultValue' => '', 'columnName' => 'Organization' )); $form->addField(array( 'name' => 'address', 'label' => '*Mailing Address:', 'type' => 'text', 'errorMessage' => 'Please enter your mailing address.', 'required' => true, 'defaultValue' => '', 'columnName' => 'Address' )); $form->addField(array( 'name' => 'city', 'label' => '*City:', 'type' => 'text', 'errorMessage' => 'Please enter your city.', 'required' => true, 'defaultValue' => '', 'columnName' => 'City' )); $form->addField(array( 'name' => 'state', 'label' => '*State or Province:', 'type' => 'text', 'errorMessage' => 'Please enter your state or province.', 'required' => true, 'defaultValue' => '', 'columnName' => 'State' )); $form->addField(array( 'name' => 'country', 'label' => '*Country:', 'type' => 'text', 'errorMessage' => 'Please enter your country.', 'required' => true, 'defaultValue' => '', 'columnName' => 'Country' )); $form->addField(array( 'name' => 'zip', 'label' => '*Zip:', 'type' => 'text', 'errorMessage' => 'Please enter your zip code.', 'required' => true, 'defaultValue' => '', 'size' => '8', 'columnName' => 'Zip' )); $form->addField(array( 'name' => 'phone', 'label' => '*Phone:', 'type' => 'text', 'errorMessage' => 'Please enter your phone number.', 'required' => true, 'defaultValue' => '', 'size' => '10', 'columnName' => 'Phone' )); $form->addField(array( 'name' => 'fax', 'label' => 'Fax:', 'type' => 'text', 'errorMessage' => 'Please enter your fax number.', 'defaultValue' => '', 'size' => '10', 'columnName' => 'Fax' )); $form->addField(array( 'name' => 'email', 'type' => 'text', 'label' => '*Email:', 'errorMessage' => 'Please enter a valid email address.', 'required' => true, 'validate' => 'Email' )); $form->addField(array( 'name' => 'group_name', 'label' => '*Group Name:', 'type' => 'text', 'errorMessage' => 'Please enter your group name.', 'required' => true, 'defaultValue' => '', 'columnName' => 'GroupName' )); $form->addField(array( 'name' => 'number_of_people', 'label' => '*Estimated number of people:', 'type' => 'text', 'errorMessage' => 'Please enter the estimated number of people in your group.', 'required' => true, 'defaultValue' => '', 'size' => '5', 'columnName' => 'NumPeople' )); $form->addField(array( 'name' => 'number_of_rooms', 'label' => '*Estimated number of rooms required:', 'type' => 'text', 'errorMessage' => 'Please enter the estimated number of rooms needed.', 'required' => true, 'defaultValue' => '', 'size' => '5', 'columnName' => 'NumRooms' )); $form->addField(array( 'name' => 'dates', 'label' => '*Dates:', 'type' => 'text', 'errorMessage' => 'Please enter the dates of your visit.', 'required' => true, 'defaultValue' => '', 'columnName' => 'Dates' )); $form->addField(array( 'name' => 'special_interests', 'type' => 'textarea', 'label' => 'Special Interests:', 'defaultValue' => '', 'cols' => '30', 'rows' => '5', 'columnName' => 'SpecialInterests', 'validate' => 'spam', 'errorMessage' => 'Please don\'t type any of the following text in the Special Interests box: "cc:", "multipart", "[url", "Content-Type:", or "href".' )); $form->addField(array( 'name' => 'lead_request_html', 'type' => 'html', 'defaultValue' => '
Would you like the CVB to send a lead request to our area accommodations to obtain rate information? The Cape Fear Coast Convention & Visitors Bureau will send your request only to those properties and facilities that merit the criteria listed.
' )); $form->addField(array( 'name' => 'lead_request', 'type' => 'radio', 'label' => '', 'options' => array('y' => 'Yes', 'n' => 'No'), 'columnName' => 'LeadRequest' )); $form->addField(array( 'name' => 'what_info_html', 'type' => 'html', 'defaultValue' => 'What information would you like?
' )); $form->groupFieldsIntoDatabaseColumn(array('group_tour_planner_guide','color_slides','cd_rom','video'), 'Info'); $form->addField(array( 'name' => 'group_tour_planner_guide', 'type' => 'checkbox', 'defaultValue' => 'F', 'label' => 'Group Tour Planner Guide' )); $form->addField(array( 'name' => 'color_slides', 'type' => 'checkbox', 'defaultValue' => 'F', 'label' => 'Color Slides' )); $form->addField(array( 'name' => 'cd_rom', 'type' => 'checkbox', 'defaultValue' => 'F', 'label' => 'CD ROM' )); $form->addField(array( 'name' => 'video', 'type' => 'checkbox', 'defaultValue' => 'F', 'label' => 'Video' )); $form->addField(array( 'name' => 'find_out', 'type' => 'textarea', 'label' => 'How did you find out about the CVB website?', 'defaultValue' => '', 'cols' => '30', 'rows' => '5', 'columnName' => 'ReferredBy', 'validate' => 'spam', 'errorMessage' => 'Please don\'t type any of the following text in the "How did you find out about the CFB website?" box: "cc:", "multipart", "[url", "Content-Type:", or "href".' )); // Spam protection $form->addField(array( 'name' => 'second', 'type' => 'text', 'label' => 'Leave this box blank!', 'validate' => 'blank', 'defaultValue' => '', 'errorMessage' => 'Please do not enter anything where the form says, "Leave this box blank!"' )); $form->init(); // Load the CMS Template define('TEMP_DIR', realpath('../../phpapps/tmp/') . '/'); $loader = new CMS_Template_Loader('group_tour_guide', 'http://' . $_SERVER['HTTP_HOST'] . '/groups/_request-group-tour-guide', 1800); $loader->set('', '=$content ?>'); $loader->load(); $tpl =& new Template(TEMP_DIR); $tpl->set('content', $form->getDisplayString()); echo $tpl->display('_cms_template_group_tour_guide.tpl.php'); ?>