403Webshell
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/travelbrace.com/application/modules/cms/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/travelbrace.com/application/modules/cms/controllers/IndexController.php
<?php

class Cms_IndexController extends Zend_Controller_Action {

	public $baseUrl = '';
	protected $objMdl;
	public $smtpUserName;
	public $smtpPassword;
	public $smtpPort;
	public $smtpHost;
	public $AgencyId;
	public $tablenamePage;
	protected $db;

	public function init() {
		$this->objMdl = new Admin_Model_CRUD();
		$object = Zend_Controller_Front::getInstance();
		$this->action = $action = $object->getRequest()->getActionName();
		$this->modulename = $modulename = $object->getRequest()->getModuleName();

		$aConfig = $this->getInvokeArg('bootstrap')->getOptions();
		$BootStrap = $aConfig['bootstrap'];
        $this->gtxagencysysid = $BootStrap['gtxagencysysid'];
		$this->siteName = $BootStrap['siteName'];
		$this->baseUrl = $BootStrap['siteUrl'];
		$this->gtxBtoBsite = $BootStrap['gtxBtoBsite'];
		$this->AgencyId = $BootStrap['gtxagencysysid'];
		$this->AgentSysId = $BootStrap['gtxagentsysid'];
		$this->LeadURL = $BootStrap['siteUrl'] . 'index/query';
		$this->tablename = 'tbl_enquiry';
		$this->tablenamePage = 'tbl_static_pages';
		$this->adminEmail = $BootStrap['adminEmail'];
		$this->objHelperGeneral = $this->_helper->General;

		$this->db = Zend_Db_Table::getDefaultAdapter();
	}

	public function indexAction() {
		$param = $this->getRequest()->getParams();
		//echo "<pre>";print_r($param);exit;
		$pageid = $param['cms'];
//        print_r($pageid);die;
		$model = new Admin_Model_CRUD();
		$getPageDetail = $model->rv_select_row($this->tablenamePage, ['*'], ['identifier' => $pageid, 'status' => 'Activate','AgencySysId' => $this->gtxagencysysid], ['sid' => 'desc']);
		$getAboutUsDetailForContactUs = $model->rv_select_row($this->tablenamePage, ['page_description'], ['identifier' => 'about-us', 'status' => 'Activate'], ['sid' => 'desc']);
		//echo "<pre>";print_r($getPageDetail);exit;
		$getContactDetail = $model->rv_select_all('tbl_query', ['*'], [ 'status' => '1','AgencySysId' => $this->gtxagencysysid], ['office' => 'ASC']);
		$detailLayout = array();
		$detailLayout['Keyword'] = $getPageDetail['meta_keywords']; // get Keyword
		$detailLayout['Description'] = $getPageDetail['meta_description']; // get Description
		$detailLayout['metaTitle'] = $getPageDetail['meta_title']; // get name
		 // $thingstodo_address = $this->objMdl->rv_select_all('tb_tbb2c_contactus_address', ['*'], ['IsMarkForDel' => 0], ['DesSysId' => 'DESC']);
        $tbl_branches = $this->objMdl->getAddress(['*'], ['tbl.status' => 1,'tbl.IsMarkForDel' => 0,'AgencySysId' => $this->gtxagencysysid], ['tbl.address' => 'DESC']);
        
         // echo "<pre>";print_r($tbl_branches);
         //   die;
        $finalThingstodo = array();
        $BranchArr = array();
        foreach($tbl_branches as $key => $value){
        	if(!empty($value['address'])){
           //echo "<pre>";print_r($value['AgencySysId']);die;
		   if($value['AgencySysId']==$this->gtxagencysysid){
        	$BranchArr[$value['address_id']] = $value['address'];
		   }
        		
        	}
			 if($value['AgencySysId']==$this->gtxagencysysid){
            $finalThingstodo[$value['address_id']][] = $value; 
			 }
        }
         
          //echo "<pre>";print_r($finalThingstodo);die;
          // die;
            $this->view->finalThingstodo = $finalThingstodo;
            $this->view->thingstodo_address = ($BranchArr);//$thingstodo_address;

		/* SEO KEYWORD */
		$resultsetSeoForCmsPages = array();
		$resultsetSeoForCmsPages['Keyword'] = $getPageDetail['meta_keywords']; // get Keyword
		$resultsetSeoForCmsPages['Description'] = $getPageDetail['meta_description']; // get Description
		$resultsetSeoForCmsPages['Title'] = $getPageDetail['meta_title']; // get name

		$getMypopCookie = Zend_Controller_Action_HelperBroker::getStaticHelper('General')->getMypopCookie('MyCookies'); // get the popup sessions
		$this->view->getMypopCookie = $getMypopCookie;
		$this->view->resultsetSeoForCmsPages = $resultsetSeoForCmsPages;
		$this->view->detailLayout = $detailLayout;
		$this->view->pagedetail = $getPageDetail;
		
		$this->view->getAboutUsDetailForContactUs = $getAboutUsDetailForContactUs;
		$this->view->baseUrl = $this->baseUrl;
		$this->view->siteName = $this->siteName;
		$this->view->getContactDetail = $getContactDetail;
//                echo "<pre>";print_r($getPageDetail);exit;
		if ($pageid == 'domestic-tour-packages') {
			$this->_redirect($this->baseUrl . 'tour-destination/domestic-tour-packages.html');
		} else if ($pageid == 'international-tour-packages') {
			$this->_redirect($this->baseUrl . 'tour-destination/international-tour-packages.html');
		}
	}

