| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/holidays.tripjack.com/application/controllers/ |
Upload File : |
<?php
class ContactController extends Catabatic_CheckSession
{
public function init(){
parent::init();
}
function indexAction(){
$form = new Application_Form_Contactus();
$form->setMethod("POST")
->setAction("contact/contectus")
->setName("contactusform");
$this->view->contactform = $form;
}
function unsubscribeAction(){
}
function newslatterAction(){
$request = $this->getRequest();
$contactForm = new Application_Form_Newslatter();
if ($this->getRequest()->isPost()) {
$enquiryForm = $this->getRequest()->getPost();
if ($contactForm->isValid($enquiryForm)) {
$html = new Zend_View();
$html->setScriptPath('emailTemplate/');
$mail = new Zend_Mail('utf-8');
$html->assign('email', $enquiryForm["email"]);
$bodyText = $html->render('newslatter.phtml');
$email=$enquiryForm["email"];
$mail = new Zend_Mail();
$mail->setBodyHtml($bodyText);
$mail->setFrom("info@simplyideaz.com",'SimplyIdeaz');
$mail->addTo($email,"SimplyIdeaz");
$mail->setSubject("SimplyIdeaz");
$mail->send();
// $enquirymodel = new Admin_Model_Newslatter();
//$enquirymodel->add($contactForm->getValues());
$mailMsg = new Flexsin_MessageStack();
$mailMsg->add("Thank you for your newsletter subscription request, an email has been sent to your email id.",'home', 'myerrorOk');
$this->_redirect('index/#newslatter');
}
}
}
public function contectusAction(){
$request = $this->getRequest();
$contactForm = new Application_Form_Contactus();
if ($this->getRequest()->isPost()) {
if (!$contactForm->isValid($request->getPost())) {
$this->view->contactform = $contactForm;
return $this->render('index');
}
}
if ($this->getRequest()->isPost()) {
$enquiryForm = $this->getRequest()->getPost();
if ($contactForm->isValid($enquiryForm)) {
$html = new Zend_View();
$html->setScriptPath('emailTemplate/');
$html->assign('name', $enquiryForm['yname']);
$html->assign('email', $enquiryForm["email"]);
$html->assign('phone', $enquiryForm["phone"]);
$html->assign('message', $enquiryForm["message"]);
$html->assign('subject', $enquiryForm["subject"]);
$mail = new Zend_Mail('utf-8');
$bodyText = $html->render('contact.phtml');
// echo $bodyText;exit;
$subject = $enquiryForm["phone"];
$email = $enquiryForm["email"];
$name = $enquiryForm["yname"];
// $tr = new Zend_Mail_Transport_Sendmail("simplyideaz@gmail.com");
// Zend_Mail::setDefaultTransport($tr);
$mail = new Zend_Mail();
$mail->setBodyHtml($bodyText);
$mail->setFrom($email,'SimplyIdeaz');
$mail->addTo("info@simplyideaz.com",$name);
$mail->addCc("simplyideaz@gmail.com");
$mail->setSubject($subject);
$mail->send();
$enquirymodel = new Admin_Model_ContactusMapper();
$enquirymodel->add($contactForm->getValues());
$mailMsg = new Flexsin_MessageStack();
$mailMsg->add(" Thanks for contacting us Your message has been successfully received, we will reply as soon as possible,<br> A copy of your query has been sent to you, Thank you for contacting us.",'home', 'myerrorOk');
$this->_redirect('contact/');
}
}
}
}