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/b2bzend/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/controllers/ItineraryDescriptionController.php
<?php

class ItineraryDescriptionController extends Catabatic_ValidateGtx {

    private $intLoggedinUserAgencySysId = '';

    public function init() {
        parent::init();
        $aConfig = $this->getInvokeArg('bootstrap')->getOptions();
        $this->siteUrl = $aConfig['bootstrap']['siteUrl'];

        $sessionLogin_user = new Zend_Session_Namespace('sessionLogin_user');
        //Zend_Session::rememberMe(60 * 60 * 24 * 7);
        //  $sessionLogin_user->lock();
        $this->intLoggedinUserRole = $sessionLogin_user->UserRole;
        $this->intLoggedinUserAgencySysId = $sessionLogin_user->intLoggedinUserAgencySysId;
        $this->IsB2CSite = $sessionLogin_user->agencyDetails['IsB2CSite'];
        // unlocking read-only lock
//        if ($sessionLogin_user->isLocked()) {
//            $sessionLogin_user->unLock();
//        }
    }

    public function indexAction() {

        $objItineraryDescription = new Travel_Model_TblItineraryDescription();

        //Start Search Code
        $searchArr = array();
        $getData = array();
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
//            echo "<pre>";print_r($getData);die;
            if (!empty($getData)) {
                if (@$getData['hiddenStartCitysearch'] != 0) {
                    $StartId = @$getData['hiddenStartCitysearch'];
                } else {
                    $StartId = "";
                }
                if (@$getData['hiddenDestinationCitysearch'] != 0) {
                    $DestinationId = @$getData['hiddenDestinationCitysearch'];
                } else {
                    $DestinationId = "";
                }
                $searchArr = array(
                    'StartCity' => $StartId,
                    'DestinationCity' => $DestinationId,
                    'StartCityName' => $getData['StartCitysearch'],
                    'DestinationCityName' => $getData['DestinationCitysearch'],
                );
            }
        }

//        echo "<pre>"; print_r($searchArr);die;    

        $objItineraryDescription->searchArr = $searchArr;
        $this->view->searchArr = $searchArr;
        $this->view->IsB2CSite = $this->IsB2CSite;

        //Agency Id
        $intLoggedinUserAgencySysId = $this->intLoggedinUserAgencySysId;
        $ItineraryList = $objItineraryDescription->getAllItineraryList($intLoggedinUserAgencySysId);

        //Get city list
//        $objLocation = new Travel_Model_TblLocation();
//        $this->view->cityListing = $objLocation->getAllCityList();