	public function sendenquiryAction() {
		if ($this->getRequest()->isPost()) {
			$param = $this->getRequest()->getParams();
			//echo"<pre>";print_r($param);die();
			if (!empty($_SERVER['HTTP_CLIENT_IP'])) { // check ip from shared internet
				$user_ip = $_SERVER['HTTP_CLIENT_IP'];
			} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { // check ip passed from proxy
				$user_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
			} else {
				$user_ip = $_SERVER['REMOTE_ADDR'];
			}
			$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
               if (empty(trim($param['captcha']))) {
                $result = ['status' => false, 'message' => 'Please enter captcha code.'];
                echo Zend_Json::encode($result);
                exit;
            }
			if (strtolower($param['captcha']) != $_SESSION['captcha']) {
				$result = ['status' => 'captcha', 'message' => 'Captcha code invalid.'];
				echo Zend_Json::encode($result);
				exit;
			} else {
			    $_SESSION['captcha'] = '';
				if (isset($param['name'])) {
					$param['name'] = $param['name'];
					$salutation = @$param['salutation'];
				} else {
					$salutation = @$param['salutation'];
					$fname = @$param['fname'];
					$lname = @$param['lname'];
					$param['name'] = $fname . ' ' . $lname;
				}

				$insertdata = [
					'name' => $param['name'],
					'email' => trim($param['email']),
					'phone' => trim($param['mobile']),
					'message' => $param['message'],
					'PlanType' =>  (int)($param['PlanType']),
					'CurrencyType' =>  (int)($param['CurrencyType']),
					'CurrencyRequired' =>  (int)($param['CurrencyRequired']),
					'InventoryType' =>  $param['InventoryType'],
					'DestinationPlaces' =>  $param['DestinationPlaces'],
					'created_at' => date('Y-m-d h:i:s'),
				];
				// echo"<pre>";print_r($param);die();
				$FirstName = (isset($fname) && $fname != '') ? $fname : $param['name'];
				$LastName = (isset($lname) && $lname != '') ? $lname : '';
				$countryCode = isset($param['countrycode']) ? $param['countrycode'] : '+91';
                                $message = (isset($param['remark']) && !empty($param['remark'])) ? $param['remark'] : $param['message'];
                                $PlanType = (isset($param['PlanType'])) ? $param['PlanType'] : 5;
				$CurrencyType = (isset($param['CurrencyType'])) ? $param['CurrencyType'] : 'INR';
                                $CurrencyRequired = (isset($param['CurrencyRequired'])) ? $param['CurrencyRequired'] : '';
                                $InventoryType = (isset($param['InventoryType'])) ? $param['InventoryType'] : '1';
                                $DestinationPlaces = (isset($param['DestinationPlaces'])) ? $param['DestinationPlaces'] :'';
                                $package_destination = (isset($param['package_destination'])) ? $param['package_destination'] :'';
                                $DestinationPlacesIds = (isset($param['package_destinationsId'])) ? $param['package_destinationsId'] :'';
								$from_destination_id = (isset($param['from_destination_id'] ))?  $param['from_destination_id'] :'';
								$from_destination = (isset($param['from_destination'] ))?  $param['from_destination'] :'';
                                $package_tpid = (isset($param['package_tpid'])) ? (int)$param['package_tpid'] : 0;
                                if(!empty($package_destination)){
                                    $DestinationPlaces = $package_destination;
                                }
                                
				if($PlanType == 'Forex' || $PlanType == 'Umrah'){
					$PlanType = 10;
					$message = $PlanType.' - '.$message;
				}
                                $date = (isset($param['traveldate']) && !empty($param['traveldate'])) ? trim($param['traveldate']) : trim($param['date']);
								
				$this->postFields = "";
				$this->postFields .= "&AgencySysId=$this->AgencyId";
				$this->postFields .= "&Salutation=" . $salutation;
				$this->postFields .= "&CountryCode=" . $countryCode;
				$this->postFields .= "&FirstName=" . $FirstName;
				$this->postFields .= "&LastName=" . $LastName;
				$this->postFields .= "&message=" . $message. ' '. $param['thispackageurl'] . ' '. $param['message'];
				$this->postFields .= "&Email=" . $param['email'];
				$this->postFields .= "&MobileNumber=" . $param['mobile'];
				$this->postFields .= "&PlanType=" . (int)$PlanType;
				$this->postFields .= "&CurrencyType=" . $CurrencyType;
				$this->postFields .= "&CurrencyRequired=" . (int)$CurrencyRequired;
				$this->postFields .= "&InventoryType=" . $InventoryType;
				$this->postFields .= "&ToDestination=" . $DestinationPlaces;
				$this->postFields .= "&ToDestinationId=" . $DestinationPlacesIds;
				$this->postFields .= "&FromDestinationId=" . $from_destination_id;
				$this->postFields .= "&FromDestination=" . $from_destination;
				$this->postFields .= "&NoofTraveler=" . $param['NoofTraveler']; 
				$this->postFields .= "&traveldate=" . $date;
				$this->postFields .= "&IPAddress=" . $user_ip;
//				$this->postFields .= "&packageSysId=" . $package_tpid;
				// echo"<pre>";print_r($this->postFields);die();
				//            $resultset = $this->objMdl->rv_insert($this->tablename, $insertdata);

				if (isset($param['form_type']) && (trim($param['form_type']) == 'contact_us')) {
					$message = "Your query has been sent successfully.";
					$status = true;
				} else {
					try {
						$model = new Gtxwebservices_Model_Webservices();
						$getPackagesData = $model->sendLead($this->postFields);
                        $getPackagesDataArr = json_decode($getPackagesData, 1);                                                
						//echo "<pre>";print_r($getPackagesData);exit;

						$message = "Your query has been sent successfully.";
						$status = true;
					} catch (Zend_Exception $error) {
						$message = $this->view->error_msg = $error->getMessage();
						$status = false;
					}
				}

				$MypopC = [
					'Salutation' => $param['salutation'],
					'fname' => $param['fname'],
					'lname' => $param['lname'],
					'name' => $param['name'],
					'email' => $param['email'],
					'countrycode' => $param['countrycode'],
					'mobile' => $param['mobile'],
					'from_destination_id' => $param['from_destination_id'],
					'from_destination' => $param['from_destination'],
					'from_destination_name' => $param['from_destination_name'],
					'date' => $param['date'],
					'message' => $param['remark']. ' '. $param['thispackageurl'] . ' '. $param['message'],
					'PlanType' => $param['PlanType'],
					'CurrencyType' =>  (int)($param['CurrencyType']),
					'CurrencyRequired' =>  (int)($param['CurrencyRequired']),
					'InventoryType' =>  $param['InventoryType'],
					'DestinationPlaces' =>  $param['DestinationPlaces'],
					// 'room' => isset($param['room']) && !empty($param['room']) ? count($param['room']) : '',
					// 'adult' => isset($param['adult']) && !empty($param['adult']) ? implode(",", $param['adult']) : '',
					// 'adult_bed_type' => isset($param['adult_bed_type']) && !empty($param['adult_bed_type']) ? implode(",", $param['adult_bed_type']) : '',
					// 'child' => isset($param['child']) && !empty($param['child']) ? implode(",", $param['child']) : '',
					// 'child1_bed_type' => isset($param['child1_bed_type']) && !empty($param['child1_bed_type']) ? implode(",", $param['child1_bed_type']) : '',
					// 'child2_bed_type' => isset($param['child2_bed_type']) && !empty($param['child2_bed_type']) ? implode(",", $param['child2_bed_type']) : '',
					// 'infant' => isset($param['infant']) && !empty($param['infant']) ? implode(",", $param['infant']) : '',
				];
				// echo "<pre>";print_r($MypopC);die;
				//setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
				setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
				$result = ['status' => true, 'message' => $message, 'name' => $param['name'], 'leadID' => $getPackagesDataArr['leadID']];

				echo Zend_Json::encode($result);
				exit;
			}
		} else {
			$result = ['status' => false, 'message' => 'Unable to send enquiry'];
			echo Zend_Json::encode($result);
			exit;
		}
	}
    public function sendenquiryrightAction() {
		
		if ($this->getRequest()->isPost()) {
			$param = $this->getRequest()->getParams();
			//echo"<pre>";print_r($param);die();
			$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();

			if (empty(trim($param['captcha']))) {
                $result = ['status' => false, 'message' => 'Please enter captcha code.'];
                echo Zend_Json::encode($result);
                exit;
            }
			if (strtolower($param['captcha']) != $_SESSION['captcha']) {
				$result = ['status' => 'captcha', 'message' => 'Captcha code invalid.'];
				echo Zend_Json::encode($result);
				exit;
			} else {
			    $_SESSION['captcha'] = '';
				if (isset($param['name'])) {
					$param['name'] = $param['name'];
				} else {
					$salutation = @$param['salutation'];
					$fname = @$param['fname'];
					$lname = @$param['lname'];
					$param['name'] = $fname . ' ' . $lname;
				}
				$salutation = @$param['salutation'];
				$insertdata = [
					'name' => $param['name'],
					'email' => trim($param['email']),
					'phone' => trim($param['mobile']),
					'message' => $param['message'],
					'PlanType' =>  (int)($param['PlanType']),
					'CurrencyType' =>  (int)($param['CurrencyType']),
					'CurrencyRequired' =>  (int)($param['CurrencyRequired']),
					'InventoryType' =>  $param['InventoryType'],
					'DestinationPlaces' =>  $param['DestinationPlaces'],
					'created_at' => date('Y-m-d h:i:s'),
				];
				//echo"<pre>";print_r($insertdata);die();
				$FirstName = (isset($fname) && $fname != '') ? $fname : $param['name'];
				$LastName = (isset($lname) && $lname != '') ? $lname : '';
				$countryCode = isset($param['countrycode']) ? $param['countrycode'] : '+91';
                                $message = (isset($param['remark']) && !empty($param['remark'])) ? $param['remark'] : $param['message'];
                                $PlanType = (isset($param['PlanType'])) ? $param['PlanType'] : 5;
				$CurrencyType = (isset($param['CurrencyType'])) ? $param['CurrencyType'] : 'INR';
                                $CurrencyRequired = (isset($param['CurrencyRequired'])) ? $param['CurrencyRequired'] : '';
                                $InventoryType = (isset($param['InventoryType'])) ? $param['InventoryType'] : '1';
                                $DestinationPlaces = (isset($param['DestinationPlaces'])) ? $param['DestinationPlaces'] :'';
                                $package_destination = (isset($param['package_destination'])) ? $param['package_destination'] :'';
                                $DestinationPlacesIds = (isset($param['package_destinationsId'])) ? $param['package_destinationsId'] :'';
                                $package_tpid = (isset($param['package_tpid'])) ? (int)$param['package_tpid'] : 0;
                                if(!empty($package_destination)){
                                    $DestinationPlaces = $package_destination;
                                }
                                
				if($PlanType == 'Forex' || $PlanType == 'Umrah'){
					$PlanType = 10;
					$message = $PlanType.' - '.$message;
				}
                                $date = (isset($param['traveldate']) && !empty($param['traveldate'])) ? trim($param['traveldate']) : trim($param['date']);
			                  
				if($param['willbookdays']){
                  $bookdays = 'Will Book- '. $param['willbookdays'];
			    }
                if(!empty($param['hotelcategory'])){
                  $hotelcategory = ' Hotel Category- '. $param['hotelcategory'][0] . $param['hotelcategory'][1] . $param['hotelcategory'][2] . $param['hotelcategory'][3];
			    }
                if($param['preferredtime']){
                  $preferredtime = ' Time to call- '. $param['preferredtime'];
			    }
                if($param['tourtype']){
                  $tourtype = ' Tour Type- '. $param['tourtype'];
			    }
                if($param['message']){
                  $requirements = ' Message- '. $param['message'];
			    }
                if($param['thispackageurl']){
                  $thispackageurl = ' Url- '. $param['thispackageurl'];
			    }				
										
				$messageextra = $bookdays.$hotelcategory.$preferredtime.$tourtype.$requirements.$thispackageurl;				
				echo $totalTraveler = (int)($param['adultTwinSharing'])+(int)($param['adultTripleSharing'])+(int)($param['adultSingleSharing'])+(int)($param['childSharing']); 				
				$this->postFields = "";
				$this->postFields .= "&AgencySysId=$this->AgencyId";
				$this->postFields .= "&Salutation=" . $salutation;
				$this->postFields .= "&CountryCode=" . $countryCode;
				$this->postFields .= "&FirstName=" . $FirstName;
				$this->postFields .= "&LastName=" . $LastName;
				$this->postFields .= "&message=" . $messageextra;
				$this->postFields .= "&Email=" . $param['email'];
				$this->postFields .= "&MobileNumber=" . $param['mobile'];
				$this->postFields .= "&PlanType=" . (int)$PlanType;
				$this->postFields .= "&CurrencyType=" . $CurrencyType;
				$this->postFields .= "&CurrencyRequired=" . (int)$CurrencyRequired;
				$this->postFields .= "&InventoryType=" . $InventoryType;
				$this->postFields .= "&ToDestination=" . $DestinationPlaces;
				$this->postFields .= "&ToDestinationId=" . $DestinationPlacesIds;
				$this->postFields .= "&NoofTraveler=" . $totalTraveler; 
				$this->postFields .= "&traveldate=" . $date;
//				$this->postFields .= "&packageSysId=" . $package_tpid;
				//echo"<pre>";print_r($this->postFields);die();
				//            $resultset = $this->objMdl->rv_insert($this->tablename, $insertdata);

				if (isset($param['form_type']) && (trim($param['form_type']) == 'contact_us')) {
					$message = "Your query has been sent successfully.";
					$status = true;
				} else {
					try {
						$model = new Gtxwebservices_Model_Webservices();
						$getPackagesData = $model->sendLead($this->postFields);
                                                    $getPackagesDataArr = json_decode($getPackagesData,1);                                                
						//echo "<pre>";print_r($getPackagesData);exit;

						$message = "Your query has been sent successfully.";
						$status = true;
					} catch (Zend_Exception $error) {
						$message = $this->view->error_msg = $error->getMessage();
						$status = false;
					}
				}

				$MypopC = [
					'Salutation' => $param['salutation'],
					'fname' => $param['fname'],
					'lname' => $param['lname'],
					'name' => $param['name'],
					'email' => $param['email'],
					'countrycode' => $param['countrycode'],
					'mobile' => $param['mobile'],
					'from_destination_id' => $param['from_destination_id'],
					'from_destination' => $param['from_destination'],
					'from_destination_name' => $param['from_destination_name'],
					'date' => $param['date'],
					'message' => $param['remark']. ' '. $messageextra,
					'PlanType' => $param['PlanType'],
					'CurrencyType' =>  (int)($param['CurrencyType']),
					'CurrencyRequired' =>  (int)($param['CurrencyRequired']),
					'InventoryType' =>  $param['InventoryType'],
					'DestinationPlaces' =>  $param['DestinationPlaces'],
					// 'room' => isset($param['room']) && !empty($param['room']) ? count($param['room']) : '',
					// 'adult' => isset($param['adult']) && !empty($param['adult']) ? implode(",", $param['adult']) : '',
					// 'adult_bed_type' => isset($param['adult_bed_type']) && !empty($param['adult_bed_type']) ? implode(",", $param['adult_bed_type']) : '',
					// 'child' => isset($param['child']) && !empty($param['child']) ? implode(",", $param['child']) : '',
					// 'child1_bed_type' => isset($param['child1_bed_type']) && !empty($param['child1_bed_type']) ? implode(",", $param['child1_bed_type']) : '',
					// 'child2_bed_type' => isset($param['child2_bed_type']) && !empty($param['child2_bed_type']) ? implode(",", $param['child2_bed_type']) : '',
					// 'infant' => isset($param['infant']) && !empty($param['infant']) ? implode(",", $param['infant']) : '',
				];
				// echo "<pre>";print_r($MypopC);die;
				//setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
				setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
				$result = ['status' => true, 'message' => $message, 'name' => $param['name'], 'leadID' => $getPackagesDataArr['leadID']];

				echo Zend_Json::encode($result);
				exit;
			}
		} else {
			$result = ['status' => false, 'message' => 'Unable to send enquiry'];
			echo Zend_Json::encode($result);
			exit;
		}
	}
	
