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/regencytours.in/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/regencytours.in/application/controllers/IndexController.php
<?php
	
	/* * *************************************************************
		* Catabatic Technology Pvt. Ltd.
		* File Name     : IndexController.php
		* File Desc.    : Index controller for home page front end
		* Created By    : Piyush Tiwari <piyush@catpl.co.in>
		* Created Date  : 27 June 2018
		* Updated Date  : ------------
	* ************************************************************* */
	
	class IndexController extends Catabatic_CheckSession {
		
		protected $objMdl;
		protected $tablename;
		protected $tablenameDestination;
		protected $baseUrl;
		protected $tollfreenumber;
		protected $objHelperGeneral;
		protected $per_page_record;
		protected $siteName;
		protected $gtxagencysysid;
		protected $stylecss;
		protected $gtxBtoBsite;
		protected $enableCache;
		protected $packageTypeStatic;
		protected $tablenameTes;
		protected $tablepart;
		protected $hotelTypeArr;
		protected $show_on_search;
		public $_session;
		public $customerbookinglistAPIUrl;
		public $uploadPakcagePath;
		public $uploadDestinationPath;
		public $dummyImagePackage;
		public $dummyImageDestination;
		public $myNamespace;
		
		public function init() {
			parent::init();
			$aConfig = $this->getInvokeArg('bootstrap')->getOptions();
			$BootStrap = $aConfig['bootstrap'];
			
			$this->siteName = $BootStrap['siteName'];
			$this->gtxagencysysid = $BootStrap['gtxagencysysid'];
			$this->baseCurrency = $BootStrap['baseCurrency'];
			$this->stylecss = $BootStrap['stylecss'];
			$this->baseUrl = $BootStrap['siteUrl'];
			$this->tollfreenumber = $BootStrap['tollfreenumber'];
			
			$this->gtxBtoBsite = $BootStrap['gtxBtoBsite'];
			$this->objMdl = new Admin_Model_CRUD();
			
			$this->tablename = "tb_tbb2c_packages_master";
			$this->tablenameTes = "tbl_testimonials";
			$this->tablenameDestination = "tb_tbb2c_destinations";
			$this->tablepart = "tbl_about_agency";
			$this->hotelTypeArr = ['Standard', 'Deluxe', 'Luxury'];
			
			$this->objHelperGeneral = $this->_helper->General;
			$this->per_page_record = 10;
			$this->_session = new Zend_Session_Namespace('User');
			
			$this->uploadPakcagePath = 'public/upload/' . $this->stylecss . '/tours/';
			$this->uploadDestinationPath = 'public/upload/' . $this->stylecss . '/destinations/';
			
			$this->dummyImagePackage = 'default-tour.jpg';
			$this->dummyImageDestination = 'default-destination.jpg';
			
			$this->enableCache = $BootStrap['enableCache'];
			$this->packageTypeStatic = $BootStrap['packageTypeDynamic'];
			
			$this->customerbookinglistAPIUrl = API_CUSTOMER_LIST; // from constant file
			
			$this->myNamespace = new Zend_Session_Namespace('MypopSess'); // get user end infomations
			$this->show_on_search = [];
		}
		
		public function indexAction() {     
			
			$currencyTypeArray = $this->objHelperGeneral->getCurrencyData();
			//echo"<pre>";print_r($currencyTypeArray);die;
			$decodedPackageDestinationArray = array();
			$geoCityData = $this->objMdl->getAllCountyDetailForHomePage();
			$arrContextOptions = array(
            "ssl" => array(
			"verify_peer" => false,
			"verify_peer_name" => false,
            ),
			);
			
			$url = $this->baseUrl . 'public/data/dynamic/car_station.json';
			$carstationArray = file_get_contents($url, false, stream_context_create($arrContextOptions));
			
			$packageDestinationArray = file_get_contents($this->baseUrl . 'public/upload/' . $this->stylecss . '/data/dynamic/data/dynamic/package_destinations.json');
			if (!empty($carstationArray)) {
				//    $decodedcarstationArray = Zend_Json::decode($carstationArray);
			}
			$resultHomeCommon = $this->objMdl->getCmsdata('tbl_home_common_box', ['*'], ['AgencySysId' => $this->gtxagencysysid], ['home_common_id' => 'DESC']);
			$popularTourContent = json_decode($resultHomeCommon->popularTourContent, 1);
			$destinationContent = json_decode($resultHomeCommon->destinationContent, 1);
			$perfectTourContent = json_decode($resultHomeCommon->perfectTourContent, 1);
			$vedioUrl = $resultHomeCommon->vedioUrl;
			// echo "<pre>";print_r($packageDestinationArray);exit();
			//$blogContent = json_decode($resultHomeCommon->blogContent, 1);
			//$offersContent = json_decode($resultHomeCommon->offersContent, 1);
			$otherUsefulContent = json_decode($resultHomeCommon->otherUsefulContent, 1);
			//$interestingFactsContent = json_decode($resultHomeCommon->interestingFactsContent, 1)
			$finalarray = array(
            'TitleSection1' => $destinationContent['destinationTitle'],
            'TitleSection2' => $otherUsefulContent['themeTitle'],
            'TitleSection3' => $popularTourContent['internationalTourTitle'],
            'TitleSection4' => $perfectTourContent['domesticTourTitle'],
            'videourl' => $vedioUrl,
			);
			
			$popads = $this->objMdl->rv_random_popads('tbl_popads', ['*'], ['isMarkForDel' => 0]);
			$this->view->popads = $popads;
			
			$destinatonTop = $this->objMdl->rv_select_all($this->tablenameDestination, ['DesSysId', 'Title', 'Activities', 'Hotels', 'Tours', 'pricestart', 'Image', 'DestDescription', 'Countries'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsFeatured' => 1, 'IsMarkForDel' => 0], ['DesSysId' => 'ASC'], 9);
			
			$display_on_header = $this->objMdl->rv_select_all($this->tablenameDestination, ['DesSysId', 'Title', 'Activities', 'Hotels', 'Tours', 'Image', 'DestDescription', 'DisplayOnHeader'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'DisplayOnHeader' => 1, 'IsMarkForDel' => 0], ['DisplayOnHeader' => 'DESC'], 100);
			//    echo "<pre>";
			//    print_r($display_on_header);
			$destinatonTopArr = array();
			foreach ($destinatonTop as $topdesKey => $topdesValue) {
				$desTitleValue = $topdesValue['Title'];
				$whereCustom = ($desTitleValue) ? " ( Destinations LIKE '%{$desTitleValue}%' )" : "";
				
				$tourResult = $this->objMdl->rv_select_row_where_custom($this->tablename, ['count(*) as totalCount'], ['IsMarkForDel' => 0, 'IsActive' => 1, 'IsPublish' => 1, 'ItemType' => 1], $whereCustom, [], '');
				
				$destinatonTopArr[] = [
                'DesSysId' => $topdesValue['DesSysId'],
                'Title' => $topdesValue['Title'],
                'Activities' => $topdesValue['Activities'],
                'Hotels' => $topdesValue['Hotels'],
                'Tours' => $topdesValue['Tours'],
                'pricestart' => $topdesValue['pricestart'],
                'Image' => $topdesValue['Image'],
                'DestDescription' => $topdesValue['DestDescription'],
                'Countries' => $topdesValue['Countries'],
                'totalCount' => $tourResult['totalCount'],
				];
			}
			
			$aboutpartners = $this->objMdl->rv_select_all('tbl_about_agency', ['id', 'title', 'icon', 'url', 'tab'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsMarkForDel' => 0,], ['id' => 'DESC'], 20);
			// echo"<pre>";print_r( $destinatonTopArr);die;
			foreach ($aboutpartners as $aboutKey => $aboutValue) {
				$aboutPartnersArray[] = [
                'id' => $aboutValue['id'],
                'icon' => $aboutValue['icon'],
                'title' => $aboutValue['title'],
				];
				//echo"<pre>";print_r($aboutPartnersArray);die;
			}
			
			$this->view->finalarray = $finalarray;
			
			$this->view->destinations = $destinatonTopArr;
			$this->view->baseUrl = $this->baseUrl;
			$this->view->tollfreenumber = $this->tollfreenumber;
			$this->view->siteName = $this->siteName;
			$this->view->show_on_search = $display_on_header;
			$this->view->aboutPartnersArray = $aboutPartnersArray;
			// echo"<pre>";print_r( $aboutPartnersArray);die;
			
     		
			$trendingTours = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['GTXPkgId'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'IsFeatured' => 1, 'countryIds' => 101], ['GTXPkgId' => 'DESC'], 12);
			
			$GTXPkgId2 = array_column(array_slice($trendingTours, 0, 12), 'GTXPkgId');
			
			if(!empty($GTXPkgId2)){
				$trendingTours = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $GTXPkgId2, 12);
				}else{
				$trendingTours = [];
			}
			
			$trendingToursinter = array();
			//echo"<pre>";print_r($trendingTours);die;
			$trendingToursinter = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['GTXPkgId'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'IsFeatured' => 1, 'countryIds!' => 101], ['GTXPkgId' => 'DESC'], 12);
			
			$GTXPkgId = array_column(array_slice($trendingToursinter, 0, 12), 'GTXPkgId');
			if(!empty($GTXPkgId)){
				$trendingToursinter = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $GTXPkgId, 12);
				}else{
				$trendingToursinter = [];
			}
			
			$trendingHotDeal = array();
			//echo"<pre>";print_r($trendingTours);die;
			$trendingHotDeal = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['GTXPkgId'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'lastMinuteDeal' => 1], ['PkgSysId' => 'DESC'], 12);
			
			$GTXPkgId3 = array_column(array_slice($trendingHotDeal, 0, 12), 'GTXPkgId');
			if(!empty($GTXPkgId3)){
				$trendingHotDeal = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $GTXPkgId3, 12);
				}else{
				$trendingHotDeal = [];
			}
			
			$trendingActivities = array();       
			$trendingActivities = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['GTXPkgId'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 3, 'IsFeatured' => 1], ['PkgSysId' => 'DESC'], 12);
			
			$GTXPkgId3 = array_column(array_slice($trendingActivities, 0, 12), 'GTXPkgId');
			if(!empty($GTXPkgId3)){
				$trendingActivities = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $GTXPkgId3, 12);
				}else{
				$trendingActivities = [];
			}
			
			$lastMinuteTours = array();       
			$lastMinuteTours = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['GTXPkgId'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'lastMinuteDeal' => 1], ['PkgSysId' => 'DESC'], 12);
			
			$GTXPkgId3 = array_column(array_slice($lastMinuteTours, 0, 12), 'GTXPkgId');
			if(!empty($GTXPkgId3)){
				$lastMinuteTours = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $GTXPkgId3, 12);
				}else{
				$lastMinuteTours = [];
			}
			
			
			foreach ($lastMinuteTours as $key => $values) {
				
				$destinationArr = explode(',', $values['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($values['LongJsonInfo']);
				
				$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $values['PackageType'], $values['PackageSubType']); // get default category
				
				$tourImage1 = explode(',', $values['Image']);
				$tourImage = $tourImage1[0];
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($values['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
				$defaultCategoryIdm = isset($LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id']) ? $LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id'] : 0;
				$lastMinuteToursFinal[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => $LongJsonInfo['package']['Name'], // full name of package name
                'img' => $tourImage,
                'night' => $values['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice)),
                'pricerange' => $LongJsonInfo['package']['PriceRange'],
                'star' => $values['StarRating'],
                'Destination' => $values['Destinations'],
                'PkgSysId' => $values['PkgSysId'],
                'GTXPkgId' => $values['GTXPkgId'],
                'defaultCategoryId' => ($defaultCategoryId != '') ? $defaultCategoryId : $defaultCategoryIdm,
                'defaultCategory' => $defaultCategory,
                'tourtype' => ($defaultTourType != '') ? $defaultTourType : 1,
                'TPId' => $TPId,
                'PackageType' => $values['PackageType'],
                'mp' => $MPType,
                'Countries' => $values['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $values['BookingValidUntil'],
				];
			}
			foreach ($trendingTours as $key => $value) {
				
				$destinationArr = explode(',', $value['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
				$iamges = $value['Image'];
				$imagesa = explode(',', $iamges);
				foreach ($imagesa as $imgsdds) {
					$finalimage = $imgsdds;
				}
				
				if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				if (trim($value['Image']) != '') {
					//die($LongJsonInfo['package']['ImgThumbnail']);
					$tourImage1 = explode(',', $value['Image']);
					if ($tourImage1[0] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/small/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/small/' . $tourImage1[1];
					}
					} else {
					$tourImage = $LongJsonInfo['package']['ImgThumbnail'];
				}
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
				$defaultCategoryIdm = isset($LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id']) ? $LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id'] : 0;
				//die(trim($LongJsonInfo['package']['Name']))
				$exchangeRate = 1;
				if ($this->gtxagencysysid == 110327) {
					$exchangeRate = $this->currencyExchangeRate($getCurrencyType, 2, 0);
					$getCurrencyType = '2';
				}
				$toursFinal[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => trim($LongJsonInfo['package']['Name']), // full name of package name
                'img' => $tourImage,
                'night' => $value['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice * $exchangeRate)),
                'currencyType' => $currencyTypeArray[$getCurrencyType],
                'star' => $value['StarRating'],
                'Destination' => $value['Destinations'],
                'PkgSysId' => $value['PkgSysId'],
                'GTXPkgId' => $value['GTXPkgId'],
                'defaultCategoryId' => ($defaultCategoryId != '') ? $defaultCategoryId : $defaultCategoryIdm,
                'defaultCategory' => $defaultCategory,
                'tourtype' => ($defaultTourType != '') ? $defaultTourType : 1,
                'TPId' => $TPId,
                'PackageType' => $value['PackageType'],
                'mp' => $MPType,
                'Countries' => $value['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $value['BookingValidUntil'],
                'oldPrice' => $value['oldPrice'],
				];
			}
			
			
			foreach ($trendingToursinter as $key => $value) {
				
				$destinationArr = explode(',', $value['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
				
				if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				
				if (isset($value['Image']) != '') {
					//    die($LongJsonInfo['package']['ImgThumbnail']);
					$tourImage1 = explode(',', $value['Image']);
					if ($tourImage1[0] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/{size}/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/{size}/' . $tourImage1[1];
					}
					} else {
					$tourImage = $LongJsonInfo['package']['ImgThumbnail'];
				}
				
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
				$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
				$exchangeRate = 1;
				if ($this->gtxagencysysid == 110327) {
					$exchangeRate = $this->currencyExchangeRate($getCurrencyType, 2, 0);
					$getCurrencyType = '2';
				}
				
				$toursFinalinter[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => $LongJsonInfo['package']['Name'], // full name of package name
                'img' => $tourImage,
                'night' => $value['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice * $exchangeRate)),
                'currencyType' => $currencyTypeArray[$getCurrencyType],
                'star' => $value['StarRating'],
                'Destination' => $value['Destinations'],
                'PkgSysId' => $value['PkgSysId'],
                'GTXPkgId' => $value['GTXPkgId'],
                'defaultCategoryId' => $defaultCategoryId,
                'defaultCategory' => $defaultCategory,
                'tourtype' => $defaultTourType,
                'TPId' => $TPId,
                'PackageType' => $value['PackageType'],
                'mp' => $MPType,
                'Countries' => $value['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $value['BookingValidUntil'],
                'oldPrice' => $value['oldPrice'],
				];
			}
			
			foreach ($trendingHotDeal as $key => $value) {
				
				$destinationArr = explode(',', $value['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
				
				if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				
				if (isset($value['Image']) != '') {
					//    die($LongJsonInfo['package']['ImgThumbnail']);
					$tourImage1 = explode(',', $value['Image']);
					if ($tourImage1[0] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/{size}/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/{size}/' . $tourImage1[1];
					}
					} else {
					$tourImage = $LongJsonInfo['package']['ImgThumbnail'];
				}
				
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
				$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
				$exchangeRate = 1;
				if ($this->gtxagencysysid == 110327) {
					$exchangeRate = $this->currencyExchangeRate($getCurrencyType, 2, 0);
					$getCurrencyType = '2';
				}
				$toursFinalHotDeal[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => $LongJsonInfo['package']['Name'], // full name of package name
                'img' => $tourImage,
                'night' => $value['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice * $exchangeRate)),
                'currencyType' => $currencyTypeArray[$getCurrencyType],
                'star' => $value['StarRating'],
                'Destination' => $value['Destinations'],
                'PkgSysId' => $value['PkgSysId'],
                'GTXPkgId' => $value['GTXPkgId'],
                'defaultCategoryId' => $defaultCategoryId,
                'defaultCategory' => $defaultCategory,
                'tourtype' => $defaultTourType,
                'TPId' => $TPId,
                'PackageType' => $value['PackageType'],
                'mp' => $MPType,
                'Countries' => $value['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $value['BookingValidUntil'],
                'oldPrice' => $value['oldPrice'],
				];
			}
			
			$activityFinal = array();
			foreach ($trendingActivities as $tKey => $tVal) {
				
				$LongJsonInfo = json_decode($tVal['LongJsonInfo'], 1);
				
				if (isset($LongJsonInfo['ThumnailImg']) && trim($LongJsonInfo['ThumnailImg']) != '') {
					$imagename = $LongJsonInfo['ThumnailImg'];
					} else {
					$imagename1 = explode(',', $tVal['Image']);
					$imagename = $this->baseUrl . 'public/upload/' . $this->stylecss . '/activities/' . $tVal['PkgSysId'] . '/images/medium/' . $imagename1[0];
					
					//echo "<pre>"; print_r($imagename); die;
				}
				$rate = 1;
				
				// foreach($currencyRate as $cKey => $cVal){
				//  if($cVal['FCurrencyType'] == $LongJsonInfo['Currency'] && $cVal['TCurrencyType'] == 1){
				//      $rate = $cVal['Rate'];
				//  }    
				// }
				$netPrice = 0;
				if (!empty($LongJsonInfo['SICCost'])) {
					$netPrice = (int) ($LongJsonInfo['SICCost'][0]['NetAdultCost'] + $LongJsonInfo['AdultEntryFee']);
					} else if (!empty($LongJsonInfo['PvtCost'])) {
					$netPrice = (int) ($LongJsonInfo['PvtCost'][0]['NetAdultCost'] + $LongJsonInfo['AdultEntryFee']);
					} else {
					$netPrice = (int) $LongJsonInfo['AdultEntryFee'];
				}
				//echo "<pre>";print_r($LongJsonInfo);die;
				$activityFinal[] = [
                'PkgSysId' => $tVal['PkgSysId'],
                'Title' => $LongJsonInfo['Title'],
                'destination' => $tVal['Destinations'],
                'oldPrice' => (isset($tVal['oldPrice']) && $tVal['oldPrice'] != 0 && $tVal['oldPrice'] != '') ? $tVal['oldPrice'] : '',
                'Image' => $imagename,
                'Duration' => $LongJsonInfo['Duration'],
                'DurationInMin' => $LongJsonInfo['DurationInMin'],
                'DurationStr' => $LongJsonInfo['DurationStr'],
                'PriceAdditional' => isset($netPrice) ? round($netPrice) : 0,
                'CurrencySymbol' => isset($LongJsonInfo['CurrencySymbol']) ? $LongJsonInfo['CurrencySymbol'] : 'INR',
				// 'CurrencySymbol' => ($currencyType) ? $currencyType : 'INR',
				];
			}
			
			$testimonials = $this->objMdl->rv_select_all('tbl_feedback', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'displayOnHome' => 1], ['FeedbackId' => 'DESC'], 10);
			$bannerDetail = $this->objMdl->rv_select_all('tb_homebanner_detail', ['banner_id', 'image', 'heading', 'description', 'videolink', 'url', 'opt'], ['AgencySysId' => $this->gtxagencysysid, 'status' => 1, 'isDisplayOnHome' => 1, 'isMarkForDel' => 0], ['banner_id' => 'DESC'], 10);
			//echo"<pre>";print_r($highlightDetail);die();
			$resultsetTheme = $this->objMdl->rv_select_all('tbl_pack_type', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'IsActive' => 1, 'displayOnHome' => 1], ['Title' => 'DESC'], 12);
			$trustedmember = $this->objMdl->rv_select_all('tbl_trustedmember', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'status' => 1], ['Id' => 'DESC'], 3);
			
			$homePromotionTypeOne = $this->objMdl->rv_select_all('tbl_home_promotion', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsmarkForDel' => 0, 'IsFeatured' => 1, 'templatetype' => 1], ['promotionId' => 'DESC'], 10);
			$homePromotionTypeTwo = $this->objMdl->rv_select_all('tbl_home_promotion', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsmarkForDel' => 0, 'IsFeatured' => 1, 'templatetype' => 2], ['promotionId' => 'DESC'], 1);
			$homePromotionTypeThree = $this->objMdl->rv_select_all('tbl_home_promotion', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsmarkForDel' => 0, 'IsFeatured' => 1, 'templatetype' => 3], ['promotionId' => 'DESC'], 1);
			
			$tagName = json_decode($homePromotionTypeTwo[0]['promotion_name']);
			$promotionUrl = json_decode($homePromotionTypeTwo[0]['promotion_url']);
			$tabType = json_decode($homePromotionTypeTwo[0]['tab_type']);
			//echo"<pre>";print_r($tagName);die();
			$finalArrayTwo = array();
			$finalArrayTwo[0] = ['tagNAme' => $tagName->promotion_tag1, 'promotionUrl' => $promotionUrl->promotion_tag_url1, 'tabType' => $tabType->tagopt1];
			$finalArrayTwo[1] = ['tagNAme' => $tagName->promotion_tag2, 'promotionUrl' => $promotionUrl->promotion_tag_url2, 'tabType' => $tabType->tagopt2];
			$finalArrayTwo[2] = ['tagNAme' => $tagName->promotion_tag3, 'promotionUrl' => $promotionUrl->promotion_tag_url3, 'tabType' => $tabType->tagopt3];
			$finalArrayTwo[3] = ['tagNAme' => $tagName->promotion_tag4, 'promotionUrl' => $promotionUrl->promotion_tag_url4, 'tabType' => $tabType->tagopt4];
			$homePromotionTypeTwoArr = array();
			if ($homePromotionTypeTwo[0]['promotionId']) {
				$homePromotionTypeTwoArr = [
                'promotionId' => $homePromotionTypeTwo[0]['promotionId'],
                'templatetype' => $homePromotionTypeTwo[0]['templatetype'],
                'promotion_image' => $homePromotionTypeTwo[0]['promotion_image'],
                'finalArrayTwo' => $finalArrayTwo,
				];
			}
			
			$resultPromotionCategory = $this->objMdl->getCmsdata('tbl_promotion_category', ['*'], ['prom_cat_id'], ['prom_cat_id' => 'DESC']);
			$getCmsPageDetail = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'about-us', 'status' => 'Activate'], ['sid' => 'desc']);
			$getOfferDetail = $this->objMdl->rv_select_all('tbl_offers', ['*'], ['status' => 1, 'AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'isActive' => 1], ['id' => 'desc']);
			$getRewardDetail = $this->objMdl->rv_select_all('tbl_reward', ['*'], ['status' => 1, 'AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0], ['id' => 'desc']);
			$getCoachesDetail = $this->objMdl->rv_select_all('tbl_coaches', ['*'], ['status' => 1, 'AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0], ['id' => 'desc']);
			$travelogues = $this->objMdl->rv_select_all('tbl_travelogues', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'status' => 1, 'displayOnBanner' => 1, 'category' => 1], ['TravId' => 'DESC'], 10);
			$travelogues = $this->objMdl->rv_select_all('tbl_travelogues', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'status' => 1, 'displayOnBanner' => 1, 'category' => 1], ['TravId' => 'DESC'], 10);
			//$flightsourcedestin = $this->objMdl->rv_select_all('tbl_flight', ['*'], ['IsActive' => 1], [], 20);
			$getCmsPageDetail_1 = $this->objMdl->rv_select_row('tbl_static_pages', ['sid', 'page_description', 'page_title', 'background_image'], ['identifier' => 'why-choose-us', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_2 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description', 'page_title'], ['identifier' => 'personalized-matching', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_3 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description', 'page_title'], ['identifier' => 'unmatched-destination-expertise', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_4 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description', 'page_title'], ['identifier' => '24-7-support-from', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_5 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description', 'page_title'], ['identifier' => 'commitment-to-health-safety', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_6 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description', 'page_title'], ['identifier' => 'home-slogan', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_7 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description', 'page_title'], ['identifier' => 'footer-slogan', 'status' => 'Activate'], ['sid' => 'desc']);
			
			$resultHomeCommon = $this->objMdl->getCmsdata('tbl_home_page_box', ['*'], ['AgencySysId' => $this->gtxagencysysid], ['home_common_id' => 'DESC']);
			
			$block1 = json_decode($resultHomeCommon->block1, 1);
			$block2 = json_decode($resultHomeCommon->block2, 1);
			$block3 = json_decode($resultHomeCommon->block3, 1);
			$block4 = json_decode($resultHomeCommon->block4, 1);
			$block5 = json_decode($resultHomeCommon->block5, 1);
			$block6 = json_decode($resultHomeCommon->block6, 1);
			$block7 = json_decode($resultHomeCommon->block7, 1);
			$block8 = json_decode($resultHomeCommon->block8, 1);
			$home_common_id = $resultHomeCommon->home_common_id;
			$this->view->home_common_id = $home_common_id;
			
			$homepagedata = array(
            array('view' => 'banner', 'Title' => $block1['block1Title'], 'Description' => $block1['block1Description'], 'order' => $block1['block1Order']),
            array('view' => 'bestoffers', 'Title' => $block2['block2Title'], 'Description' => $block2['block2Description'], 'order' => $block2['block2Order']),
            array('view' => 'findbestthings', 'Title' => $block3['block3Title'], 'Description' => $block3['block3Description'], 'order' => $block3['block3Order']),
            array('view' => 'destination', 'Title' => $block4['block4Title'], 'Description' => $block4['block4Description'], 'order' => $block4['block4Order']),
            array('view' => 'theme', 'Title' => $block5['block5Title'], 'Description' => $block5['block5Description'], 'order' => $block5['block5Order']),
            array('view' => 'theme2', 'Title' => $block6['block6Title'], 'Description' => $block6['block6Description'], 'order' => $block6['block6Order']),
            array('view' => 'theme3', 'Title' => $block7['block7Title'], 'Description' => $block7['block7Description'], 'order' => $block7['block7Order']),
            array('view' => 'PackageIds', 'Title' => $block8['block8Title'], 'Description' => $block8['block8Description'], 'order' => $block8['block8Order'], 'order' => $block8['block8PackageIds']),
			);
			$this->view->homepagedata = $homepagedata;
			
			$block8= explode(',',$block8['block8PackageIds']); 		 
			$block8Packagebyids = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $block8,12);
			
			foreach ($block8Packagebyids as $key => $value) {
				
                $LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
                //echo"<pre>";print_r($value);die;
                if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
                    $categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
                    $categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				
                if (trim($value['Image']) != '') {
                    //die($LongJsonInfo['package']['ImgThumbnail']);
                    $tourImage1 = explode(',', $value['Image']);
                    if ($tourImage1[0] != '') {
                        $tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
                        $tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/' . $tourImage1[1];
					}
					} else {
                    $tourImage = (!empty($LongJsonInfo['package']['ImgThumbnail'])) ? $LongJsonInfo['package']['ImgThumbnail'] : '';
				}
				
                $defaultCategoryId = $categoryDetails['defaultCategoryId'];
                $defaultCategory = $categoryDetails['defaultCategory'];
                $defaultTourType = $categoryDetails['defaultTourType'];
                $TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
                $MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
                $tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
                $priceArrJson = $categoryDetails['priceArrJson'];
                $displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
                $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
                $defaultCategoryIdm = isset($LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id']) ? $LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id'] : 0;
				
                $Packagebyidsblock8[] = [
				'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 30),
				'nameF' => trim($LongJsonInfo['package']['Name']), // full name of package name
				'img' => $tourImage,
				'night' => $value['Nights'],
				'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice)),
				'currencyType' => $currencyTypeArray[$getCurrencyType],
				'star' => $value['StarRating'],
				'Destination' => $value['Destinations'],
				'PkgSysId' => $value['PkgSysId'],
				'GTXPkgId' => $value['GTXPkgId'],
				'defaultCategoryId' => ($defaultCategoryId != '') ? $defaultCategoryId : $defaultCategoryIdm,
				'defaultCategory' => $defaultCategory,
				'tourtype' => ($defaultTourType != '') ? $defaultTourType : 1,
				'TPId' => $TPId,
				'PackageType' => $value['PackageType'],
				'mp' => $MPType,
				'Countries' => $value['Countries'],
				'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
				'BookingValidUntil' => $value['BookingValidUntil'],
				'oldPrice' => $value['oldPrice'],
                ];
				
			}	
			
			
			
			$newhomepagedata = array(
            array('view' => 'domesticytours', 'Title' => $block1['block1Title'], 'Description' => $block1['block1Description'], 'order' => $block1['block1Order']),
            array('view' => 'internationaltours', 'Title' => $block2['block2Title'], 'Description' => $block2['block2Description'], 'order' => $block2['block2Order']),
            array('view' => 'destinations', 'Title' => $block3['block3Title'], 'Description' => $block3['block3Description'], 'order' => $block3['block3Order']),
            array('view' => 'categorytheme', 'Title' => $block4['block4Title'], 'Description' => $block4['block4Description'], 'order' => $block4['block4Order']),
            array('view' => 'testimonial', 'Title' => $block5['block5Title'], 'Description' => $block5['block5Description'], 'order' => $block5['block5Order']),
            array('view' => 'travelogues', 'Title' => $block6['block6Title'], 'Description' => $block6['block6Description'], 'order' => $block6['block6Order']),
            array('view' => 'offers', 'Title' => $block7['block7Title'], 'Description' => $block7['block7Description'], 'order' => $block7['block7Order']),
			);
			
			$this->view->newhomepagedata = $newhomepagedata;
			
			$this->view->travelogues = $travelogues;
			$this->view->videolinks = $videolinks;
			$this->view->trustedmember = $trustedmember;
			$this->view->getOfferDetail = $getOfferDetail;
			$this->view->getRewardDetail = $getRewardDetail;
			$this->view->getCoachesDetail = $getCoachesDetail;
			$this->view->Packagebyidsblock8 = $Packagebyidsblock8;
			
			// echo "<pre>";print_r($homepagedata);die;
			
			$this->view->flightsourcedestin = $flightsourcedestin;
			$this->view->getCmsPageDetail = $getCmsPageDetail;
			$this->view->getCmsPageDetail_1 = $getCmsPageDetail_1;
			$this->view->getCmsPageDetail_2 = $getCmsPageDetail_2;
			$this->view->getCmsPageDetail_3 = $getCmsPageDetail_3;
			$this->view->getCmsPageDetail_4 = $getCmsPageDetail_4;
			$this->view->getCmsPageDetail_5 = $getCmsPageDetail_5;
			$this->view->getCmsPageDetail_6 = $getCmsPageDetail_6;
			$this->view->getCmsPageDetail_7 = $getCmsPageDetail_7;
			
			$this->view->resultPromotionCategory = $resultPromotionCategory;
			$this->view->homePromotionTypeOne = $homePromotionTypeOne;
			$this->view->homePromotionTypeTwo = $homePromotionTypeTwoArr;
			$this->view->homePromotionTypeThree = $homePromotionTypeThree[0];
			$this->view->testimonials = $testimonials;
			$this->view->bannerDetail = $bannerDetail;
			$this->view->highlightDetail = $highlightDetail;
			$this->view->highlightBlockDetail = $highlightBlockDetail;
			$this->view->baseUrl = $this->baseUrl;
			$this->view->toursFinal = $toursFinal;
			$this->view->toursFinalinter = $toursFinalinter;
			$this->view->toursFinalHotDeal = $toursFinalHotDeal;
			$this->view->resultsetTheme = $resultsetTheme;
			$this->view->lastMinuteTours = $lastMinuteToursFinal;
			$this->view->carStationArray = $decodedcarstationArray;
			$this->view->activityFinal = $activityFinal;
			$this->view->MobileDetect = $this->objHelperGeneral->getDevice();
			$this->view->destinationsDomestic = $destinationsDomestic;
			$this->view->trendingTours = $trendingTours;
			
		
			$specialDeals = array();
			//echo"<pre>";print_r($trendingTours);die;
			$specialDeals = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['GTXPkgId'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'lastMinuteDeal' => 1], ['PkgSysId' => 'DESC'], 12);
			
			$GTXPkgId3 = array_column(array_slice($specialDeals, 0, 12), 'GTXPkgId');
			if(!empty($GTXPkgId3)){
				$specialDeals = $this->objMdl->getPackageByPackageIds(['tbl.ItemType' => 1], $GTXPkgId3, 12);
				}else{
				$specialDeals = [];
			}
			
			$specialDealsArray = array();
			
			foreach ($specialDeals as $key => $value) {
				
                $LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
                //echo"<pre>";print_r($value);die;
                if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
                    $categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
                    $categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				
                if (trim($value['Image']) != '') {
                    //die($LongJsonInfo['package']['ImgThumbnail']);
                    $tourImage1 = explode(',', $value['Image']);
                    if ($tourImage1[0] != '') {
                        $tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
                        $tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/' . $tourImage1[1];
					}
					} else {
                    $tourImage = (!empty($LongJsonInfo['package']['ImgThumbnail'])) ? $LongJsonInfo['package']['ImgThumbnail'] : '';
				}
				
                $defaultCategoryId = $categoryDetails['defaultCategoryId'];
                $defaultCategory = $categoryDetails['defaultCategory'];
                $defaultTourType = $categoryDetails['defaultTourType'];
                $TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
                $MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
                $tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
                $priceArrJson = $categoryDetails['priceArrJson'];
                $displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
                
				$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
                $defaultCategoryIdm = isset($LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id']) ? $LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id'] : 0;
				
                $specialDealsArray[] = [
				'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 30),
				'nameF' => trim($LongJsonInfo['package']['Name']), // full name of package name
				'img' => $tourImage,
				'night' => $value['Nights'],
				'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice)),
				'currencyType' => $currencyTypeArray[$getCurrencyType],
				'star' => $value['StarRating'],
				'Destination' => $value['Destinations'],
				'PkgSysId' => $value['PkgSysId'],
				'GTXPkgId' => $value['GTXPkgId'],
				'defaultCategoryId' => ($defaultCategoryId != '') ? $defaultCategoryId : $defaultCategoryIdm,
				'defaultCategory' => $defaultCategory,
				'tourtype' => ($defaultTourType != '') ? $defaultTourType : 1,
				'TPId' => $TPId,
				'PackageType' => $value['PackageType'],
				'mp' => $MPType,
				'Countries' => $value['Countries'],
				'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
				'BookingValidUntil' => $value['BookingValidUntil'],
				'oldPrice' => $value['oldPrice'],
                ];
				
			}
			$gtxPkgIdsu = array_column($specialDealsArray, 'GTXPkgId');
            array_multisort($gtxPkgIdsu, SORT_DESC, $specialDealsArray);

			//  echo"<pre>";print_r($specialDealsArray);die;
			$this->view->specialDealsArray = $specialDealsArray;
			
			$checkDuplicateCountries = array();
			foreach ($geoCityData as $cdKey => $cdVal) {
				if (!in_array(trim($cdVal['CountryIds']), $checkDuplicateCountries)) {
					$finalgeoCityData[] = $cdVal;
					$checkDuplicateCountries[] = trim($cdVal['CountryIds']);
				}
			}
			$this->view->countryNameArray = $finalgeoCityData;
			$sessionFlightSearchParams = new Zend_Session_Namespace('sessionFlightSearchParams');
			$this->view->sessionFlightSearchParams = $sessionFlightSearchParams->params;
			$this->view->popularDestinationArray = $popularDestinationArray;
			$this->view->gtxBtoBsite = $this->gtxBtoBsite;
			
			$SearchCarData = new Zend_Session_Namespace('SearchCarData');
			$this->view->sessionSearchCarData = $SearchCarData->params;
			
			$resultHomeCommon = $this->objMdl->getCmsdata('tbl_home_common_box', ['*'], ['AgencySysId' => $this->gtxagencysysid], ['home_common_id' => 'DESC']);
			$home_common_id = $resultHomeCommon->home_common_id;
			
			$block1 = json_decode($resultHomeCommon->block1, 1);
			$block2 = json_decode($resultHomeCommon->block2, 1);
			$block3 = json_decode($resultHomeCommon->block3, 1);
			$block4 = json_decode($resultHomeCommon->block4, 1);
			$block5 = json_decode($resultHomeCommon->block5, 1);
			$block6 = json_decode($resultHomeCommon->block6, 1);
			$block7 = json_decode($resultHomeCommon->block7, 1);
			$block8 = json_decode($resultHomeCommon->block8, 1);
			$block9 = json_decode($resultHomeCommon->block9, 1);
			$block10 = json_decode($resultHomeCommon->block10, 1);
			$block11 = json_decode($resultHomeCommon->block11, 1);
			$block12 = json_decode($resultHomeCommon->block12, 1);
			$block13 = json_decode($resultHomeCommon->block13, 1);
			$block14 = json_decode($resultHomeCommon->block14, 1);
			$block15 = json_decode($resultHomeCommon->block15, 1);
			$homepageview = array(
            array('view' => 'aboutus', 'Title' => $block1['block1Title'], 'order' => $block1['block1order'], 'status' => $block1['block1check'], 'desc' => $block1['block1Description'], 'searchtext' => $block1['searchtext'], 'banner1' => $block1['banner1'], 'banner2' => $block1['banner2'], 'banner3' => $block1['banner3'], 'banner4' => $block1['banner4'], 'banner5' => $block1['banner5'], 'banner6' => $block1['banner6'], 'banner7' => $block1['banner7'], 'banner8' => $block1['banner8'], 'images' => $block1['images'], 'url' => $block1['url']),
            array('view' => 'destination', 'Title' => $block2['block2Title'], 'order' => $block2['block2order'], 'status' => $block2['block2check'], 'desc' => $block2['block2Description'], 'block2PackageIds' => $block2['block2PackageIds']),
            array('view' => 'offers', 'Title' => $block3['block3Title'], 'order' => $block3['block3order'], 'status' => $block3['block3check'], 'desc' => $block3['block3Description'], 'block3PackageIds' => $block3['block3PackageIds']),
            array('view' => 'packages', 'Title' => $block4['block4Title'], 'order' => $block4['block4order'], 'status' => $block4['block4check'], 'desc' => $block4['block4Description']),
            array('view' => 'domestic', 'Title' => $block5['block5Title'], 'order' => $block5['block5order'], 'status' => $block5['block5check'], 'desc' => $block5['block5Description']),
            array('view' => 'testimonial', 'Title' => $block6['block6Title'], 'order' => $block6['block6order'], 'status' => $block6['block6check'], 'desc' => $block6['block6Description']),
            array('view' => 'blogs', 'Title' => $block7['block7Title'], 'order' => $block7['block7order'], 'status' => $block7['block7check'], 'desc' => $block7['block7Description']),
            array('view' => 'category', 'Title' => $block8['block8Title'], 'order' => $block8['block8order'], 'status' => $block8['block8check'], 'desc' => $block8['block8Description']),
            array('view' => 'country', 'Title' => $block9['block9Title'], 'order' => $block9['block9order'], 'status' => $block9['block9check'], 'desc' => $block9['block9Description'], 'block9PackageIds' => $block9['block9PackageIds']),
            array('view' => 'regions', 'Title' => $block10['block10Title'], 'order' => $block10['block10order'], 'status' => $block10['block10check'], 'desc' => $block10['block10Description'], 'block10PackageIds' => $block10['block10PackageIds']),
            array('view' => 'state', 'Title' => $block11['block11Title'], 'order' => $block11['block11order'], 'status' => $block11['block11check'], 'desc' => $block11['block11Description'], 'block11PackageIds' => $block11['block11PackageIds']),
            array('view' => 'international', 'Title' => $block12['block12Title'], 'order' => $block12['block12order'], 'status' => $block12['block12check'], 'desc' => $block12['block12Description']),
            array('view' => 'partner', 'Title' => $block13['block13Title'], 'order' => $block13['block13order'], 'status' => $block13['block13check'], 'desc' => $block13['block13Description']),
			//  array('view' => 'ourpartners', 'Title' =>$block14['block14Title'], 'order' => $block14['block14order'], 'status' => $block14['block14check'], 'desc' => $block14['block14Description']),
			//array('view' => 'regions', 'Title' =>$block15['block15Title'], 'order' => $block15['block15order'], 'status' => $block15['block15check'], 'desc' => $block15['block15Description']),
			);
			
			$countriesToptrand = $this->objMdl->rv_select_all('tbl_countries', ['*'], ['DisplayOnHeader' => 1, 'AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsMarkForDel' => 0,], ['title' => 'DESC'], 20);
			
			$regionsToptrand = $this->objMdl->rv_select_all('tbl_regions', ['*'], ['displayOnHeader' => 1, 'AgencySysId' => $this->gtxagencysysid, 'IsMarkForDel' => 0,], ['title' => 'DESC'], 20);
			
			$statesHometrand = $this->objMdl->rv_select_all('tbl_states', ['*'], ['displayOnHome' => 1, 'AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsMarkForDel' => 0,], ['title' => 'DESC'], 20);
			
			$this->view->countriesToptrand = $countriesToptrand;
			$this->view->regionsToptrand = $regionsToptrand;
			$this->view->statesHometrand = $statesHometrand;
			$this->view->homepageview = $homepageview;
			$this->view->home_common_id = $home_common_id;
			//echo"<pre>";print_r($countriesToptrand);die;
		}
		
		public function index1Action() {
			
			
			// $dd = array('a','b','c');
			// $dd2 = array('g','h','d');
			// print_r(array_merge($dd2,$dd));
			// die('dd');
			//$this->objMdl->runMyQuery("ALTER TABLE `tbl_pack_type` ADD `metaTitle` VARCHAR(256) NOT NULL AFTER `image`, ADD `metaKeyword` VARCHAR(500) NOT NULL AFTER `metaTitle`, ADD `metaDescription` VARCHAR(500) NOT NULL AFTER `metaKeyword`;");
			$currencyTypeArray = $this->objHelperGeneral->getCurrencyData();
			$decodedPackageDestinationArray = array();
			$geoCityData = $this->objMdl->getAllCountyDetailForHomePage();
			$arrContextOptions = array(
            "ssl" => array(
			"verify_peer" => false,
			"verify_peer_name" => false,
            ),
			);
			
			$url = $this->baseUrl . 'public/data/dynamic/car_station.json';
			$carstationArray = file_get_contents($url, false, stream_context_create($arrContextOptions));
			
			$packageDestinationArray = file_get_contents($this->baseUrl . 'public/upload/' . $this->stylecss . '/data/dynamic/package_destinations.json');
			// echo "<pre>";print_r( $packageDestinationArray);exit();
			if (!empty($carstationArray)) {
				$decodedcarstationArray = Zend_Json::decode($carstationArray);
			}
			//echo "<pre>";print_r($decodedcarstationArray);die;
			$destinatonTop = $this->objMdl->rv_select_all($this->tablenameDestination, ['DesSysId', 'Title', 'Activities', 'Hotels', 'Tours', 'Image', 'DestDescription'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsFeatured' => 1, 'IsMarkForDel' => 0], ['DesSysId' => 'DESC'], 8);
			
			$display_on_header = $this->objMdl->rv_select_all($this->tablenameDestination, ['DesSysId', 'Title', 'Activities', 'Hotels', 'Tours', 'Image', 'DestDescription', 'DisplayOnHeader'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'DisplayOnHeader' => 1, 'IsMarkForDel' => 0], ['DisplayOnHeader' => 'DESC'], 100);
			// echo "<pre>";
			// print_r($display_on_header);
			$destinatonTopArr = array();
			foreach ($destinatonTop as $topdesKey => $topdesValue) {
				$desTitleValue = $topdesValue['Title'];
				$whereCustom = ($desTitleValue) ? " ( Destinations LIKE '%{$desTitleValue}%' )" : "";
				
				$tourResult = $this->objMdl->rv_select_row_where_custom($this->tablename, ['count(*) as totalCount'], ['IsMarkForDel' => 0, 'IsActive' => 1, 'IsPublish' => 1, 'ItemType' => 1], $whereCustom, [], '');
				
				$destinatonTopArr[] = [
                'DesSysId' => $topdesValue['DesSysId'],
                'Title' => $topdesValue['Title'],
                'Activities' => $topdesValue['Activities'],
                'Hotels' => $topdesValue['Hotels'],
                'Tours' => $topdesValue['Tours'],
                'Image' => $topdesValue['Image'],
                'DestDescription' => $topdesValue['DestDescription'],
                'totalCount' => $tourResult['totalCount'],
				];
			}
			
			$this->view->destinations = $destinatonTopArr;
			$this->view->baseUrl = $this->baseUrl;
			$this->view->tollfreenumber = $this->tollfreenumber;
			$this->view->siteName = $this->siteName;
			$this->view->show_on_search = $display_on_header;
			
			$trendingTours = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['PkgSysId', 'Image', 'GTXPkgId', 'Destinations', 'Countries', 'BookingValidUntil', 'LongJsonInfo', 'Nights', 'StarRating', 'PackageType', 'PackageSubType', 'oldPrice'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'IsFeatured' => 1, 'countryIds' => 101], ['PkgSysId' => 'DESC'], 20);
			// echo"<pre>";print_r( $trendingTours);die;
			$trendingToursinter = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['PkgSysId', 'Image', 'GTXPkgId', 'Destinations', 'Countries', 'BookingValidUntil', 'LongJsonInfo', 'Nights', 'StarRating', 'PackageType', 'PackageSubType', 'oldPrice'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'IsFeatured' => 1, 'countryIds!' => 101], ['PkgSysId' => 'DESC'], 20);
			//echo"<pre>";print_r($trendingTours);die;
			
			$trendingActivities = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['PkgSysId', 'Image', 'GTXPkgId', 'Destinations', 'Countries', 'BookingValidUntil', 'LongJsonInfo', 'Nights', 'StarRating', 'PackageType', 'PackageSubType', 'oldPrice'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 3, 'IsFeatured' => 1], ['PkgSysId' => 'DESC'], 12);
			
			//$currencyRate = $this->objMdl->rv_select_all('tbl_currency_rate', ['*'], ['cid'], ['cid' => 'DESC']);
			$lastMinuteTours = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['PkgSysId', 'Image', 'GTXPkgId', 'Destinations', 'Countries', 'BookingValidUntil', 'LongJsonInfo', 'Nights', 'StarRating', 'PackageType', 'PackageSubType', 'oldPrice'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'lastMinuteDeal' => 1], ['PkgSysId' => 'DESC'], 6);
			
			foreach ($trendingTours as $key => $value) {
				
				$destinationArr = explode(',', $value['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
				$iamges = $value['Image'];
				$imagesa = explode(',', $iamges);
				foreach ($imagesa as $imgsdds) {
					$finalimage = $imgsdds;
				}
				//echo"<pre>";print_r($LongJsonInfo);die;
				if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				$Image = isset($value['Image']) ?: '';
				// echo"<pre>";print_r($Image);die('vshgdvbhjsbckj');
				if (trim($Image) != '') {
					//die($LongJsonInfo['package']['ImgThumbnail']);
					$tourImage1 = explode(',', $value['Image']);
					if ($tourImage1[0] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/small/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/small/' . $tourImage1[1];
					}
					} else {
					$tourImage = $LongJsonInfo['package']['ImgThumbnail'];
				}
				// die('hiscgbhdsch');
				
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
				$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
				$defaultCategoryIdm = isset($LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id']) ? $LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id'] : 0;
				//   die(trim($LongJsonInfo['package']['Name']))
				$toursFinal[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => trim($LongJsonInfo['package']['Name']), // full name of package name
                'img' => $tourImage,
                'night' => $value['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice)),
                'currencyType' => $currencyTypeArray[$getCurrencyType],
                'star' => $value['StarRating'],
                'Destination' => $value['Destinations'],
                'PkgSysId' => $value['PkgSysId'],
                'GTXPkgId' => $value['GTXPkgId'],
                'defaultCategoryId' => ($defaultCategoryId != '') ? $defaultCategoryId : $defaultCategoryIdm,
                'defaultCategory' => $defaultCategory,
                'tourtype' => ($defaultTourType != '') ? $defaultTourType : 1,
                'TPId' => $TPId,
                'PackageType' => $value['PackageType'],
                'mp' => $MPType,
                'Countries' => $value['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $value['BookingValidUntil'],
                'oldPrice' => $value['oldPrice'],
				];
			}
			
			foreach ($trendingToursinter as $key => $value) {
				
				$destinationArr = explode(',', $value['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($value['LongJsonInfo']);
				
				if (isset($_SESSION['TravelAgent']['session']) && !empty($_SESSION['TravelAgent']['session'])) {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2B', $value['PackageType'], $value['PackageSubType']); // get default category
					} else {
					$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $value['PackageType'], $value['PackageSubType']); // get default category
				}
				
				if (trim($value['Image']) != '') {
					//die($LongJsonInfo['package']['ImgThumbnail']);
					$tourImage1 = explode(',', $value['Image']);
					if ($tourImage1[0] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/{size}/' . $tourImage1[0];
						} else if ($tourImage1[1] != '') {
						$tourImage = $this->baseUrl . 'public/upload/' . $this->stylecss . '/tours/' . $value['PkgSysId'] . '/{size}/' . $tourImage1[1];
					}
					} else {
					$tourImage = $LongJsonInfo['package']['ImgThumbnail'];
				}
				
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($value['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
				$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			if(!empty($getCurrencyType) && empty($this->baseCurrency)){
			 $getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['PC'];
			}else{
			$getCurrencyType = $priceArrJson[$tourTypeChar][$defaultCategory]['price'][0]['Currency'];
			}
				$toursFinalinter[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => $LongJsonInfo['package']['Name'], // full name of package name
                'img' => $tourImage,
                'night' => $value['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice)),
                'currencyType' => $currencyTypeArray[$getCurrencyType],
                'star' => $value['StarRating'],
                'Destination' => $value['Destinations'],
                'PkgSysId' => $value['PkgSysId'],
                'GTXPkgId' => $value['GTXPkgId'],
                'defaultCategoryId' => $defaultCategoryId,
                'defaultCategory' => $defaultCategory,
                'tourtype' => $defaultTourType,
                'TPId' => $TPId,
                'PackageType' => $value['PackageType'],
                'mp' => $MPType,
                'Countries' => $value['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $value['BookingValidUntil'],
                'oldPrice' => $value['oldPrice'],
				];
			}
			
			
			$activityFinal = array();
			foreach ($trendingActivities as $tKey => $tVal) {
				
				$LongJsonInfo = json_decode($tVal['LongJsonInfo'], 1);
				
				if (isset($LongJsonInfo['ThumnailImg']) && trim($LongJsonInfo['ThumnailImg']) != '') {
					$imagename = $LongJsonInfo['ThumnailImg'];
					} else {
					$imagename1 = explode(',', $tVal['Image']);
					$imagename = $this->baseUrl . 'public/upload/' . $this->stylecss . '/activities/' . $tVal['PkgSysId'] . '/images/medium/' . $imagename1[0];
					
					//echo "<pre>"; print_r($imagename); die;
				}
				$rate = 1;
				
				// foreach($currencyRate as $cKey => $cVal){
				//  if($cVal['FCurrencyType'] == $LongJsonInfo['Currency'] && $cVal['TCurrencyType'] == 1){
				//      $rate = $cVal['Rate'];
				//  }    
				// }
				$netPrice = 0;
				if (!empty($LongJsonInfo['SICCost'])) {
					$netPrice = (int) ($LongJsonInfo['SICCost'][0]['NetAdultCost'] + $LongJsonInfo['AdultEntryFee']);
					} else if (!empty($LongJsonInfo['PvtCost'])) {
					$netPrice = (int) ($LongJsonInfo['PvtCost'][0]['NetAdultCost'] + $LongJsonInfo['AdultEntryFee']);
					} else {
					$netPrice = (int) $LongJsonInfo['AdultEntryFee'];
				}
				//echo "<pre>";print_r($LongJsonInfo);die;
				$activityFinal[] = [
                'PkgSysId' => $tVal['PkgSysId'],
                'Title' => $LongJsonInfo['Title'],
                'destination' => $tVal['Destinations'],
                'oldPrice' => (isset($tVal['oldPrice']) && $tVal['oldPrice'] != 0 && $tVal['oldPrice'] != '') ? $tVal['oldPrice'] : '',
                'Image' => $imagename,
                'Duration' => $LongJsonInfo['Duration'],
                'DurationInMin' => $LongJsonInfo['DurationInMin'],
                'DurationStr' => $LongJsonInfo['DurationStr'],
                'PriceAdditional' => isset($netPrice) ? round($netPrice) : 0,
                'CurrencySymbol' => isset($LongJsonInfo['CurrencySymbol']) ? $LongJsonInfo['CurrencySymbol'] : 'INR',
				//  'CurrencySymbol' => ($currencyType) ? $currencyType : 'INR',
				];
			}
			$testimonials = $this->objMdl->rv_select_all('tbl_feedback', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'displayOnHome' => 1], ['FeedbackId' => 'DESC'], 10);
			$bannerDetail = $this->objMdl->rv_select_all('tb_homebanner_detail', ['banner_id', 'image', 'heading', 'description', 'url', 'opt'], ['AgencySysId' => $this->gtxagencysysid, 'status' => 1, 'isDisplayOnHome' => 1, 'isMarkForDel' => 0], ['banner_id' => 'DESC'], 10);
			$resultsetTheme = $this->objMdl->rv_select_all('tbl_pack_type', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'IsActive' => 1, 'displayOnHome' => 1], ['packType' => 'ASC'], 6);
			
			$homePromotionTypeOne = $this->objMdl->rv_select_all('tbl_home_promotion', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsmarkForDel' => 0, 'IsFeatured' => 1, 'templatetype' => 1], ['promotionId' => 'DESC'], 10);
			$homePromotionTypeTwo = $this->objMdl->rv_select_all('tbl_home_promotion', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsmarkForDel' => 0, 'IsFeatured' => 1, 'templatetype' => 2], ['promotionId' => 'DESC'], 1);
			$homePromotionTypeThree = $this->objMdl->rv_select_all('tbl_home_promotion', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'IsmarkForDel' => 0, 'IsFeatured' => 1, 'templatetype' => 3], ['promotionId' => 'DESC'], 1);
			
			$tagName = json_decode($homePromotionTypeTwo[0]['promotion_name']);
			$promotionUrl = json_decode($homePromotionTypeTwo[0]['promotion_url']);
			$tabType = json_decode($homePromotionTypeTwo[0]['tab_type']);
			$finalArrayTwo = array();
			$finalArrayTwo[0] = ['tagNAme' => $tagName->promotion_tag1, 'promotionUrl' => $promotionUrl->promotion_tag_url1, 'tabType' => $tabType->tagopt1];
			$finalArrayTwo[1] = ['tagNAme' => $tagName->promotion_tag2, 'promotionUrl' => $promotionUrl->promotion_tag_url2, 'tabType' => $tabType->tagopt2];
			$finalArrayTwo[2] = ['tagNAme' => $tagName->promotion_tag3, 'promotionUrl' => $promotionUrl->promotion_tag_url3, 'tabType' => $tabType->tagopt3];
			$finalArrayTwo[3] = ['tagNAme' => $tagName->promotion_tag4, 'promotionUrl' => $promotionUrl->promotion_tag_url4, 'tabType' => $tabType->tagopt4];
			$homePromotionTypeTwoArr = array();
			if ($homePromotionTypeTwo[0]['promotionId']) {
				$homePromotionTypeTwoArr = [
                'promotionId' => $homePromotionTypeTwo[0]['promotionId'],
                'templatetype' => $homePromotionTypeTwo[0]['templatetype'],
                'promotion_image' => $homePromotionTypeTwo[0]['promotion_image'],
                'finalArrayTwo' => $finalArrayTwo,
				];
			}
			
			$resultPromotionCategory = $this->objMdl->getCmsdata('tbl_promotion_category', ['*'], ['prom_cat_id'], ['prom_cat_id' => 'DESC']);
			$getCmsPageDetail = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'about-us', 'status' => 'Activate'], ['sid' => 'desc']);
			$getOfferDetail = $this->objMdl->rv_select_row('tbl_offers', ['*'], ['status' => 1, 'id' => 1], ['id' => 'desc']);
			$travelogues = $this->objMdl->rv_select_all('tbl_travelogues', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'status' => 1, 'displayOnBanner' => 1, 'category' => 1], ['TravId' => 'DESC'], 10);
			$travelogues = $this->objMdl->rv_select_all('tbl_travelogues', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isMarkForDel' => 0, 'status' => 1, 'displayOnBanner' => 1, 'category' => 1], ['TravId' => 'DESC'], 10);
			//   $flightsourcedestin = $this->objMdl->rv_select_all('tbl_flight', ['*'], ['IsActive' => 1], [], 20);
			$getCmsPageDetail_1 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'why-choose-us', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_2 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'personalized-matching', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_3 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'destination-expertise', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_4 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'support-from', 'status' => 'Activate'], ['sid' => 'desc']);
			$getCmsPageDetail_5 = $this->objMdl->rv_select_row('tbl_static_pages', ['page_description'], ['identifier' => 'health-safety', 'status' => 'Activate'], ['sid' => 'desc']);
			
			$this->view->travelogues = $travelogues;
			$this->view->getOfferDetail = $getOfferDetail;
			
			// echo "<pre>";print_r($getCmsPageDetail_1);die;
			
			$this->view->flightsourcedestin = $flightsourcedestin;
			$this->view->getCmsPageDetail = $getCmsPageDetail;
			$this->view->getCmsPageDetail_1 = $getCmsPageDetail_1;
			$this->view->getCmsPageDetail_2 = $getCmsPageDetail_2;
			$this->view->getCmsPageDetail_3 = $getCmsPageDetail_3;
			$this->view->getCmsPageDetail_4 = $getCmsPageDetail_4;
			$this->view->getCmsPageDetail_5 = $getCmsPageDetail_5;
			
			$this->view->resultPromotionCategory = $resultPromotionCategory;
			$this->view->homePromotionTypeOne = $homePromotionTypeOne;
			$this->view->homePromotionTypeTwo = $homePromotionTypeTwoArr;
			$this->view->homePromotionTypeThree = $homePromotionTypeThree[0];
			$this->view->testimonials = $testimonials;
			$this->view->bannerDetail = $bannerDetail;
			$this->view->baseUrl = $this->baseUrl;
			$this->view->toursFinal = $toursFinal;
			$this->view->toursFinalinter = $toursFinalinter;
			$this->view->resultsetTheme = $resultsetTheme;
			$this->view->lastMinuteTours = $lastMinuteToursFinal;
			$this->view->carStationArray = $decodedcarstationArray;
			$this->view->activityFinal = $activityFinal;
			$this->view->MobileDetect = $this->objHelperGeneral->getDevice();
			$this->view->destinationsDomestic = $destinationsDomestic;
			$this->view->destinationsInternational = $destinationsInternational;
			$this->view->lastMinuteTours = $lastMinuteToursFinal;
			
			/*   $popularDestination = $this->objMdl->rv_select_all('tbl_countries', ['contSysId', 'title', 'Image', 'description','countryId'], ['IsActive' => 1, 'IsMarkForDel' => 0,'displayOnVisa' => 1], ['title' => 'ASC']);
				$countryCode = $this->objMdl->rv_select_all('tb_master_geo_country', ['contId','code'], [ 'isActive' => 1,'isMarkForDel'=>0], ['contId' => 'DESC']);
				$countryCodeArr = array();
				foreach($countryCode as $cKey => $cVal){
				$countryCodeArr[$cVal['contId']] = $cVal['code'];
				}
				echo "<pre>";print_r($popularDestination);die;
				foreach ($popularDestination as $desKey => $desValue) {
				$popularDestinationArray[] = [
				'contSysId' =>$desValue['contSysId'],
				'Image' =>$desValue['Image'],
				'title' =>$desValue['title'],
				'description' =>$desValue['description'],
				'code' => $countryCodeArr[$desValue['countryId']],
				];
				
			} */
			$specialDeals = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['PkgSysId', 'Image', 'GTXPkgId', 'Destinations', 'Countries', 'LongJsonInfo', 'StarRating', 'packageNameUrl', 'CountryIds'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsMarkForDel' => 0, 'ItemType' => 6, 'IsFeatured' => 1], ['PkgSysId' => 'DESC'], 6);
			$specialDealsArray = array();
			foreach ($specialDeals as $dealKey => $dealValue) {
				//echo "<pre>";print_r($countryCode);die;
				$LongJsonInfo = Zend_Json::decode($dealValue['LongJsonInfo']);
				$VisaAdultRates = $LongJsonInfo['VisaAdultRates'] + $LongJsonInfo['Markup'][0]['MarkUp'];
				$specialDealsArray[] = [
                'PkgSysId' => $dealValue['PkgSysId'],
                'GTXPkgId' => $dealValue['GTXPkgId'],
                'VisaName' => $LongJsonInfo['VisaName'],
                'Nationality' => $LongJsonInfo['Nationality'],
                'VisaAdultRates' => $VisaAdultRates,
                'CurrencyType' => $currencyTypeArray[$LongJsonInfo['CurrencyType']],
                'Country' => $LongJsonInfo['Country'],
                'PrecessingTime' => $LongJsonInfo['PrecessingTime'],
                'packageNameUrl' => $dealValue['packageNameUrl'],
                'searchUrl' => strtolower(Catabatic_Helper::getSeoName(trim($LongJsonInfo['Country']))) . '-visa/' . strtolower(Catabatic_Helper::getSeoName(trim($dealValue['packageNameUrl']))) . '.html',
                'code' => $countryCodeArr[$dealValue['CountryIds']],
				];
			}
			//echo"<pre>";print_r($specialDealsArray);die;
			$this->view->specialDealsArray = $specialDealsArray;
			
			$checkDuplicateCountries = array();
			foreach ($geoCityData as $cdKey => $cdVal) {
				if (!in_array(trim($cdVal['CountryIds']), $checkDuplicateCountries)) {
					$finalgeoCityData[] = $cdVal;
					$checkDuplicateCountries[] = trim($cdVal['CountryIds']);
				}
			}
			$this->view->countryNameArray = $finalgeoCityData;
			$sessionFlightSearchParams = new Zend_Session_Namespace('sessionFlightSearchParams');
			$this->view->sessionFlightSearchParams = $sessionFlightSearchParams->params;
			$this->view->popularDestinationArray = $popularDestinationArray;
			$this->view->gtxBtoBsite = $this->gtxBtoBsite;
			
			$SearchCarData = new Zend_Session_Namespace('SearchCarData');
			$this->view->sessionSearchCarData = $SearchCarData->params;
		}
		
		public function destinationAction() {
			$this->objMdl = new Admin_Model_CRUD();
			$destinations = $this->objMdl->getDestinationsHeader(['tbl.IsActive' => 1, 'tbl.IsPublish' => 1, 'tbl.IsMarkForDel' => 0, 'tb2.IsMarkForDel' => 0], ['tbl.DesSysId' => 'ASC'], 100);
			$destinationSearch = $this->objMdl->getDestinationSearch(['tbl.IsActive' => 1, 'tbl.IsPublish' => 1, 'tbl.IsMarkForDel' => 0, 'tb2.IsMarkForDel' => 0], ['tbl.DesSysId' => 'ASC'], 100);
			//echo "<pre>";print_r($destinations);die;
			$destinationsAll = $this->objMdl->getDestinationsHeader(['tbl.IsActive' => 1, 'tbl.IsPublish' => 1, 'tbl.IsMarkForDel' => 0], ['tbl.DesSysId' => 'ASC'], 100);
			//echo "<pre>";print_r($destinationSearch);die;
			$region_names = $finalDestination = $finalDestinationAll = [];
			$regionnew = '';
			$region = trim($this->getRequest()->getParam('region'));
			$des = trim($this->getRequest()->getParam('des'));
			
			if (isset($region) && $region != '') {
				
				
				foreach ($destinations as $key => $value) {
					if (isset($region) && !empty($region)) {
						if ($region == $value['region_label']) {
							if (($value['region_label'] != NULL) && !in_array($value['region_label'], $region_names)) {
								$region_names[] = $value['region_label'];
								if ($region == $value['region_label']) {
									$regionnew = $value['region_name'];
								}
							}
							
							$finalDestination[$value['region_label']][] = [
                            'DesSysId' => $value['DesSysId'],
                            'Title' => $value['Title'],
                            'Image' => $value['Image'],
                            'Tours' => $value['Tours'],
							];
						}
					}
				}
				//                echo "<pre>";print_r($finalDestination);die;
				} else if (isset($des) && $des != '') {
				if ($des == 'Domestic') {
					$destinationsAll = $this->objMdl->getDestinationsInd(['tbl.IsActive' => 1, 'tbl.IsPublish' => 1, 'tbl.IsMarkForDel' => 0], ['tbl.DesSysId' => 'ASC'], 100);
					} else {
					$destinationsAll = $this->objMdl->getDestinationsInt(['tbl.IsActive' => 1, 'tbl.IsPublish' => 1, 'tbl.IsMarkForDel' => 0], ['tbl.DesSysId' => 'ASC'], 100, 101);
				}
				foreach ($destinationsAll as $allkey => $allvalue) {
					
					$finalDestinationAll[] = [
                    'DesSysId' => $allvalue['DesSysId'],
                    'Title' => $allvalue['Title'],
                    'Image' => $allvalue['Image'],
                    'Tours' => $allvalue['Tours'],
					];
				}
				} else {
				
				foreach ($destinationsAll as $allkey => $allvalue) {
					
					$finalDestinationAll[] = [
                    'DesSysId' => $allvalue['DesSysId'],
                    'Title' => $allvalue['Title'],
                    'Image' => $allvalue['Image'],
                    'Tours' => $allvalue['Tours'],
					];
				}
			}
			$regionImage = $this->objMdl->getRegionImage($region);
			
			$this->view->baseUrl = $this->baseUrl;
			$this->view->finalDestinationAll = $finalDestinationAll;
			$this->view->finalDestination = $finalDestination;
			$this->view->region_names = $region_names;
			//        $this->view->region = $region;
			$this->view->region = $regionnew;
			$this->view->des = $des;
		}
		
		public function saveLetterAction() {
			$this->view->layout()->disableLayout();
			$this->_helper->viewRenderer->setNoRender(true);
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$date = new Zend_Date();
				$currentDate = $date->get('YYYY-MM-dd HH:mm:ss');
				$email = $param['email'];
				
				$newsletter = new Travel_Model_PackagesMaster();
				
				$savePageData = [
                'created_date' => $currentDate,
                'news_letter_email' => $email,
                'status' => 1,
                'AgencySysId' => $this->gtxagencysysid,
				];
				
				$resultset = $newsletter->checkLetter("tb_tbb2c_newsletter", ['*'], ['news_letter_email' => $savePageData['news_letter_email'], 'AgencySysId' => $this->gtxagencysysid]);
				
				if (isset($resultset) && !empty($resultset)) {
					$response = array('success' => false, 'msg' => 'This Email Id Already Exists!!!');
					echo json_encode($response);
					exit;
					} else {
					$returnId = $newsletter->sendNewsLetter('tb_tbb2c_newsletter', $savePageData);
					if ($returnId) {
						$response = array('success' => true, 'msg' => 'Your query has been submitted successfully!');
						echo json_encode($response);
						exit;
					}
				}
			}
		}
		
		public function autosuggestdesAction() {
			try {
				$arrResponse = array();
				if ($this->getRequest()->getParam("term")) {
					$term = $this->getRequest()->getParam("term");
					$objDes = new Travel_Model_PackagesMaster();
					$arrResponse = $objDes->getDestinationAutoSuggest($term, $this->tablename);
				}
				//print_r($arrResponse);die('okkk');
				echo json_encode($arrResponse);
				exit;
				} catch (Exception $e) {
				$response = array('success' => false, 'msg' => $e->getMessage());
				echo json_encode($response);
				exit;
			}
		}
		
		public function autosuggestAction() {
			$this->_helper->viewRenderer->setNoRender(true);
			$this->_helper->layout->disableLayout();
			try {
				$arrResponse = array();
				if ($this->getRequest()->getParam("term") or $this->getRequest()->getParam("query")) {
					$term = $this->getRequest()->getParam("term") ? $this->getRequest()->getParam("term") : $this->getRequest()->getParam("query");
					$countryId = $this->getRequest()->getParam("countryId") ? $this->getRequest()->getParam("countryId") : '';
					
					$condCity = "tbl.Title like '" . $term . "%'";
					if (isset($countryId) && !empty($countryId)) {
						$condCity .= " AND tbl.ContSysId = " . $countryId . "";
					}
					$arrResponse = $this->objMdl->getBuyHotelCityAutoSuggest($condCity);
				}
				echo json_encode($arrResponse);
				exit;
				} catch (Exception $e) {
				$response = array('success' => false, 'msg' => $e->getMessage());
				echo json_encode($response);
				exit;
			}
		}
		
		public function sitemapAction() {
			$this->_helper->layout->disableLayout();
			$html = new Zend_View();
			$folder = $this->stylecss;
			$html->setScriptPath(APPLICATION_PATH . '/sites/' . $folder);
			header("Content-type: text/xml");
			$bodyText = $html->render('sitemap.xml');
			echo $bodyText;
			die();
		}
		
		public function robotsAction() {
			$this->_helper->layout->disableLayout();
			$html = new Zend_View();
			$folder = $this->stylecss;
			$bodyText = '';
			if (file_exists(APPLICATION_PATH . '/sites/' . $folder . '/robots.txt')) {
				$html->setScriptPath(APPLICATION_PATH . '/sites/' . $folder);
				header("Content-type: text/txt");
				$bodyText = $html->render('robots.txt');
			}
			echo $bodyText;
			die();
		}
		
		public function customerloginAction() {
			// die('here');
			$request = Zend_Controller_Front::getInstance()->getRequest();
			if ($this->getRequest()->isPost()) {
				$data = $request->getPost();
				//echo "<pre>";print_r($data);die;
				$this->_session->session = $data;
				//            echo $data['redirect_link_r'];die;
				//            $this->_redirect($data['redirect_link_r']);
				$response = array('status' => true, 'msg' => 'success');
				echo json_encode($response);
				exit;
			}
		}
		
		public function logoutAction() {
			$storage = new Zend_Session_Namespace('User');
			$storage->unsetAll();
			$this->_redirect('/');
		}
		
		/*
			* writeSessionPopup is used to show the request a callback popup window after interval on landing page
		*/
		
		public function writeSessionPopupAction() {
			$myNamespace = new Zend_Session_Namespace('MypopSess');
			$myNamespace->setPopup = true;
			$myNamespace->session_time = time();
			exit;
		}
		
		public function awardsAction() {
			
			$this->view->baseUrl = $this->baseUrl;
		}
		
		public function galleryAction() {
			
			$this->view->baseUrl = $this->baseUrl;
			$this->objMdl = new Admin_Model_CRUD();
			$galleryDetail = $this->objMdl->rv_select_all('tb_gallery_detail', ['gallery_id', 'image', 'title'], ['AgencySysId' => $this->gtxagencysysid, 'status' => 1], ['gallery_id' => 'DESC']);
			$this->view->galleryDetail = $galleryDetail;
		}
		
		public function sendSearchFlightEmailAction() {
			$this->view->layout()->disableLayout();
			$this->_helper->viewRenderer->setNoRender(true);
			$arrPrefferedAirlines = unserialize(CONST_FLIGHT_PREFERRED_AIRLINES);
			$arrCabinClass = unserialize(CONST_FLIGHT_CABIN_CLASS);
			
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
				//            echo "<pre>";print_r($param);die;
				
				$sourceName = $param['sourceName'];
				$destinationName = $param['destinationName'];
				$depart_date = isset($param['depart_date']) ? $param['depart_date'] : '';
				$return_date = isset($param['return_date']) ? $param['return_date'] : '';
				$adults = $param['adults'];
				$childs = $param['childs'];
				$infants = $param['infants'];
				$cabin_class = $arrCabinClass[$param['cabin_class']];
				$subject = "Flight Enquiry Details";
				$message = '';
				$message .= '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" font-size:14px; font-family: Roboto, sans-serif;">
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear Admin, <br>
				<br>
				You have received a new flight query detail as below:</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">From Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $sourceName . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">To Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $destinationName . '</td>
				</tr>
				
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Departing : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $depart_date . '</td>
				</tr>';
				if ($return_date != '') {
					$message .= '<tr>
					<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Returning : </td>
					<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $return_date . '</td>
					</tr>';
				}
				
				$message .= '<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Travelers : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">Adult(s) : ' . $adults . ', Child(s) : ' . $childs . ', Infant(s) : ' . $infants . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Cabin Class : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cabin_class . '</td>
				</tr>
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
				<hr / style="border-width: 0.6px;">
				<br>
				<br>
				contact number: ' . $contactDetail_mail["mobile"] . '<br>
				Email: ' . $contactDetail_mail["email"] . '</td>
				</tr>
				</table>
				<div style="text-align:center;">
				<img style="width:100px;" src="' . $this->baseUrl . 'public/images/logo.png" />
				</div>
				<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" >
				<tr>
				<td style=" text-align:right;">Powered by &#45; <a  href="http://www.hellogtx.com/" target="_blank" style="font-family:AvantGarde Bk BT;color:#0b74c4; text-decoration:none">hello<span style="font-family:AvantGarde Bk BT;color:#fb5a2d;">GTX</span></a></td>
				</tr>
				</table>';
				
				$configs = [
                'to' => $contactDetail_mail['email'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $message,
				];
				
				$emailres = $this->_helper->General->mailSentByElastice($configs, 'Flight');
				
				if ($emailres) {
					$response = array('status' => true, 'msg' => 'Flight enquiry sent successfully.');
					echo json_encode($response);
					exit;
					} else {
					$response = array('status' => false, 'msg' => 'Unable to send enquiry.');
					echo json_encode($response);
					exit;
				}
			}
		}
		
		public function sendSearchHotelEmailAction() {
			$this->view->layout()->disableLayout();
			$this->_helper->viewRenderer->setNoRender(true);
			$arrPrefferedAirlines = unserialize(CONST_FLIGHT_PREFERRED_AIRLINES);
			$arrCabinClass = unserialize(CONST_FLIGHT_CABIN_CLASS);
			
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
				//            echo "<pre>";print_r($param);die;
				
				$cityName = $param['cityNameVal'];
				$cityId = $param['cityId'];
				echo $cityName;
				echo $cityId;
				die();
				$check_in = isset($param['check_in']) ? $param['check_in'] : '';
				$check_out = isset($param['check_out']) ? $param['check_out'] : '';
				$roomDetail = '';
				for ($m = 1; $m <= $param['roomcount']; $m++) {
					
					$roomDetail .= 'Room ' . $m . ' : Adult : ' . $param['traveler_hotel_adult_' . $m] . ', Child : ' . $param['traveler_hotel_child_' . $m] . '<br>';
				}
				
				$cabin_class = $arrCabinClass[$param['cabin_class']];
				$subject = "Hotel Enquiry Details";
				$message = '';
				$message .= '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" font-size:14px; font-family: Roboto, sans-serif;">
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear Admin, <br>
				<br>
				You have received a new hotel query detail as below:</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cityName . '</td>
				</tr>
				
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Check In  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $check_in . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Check Out  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $check_out . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Travelers : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $roomDetail . '</td>
				</tr>
				
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
				<hr / style="border-width: 0.6px;">
				<br>
				<br>
				contact number: ' . $contactDetail_mail["mobile"] . '<br>
				Email: ' . $contactDetail_mail["email"] . '</td>
				</tr>
				</table>
				<div style="text-align:center;">
				<img style="width:100px;" src="' . $this->baseUrl . 'public/images/logo.png" />
				</div>
				<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" >
				<tr>
				<td style=" text-align:right;">Powered by &#45; <a  href="http://www.hellogtx.com/" target="_blank" style="font-family:AvantGarde Bk BT;color:#0b74c4; text-decoration:none">hello<span style="font-family:AvantGarde Bk BT;color:#fb5a2d;">GTX</span></a></td>
				</tr>
				</table>';
				
				$configs = [
                'to' => $contactDetail_mail['email'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $message,
				];
				
				$emailres = $this->_helper->General->mailSentByElastice($configs, 'Hotel');
				
				if ($emailres) {
					$response = array('status' => true, 'msg' => 'Hotel enquiry sent successfully.');
					echo json_encode($response);
					exit;
					} else {
					$response = array('status' => false, 'msg' => 'Unable to send enquiry.');
					echo json_encode($response);
					exit;
				}
			}
		}
		
		public function sendSearchCabsEmailAction() {
			$this->view->layout()->disableLayout();
			$this->_helper->viewRenderer->setNoRender(true);
			$arrPrefferedAirlines = unserialize(CONST_FLIGHT_PREFERRED_AIRLINES);
			$arrCabinClass = unserialize(CONST_FLIGHT_CABIN_CLASS);
			
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
				//            echo "<pre>";print_r($param);die;
				
				$cabFromDestinationName = $param['cabFromDestinationName'];
				$cabToDestinationName = $param['cabToDestinationName'];
				$cab_start_date = isset($param['cab_start_date']) ? $param['cab_start_date'] : '';
				$cab_end_date = isset($param['cab_end_date']) ? $param['cab_end_date'] : '';
				
				$subject = "Cabs Enquiry Details";
				$message = '';
				$message .= '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" font-size:14px; font-family: Roboto, sans-serif;">
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear Admin, <br>
				<br>
				You have received a new hotel query detail as below:</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">From Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cabFromDestinationName . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">To Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cabToDestinationName . '</td>
				</tr>
				
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Start Date  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cab_start_date . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">End Date  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cab_end_date . '</td>
				</tr>
				
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
				<hr / style="border-width: 0.6px;">
				<br>
				<br>
				contact number: ' . $contactDetail_mail["mobile"] . '<br>
				Email: ' . $contactDetail_mail["email"] . '</td>
				</tr>
				</table>
				<div style="text-align:center;">
				<img style="width:100px;" src="' . $this->baseUrl . 'public/images/logo.png" />
				</div>
				<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" >
				<tr>
				<td style=" text-align:right;">Powered by &#45; <a  href="http://www.hellogtx.com/" target="_blank" style="font-family:AvantGarde Bk BT;color:#0b74c4; text-decoration:none">hello<span style="font-family:AvantGarde Bk BT;color:#fb5a2d;">GTX</span></a></td>
				</tr>
				</table>';
				
				$configs = [
                'to' => $contactDetail_mail['email'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $message,
				];
				
				$emailres = $this->_helper->General->mailSentByElastice($configs, 'Cabs');
				
				if ($emailres) {
					$response = array('status' => true, 'msg' => 'Cab enquiry sent successfully.');
					echo json_encode($response);
					exit;
					} else {
					$response = array('status' => false, 'msg' => 'Unable to send enquiry.');
					echo json_encode($response);
					exit;
				}
			}
		}
		
		public function sendSearchForexEmailAction() {
			$this->view->layout()->disableLayout();
			$this->_helper->viewRenderer->setNoRender(true);
			$arrPrefferedAirlines = unserialize(CONST_FLIGHT_PREFERRED_AIRLINES);
			$arrCabinClass = unserialize(CONST_FLIGHT_CABIN_CLASS);
			
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
				//            echo "<pre>";print_r($param);die;
				
				$forexFromDestinationName = $param['forexFromDestinationName'];
				$forexToDestinationName = $param['forexToDestinationName'];
				$forex_depart_date = isset($param['forex_depart_date']) ? $param['forex_depart_date'] : '';
				$forex_return_date = isset($param['forex_return_date']) ? $param['forex_return_date'] : '';
				
				$subject = "Forex Enquiry Details";
				$message = '';
				$message .= '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" font-size:14px; font-family: Roboto, sans-serif;">
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear Admin, <br>
				<br>
				You have received a new hotel query detail as below:</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">From Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $forexFromDestinationName . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">To Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $forexToDestinationName . '</td>
				</tr>
				
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Departing Date  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $forex_depart_date . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Returning Date  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $forex_return_date . '</td>
				</tr>
				
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
				<hr / style="border-width: 0.6px;">
				<br>
				<br>
				contact number: ' . $contactDetail_mail["mobile"] . '<br>
				Email: ' . $contactDetail_mail["email"] . '</td>
				</tr>
				</table>
				<div style="text-align:center;">
				<img style="width:100px;" src="' . $this->baseUrl . 'public/images/logo.png" />
				</div>
				<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" >
				<tr>
				<td style=" text-align:right;">Powered by &#45; <a  href="http://www.hellogtx.com/" target="_blank" style="font-family:AvantGarde Bk BT;color:#0b74c4; text-decoration:none">hello<span style="font-family:AvantGarde Bk BT;color:#fb5a2d;">GTX</span></a></td>
				</tr>
				</table>';
				
				$configs = [
                'to' => $contactDetail_mail['email'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $message,
				];
				
				$emailres = $this->_helper->General->mailSentByElastice($configs, 'Forex');
				
				if ($emailres) {
					$response = array('status' => true, 'msg' => 'Forex enquiry sent successfully.');
					echo json_encode($response);
					exit;
					} else {
					$response = array('status' => false, 'msg' => 'Unable to send enquiry.');
					echo json_encode($response);
					exit;
				}
			}
		}
		
		public function sendSearchTrainEmailAction() {
			$this->view->layout()->disableLayout();
			$this->_helper->viewRenderer->setNoRender(true);
			$arrPrefferedAirlines = unserialize(CONST_FLIGHT_PREFERRED_AIRLINES);
			$arrCabinClass = unserialize(CONST_TRAIN_CABIN_CLASS);
			
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
				//            echo "<pre>";print_r($param);die;
				
				$trainFromDestinationName = $param['trainFromDestinationName'];
				$trainToDestinationName = $param['trainToDestinationName'];
				$train_depart_date = isset($param['train_depart_date']) ? $param['train_depart_date'] : '';
				$train_return_date = isset($param['train_return_date']) ? $param['train_return_date'] : '';
				
				$adults = $param['adults'];
				$childs = $param['childs'];
				$infants = $param['infants'];
				$cabin_class = $arrCabinClass[$param['train_class']];
				$subject = "Train Enquiry Details";
				$message = '';
				$message .= '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" font-size:14px; font-family: Roboto, sans-serif;">
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear Admin, <br>
				<br>
				You have received a new hotel query detail as below:</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">From Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $trainFromDestinationName . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">To Destination : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $trainToDestinationName . '</td>
				</tr>
				
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Departing Date  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $train_depart_date . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Returning Date  : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $train_return_date . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Travelers : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">Adult(s) : ' . $adults . ', Child(s) : ' . $childs . ', Infant(s) : ' . $infants . '</td>
				</tr>
				<tr>
				<td width="30%" style=" padding:5px 40px;vertical-align: middle;">Cabin Class : </td>
				<td width="70%" style=" padding:5px 40px;vertical-align: middle;">' . $cabin_class . '</td>
				</tr>
				
				<tr>
				<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
				<hr / style="border-width: 0.6px;">
				<br>
				<br>
				contact number: ' . $contactDetail_mail["mobile"] . '<br>
				Email: ' . $contactDetail_mail["email"] . '</td>
				</tr>
				</table>
				<div style="text-align:center;">
				<img style="width:100px;" src="' . $this->baseUrl . 'public/images/logo.png" />
				</div>
				<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" >
				<tr>
				<td style=" text-align:right;">Powered by &#45; <a  href="http://www.hellogtx.com/" target="_blank" style="font-family:AvantGarde Bk BT;color:#0b74c4; text-decoration:none">hello<span style="font-family:AvantGarde Bk BT;color:#fb5a2d;">GTX</span></a></td>
				</tr>
				</table>';
				
				$configs = [
                'to' => $contactDetail_mail['email'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $message,
				];
				
				$emailres = $this->_helper->General->mailSentByElastice($configs, 'Forex');
				
				if ($emailres) {
					$response = array('status' => true, 'msg' => 'Train enquiry sent successfully.');
					echo json_encode($response);
					exit;
					} else {
					$response = array('status' => false, 'msg' => 'Unable to send enquiry.');
					echo json_encode($response);
					exit;
				}
			}
		}
		
		public function getCitydataAction() {
			$this->_helper->viewRenderer->setNoRender(true);
			$this->_helper->layout->disableLayout();
			$crud = new Admin_Model_CRUD();
			//       print_r($this->getRequest()->getParam("term"));
			//       exit;
			try {
				$arrResponse = array();
				if ($this->getRequest()->getParam("term") or $this->getRequest()->getParam("query")) {
					$term = $this->getRequest()->getParam("term") ? $this->getRequest()->getParam("term") : $this->getRequest()->getParam("query");
					$countryId = $this->getRequest()->getParam("countryId") ? $this->getRequest()->getParam("countryId") : '';
					
					$condCity = "tbl.Title like '" . $term . "%'";
					if (isset($countryId) && !empty($countryId)) {
						$condCity .= " AND tbl.ContSysId = " . $countryId . "";
					}
					//echo $condCity;
					$arrResponse = $crud->getBuyHotelCityAutoSuggest($condCity);
					//                 print_r($arrResponse);die;
				}
				echo json_encode($arrResponse);
				exit;
				} catch (Exception $e) {
				$response = array('success' => false, 'msg' => $e->getMessage());
				echo json_encode($response);
				exit;
			}
		}
		
		public function thanksAction() {
			$this->view->baseUrl = $this->baseUrl;
		}
		
		function curl_get($url, array $get = NULL, array $options = array()) {
			$defaults = array(
            CURLOPT_URL => $url . (strpos($url, '?') === FALSE ? '?' : '') . http_build_query($get),
            CURLOPT_HEADER => 0,
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_TIMEOUT => 4
			);
			
			$ch = curl_init();
			curl_setopt_array($ch, ($options + $defaults));
			if (!$result = curl_exec($ch)) {
				trigger_error(curl_error($ch));
			}
			curl_close($ch);
			return $result;
		}
		
		public function sendFeedbackImageUploadAction() {
			//        $filename = $_FILES['file']['name'];
			$orignalFIle = @$_FILES["file1"]["name"];
			
			//        echo "<pre>";print_r($_FILES);die;
			if (isset($_FILES) && !empty($_FILES)) {
				foreach ($_FILES as $key => $orignalFIleName) {
					if (!empty($orignalFIleName)) {
						$orignalFIleName = $_FILES[$key]["name"];
						$orignalFolderName = $_SERVER["DOCUMENT_ROOT"] . "/public/upload/" . $this->stylecss . "/feedback/image";
						$originalSmallFolder = $orignalFolderName . "/small";
						$fileExt = $this->_helper->General->getFileExtension($orignalFIleName);
						$fileName = 'feedback_' . $key . '_' . time() . '.' . $fileExt;
						if (!file_exists($orignalFolderName)) {
							@mkdir($orignalFolderName, 0777, true);
						}
						if (!file_exists($originalSmallFolder)) {
							@mkdir($originalSmallFolder, 0777, true);
						}
						$temp_file_name = $_FILES[$key]["tmp_name"]; // temprary file name
						if (move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileName)) {
							$fileNameArray[] = $fileName;
						}
					}
				}
				$resultArr = array('status' => true, 'fileNameArray' => $fileNameArray, 'total' => count($fileNameArray));
				} else {
				$resultArr = array('status' => false, 'total' => 0);
			}
			echo json_encode($resultArr);
			exit;
		}
		
		public function sendFeedbackAction() {
			//         $objCustomerRewiew = new CustomerReview_Model_Feedback();
			$this->_helper->layout->disableLayout();
			$front = Zend_Controller_Front::getInstance();
			$front->setParam('noViewRenderer', true);
			if ($this->getRequest()->getPost()) {
				$param = $this->getRequest()->getParams();
				$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
				$date = date('Y');
				$TravelMonthArr = [
                1 => 'Jan ' . $date,
                2 => 'Feb ' . $date,
                3 => 'Mar ' . $date,
                4 => 'Apr ' . $date,
                5 => 'May ' . $date,
                6 => 'Jun ' . $date,
                7 => 'Jul ' . $date,
                8 => 'Aug ' . $date,
                9 => 'Sep ' . $date,
                10 => 'Oct ' . $date,
                11 => 'Nov ' . $date,
                12 => 'Dec ' . $date,
				];
				
				//            $objAgency = new Travel_Model_TblAgency();
				//            $agencyData = $objAgency->getUserDataByAgency($param['AgencySysId']); 
				
				$TripImageName = (isset($param['TripImageName']) && !empty($param['TripImageName'])) ? implode(',', $param['TripImageName']) : '';
				$saveData = [
                'AgencySysId' => $this->gtxagencysysid,
                'Name' => $param['Name'],
                'EmailId' => $param['EmailId'],
                'Destination' => $param['Destination'],
                'DestinationId' => 1,
                'TravelMonth' => $param['TravelMonth'],
                'ReviewStarValue' => $param['ReviewStarValue'],
                'ReviewTitle' => $param['ReviewTitle'],
                'Review' => $param['Review'],
                'TripImage' => $TripImageName,
                'isActive' => 1,
                'isMarkForDel' => 0
				];
				////           echo "<pre>";print_r($saveData);die;
				$crud = new Admin_Model_CRUD();
				$feedback = $crud->rv_insert('tbl_feedback', $saveData);
				
				$html = '';
				$htmlImage = '';
				if (isset($param['TripImageName']) && !empty($param['TripImageName'])) {
					$mi = 1;
					foreach ($param['TripImageName'] as $key => $val) {
						$TripImageName = $val;
						$html .= '<a href="' . $this->baseUrl . 'public/upload/' . $this->stylecss . '/feedback/image/' . $TripImageName . '">Image Url ' . $mi . '</a><br>';
						$mi++;
					}
					$htmlImage = '<tr>
                    <td style=" padding:5px 40px;vertical-align: middle;">Trip Images : </td>
                    <td style=" padding:5px 40px;vertical-align: middle;">' . $html . '</td>
					</tr>';
				}
				// echo "<pre>";print_r($html);die;
				if ($feedback) {
					
					$mailBody = '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border: dashed 1px #ccc; font-size:14px; font-family: Roboto, sans-serif;">
					
					<tr>
					<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear ' . ucfirst($param['Name']) . ', <br>
                    <br>
                    Greetings from ' . $this->siteName . '!  <br> <br>
                    Thank you for your feedback!</td>
					</tr>
					<tr>
					<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
					<hr / style="border-width: 0.6px;">
					<br>
					contact number: ' . $contactDetail_mail['phone'] . '<br>
					Email:' . $contactDetail_mail['email'] . '</td>
					</tr>
					</table>';
					
					$mailBodyAdmin = '<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border: dashed 1px #ccc; font-size:14px; font-family: Roboto, sans-serif;">
					
					<tr>
					<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Dear Admin, <br>
                    <br>
                    Greetings !  <br> <br>
                    You have received a new feedback detail as below:</td>
					</tr>
					<tr>
					<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">&nbsp;</td>
					
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">Name :</td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ucfirst($param['Name']) . '</td>
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">Email :</td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ($param['EmailId']) . '</td>
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">Destination : </td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ($param['Destination']) . '</td>
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">Month : </td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ($TravelMonthArr[$param['TravelMonth']]) . '</td>
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">Experience : </td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ($param['ReviewStarValue']) . ' Star</td>
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">ReviewTitle : </td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ($param['ReviewTitle']) . '</td>
					</tr>
					<tr>
					<td style=" padding:5px 40px;vertical-align: middle;">Review : </td>
					<td style=" padding:5px 40px;vertical-align: middle;">' . ($param['Review']) . '</td>
					</tr>
					' . $htmlImage . '
					
					<tr>
					<td colspan="2" style=" padding:5px 40px;vertical-align: middle;">Thanks ! <br>
					<hr / style="border-width: 0.6px;">
					<br>
					contact number: ' . $contactDetail_mail['phone'] . '<br>
					Email:' . $contactDetail_mail['email'] . '</td>
					</tr>
					</table>';
				}
				
				$subject = 'Feedback';
				$configs = [
                'to' => $param['EmailId'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $mailBody,
				];
				
				$custMail = $this->objHelperGeneral->mailSentByElastice($configs, 'package');
				$configsAdmin = [
                'to' => $contactDetail_mail['email'],
                'fromName' => $this->siteName,
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $mailBodyAdmin,
				];
				
				$adminMail = $this->objHelperGeneral->mailSentByElastice($configsAdmin, 'package');
				
				$returnArray = array('status' => true, 'message' => 'Feedback submitted successfully!!!');
				echo json_encode($returnArray);
				exit;
			}
		}
		
		public function dealsAction() {
			$this->view->baseUrl = $this->baseUrl;
			$this->view->siteName = $this->siteName;
			
			$lastMinuteTours = $this->objMdl->rv_select_all('tb_tbb2c_packages_master', ['PkgSysId', 'Image', 'GTXPkgId', 'Destinations', 'Countries', 'BookingValidUntil', 'LongJsonInfo', 'Nights', 'StarRating', 'PackageType', 'PackageSubType'], ['AgencySysId' => $this->gtxagencysysid, 'IsActive' => 1, 'IsPublish' => 1, 'IsMarkForDel' => 0, 'ItemType' => 1, 'lastMinuteDeal' => 1], ['PkgSysId' => 'DESC'], 6);
			
			foreach ($lastMinuteTours as $key => $values) {
				
				$destinationArr = explode(',', $values['Destinations']); // get the first destination only by extracting array
				$LongJsonInfo = Zend_Json::decode($values['LongJsonInfo']);
				
				$categoryDetails = $this->objHelperGeneral->getCategoryAndPriceArray($LongJsonInfo['package']['TourTypes']['MarketType'], 'B2C', $values['PackageType'], $values['PackageSubType']); // get default category
				
				$tourImage1 = explode(',', $values['Image']);
				$tourImage = $tourImage1[0];
				
				$defaultCategoryId = $categoryDetails['defaultCategoryId'];
				$defaultCategory = $categoryDetails['defaultCategory'];
				$defaultTourType = $categoryDetails['defaultTourType'];
				$TPId = ($values['PackageType'] == $this->packageTypeStatic) ? $LongJsonInfo['package']['TPId'] : $categoryDetails['TPId'];
				$MPType = (!empty($categoryDetails['MPType']) && ($categoryDetails['MPType'] != 'LowestCost')) ? array_search($categoryDetails['MPType'], unserialize(CONST_MEAL_PLAN_ARR)) : 0;
				
				$tourTypeChar = ($defaultTourType == 1) ? 'P' : 'G'; // if private than P else G for Group tour type
				$priceArrJson = $categoryDetails['priceArrJson'];
				
				$displayFinalPrice = $this->objHelperGeneral->getPackagePrice($defaultCategory, $tourTypeChar, $priceArrJson, true);  // Param 4: true ( if calculate discounted price )
				$defaultCategoryIdm = isset($LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id']) ? $LongJsonInfo['package']['Itineraries']['Itinerary'][0]['ItineraryItem'][1]['Items'][0]['Id'] : 0;
				$lastMinuteToursFinal[] = [
                'name' => $this->objHelperGeneral->trimContent($LongJsonInfo['package']['Name'], 24),
                'nameF' => $LongJsonInfo['package']['Name'], // full name of package name
                'img' => $tourImage,
                'night' => $values['Nights'],
                'price' => $this->objHelperGeneral->moneyFormatINR(round($displayFinalPrice)),
                'pricerange' => $LongJsonInfo['package']['PriceRange'],
                'star' => $values['StarRating'],
                'Destination' => $values['Destinations'],
                'PkgSysId' => $values['PkgSysId'],
                'GTXPkgId' => $values['GTXPkgId'],
                'defaultCategoryId' => ($defaultCategoryId != '') ? $defaultCategoryId : $defaultCategoryIdm,
                'defaultCategory' => $defaultCategory,
                'tourtype' => ($defaultTourType != '') ? $defaultTourType : 1,
                'TPId' => $TPId,
                'PackageType' => $values['PackageType'],
                'mp' => $MPType,
                'Countries' => $values['Countries'],
                'isFixedDeparturesPackage' => $LongJsonInfo['package']['IsFixedDeparturePackage'],
                'BookingValidUntil' => $values['BookingValidUntil'],
				];
			}
			$this->view->lastMinuteTours = $lastMinuteToursFinal;
			$getPageDetail = $this->objMdl->rv_select_row('tbl_static_pages', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'identifier' => 'travelogue', 'status' => 'Activate'], ['sid' => 'desc']);
			
			$this->view->getPageDetail = $getPageDetail;
		}
		
		public function offersAction() {
			$this->view->baseUrl = $this->baseUrl;
			$CONST_OFFERS = unserialize('CONST_OFFERS');
			$this->objMdl = new Admin_Model_CRUD();
			$offers = $this->objMdl->rv_select_all('tbl_offers', ['*'], ['AgencySysId' => $this->gtxagencysysid, 'isActive' => 1, 'isMarkForDel' => 0], ['Id' => 'DESC']);
			$getPageDetail = $this->objMdl->rv_select_row('tbl_static_pages', ['*'], ['identifier' => 'offers'], ['sid' => 'desc']);
			$this->view->pagedetail = $getPageDetail;
			$offersArr = $offersAllArr = array();
			foreach ($offers as $key => $value) {
				$offersArr[$value['category']][] = $value;
				$offersAllArr[] = $value;
			}
			$this->view->offersAllArr = $offersAllArr;
			// print_r($offersAllArr); die;
			$this->view->offers = $offersArr;
			$this->view->CONST_OFFERS = $CONST_OFFERS;
			//   echo "<pre>";print_r($offersArr);die;
			$resultsetSeoForBlog['TravTitle'] = $getPageDetail['page_title']; // get package Keyword
			$resultsetSeoForBlog['Keyword'] = $getPageDetail['meta_keywords']; // get package Keyword
			$resultsetSeoForBlog['Description'] = $getPageDetail['meta_description']; // get package Description
			$resultsetSeoForBlog['metaTitle'] = (trim($getPageDetail['meta_title']) != '') ? $getPageDetail['meta_title'] : $getPageDetail['page_title']; // get package Metatag
			$this->view->detailLayout = $resultsetSeoForBlog;
		}
		
		public function testmailAction() {
			//$url="http://103.239.139.156:8003/api/v1/car/hotel-master/";
			$url = "http://103.239.139.156";
			$datashd = get_headers($url);
			//print_r($datashd);
			//die();
			$contactDetail_mail = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom')->getContactDetailForFooter();
			if ($this->getRequest()->isPost()) {
				$param = $this->getRequest()->getParams();
				$to = $param['to'];
				$from = $param['from'];
				$subject = $param['subject'];
				$message = $param['message'];
				
				$configs = [
                'to' => $to,
                'fromName' => 'test Mail',
                'fromEmail' => $contactDetail_mail['email'],
                'subject' => $subject,
                'bodyHtml' => $message,
				];
				$this->_helper->General->mailSentByElastice($configs, 'test');
				
				$this->view->message = "Successfully mail has been sent";
			}
		}
		
		public function currencyExchangeRate($fromcurrency, $tocurrency, $MarkUpPersentage = 0, $AgencySysId = NULL) {
			$this->objMdl = new Admin_Model_CRUD();
			$returnVal = 1;
			$AgencySysId = isset($AgencySysId) ? (int) $AgencySysId : null;
			if ($fromcurrency != $tocurrency) {
				$currencyRate = $this->objMdl->rv_select_row_rate('tbl_currency_rate', ['Rate'], ['FCurrencyType' => @$fromcurrency, 'TCurrencyType' => @$tocurrency, 'isActive' => 1], ['cid' => 'ASC']);
				if ($MarkUpPersentage > 0) {
					$returnVal = isset($currencyRate['Rate']) ? ((float) $currencyRate['Rate'] + ((float) ($currencyRate['Rate']) * $MarkUpPersentage) / 100) : 1;
					} else {
					$returnVal = isset($currencyRate['Rate']) ? (float) $currencyRate['Rate'] : 1;
				}
			}
			
			return $returnVal;
		}
		
	}

Youez - 2016 - github.com/yon3zu
LinuXploit