        $page = $this->_getParam('page', 1);
        $paginator = Zend_Paginator::factory($ItineraryList);
        $paginator->setItemCountPerPage(25);
        $paginator->setCurrentPageNumber($page);
        $this->view->paginator = $paginator;
        $this->view->totalrec = $paginator->getTotalItemCount();
		$this->view->page = $page;
        //For display message
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
    }

    public function activeWebsiteAction() {
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);
        if ($this->_request->isXmlHttpRequest()) {
            $postData = $this->getRequest()->getPost();
            $ItineraryId = $postData['ItineraryId'];
            $status = $postData['status'];
            $objItineraryDescription = new Travel_Model_TblItineraryDescription();
            if (isset($ItineraryId)) {
                try {
                    $insert = array(
                        'IsWebsite' => $status,
                    );
                    $objIsWebsiteIti = $objItineraryDescription->updateItineraryDescription($ItineraryId, $insert);
                    if (!$objIsWebsiteIti || $objIsWebsiteIti != 1) {
                        $result_message = ['status' => false, 'message' => 'Oops something wrong!!!'];
                        echo Zend_Json::encode($result_message);
                        exit;
                    } else {
                        $result_message = ['status' => true, 'message' => 'Active successfully'];
                        echo Zend_Json::encode($result_message);
                        exit;
                    }
                } catch (Exception $ex) {
                    $ex->getMessage();
                }
            } else {
                $result_message = ['status' => false, 'message' => 'Oops there might be something wrong!!!'];
                echo Zend_Json::encode($result_message);
                exit;
            }
        }
    }

    public function viewManageItineraryDetailsAction() {
        /* Disable Layout */
        $this->_helper->layout->disableLayout();

        $ItineraryId = $this->getRequest()->getParam('id');

        $objItineraryDescription = new Travel_Model_TblItineraryDescription();
        if ($this->intLoggedinUserRole != 1) {
            $intLoggedinUserId = $this->intLoggedinUserAgencySysId;
        } else {
            $intLoggedinUserId = "";
        }
        $this->view->arrItineraryList = $objItineraryDescription->getAllItineraryList($this->intLoggedinUserAgencySysId, $ItineraryId);
//        $objLocation = new Travel_Model_TblLocation();
//        $this->view->cityListing = $objLocation->getAllCityList();
    }

    public function addItineraryDescriptionAction() {
        
    }

    public function viewItineraryDescriptionFormAction() {

        $this->_helper->layout->setLayout('newLayout');

        /* Disable Layout */
        $this->_helper->layout->disableLayout();
    }

    public function viewEditItineraryDescriptionFormAction() {

        /* Disable Layout */
        $this->_helper->layout->disableLayout();


        $ItineraryId = $this->getRequest()->getParam('id');

        if ($this->intLoggedinUserRole != 1) {
            $intLoggedinUserId = $this->intLoggedinUserAgencySysId;
        } else {
            $intLoggedinUserId = "";
        }

        $objItineraryDescription = new Travel_Model_TblItineraryDescription();
        $this->view->arrItineraryList = $objItineraryDescription->getAllItineraryList($this->intLoggedinUserAgencySysId, $ItineraryId);
//        $objLocation = new Travel_Model_TblLocation();
//        $this->view->cityListing = $objLocation->getAllCityList();
    }

    public function saveItineraryDescriptionAction() {
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);
        if ($this->getRequest()->isPost()) {
            $post = $this->getRequest()->getPost();
            $Iswebsite = 0;
            /* For activities */
            if (!empty($post)) {
                $ItineraryId = isset($post['ItineraryId']) ? $post['ItineraryId'] : '0';
                $ItineraryStartCity = isset($post['hiddenStartCity']) ? trim($post['hiddenStartCity']) : '0';
                $ItineraryDestinationCity = isset($post['hiddenDestinationCity']) ? trim($post['hiddenDestinationCity']) : '0';
                $ItineraryTitle = isset($post['title']) ? trim($this->sanitize_data($post['title'])) : '0';
                $ItineraryDescription = isset($post['description']) ? $this->sanitize_data_html($post['description']) : '0';
                $Iswebsite = isset($post['Iswebsite']) ? $this->sanitize_data_html($post['Iswebsite']) : '0';
                $ItineraryStartCityArr = explode('__', $ItineraryStartCity);
                $ItineraryDestinationCityArr = explode('__', $ItineraryDestinationCity);
            }
//            echo "<pre>";print_r($ItineraryId);die;
            $objItineraryDescription = new Travel_Model_TblItineraryDescription();

            $insert = array(
                'AgencySysId' => $this->intLoggedinUserAgencySysId,
                'StartCity' => $ItineraryStartCityArr[0],
                'DestinationCity' => $ItineraryDestinationCityArr[0],
                'Title' => $ItineraryTitle,
                'Description' => $ItineraryDescription,
                'Iswebsite' => $Iswebsite,
                'IsActive' => 1,
                'IsMarkForDel' => 0,
            );
            try {
                if ($ItineraryId != "" && $ItineraryId != 0) {

                    $objItineraryDescription->updateItineraryDescription($ItineraryId, $insert);
                    $this->_helper->flashMessenger->addMessage("Itinerary updated successfully.");
                    // $this->_helper->redirector('index', 'itinerary-description', 'default');
                } else {
                    $ItineraryId = $objItineraryDescription->addItineraryDescription($insert);
                    $this->_helper->flashMessenger->addMessage("Itinerary saved successfully.");
                }
                if (trim($_SESSION['sessionLogin_user']['agencyDetails']['IsB2CSite']) == 1) {
                    if ($Iswebsite == 1) {
                        $URL = trim($_SESSION['sessionLogin_user']['agencyDetails']['Url']) . '/gtxwebservices/index/itinerary-description';
                    } else {
                        $URL = trim($_SESSION['sessionLogin_user']['agencyDetails']['Url']) . '/gtxwebservices/index/itinerary-description-deactivate';
                    }
                    $AgencySysId = Travel_Model_AgencyAuth::getIdentity()->AgencySysId;
                    $gtxWebservicesModel = new Gtxwebservices_Model_Webservices();
                    $this->postFields = "";
                    $this->postFields .= "&AgencySysId=" . $AgencySysId;
                    $this->postFields .= "&packageId=$ItineraryId";
                    $writeLogObj = new Payment_Model_Payment();
                    $writeLogObj->writeLog($this->postFields . "\n");
                    $agencyData = $gtxWebservicesModel->getAgencyInfo($AgencySysId);
                    $IsAgencySSL = isset($agencyData['IsSSL']) ? (int) $agencyData['IsSSL'] : 0;
                    try {
                        $ch = curl_init();
                        curl_setopt($ch, CURLOPT_URL, $URL);
                        curl_setopt($ch, CURLOPT_HEADER, 0);
                        if ($IsAgencySSL == 1) {
                            if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
                                curl_setopt($ch, CURLOPT_PORT, 443);
                                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
                                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
                            }
                        }
                        curl_setopt($ch, CURLOPT_POST, 1);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                        curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postFields);
                        $output = curl_exec($ch);
                        $writeLogObj->writeLog($output . "\n");
                        curl_close($ch);
                        $this->_helper->redirector('index', 'itinerary-description', 'default');
                    } catch (Zend_Exception $ex) {
                        $response = array('success' => false, 'msg' => $e->getMessage());
                        echo json_encode($response);
                        exit;
                    }
                } else {
                    $this->_helper->redirector('index', 'itinerary-description', 'default');
                }
            } catch (Exception $e) {
                $response = array('success' => false, 'msg' => $e->getMessage());
                echo json_encode($response);
                exit;
            }
        }
    }

    public function deactivateAction() {
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);

        $objItineraryDescription = new Travel_Model_TblItineraryDescription();
        $ItineraryId = $this->getRequest()->getParam('id');
        $statusValue = '0';
        if ($this->intLoggedinUserRole != 1) {
            $intLoggedinUserId = $this->intLoggedinUserAgencySysId;
        } else {
            $intLoggedinUserId = "";
        }

        $isDeactive = $objItineraryDescription->setActiveDeactive($ItineraryId, $statusValue);
        $message = @$isDeactive ? "Itinerary deactivated successfully." : "Itinerary deactivation failed.";
        $this->_helper->flashMessenger->addMessage($message);
        $this->_helper->redirector('index', 'itinerary-description', 'default');
    }

    public function activateAction() {
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);

        $objItineraryDescription = new Travel_Model_TblItineraryDescription();
        $ItineraryId = $this->getRequest()->getParam('id');
        $statusValue = '1';
        if ($this->intLoggedinUserRole != 1) {
            $intLoggedinUserId = $this->intLoggedinUserAgencySysId;
        } else {
            $intLoggedinUserId = "";
        }

        $isActive = $objItineraryDescription->setActiveDeactive($ItineraryId, $statusValue);
        $message = @$isActive ? "Itinerary activated successfully." : "Itinerary activation failed.";
        $this->_helper->flashMessenger->addMessage($message);
        $this->_helper->redirector('index', 'itinerary-description', 'default');
    }

    public function deleteItineraryAction() {

        /* Disable Layout */
        $this->_helper->layout->disableLayout();

        $ItineraryId = base64_decode($this->getRequest()->getParam('id'));

        $objItineraryDescription = new Travel_Model_TblItineraryDescription();
        $intLoggedinUserAgencySysId = $this->intLoggedinUserAgencySysId;

        $objItineraryDescription->deleteItinerary($ItineraryId, $intLoggedinUserAgencySysId);

        $this->_helper->flashMessenger->addMessage("Itinerary deleted successfully.");
        $this->_helper->redirector('index', 'itinerary-description', 'default');
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit