[insert_php] global $wpdb; if(!isset($_GET[‘event’])){ echo ‘‘; } $eventID = $_GET[‘event’]; $warningText = “”; $successText = “”; $event = getEventByEventID($_POST[‘eventID’]); if($event){ $email = $_POST[’emailField’]; $firstName = $_POST[‘firstNameField’]; $lastName = $_POST[‘lastNameField’]; $address = $_POST[‘addressField’]; $city = $_POST[‘cityField’]; $state = strtoupper($_POST[‘stateField’]); $zip = $_POST[‘zipField’]; $phone = trimPhone($_POST[‘phoneField’]); $orgPhone = trimPhone($_POST[‘organizationPhoneField’]); $orgName = $_POST[‘organizationNameField’]; $orgAddress = $_POST[‘organizationAddressField’]; $orgCity = $_POST[‘organizationCityField’]; $orgState = strtoupper($_POST[‘organizationStateField’]); $orgZip = $_POST[‘organizationZipField’]; $sessionTitle = $_POST[‘sessionTitleField’]; $sessionType = $_POST[‘sessionTypeField’]; $sessionCanRecord = $_POST[‘sessionCanRecordField’]; $sessionLevel = isset($_POST[‘sessionLevelField’]) ? implode(“,”, $_POST[‘sessionLevelField’]) : ”; $sessionEquipment = isset($_POST[‘sessionEquipmentField’]) ? implode(“,”, $_POST[‘sessionEquipmentField’]) : ”; $sessionEquipmentExtra = $_POST[‘sessionEquipmentExtraField’]; $sessionDescription = $_POST[‘sessionDescriptionField’]; $speaker = getPersonByEmail($email); $organization = getOrganizationByPhone($orgPhone); if($speaker){ $primaryPhoneType = $speaker->phonePrimary; }else{ $primaryPhoneType = ‘work’; } $fieldArray = array(’email’,’firstName’,’lastName’,’address’,’city’,’state’,’zip’,’phone_’.$primaryPhoneType); $valueArray = array($email,$firstName,$lastName,$address,$city,$state,$zip,$phone); if($speaker){ if($firstName != $speaker->firstName || $lastName != $speaker->lastName || $address != $speaker->address || $city != $speaker->city || $state != $speaker->state || $zip != $speaker->zip || $phone != getPrimaryPhoneByPersonID($speaker->personID)){ if($speaker->status_id != 7){ $warningText = ‘We have your e-mail address on record, but the other information you entered does not match the information we have. If your name, address, or phone number has changed, please update your information here.’; $successText = ‘Your presentation proposal has been submitted.’; }else{ updateValues(‘Persons’,’personID’,$speaker->personID,$fieldArray,$valueArray); } } }else{ insertValues(‘Persons’,$fieldArray,$valueArray); } $speaker = getPersonByEmail($email); $orgFieldArray = array(‘name’,’address’,’city’,’state’,’zip’,’phone’); $orgValueArray = array($orgName,$orgAddress,$orgCity,$orgState,$orgZip,$orgPhone); if($organization){ updateValues(‘Organizations’,’organizationID’,$organization->organizationID,$orgFieldArray,$orgValueArray); }else{ insertValues(‘Organizations’,$orgFieldArray,$orgValueArray); } $organization = getOrganizationByPhone($orgPhone); $sessionFieldArray = array( ‘person_id’, ‘event_id’, ‘organization_id’, ‘sessionTitle’, ‘sessionDescription’, ‘sessionType_id’, ‘sessionCanRecord’, ‘sessionLevel’, ‘equipmentNeeds’, ‘additionalNeeds’); $sessionValueArray = array( $speaker->personID, $eventID, $organization->organizationID, $sessionTitle, $sessionDescription, getSessionTypeID($sessionType,$eventID), $sessionCanRecord, $sessionLevel, $sessionEquipment, $sessionEquipmentExtra); insertValues(‘PresentationProposals’,$sessionFieldArray,$sessionValueArray); $successText = ‘Thank you for submitting a presentation proposal. You will hear back from us once the presentations have been selected.’; } echo ‘‘ . $warningText . ‘‘; echo ‘‘ . $successText . ‘‘; [/insert_php]
[insert_php] formSectionTitle(‘Speaker Information’); formTextField(’email’ ,’E-mail’ ,” ,1 ,75); formTextField(‘firstName’ ,’First Name’ ,” ,2 ,50); formTextField(‘lastName’ ,’Last Name’ ,” ,1 ,50); formTextField(‘address’ ,’Address’ ,” ,2 ,100); formTextField(‘city’ ,’City’ ,” ,1 ,25); formTextField(‘state’ ,’State’ ,” ,2 ,2); formTextField(‘zip’ ,’Zip’ ,” ,1 ,5); formTextField(‘phone’ ,’Phone’ ,” ,2 ,15); formSectionTitle(‘Organization Information’); formTextField(‘organizationPhone’ ,’Phone’ ,” ,1 ,15); formTextField(‘organizationName’ ,’Name’ ,” ,2 ,100); formTextField(‘organizationAddress’ ,’Address’ ,” ,1 ,50); formTextField(‘organizationCity’ ,’City’ ,” ,2 ,50); formTextField(‘organizationState’ ,’State’ ,” ,1 ,2); formTextField(‘organizationZip’ ,’Zip’ ,” ,2 ,5); formSectionTitle(‘Presentation Information’); formTextField(‘sessionTitle’ ,’Title’ ,” ,1 ,100); formDropDown(‘sessionType’ ,’Type’ ,” ,2 ,getSessionTypes($eventID)); formDropDown(‘sessionCanRecord’ ,’Can we record your session?’, ”, 1, array(‘Yes’,’No’)); formCheckBoxes(‘sessionLevel’ ,’Level’ ,” ,2 ,getGradeLevelList()); formCheckBoxes(‘sessionEquipment’ ,’Equipment’ ,” ,1 ,getEquipmentList()); formTextField(‘sessionEquipmentExtra’ ,’Additional Equipment’ ,” ,2 ,255); formTextArea(‘sessionDescription’ ,’Description’ ,” ,1 ,10, 30); [/insert_php]