// Database details. include("connectDB.php"); mysql_connect("127.0.0.1", $user, $password) or die(mysql_error()); mysql_select_db($database); virtual("../header.incl"); function notify() { $to = "lattner@apple.com,clattner@apple.com"; $subject = "LLVM Dev Meeting Session Proposal"; $body = '
'; $body .= 'Name: ' . $_POST['first'] . ' ' . $_POST['last'] . '
'; $body .= 'Organization: ' . $_POST['org'] . '
'; $body .= 'Email: ' . $_POST['email'] . '
'; $body .= 'Phone: ' . $_POST['phone'] . '
'; $body .= 'Title: ' . $_POST['title'] . '
'; $body .= "Summary: " . $_POST['summary'] . '
'; if($_POST['talkType'] == 1) $talkType = "Talk"; else if($_POST['talkType'] == 2) $talkType = "BOF"; else if($_POST['talkType'] == 3) $talkType = "Poster"; $body .= 'Type: ' . $talkType . '
'; if($_POST['min'] == 1) $min =20; else if ($_POST['min'] == 2) $min = 30; else if($_POST['min'] == 3) $min = 45; else if($_POST['min'] == 4) $min = 60; $body .= 'Min Length: ' . $min . ' minutes
'; if($_POST['max'] == 1) $max =20; else if ($_POST['max'] == 2) $max = 30; else if($_POST['max'] == 3) $max = 45; else if($_POST['max'] == 4) $max = 60; $body .= 'Max Length: ' . $max . ' minutes
'; $body .= ''; $headers = 'From: lattner@apple.com' . "\r\n"; $headers .= 'Content-Type: text/html; charset="iso-8859-1"'."\n"; mail($to, $subject, $body, $headers); } function my_escape_string(&$item, $key) { $item = mysql_real_escape_string($item); } function processForm() { array_walk($_POST, 'my_escape_string'); $sql = "INSERT into presenters (lastName, firstName, organization, email, phone, title, summary, minLength, maxLength,talkType) VALUES('$_POST[last]', '$_POST[first]', '$_POST[org]', '$_POST[email]', '$_POST[phone]', '$_POST[title]', '$_POST[summary]','$_POST[min]', '$_POST[max]', '$_POST[talkType]')"; mysql_query($sql) or die(mysql_error()); print 'Congratulations! Your talk proposal for the LLVM Developers\' Meeting has been submitted. We will contact you once the agenda has been finalized (~October 1, 2012).Please sign up for the LLVM Developers\' Meeting mailing list to receive announcements about the event.
'; notify(); } function validateForm() { $errors = array(); // First name must be set. if ($_POST['first'] == "") array_push($errors, "First name must be provided"); if ($_POST['last'] == "") { array_push($errors, "Last name must be provided"); } if ($_POST['email'] == "") array_push($errors, "Email must be provided"); if ($_POST['org'] == "") array_push($errors, "Organization must be provided"); if ($_POST['phone']=="") array_push($errors, "Phone number must be provided"); if ($_POST['talkType'] == "") array_push($errors, "Please select Talk, BOF, or Poster"); if ($_POST['title'] == "") array_push($errors, "Please provide talk title"); if ($_POST['summary'] == "") array_push($errors, "Please provide talk summary"); return $errors; } // Print single line text box. function inputText($element_name, $size, $maxLength, $values) { print ''; } // Print text area. function inputTextarea($element_name, $row, $column, $values) { print ''; } // Print radio box. function inputRadiocheck($element_name, $values, $element_value) { print ''; } // Specific to our length drop down list. function inputList($name, $values) { print ''; } function showForm($errors) { if($errors) { print ''; print 'Errors:
'; print'