Deadline: December 17, 2010"; } ?> '; } // Print a textarea function textarea($cols, $rows, $element_name, $values) { print ''; } // Print a radio button or checkbox function input_radiocheck($type, $element_name, $id, $values, $element_value) { print ''; } // Print a tag print ''; } // Print a submit button function input_submit($element_name, $label) { print ''; } // End Helper Functions ?> '< Select Title >', 'Dr.' => 'Dr.', 'Professor' => 'Professor', 'Mr.' => 'Mr.', 'Ms.' => 'Ms.', 'Mrs.' => 'Mrs.'); $hotel = array('' => '< Select Hotel >', 'Pacifica Suites' => 'Pacifica Suites', 'Holiday Inn on Calle Real' => 'Holiday Inn on Calle Real', 'Best Western South Coast Inn' => 'Best Western South Coast Inn', 'Motel 6 on Calle Real' => 'Motel 6 on Calle Real', 'N/A' => 'N/A'); // The main page logic: // - If the form is submitted, validate and then process or redisplay // - If it's not submitted, display if ($_POST['_submit_check']) { // If validate_form() returns errors, pass them to show_form() if ($form_errors = validate_form()) { show_form($form_errors); } else { // The submitted data is valid, so process it process_form(); } } else { // The form wasn't submitted, so display show_form(); } function show_form($errors = '') { // If the form is submitted, get defaults from submitted parameters if ($_POST['_submit_check']) { $defaults = $_POST; } // If errors were passed in, put them in $error_text (with HTML markup) if ($errors) { $error_text .= "
\n"; $error_text .= "

The Following Fields are Required

\n"; $error_text .= "\n"; $error_text .= "
\n"; } else { // No errors? Then $error_text is blank $error_text = ''; } // Jump out of PHP mode to make displaying all the HTML tags easier ?>

Attendee Registration Information













May we include your contact information in a pdf file to send to all attendees after the symposium?

Travel Information




Round trip transportation to UCSB from the Symposium hotels on January 7 & 8 will be provided.
Will you require transportation from Hotel to UCSB?

Attendance (meal count)

Friday, January 7

Morning
Lunch
Afternoon

Dinner (invitation only)

Saturday, January 8

Morning
Lunch

Special Diet Requests

Do you require a vegetarian meal?


Sightseeing Tour

Would you like to hear more about a special no-host tour of Santa Barbara on Friday, January 7, for people traveling with attendees?

Comments


