Connect with CIRA Twitter Facebook Linkin YouTube Slideshare

 

 

 

 

getAdapter()->setLocale($lang); //var_dump($translate->getLocale()); $form = new Cira_Form_Awards; $form->setTranslater($translate); if (isset($_POST["register"]) && $form->isValid($_POST)) { $formData = $form->getValidValues($_POST); $applicant = new Cira_Model_Applicant; //############################################## $options = array(1 => 'category-elearning', 2 => 'category-webtechnology', 3 => 'category-smallbusiness', 4 => 'category-notforprofit'); $key = array_search($form->getValue('category'), $options); $formData[answer_1] = $form->getValue('c'.$key.'_answer_1'); $formData[answer_2] = $form->getValue('c'.$key.'_answer_2'); $formData[answer_3] = $form->getValue('c'.$key.'_answer_3'); $formData[answer_4] = $form->getValue('c'.$key.'_answer_4'); $formData[answer_5] = $form->getValue('c'.$key.'_answer_5'); //############################################## $applicant->save($formData); $view = new Zend_View(); $view->setScriptPath(dirname(__FILE__).'/views'); $view->translate = $translate; echo $view->render('success.php'); //############ require_once('Zend/Mail.php'); $mail = new Zend_Mail(); $mail->setBodyText('This email is a notification that someone has submitted a new Impact Awards entry.'); $mail->setFrom($submission_fromemail, $submission_fromemailname); $mail->addTo($submission_toemail, $submission_toemailname); $mail->setSubject('New Cira Impact Awards Submission - '.$form->getValue('first_name')." " .$form->getValue('last_name')); try{ $mail->send(); } catch (Exception $e) { //echo "Failed to Send Email."; } //################## } else { $codes = $form->getErrors(); $messages = $form->getMessages(); $form->populate($_POST); $view = new Zend_View; echo $form->render($view); } $db->closeConnection(); setLocale('en_US'); ?>