	public function sendQueryDetailsAction() {

		$this->_helper->layout()->disableLayout('');
		$this->_helper->viewRenderer->setNoRender(true);
		if ($this->getRequest()->isPost()) {

			$param = $this->getRequest()->getParams();
			$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();

//            echo "<pre>";print_r($param);die;
			//check if any of the inputs are empty
			if (empty($param['name']) || empty($param['email']) || empty($param['mobile'])) {
				$result = ['status' => false, 'message' => 'Please fill out the form completely.'];
			} else {

				$queryArr = array(
					'AgencySysId' => $this->AgencyId,
					'AgentSysId' => $this->AgentSysId,
					'AgencyName' => '',
					'Destination' => isset($param['Destination']) && !empty($param['Destination']) ? $param['Destination'] : '',
					'DestinationID' => isset($param['DestinationID']) && !empty($param['DestinationID']) ? $param['DestinationID'] : '',
					'PlanType' => isset($param['planType']) && !empty($param['planType']) ? $param['planType'] : '',
					'Email' => $param['email'],
					'MobileNumber' => $param['mobile'],
					'FirstName' => $param['name'],
					'LastName' => '',
					'NoofTraveler' => '2',
					'PKGCheckInDate' => date('m/d/Y'),
					'Noofdays' => '2',
					'remark' => '',
				);

				try {

					$curl = curl_init($this->gtxBtoBsite . "gtxwebservices/b2b-query"); // b2c demo site url
					curl_setopt($curl, CURLOPT_POST, true);
					curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($queryArr));
					curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
					curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

					$response = curl_exec($curl);

					$message = "Your query has been sent successfully.";
					$status = true;
					curl_close($curl);
				} catch (Exception $ex) {
					$message = $this->view->error_msg = $ex->getMessage();
					$status = false;
				}
				$flname = explode(' ', $param['name']);
				$MypopC = [
					'name' => $param['name'],
					'fname' => $flname[0],
					'lname' => $flname[1],
					'email' => $param['email'],
					'mobile' => $param['mobile'],
				];

				setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");

				$result = ['status' => $status, 'message' => $message];

				$params = array('param' => $param, 'baseUrl' => $this->baseUrl, 'callusnumber' => $this->callusnumber, 'emailId' => $this->contactEmail, 'contactDetail_mail' => $contactDetail_mail, 'siteName' => $this->siteName);

				$cust_subject = 'Thanks for contacting us';
				$cust_html = new Zend_View();
				$cust_html->setScriptPath(APPLICATION_PATH . '/views/');
				$cust_html->assign($params);
				$cust_mailBody = $cust_html->render('customer_mail_master.phtml');

				$cust_configs = [
					'to' => trim($param['email']),
					'fromName' => $this->siteName,
					'fromEmail' => $contactDetail_mail['email'],
					'subject' => $cust_subject,
					'bodyHtml' => $cust_mailBody,
				];

				$cust_Mail = $this->objHelperGeneral->mailSentByElastice($cust_configs, 'Package');

				$admin_subject = 'New Request for Callback';
				$admin_html = new Zend_View();
				$admin_html->setScriptPath(APPLICATION_PATH . '/views/');
				$admin_html->assign($params);
				$admin_mailBody = $admin_html->render('admin_mail_master.phtml');

				$admin_configs = [
					'to' => $contactDetail_mail['email'],
					'fromName' => $this->siteName,
					'fromEmail' => $contactDetail_mail['email'],
					'subject' => $admin_subject,
					'bodyHtml' => $admin_mailBody,
				];

				$admin_Mail = $this->objHelperGeneral->mailSentByElastice($admin_configs, 'Package');
			}

		} else {

			$result = ['status' => false, 'message' => 'Invalid Request!'];
		}