10) { $errors[] = 'Title (maximum 10 characters)'; } // First Name if (! strlen(trim($_POST['first']))) { $errors[] = 'First Name'; } // First Name (maximum 160 characters) if (strlen(trim($_POST['first'])) > 160) { $errors[] = 'First Name (maximum 160 characters)'; } // Last Name if (! strlen(trim($_POST['last']))) { $errors[] = 'Last Name'; } // Last Name (maximum 160 characters) if (strlen(trim($_POST['last'])) > 160) { $errors[] = 'Last Name (maximum 160 characters)'; } // University / Company if (! strlen(trim($_POST['university']))) { $errors[] = 'University / Company'; } // University / Company (maximum 160 characters) if (strlen(trim($_POST['university'])) > 160) { $errors[] = 'University / Company (maximum 160 characters)'; } // Department / Division if (! strlen(trim($_POST['department']))) { $errors[] = 'Department / Division'; } // Department / Division (maximum 160 characters) if (strlen(trim($_POST['department'])) > 160) { $errors[] = 'Department / Division (maximum 160 characters)'; } // Mailing Address if (! strlen(trim($_POST['address']))) { $errors[] = 'Mailing Address'; } // Mailing Address (maximum 320 characters) if (strlen(trim($_POST['address'])) > 320) { $errors[] = 'Mailing Address (maximum 320 characters)'; } // City if (! strlen(trim($_POST['city']))) { $errors[] = 'City'; } // City (maximum 160 characters) if (strlen(trim($_POST['city'])) > 160) { $errors[] = 'City (maximum 160 characters)'; } // State / Province if (! strlen(trim($_POST['state']))) { $errors[] = 'State / Province'; } // State / Province (maximum 160 characters) if (strlen(trim($_POST['state'])) > 160) { $errors[] = 'State / Province (maximum 160 characters)'; } // Country if (! strlen(trim($_POST['country']))) { $errors[] = 'Country'; } // Country (maximum 160 characters) if (strlen(trim($_POST['country'])) > 160) { $errors[] = 'Country (maximum 160 characters)'; } // Postal / Zip Code if (! strlen(trim($_POST['zip_code']))) { $errors[] = 'Postal / Zip Code'; } // Postal / Zip Code (maximum 160 characters) if (strlen(trim($_POST['zip_code'])) > 160) { $errors[] = 'Postal / Zip Code (maximum 160 characters)'; } // Phone if (! strlen(trim($_POST['phone']))) { $errors[] = 'Phone'; } // Phone (maximum 160 characters) if (strlen(trim($_POST['phone'])) > 160) { $errors[] = 'Phone (maximum 160 characters)'; } // Email if (! strlen(trim($_POST['email']))) { $errors[] = 'Email'; } // Email (maximum 160 characters) if (strlen(trim($_POST['email'])) > 160) { $errors[] = 'Email (maximum 160 characters)'; } // May we include your contact information in a pdf file to send to all attendees after the symposium? if (! strlen(trim($_POST['contact_info']))) { $errors[] = 'May we include your contact information in a pdf file to send to all attendees after the symposium?'; } // May we include your contact information in a pdf file to send to all attendees after the symposium? (maximum 3 characters) if (strlen(trim($_POST['contact_info'])) > 3) { $errors[] = 'May we include your contact information in a pdf file to send to all attendees after the symposium? (maximum 3 characters)'; } // Which hotel are you staying? if (! strlen(trim($_POST['hotel']))) { $errors[] = 'Which hotel are you staying?'; } // Round trip transportation to UCSB from the Symposium hotels (maximum 160 characters) if (strlen(trim($_POST['hotel'])) > 160) { $errors[] = 'Which hotel are you staying? (maximum 160 characters)'; } // Arrival Date (maximum 3 characters) if (strlen(trim($_POST['arrival_date'])) > 160) { $errors[] = 'Arrival Date (maximum 160 characters)'; } // Departure Date (maximum 160 characters) if (strlen(trim($_POST['departure_date'])) > 160) { $errors[] = 'Departure Date (maximum 160 characters)'; } // Round trip transportation to UCSB from the Symposium hotels if (! strlen(trim($_POST['transportation']))) { $errors[] = 'Round trip transportation to UCSB from the Symposium hotels'; } // Round trip transportation to UCSB from the Symposium hotels (maximum 3 characters) if (strlen(trim($_POST['transportation'])) > 3) { $errors[] = 'Round trip transportation to UCSB from the Symposium hotels (maximum 3 characters)'; } // Friday, January 7 // Friday Morning, January 7 if (! strlen(trim($_POST['attendance_friday_morning']))) { $errors[] = 'Attendance Friday Morning, January 7'; } // Friday Morning, January 7 (maximum 8 characters) if (strlen(trim($_POST['attendance_friday_morning'])) > 8) { $errors[] = 'Attendance Friday Morning, January 7 (maximum 8 characters)'; } // Friday Lunch, January 7 if (! strlen(trim($_POST['attendance_friday_lunch']))) { $errors[] = 'Attendance Friday Lunch, January 7'; } // Friday Lunch, January 7 (maximum 8 characters) if (strlen(trim($_POST['attendance_friday_lunch'])) > 8) { $errors[] = 'Attendance Friday Lunch, January 7 (maximum 8 characters)'; } // Friday Afternoon, January 7 if (! strlen(trim($_POST['attendance_friday_afternoon']))) { $errors[] = 'Attendance Friday Afternoon, January 7'; } // Friday Afternoon, January 7 (maximum 8 characters) if (strlen(trim($_POST['attendance_friday_afternoon'])) > 8) { $errors[] = 'Attendance Friday Afternoon, January 7 (maximum 8 characters)'; } // Saturday, January 8 // Saturday Morning, January 8 if (! strlen(trim($_POST['attendance_saturday_morning']))) { $errors[] = 'Attendance Saturday Morning, January 8'; } // Saturday Morning, January 8 (maximum 8 characters) if (strlen(trim($_POST['attendance_saturday_morning'])) > 8) { $errors[] = 'Attendance Saturday Morning, January 8 (maximum 8 characters)'; } // Saturday Lunch, January 8 if (! strlen(trim($_POST['attendance_saturday_lunch']))) { $errors[] = 'Attendance Saturday Lunch, January 8'; } // Saturday Lunch, January 8 (maximum 8 characters) if (strlen(trim($_POST['attendance_saturday_lunch'])) > 8) { $errors[] = 'Attendance Saturday Lunch, January 8 (maximum 6 characters)'; } // Do you require a vegetarian meal? if (! strlen(trim($_POST['vegetarian']))) { $errors[] = 'Do you require a vegetarian meal?'; } // Do you require a vegetarian meal? (maximum 3 characters) if (strlen(trim($_POST['vegetarian'])) > 3) { $errors[] = 'Do you require a vegetarian meal? (maximum 3 characters)'; } // Dietary Restrictions (maximum 160 characters) if (strlen(trim($_POST['dietary_restrictions'])) > 160) { $errors[] = 'Dietary Restrictions (maximum 160 characters)'; } // Would you like to hear more about a special no-host tour of Santa Barbara on Friday, January 7, for people traveling with attendees? if (! strlen(trim($_POST['sb_tour']))) { $errors[] = 'Would you like to hear more about a special no-host tour of Santa Barbara on Friday, January 7, for people traveling with attendees?'; } // Would you like to hear more about a special no-host tour of Santa Barbara on Friday, January 7, for people traveling with attendees? (maximum 3 characters) if (strlen(trim($_POST['sb_tour'])) > 8) { $errors[] = 'Would you like to hear more about a special no-host tour of Santa Barbara on Friday, January 7, for people traveling with attendees? (maximum 8 characters)'; } // Questions / Commnents (maximum 640 characters) if (strlen(trim($_POST['commnents'])) > 640) { $errors[] = 'Questions / Commnents (maximum 640 characters)'; } // End Validation return $errors; } function process_form() { // Start $event = stripslashes($_POST['event']); // Event $year = stripslashes($_POST['year']); // Year of Event // Start print data $print_first = stripslashes(htmlentities($_POST['first'])); $print_last = stripslashes(htmlentities($_POST['last'])); // End print data // Start email data $email_person_title = stripslashes($_POST['person_title']); $email_first = stripslashes($_POST['first']); $email_last = stripslashes($_POST['last']); $email_university = stripslashes($_POST['university']); $email_department = stripslashes($_POST['department']); $email_address = stripslashes($_POST['address']); $email_city = stripslashes($_POST['city']); $email_state = stripslashes($_POST['state']); $email_country = stripslashes($_POST['country']); $email_zip_code = stripslashes($_POST['zip_code']); $email_phone = stripslashes($_POST['phone']); $email_email = stripslashes($_POST['email']); $email_contact_info = stripslashes($_POST['contact_info']); $email_hotel = stripslashes($_POST['hotel']); $email_arrival_date = stripslashes($_POST['arrival_date']); $email_departure_date = stripslashes($_POST['departure_date']); $email_transportation = stripslashes($_POST['transportation']); $email_attendance_friday_morning = stripslashes($_POST['attendance_friday_morning']); $email_attendance_friday_lunch = stripslashes($_POST['attendance_friday_lunch']); $email_attendance_friday_afternoon = stripslashes($_POST['attendance_friday_afternoon']); $email_attendance_saturday_morning = stripslashes($_POST['attendance_saturday_morning']); $email_attendance_saturday_lunch = stripslashes($_POST['attendance_saturday_lunch']); $email_vegetarian = stripslashes($_POST['vegetarian']); $email_dietary_restrictions = stripslashes($_POST['dietary_restrictions']); $email_sb_tour = stripslashes($_POST['sb_tour']); $email_comments = stripslashes($_POST['comments']); // End email data /* Start database query ********************* *********************/ require 'DB.php'; $db = DB::connect('mysql://event:Dx5SAHTTSdrFE2L7@localhost/organic-materials'); if (DB::isError($db)) { die("