		echo Zend_Json::encode($result);
		exit;
	}

	public function aboutDetailsAction() {

//         $aboutResult = $this->objMdl->getCmsdata($this->tableabout, ['*'], ['AboutId'=>$pId], ['AboutId'=>'DESC']);
		$aboutResult = $this->objMdl->rv_select_all($this->tableabout, ['*'], ['status' => 1, 'isMarkForDel' => 0], ['AboutId' => 'DESC'], 4);
		$this->view->aboutResult = $aboutResult;

		$this->view->baseUrl = $this->baseUrl;
		$this->view->CONST_YEAR_NAME = $this->CONST_YEAR_NAME;
	}

	public function getHotelDetailAction() {

		$this->_helper->layout()->disableLayout();
		if ($this->getRequest()->isXmlHttpRequest()) {
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$hotelId = $param['hotelId'];
				$type = $param['type'];
				$categoryId = $param['categoryId'];
				$packageId = $param['packageId'];
				$gtxID = $param['gtxID'];
				$model = new Detail_Model_PackageMapper();
				if ($type == 'H') {
					$getDetail = $model->fetchHotelDetails($categoryId, $gtxID, $packageId, $hotelId);
				} else if ($type == 'A') {
					$getDetail = $model->fetchActivityDetails($categoryId, $gtxID, $packageId, $hotelId);
				} else {
					$getDetail = $model->fetchSightSeeingDetails($categoryId, $gtxID, $packageId, $hotelId);
				}
				$this->view->type = $type;
				$this->view->hotelData = $getDetail;
				$this->view->baseUrl = $this->baseUrl;
			}
		}
	}

	public function getgeocityAction() {
		$param = $this->getRequest()->getParams();
		$model = new Admin_Model_CRUD();
		$select = $this->db->select()->from("tb_master_geo_city", "*");
		$select->where('Title LIKE ?', '%' . $param['term'] . '%');
		//$select->where('Title=?', $param['term']);
		$select->where("IsMarkForDel=?", 0);
		$select->where("IsActive=?", 1);
		$result = $this->db->fetchAll($select);
        //echo"<pre>";print_r($result);die;
		$dataArr = [];
		if ($result) {
			foreach ($result as $key => $value) {
				$dataArr[] = array(
					'label' => $value['Title'],
					'value' => $value['Title'],
					'id' => $value['CityId'],
					'ContId' => $value['ContSysId'],
					'countryName' => $value['Country'],
				);
			}
		}
		echo json_encode($dataArr);exit;
		//print_r($dataArr);die;

	}
		public function thankAction() {
		
	}
	public function forexAction() {
	
	 $testimonials = $this->objMdl->rv_select_all('tbl_feedback', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'displayOnHome' => 1], ['FeedbackId' => 'DESC'], 10);
     $this->view->testimonials = $testimonials;
	 
	 $forexbanner = $this->objMdl->rv_select_all('tbl_forex', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'category' => 1], ['Id' => 'DESC'], 10);
     $this->view->forexbanner = $forexbanner;
	 
	 $forexwhatwedo = $this->objMdl->rv_select_all('tbl_forex', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'category' => 2], ['Id' => 'DESC'], 10);
     $this->view->forexwhatwedo = $forexwhatwedo;
	//echo '<pre>';	print_r($forexbanner);die;
	}
	public function sendenquiryvisaAction() {
        if ($this->getRequest()->isPost()) {
            $param = $this->getRequest()->getParams();
			if (!empty($_SERVER['HTTP_CLIENT_IP'])) { // check ip from shared internet
				$user_ip = $_SERVER['HTTP_CLIENT_IP'];
			} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { // check ip passed from proxy
				$user_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
			} else {
				$user_ip = $_SERVER['REMOTE_ADDR'];
			}
            // echo"<pre>";print_r($param);die('shalvii');
            $contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
            $contactDetail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();

              if (empty(trim($param['captcha']))) {
                $result = ['status' => false, 'message' => 'Please enter captcha code.'];
                echo Zend_Json::encode($result);
                exit;
            }
			if (strtolower($param['captcha']) != $_SESSION['captcha']) {
				$result = ['status' => 'captcha', 'message' => 'Captcha code invalid.'];
				echo Zend_Json::encode($result);
				exit;
			} else {
			 $_SESSION['captcha'] = '';
                if (isset($param['name'])) {
                    $param['name'] = $param['name'];
                    $salutation = @$param['salutation'];
                } else {
                    $salutation = @$param['salutation'];
                    $fname = @$param['fname'];
                    $lname = @$param['lname'];
                    $param['name'] = $fname . ' ' . $lname;
                }
                $insertdata = [
                    'name' => $param['name'],
                    'email' => trim($param['email']),
                    'phone' => trim($param['mobile']),
                    'message' => $param['message'],
                    'PlanType' => (int) ($param['PlanType']),
                    'CurrencyType' => (int) ($param['CurrencyType']),
                    'CurrencyRequired' => (int) ($param['CurrencyRequired']),
                    'InventoryType' => $param['InventoryType'],
                    'DestinationPlaces' => $param['DestinationPlaces'],
                    'created_at' => date('Y-m-d h:i:s'),
                ];
                //echo"<pre>";print_r($insertdata);die();
                $FirstName = (isset($fname) && $fname != '') ? $fname : $param['name'];
                $LastName = (isset($lname) && $lname != '') ? $lname : '';
                $countryCode = isset($param['countrycode']) ? $param['countrycode'] : '+91';
                $message = (isset($param['remark']) && !empty($param['remark'])) ? $param['remark'] : $param['message'];
                $PlanType = (isset($param['PlanType'])) ? $param['PlanType'] : 5;
                $CurrencyType = (isset($param['CurrencyType'])) ? trim($param['CurrencyType']) : 'INR';
                $CurrencyRequired = (isset($param['CurrencyRequired'])) ? trim($param['CurrencyRequired']) : '';
                $salutation = (isset($param['salutation'])) ? $param['salutation'] : '';
                $InventoryType = (isset($param['InventoryType'])) ? trim($param['InventoryType']) : '1';
                $DestinationPlaces = (isset($param['DestinationPlaces'])) ? trim($param['DestinationPlaces']) : '';
                $package_destination = (isset($param['package_destination'])) ? $param['package_destination'] : '';
                $DestinationPlacesIds = (isset($param['package_destinationsId'])) ? $param['package_destinationsId'] : '';
                $packdate = (isset($param['date'])) ? $param['date'] : '';
                if ($param['willbookdays']) {
                    $bookdays = 'Will Book- ' . $param['willbookdays'];
                }
                if (!empty($param['hotelcategory'])) {
                    $hotelcategory = ' Hotel Category- ' . $param['hotelcategory'][0] . $param['hotelcategory'][1] . $param['hotelcategory'][2] . $param['hotelcategory'][3];
                }
                if ($param['preferredtime']) {
                    $preferredtime = ' Time to call- ' . $param['preferredtime'];
                }
                if ($param['tourtype']) {
                    $tourtype = ' Tour Type- ' . $param['tourtype'];
                }
                if ($param['message']) {
                    $requirements = ' Message- ' . $param['message'];
                }
                if ($param['thispackageurl']) {
                    $thispackageurl = ' Url- ' . $param['thispackageurl'];
                }
                $messageextra = $bookdays . $hotelcategory . $preferredtime . $tourtype . $requirements . $thispackageurl;
                $package_tpid = (isset($param['package_tpid'])) ? (int) $param['package_tpid'] : 0;
                if (!empty($package_destination)) {
                    $DestinationPlaces = $package_destination;
                }

                $FirstName = (isset($fname) && $fname != '') ? $fname : $param['name'];
                $LastName = (isset($lname) && $lname != '') ? $lname : '';
                $countryCode = isset($param['countrycode']) ? $param['countrycode'] : '+91';
                $message = (isset($param['remark']) && !empty($param['remark'])) ? $param['remark'] : $param['message'];
                $PlanType = (isset($param['PlanType'])) ? $param['PlanType'] : 5;
                $CurrencyType = (isset($param['CurrencyType'])) ? $param['CurrencyType'] : 'INR';
                $CurrencyRequired = (isset($param['CurrencyRequired'])) ? $param['CurrencyRequired'] : '';
                $InventoryType = (isset($param['InventoryType'])) ? $param['InventoryType'] : '1';
                $DestinationPlaces = (isset($param['DestinationPlaces'])) ? $param['DestinationPlaces'] : '';
                $TripType = (isset($param['TripType'])) ? $param['TripType'] : '';
                $Purpose = (isset($param['Purpose'])) ? $param['Purpose'] : '';
                $NoofDays = (isset($param['NoofDays'])) ? $param['NoofDays'] : '';
                //New Added  Feilds
                $ToDestination = (isset($param['ToDestination'])) ? $param['ToDestination'] : '';
                $traveldate = (isset($param['traveldate_flight'])) ? $param['traveldate_flight'] : '';
                $returndate = (isset($param['returndate'])) ? $param['returndate'] : '';
                $Destination = (isset($param['Destination'])) ? $param['Destination'] : '';
                $checkInDate = (isset($param['checkInDate'])) ? $param['checkInDate'] : '';
                $checkOutDate = ( isset($param['checkOutDate'])) ? $param['checkOutDate'] : '';
                $residence = ( isset($param['residence'])) ? $param['residence'] : '';
                $Service = (isset($param['Service'])) ? $param['Service'] : '';
                $Count = (isset($param['Count'])) ? $param['Count'] : '';
                $goingfrom = (isset($param['goingfrom'])) ? $param['goingfrom'] : '';
                $goingto = (isset($param['goingto'])) ? $param['goingto'] : '';
                $contactno = $contactDetail['whatsapp_no'];
                $callon = $param['mobile'];
                $custname = $param['fname'] . ' ' . $param['lname'];
                $custmail = $param['email'];
                $agencyDisplayName = $this->baseUrl;
                $NoofTraveler = $param['NoofTraveler'];

                //end
                // echo"<pre>";print_r($PlanType);die();
                if ($PlanType == 1) {
                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&Destination=" . $param['Destination_flight'];
                    $this->postFields .= "&ToDestination=" . $ToDestination;
                    $this->postFields .= "&TripType=" . $param['TripType_1'];
                    $this->postFields .= "&traveldate=" . $traveldate;
                    $this->postFields .= "&returndate=" . $returndate;
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&message=" . $message;

                    $Destination_flight = $param['Destination_flight'];
                    $TripType = $param['TripType_1'];
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your flight query for $Destination_flight.%0a%0a*Name:* $FirstName $LastName %0a%0a*Source City:* $Destination_flight %0a%0a*Destination City:* $ToDestination %0a%0a*Trip Type:* $TripType %0a%0a*Travel Date:* $traveldate  %0a%0a*Return Date:* $returndate %0a%0a*No Of Pax:* $NoofTraveler  %0a%0a*Remarks:* $message   %0a%0aYou can also call  at $callon or email at %0a$custmail  or whatsapp me here.%0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                } else if ($PlanType == 2) {
                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&ToDestination=" . $param['Destination'];
                    $this->postFields .= "&traveldate=" . $checkInDate;
                    $this->postFields .= "&returndate=" . $checkOutDate;
                    $this->postFields .= "&Nationality=" . $residence;
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&message=" . $message;
					$this->postFields .= "&IPAddress=" . $user_ip;
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your hotel query for $Destination.%0a%0a*Name:* $FirstName $LastName %0a%0a*Destination:* $Destination  %0a%0a*CheckIn Date:* $checkInDate %0a%0a*CheckOut Date:* $checkOutDate %0a%0a*Nationality:* $residence %0a%0a*No Of Pax:* $NoofTraveler Adult(s)  %0a%0a*Remarks:* $message %0a%0aYou can also call  at $callon or email at %0a$custmail  or whatsapp me here.%0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                } else if ($PlanType == 5) {
                    $param['traveldate'] = isset($param['traveldate']) && !empty($param['traveldate']) ? $param['traveldate'] : $packdate;
                    $param['Destination'] = isset($param['Destination']) && !empty($param['Destination']) ? $param['traveldate'] : $package_destination;
                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&traveldate=" . $param['traveldate'];
                    $this->postFields .= "&ToDestination=" . $param['Destination'];
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&message=" . $message . $messageextra;
                    $Destination = $param['Destination'];
                    $TravelDate = $param['traveldate'];
					$this->postFields .= "&IPAddress=" . $user_ip;
                    $this->postFields .= "&packageSysId=" . $package_tpid;
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your package query for $Destination.%0a%0a*Name:* $FirstName $LastName %0a%0a*Destination:* $Destination  %0a%0a*Travel Date:* $TravelDate  %0a%0a*No Of Pax:* $NoofTraveler Adult(s)  %0a%0a*Remarks:* $message %0a%0aYou can also call  at $callon or email at %0a$custmail or whatsapp me here.%0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                    //print_r($messageextra);die;
                } else if ($PlanType == 6) {
                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&traveldate=" . $param['traveldate'];
                    $this->postFields .= "&ToDestination=" . $DestinationPlaces;
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&TripType=" . $param['TripType_2'];
                    $this->postFields .= "&Purpose=" . $Purpose;
                    $this->postFields .= "&NoofDays=" . $param['NoofDays_visa'];
                    $this->postFields .= "&message=" . $message;
					$this->postFields .= "&IPAddress=" . $user_ip;
                    $VisaCategory = $param['TripType_2'];
                    $TravelDate = $param['traveldate'];
                    $NoofDays = $param['NoofDays_visa'];
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your package visa for $DestinationPlaces. %0a%0a*Name:* $FirstName $LastName %0a%0a*Destination:* $DestinationPlaces %0a%0a*Visa Category:* $VisaCategory %0a%0a*No Of Pax:* $NoofTraveler Adult(s) %0a%0a*Travel Date:* $TravelDate %0a%0a*For Purpose:* $Purpose %0a%0a*Stay Length:* $NoofDays %0a%0a*Remarks:* $message  %0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                } else if ($PlanType == 9) {

                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&ToDestination=" . $param['Destination'];
                    $this->postFields .= "&traveldate=" . $param['traveldate'];
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&message=" . $message;
                    $Destination = $param['Destination'];
                    $TravelDate = $param['traveldate'];
					$this->postFields .= "&IPAddress=" . $user_ip;
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your sightseeing query for $Destination.%0a%0a*Name:* $FirstName $LastName %0a%0a*Destination:* $Destination  %0a%0a*Travel Date:* $TravelDate  %0a%0a*No Of Pax:* $NoofTraveler Adult(s)  %0a%0a*Remarks:* $message %0a%0aYou can also call  at $callon or email at %0a$custmail  or whatsapp me here.%0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                } else if ($PlanType == 10) {
                    $remark = '';
                    if ($CurrencyType != '') {
                        $remark .= 'Currency:' . $CurrencyType . ', ';
                    }
                    if ($CurrencyRequired != '') {
                        $remark .= 'Amount:' . $CurrencyRequired . ', ';
                    }
                    if ($InventoryType != '') {
                        $remark .= 'Inventory Type:' . $InventoryType;
                    }
                    if ($Count != '') {
                        $remark .= 'Count:' . $Count;
                    }
                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&ToDestination=" . $DestinationPlaces;
                    $this->postFields .= "&traveldate=" . $param['traveldate'];
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&Purpose=" . $Service;
                    $this->postFields .= "&message=" . $remark . ' ' . $message;
                    $TravelDate = $param['traveldate'];
                    $Destination = $param['Destination'];
					$this->postFields .= "&IPAddress=" . $user_ip;
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your misecellaneous query for $Destination.%0a%0a*Name:* $FirstName $LastName %0a%0a*Destination:* $Destination  %0a%0a*Travel Date:* $TravelDate %0a%0a*Service:* $Service %0a%0a*Count:* $Count %0a%0a*No Of Pax:* $NoofTraveler Adult(s) %0a%0a*Remarks:* $message  %0a%0aYou can also call  at $callon or email at %0a$custmail  or whatsapp me here.%0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                } else if ($PlanType == 11) {
                    $this->postFields .= "&AgencySysId=$this->AgencyId";
                    $this->postFields .= "&Salutation=" . $salutation;
                    $this->postFields .= "&FirstName=" . $FirstName;
                    $this->postFields .= "&LastName=" . $LastName;
                    $this->postFields .= "&CountryCode=" . $countryCode;
                    $this->postFields .= "&MobileNumber=" . $param['mobile'];
                    $this->postFields .= "&Email=" . $param['email'];
                    $this->postFields .= "&PlanType=" . (int) $PlanType;
                    $this->postFields .= "&TripType=" . $param['TripType_3'];
                    $this->postFields .= "&ToDestination=" . $goingto;
                    $this->postFields .= "&Destination=" . $goingfrom;
                    $this->postFields .= "&NoofDays=" . $NoofDays;
                    $this->postFields .= "&traveldate=" . $param['traveldate'];
                    $this->postFields .= "&NoofTraveler=" . $param['NoofTraveler'];
                    $this->postFields .= "&message=" . $message;
					$this->postFields .= "&IPAddress=" . $user_ip;
                    $TravelDate = $param['traveldate'];
                    $TripType = $param['TripType_3'];
                    $whatsappmessage = "*Dear Admin*,%0a%0aThanks for your Transfer query for $goingfrom.%0a%0a*Name:* $FirstName $LastName %0a%0a*Going From:* $goingfrom %0a%0a*Going To:* $goingto %0a%0a*Trip Type:* $TripType %0a%0a*Travel Date:* $TravelDate %0a%0a*No. of Days:* $NoofDays  %0a%0a*No Of Pax:* $NoofTraveler Adult(s) %0a%0a*Remarks:* $message  %0a%0aYou can also call  at $callon or email at %0a$custmail  or whatsapp me here.%0a%0aRegards %0a%0a$custname, %0a$agencyDisplayName";
                }

//				$this->postFields .= "&packageSysId=" . $package_tpid;
                // echo"<pre>";print_r( $this->postFields);die('here');
                //            $resultset = $this->objMdl->rv_insert($this->tablename, $insertdata);

                if (isset($param['form_type']) && (trim($param['form_type']) == 'contact_us')) {
                    $message = "Your query has been sent successfully.";
                    $status = true;
                } else {
                    //    echo '<pre>';print_r($this->postFields);die('ddd');
                    try {
                        $model = new Gtxwebservices_Model_Webservices();
                        $getPackagesData = $model->sendLead($this->postFields);
                        $getPackagesDataArr = json_decode($getPackagesData, 1);

                        $message = "Your query has been sent successfully.";
                        $status = true;
                    } catch (Zend_Exception $error) {
                        $message = $this->view->error_msg = $error->getMessage();
                        $status = false;
                    }
                }

                $MypopC = [
                    'salutation' => $param['salutation'],
                    'fname' => $param['fname'],
                    'lname' => $param['lname'],
                    'name' => $param['name'],
                    'email' => $param['email'],
                    'countrycode' => $param['countrycode'],
                    'mobile' => $param['mobile'],
                    'from_destination_id' => $param['from_destination_id'],
                    'from_destination' => $param['from_destination'],
                    'from_destination_name' => $param['from_destination_name'],
                    'date' => $param['date'],
                    'message' => $param['remark'] . ' ' . $param['thispackageurl'],
                    'PlanType' => $param['PlanType'],
                    'CurrencyType' => (int) ($param['CurrencyType']),
                    'CurrencyRequired' => (int) ($param['CurrencyRequired']),
                    'InventoryType' => $param['InventoryType'],
                    'DestinationPlaces' => $param['DestinationPlaces'],
                    'IPAddress' => $user_ip,
                        // 'room' => isset($param['room']) && !empty($param['room']) ? count($param['room']) : '',$this->postFields .= "&IPAddress=" . $user_ip;
                        // 'adult' => isset($param['adult']) && !empty($param['adult']) ? implode(",", $param['adult']) : '',
                        // 'adult_bed_type' => isset($param['adult_bed_type']) && !empty($param['adult_bed_type']) ? implode(",", $param['adult_bed_type']) : '',
                        // 'child' => isset($param['child']) && !empty($param['child']) ? implode(",", $param['child']) : '',
                        // 'child1_bed_type' => isset($param['child1_bed_type']) && !empty($param['child1_bed_type']) ? implode(",", $param['child1_bed_type']) : '',
                        // 'child2_bed_type' => isset($param['child2_bed_type']) && !empty($param['child2_bed_type']) ? implode(",", $param['child2_bed_type']) : '',
                        // 'infant' => isset($param['infant']) && !empty($param['infant']) ? implode(",", $param['infant']) : '',
                ];
                // echo "<pre>";print_r($MypopC);die;
                //setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
                setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");

                $result = ['status' => true, 'message' => $message, 'name' => $param['name'], 'leadID' => $getPackagesDataArr['leadID'], 'contactno' => $contactno, 'whatsappmessage' => $whatsappmessage];

                echo Zend_Json::encode($result);
                exit;
            }
        } else {
            $result = ['status' => false, 'message' => 'Unable to send enquiry'];
            echo Zend_Json::encode($result);
            exit;
        }
    }
	
		public function enquiryAction() {
	
	}
	
	
	public function sendenquiryecotravelAction() {
		if ($this->getRequest()->isPost()) {
			$param = $this->getRequest()->getParams();
			//echo"<pre>";print_r($param);die();
			if (!empty($_SERVER['HTTP_CLIENT_IP'])) { // check ip from shared internet
				$user_ip = $_SERVER['HTTP_CLIENT_IP'];
			} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { // check ip passed from proxy
				$user_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
			} else {
				$user_ip = $_SERVER['REMOTE_ADDR'];
			}
			$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
			if (trim($param['date'])) {
				$date = trim($param['date']);
				
				// Create DateTime object from expected format (dd/mm/yyyy)
				$d = DateTime::createFromFormat('d/m/Y', $date);
				
				// Check format validity
				if (!($d && $d->format('d/m/Y') === $date)) {
					$result = [
						'status' => false,
						'message' => 'invaliddate'
					];
					echo Zend_Json::encode($result);
					exit;
				}
			}

            if (empty(trim($param['captcha']))) {
                $result = ['status' => false, 'message' => 'Please enter captcha code.'];
                echo Zend_Json::encode($result);
                exit;
            }
			if (strtolower($param['captcha']) != $_SESSION['captcha']) {
				$result = ['status' => 'captcha', 'message' => 'Captcha code invalid.'];
				echo Zend_Json::encode($result);
				exit;
			}else {
			     $_SESSION['captcha'] = '';
				if (isset($param['name'])) {
					$param['name'] = $param['name'];
					$salutation = @$param['salutation'];
				} else {
					$salutation = @$param['salutation'];
					$fname = @$param['fname'];
					$lname = @$param['lname'];
					$param['name'] = $fname . ' ' . $lname;
				}

				
				$FirstName = (isset($fname) && $fname != '') ? $fname : $param['name'];
				$LastName = (isset($lname) && $lname != '') ? $lname : '';
				$countryCode = isset($param['countrycode']) ? $param['countrycode'] : '+91';
                                $message = (isset($param['remark']) && !empty($param['remark'])) ? $param['remark'] : $param['message'];
                                $PlanType = (isset($param['PlanType'])) ? $param['PlanType'] : 5;
				$CurrencyType = (isset($param['CurrencyType'])) ? $param['CurrencyType'] : 'INR';
                                $CurrencyRequired = (isset($param['CurrencyRequired'])) ? $param['CurrencyRequired'] : '';
                                $InventoryType = (isset($param['InventoryType'])) ? $param['InventoryType'] : '1';
                                $DestinationPlaces = (isset($param['DestinationPlaces'])) ? $param['DestinationPlaces'] :'';
                                $package_destination = (isset($param['package_destination'])) ? $param['package_destination'] :'';
                                $DestinationPlacesIds = (isset($param['package_destinationsId'])) ? $param['package_destinationsId'] :'';
								$from_destination_id = (isset($param['from_destination_id'] ))?  $param['from_destination_id'] :'';
								$from_destination = (isset($param['from_destination'] ))?  $param['from_destination'] :'';
                                $package_tpid = (isset($param['package_tpid'])) ? (int)$param['package_tpid'] : 0;
                                if(!empty($package_destination)){
                                    $DestinationPlaces = $package_destination;
                                }
                                
				if($PlanType == 'Forex' || $PlanType == 'Umrah'){
					$PlanType = 10;
					$message = $PlanType.' - '.$message;
				}
                                $date = (isset($param['traveldate']) && !empty($param['traveldate'])) ? trim($param['traveldate']) : trim($param['date']);
								
				if (isset($param['getformId']) && (trim($param['getformId']) == 'Iscruise')) {				
					$cabinType = $param['cabinType'];
					if(!empty($cabinType)){
					$cabinType = ' { ' . 'Cabin Type - '.$cabinType . ' } ';
					}					
					$message = 'Cruise Enquiry -' . $cabinType . $param['remark'];
					 
				}	
				if (isset($param['getformId']) && (trim($param['getformId']) == 'Isinsurance')) {					
				    $checkInDate = (isset($param['date'])) ? $param['date'] : '';
					 $checkOutDate = ( isset($param['date2'])) ? $param['date2'] : ''; 
					 $residence = ( isset($param['Nationality'])) ? $param['Nationality'] : ''; 
					 $Country = ( isset($param['DestinationPlaces'])) ? $param['DestinationPlaces'] : ''; 
					
					if(!empty($Country)){
					$Country = ' { ' . 'Country - '.$Country . ' } ';
					}
					 
					if(!empty($checkInDate)){
					$checkInDate = ' { ' . 'Trip Start Date - '.$checkInDate . ' } ';
					}		
					if(!empty($checkOutDate)){
					$checkOutDate = ' { ' . 'Trip End Date - '.$checkOutDate . ' } ';
					}
					if(!empty($residence)){
					$residence = ' { ' . 'Nationality - '.$residence . ' } ';
					}
					
					$message = 'Insurance Enquiry -' . $Country . $checkInDate .  $checkOutDate .  $residence . $param['remark'];
					 
				}
				if (isset($param['getformId']) && (trim($param['getformId']) == 'Ishotel')) {
					
					 $checkInDate = (isset($param['date'])) ? $param['date'] : '';
					 $checkOutDate = ( isset($param['date2'])) ? $param['date2'] : ''; 
					 $residence = ( isset($param['Nationality'])) ? $param['Nationality'] : ''; 
					 
					if(!empty($checkInDate)){
					$checkInDate = ' { ' . 'Check In - '.$checkInDate . ' } ';
					}		
					if(!empty($checkOutDate)){
					$checkOutDate = ' { ' . 'Check Out - '.$checkOutDate . ' } ';
					}
					if(!empty($residence)){
					$residence = ' { ' . 'Nationality - '.$residence . ' } ';
					}
					
					$message = 'Hotels Enquiry -' . $checkInDate .  $checkOutDate .  $residence . $param['remark'];
					 
				}
				if (isset($param['getformId']) && (trim($param['getformId']) == 'Ispackage')) {				
										
					$message = 'Package Enquiry - ' . $param['remark'];
					 
				}
				
				if (isset($param['getformId']) && (trim($param['getformId']) == 'Isflight')) {
					
					 $checkInDate = (isset($param['date'])) ? $param['date'] : '';
					 $checkOutDate = ( isset($param['date2'])) ? $param['date2'] : ''; 
					 $NoofTraveler2 = ( isset($param['NoofTraveler'])) ? $param['NoofTraveler'] : ''; 
					 
					 $DepartingFrom = ( isset($param['DestinationPlaces'])) ? $param['DestinationPlaces'] : ''; 
					 $GoingTo = ( isset($param['DestinationPlaces2'])) ? $param['DestinationPlaces2'] : ''; 
					 
					if(!empty($NoofTraveler2)){
					$NoofTraveler2 = ' { ' . 'Passengers - '.$NoofTraveler2 . ' } ';
					}
					 
					if(!empty($checkInDate)){
					$checkInDate = ' { ' . 'Departure - '.$checkInDate . ' } ';
					}		
					if(!empty($checkOutDate)){
					$checkOutDate = ' { ' . 'Return - '.$checkOutDate . ' } ';
					}
					if(!empty($DepartingFrom)){
					$DepartingFrom = ' { ' . 'Departing From - '.$DepartingFrom . ' } ';
					}
					if(!empty($GoingTo)){
					$GoingTo = ' { ' . 'Going To - '.$GoingTo . ' } ';
					}
					
					$message = 'Flight Enquiry -' . $checkInDate .  $checkOutDate .  $DepartingFrom .  $GoingTo . $NoofTraveler2 . $param['remark'];
					 
				}
				
				//echo"<pre>";print_r($message);die();
								
				$this->postFields = "";
				$this->postFields .= "&AgencySysId=$this->AgencyId";
				$this->postFields .= "&Salutation=" . $salutation;
				$this->postFields .= "&CountryCode=" . $countryCode;
				$this->postFields .= "&FirstName=" . $FirstName;
				$this->postFields .= "&LastName=" . $LastName;
				$this->postFields .= "&message=" . $message. ' '. $param['thispackageurl'] . ' '. $param['message'];
				$this->postFields .= "&Email=" . $param['email'];
				$this->postFields .= "&MobileNumber=" . $param['mobile'];
				$this->postFields .= "&PlanType=" . (int)$PlanType;
				$this->postFields .= "&CurrencyType=" . $CurrencyType;
				$this->postFields .= "&CurrencyRequired=" . (int)$CurrencyRequired;
				$this->postFields .= "&InventoryType=" . $InventoryType;
				$this->postFields .= "&ToDestination=" . $DestinationPlaces;
				$this->postFields .= "&ToDestinationId=" . $DestinationPlacesIds;
				$this->postFields .= "&FromDestinationId=" . $from_destination_id;
				$this->postFields .= "&FromDestination=" . $from_destination;
				$this->postFields .= "&NoofTraveler=" . $param['NoofTraveler']; 
				$this->postFields .= "&traveldate=" . $date;
				$this->postFields .= "&IPAddress=" . $user_ip;
			
				
//				$this->postFields .= "&packageSysId=" . $package_tpid;
				 // echo"<pre>";print_r($this->postFields);die();
				//            $resultset = $this->objMdl->rv_insert($this->tablename, $insertdata);

				if (isset($param['form_type']) && (trim($param['form_type']) == 'contact_us')) {
					$message = "Your query has been sent successfully.";
					$status = true;
				} else {
					try {
						$model = new Gtxwebservices_Model_Webservices();
						$getPackagesData = $model->sendLead($this->postFields);
                        $getPackagesDataArr = json_decode($getPackagesData, 1);                                                
						//echo "<pre>";print_r($getPackagesData);exit;

						$message = "Your query has been sent successfully.";
						$status = true;
					} catch (Zend_Exception $error) {
						$message = $this->view->error_msg = $error->getMessage();
						$status = false;
					}
				}

				$MypopC = [
					'Salutation' => $param['salutation'],
					'fname' => $param['fname'],
					'lname' => $param['lname'],
					'name' => $param['name'],
					'email' => $param['email'],
					'countrycode' => $param['countrycode'],
					'mobile' => $param['mobile'],
					'from_destination_id' => $param['from_destination_id'],
					'from_destination' => $param['from_destination'],
					'from_destination_name' => $param['from_destination_name'],
					'date' => $param['date'],
					'message' => $param['remark']. ' '. $param['thispackageurl'] . ' '. $param['message'],
					'PlanType' => $param['PlanType'],
					'CurrencyType' =>  (int)($param['CurrencyType']),
					'CurrencyRequired' =>  (int)($param['CurrencyRequired']),
					'InventoryType' =>  $param['InventoryType'],
					'DestinationPlaces' =>  $param['DestinationPlaces'],
					// 'room' => isset($param['room']) && !empty($param['room']) ? count($param['room']) : '',
					// 'adult' => isset($param['adult']) && !empty($param['adult']) ? implode(",", $param['adult']) : '',
					// 'adult_bed_type' => isset($param['adult_bed_type']) && !empty($param['adult_bed_type']) ? implode(",", $param['adult_bed_type']) : '',
					// 'child' => isset($param['child']) && !empty($param['child']) ? implode(",", $param['child']) : '',
					// 'child1_bed_type' => isset($param['child1_bed_type']) && !empty($param['child1_bed_type']) ? implode(",", $param['child1_bed_type']) : '',
					// 'child2_bed_type' => isset($param['child2_bed_type']) && !empty($param['child2_bed_type']) ? implode(",", $param['child2_bed_type']) : '',
					// 'infant' => isset($param['infant']) && !empty($param['infant']) ? implode(",", $param['infant']) : '',
				];
				// echo "<pre>";print_r($MypopC);die;
				//setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
				setcookie("MyCookies", json_encode($MypopC), time() + (3600 * 24 * 2), "/");
				$result = ['status' => true, 'message' => $message, 'name' => $param['name'], 'leadID' => $getPackagesDataArr['leadID']];

				echo Zend_Json::encode($result);
				exit;
			}
		} else {
			$result = ['status' => false, 'message' => 'Unable to send enquiry'];
			echo Zend_Json::encode($result);
			exit;
		}
	}
	
	public function europamundoAction() {
		
	}

}

Youez - 2016 - github.com/yon3zu
LinuXploit