\n" . "Can't connect: " . $db->getMessage() . "\n

"); } $db->setErrorHandling(PEAR_ERROR_DIE); // print a message and quit on future database errors $db->setFetchMode(DB_FETCHMODE_ASSOC); // Change the fetch mode to string-keyed arrays $unique_id = $db->nextID('people'); // Adds unique id for each row $user_id = "Wudl-".sprintf("%03s",$unique_id); // Adds unique ID which includes program name // Insert into people table $db->query('INSERT INTO people (person_title, first, last, university, department, address, city, state, country, zip_code, phone, email, contact_info, hotel, arrival_date, departure_date, transportation, attendance_friday_morning, attendance_friday_lunch, attendance_friday_afternoon, attendance_saturday_morning, attendance_saturday_lunch, vegetarian, dietary_restrictions, sb_tour, comments, event, year, user_id, unique_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)', array( $_POST['person_title'], $_POST['first'], $_POST['last'], $_POST['university'], $_POST['department'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['country'], $_POST['zip_code'], $_POST['phone'], $_POST['email'], $_POST['contact_info'], $_POST['hotel'], $_POST['arrival_date'], $_POST['departure_date'], $_POST['transportation'], $_POST['attendance_friday_morning'], $_POST['attendance_friday_lunch'], $_POST['attendance_friday_afternoon'], $_POST['attendance_saturday_morning'], $_POST['attendance_saturday_lunch'], $_POST['vegetarian'], $_POST['dietary_restrictions'], $_POST['sb_tour'], $_POST['comments'], $_POST['event'], $_POST['year'], $user_id, $unique_id )); /* End database query ********************* *********************/ // Start Mail Code $message .= "$email_first $email_last,\n Your Registration has been received. Advances in Organic Materials: A Symposium in Honor of Fred Wudl's 70th Birthday. Please print a copy of this page for your records.\n\n"; $message .= "Attendee Registration Information \n\n"; $message .= " - Name: $email_person_title $email_first $email_last \n"; $message .= " - University / Company: $email_university \n"; $message .= " - Department / Division: $email_department \n"; $message .= " - Address: $email_address \n"; $message .= " - City: $email_city \n"; $message .= " - State / Province: $email_state \n"; $message .= " - Country: $email_country \n"; $message .= " - Postal / Zip Code: $email_zip_code \n"; $message .= " - Phone: $email_phone \n"; $message .= " - Email: $email_email \n"; $message .= " - May we include your contact information in a pdf file to send to all attendees after the symposium?: $email_contact_info \n\n"; $message .= "Travel Information \n\n"; $message .= " - Which hotel are you staying?: $email_hotel \n"; $message .= " - Arrival Date: $email_arrival_date \n"; $message .= " - Departure Date: $email_departure_date \n"; $message .= " - Round trip transportation to UCSB from the Symposium hotels on January 7 & 8 will be provided. Will you require transportation from Hotel to UCSB?: $email_transportation \n\n"; $message .= "Attendance (meal count) \n\n"; $message .= " - Attendance Friday Morning, January 7: $email_attendance_friday_morning \n"; $message .= " - Attendance Friday Lunch, January 7: $email_attendance_friday_lunch \n"; $message .= " - Attendance Friday Afternoon, January 7: $email_attendance_friday_afternoon \n"; $message .= " - Attendance Saturday Morning, January 8: $email_attendance_saturday_morning \n"; $message .= " - Attendance Saturday Lunch, January 8: $email_attendance_saturday_lunch \n"; $message .= " - Do you require a vegetarian meal?: $email_vegetarian \n"; $message .= " - Dietary Restrictions: $email_dietary_restrictions \n\n"; $message .= "Sightseeing Tour \n\n"; $message .= " - Would you like to hear more about a special no-host tour of Santa Barbara on Friday, January 7, for people traveling with attendees?: $email_sb_tour \n\n"; $message .= "Questions / Comments \n\n"; $message .= " - Comments: $email_comments \n\n"; $message .= "\nMarlene Carlyle Symposium Coordinator Center for Polymers and Organic Solids Phone: (805) 893-3453 Email: wudl-symposium@chem.ucsb.edu Advances in Organic Materials Symposium 2011 January 7-8, 2011 Engineering Science Building 1001 UC Santa Barbara"; $to = "$email_email"; $subject .= "2011 Advances in Organic Materials Symposium Registration Received"; $addHdrs .= "From: wudl-symposium@chem.ucsb.edu\n"; $addHdrs .= "Reply-to: wudl-symposium@chem.ucsb.edu\n"; $addHdrs .= "Bcc: wudl-symposium@chem.ucsb.edu\n"; // Added BCC $addHdrs .= "X-Mailer: PHP/ " . phpversion() . " \n"; mail($to, $subject, $message, $addHdrs); // End mail code // Start Code Break ?>

Dear ,

Your Registration has been received.

Thank you!