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/PackageRangeController.php
<?php

/*
 * Catabatic Technology Pvt. Ltd.
 * File Name :PackageRangeController.php
 * File Description :PackageRangeController.php
 * Created By : Pardeep Panchal
 * Created Date: 04-Auguest-2016
 */

class PackageRangeController extends Zend_Controller_Action {

    public function init() {
        
        $sessionLogin_user = new Zend_Session_Namespace('sessionLogin_user');
        Zend_Session::rememberMe(60 * 60 * 24 * 7);
        
        #get session variable
       
        $this->intLoggedinUserId            = $sessionLogin_user->intLoggedinUserId;
        $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 */
        }
        
        if(empty($this->intLoggedinUserId)) {
            $this->_redirect('/login/');
        }
        
    }

    public function indexAction() {
        
        $this->view->strPageTitle = "Package Range";
        $this->view->strAddButtonText = "Add Package Range";
        $this->view->strAddButtonUrl = "package-range/add-package-range";
        
        $obj = new Travel_Model_TblPackageRange();
        $arrResult = $obj->getPackageRangeList();
        $page = $this->_getParam('page', 1);
        $paginator = Zend_Paginator::factory($arrResult);
        $paginator->setItemCountPerPage(GRID_PER_PAGE_RECORD_COUNT);
        $paginator->setCurrentPageNumber($page);

        $this->view->paginator = $paginator;
        $this->view->messages = $this->_helper->flashMessenger->getMessages();
    }

    public function addPackageRangeAction() {
        
        $this->view->strPageTitle = "Add Package Range";
        $this->view->strFormAction = "/package-range/add-package-range";
        $this->view->strCancelButtonUrl = "package-range";
        
        
        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
            $obj = new Travel_Model_TblPackageRange();
            if (!$obj->isPackageRangeExists(trim($getData['title']),"")) {
                
                
//                $date = new Zend_Date();
                $currentDate = date('Y-m-d H:i:s');
                $strPackageRangeTitle = trim($getData['title']);
                $strIcon = stripslashes($_FILES['icon']['name']);
                
                if(!empty($strIcon)){ 
                    
                    $strDestinationFolder = APPLICATION_PATH.'/../public/upload/master/';
                    $arrFileInfo = pathinfo($strIcon);
                    $strFileExt = $arrFileInfo['extension']; // get File Extension...
                    $strIcon = 'PackageRangeIcon_'.ucfirst($strPackageRangeTitle).'_'.time().'.'.$strFileExt; // Renamed File Name
                    $objHelper = $this->_helper->FileUpload;
                    $objHelper->upload($strDestinationFolder,$strIcon);
                    
                
                }else{
                    $strIcon = "";
                }
                
                
                $data = array(
                    'Title' => $strPackageRangeTitle,
                    'Icon' => $strIcon,
                    'CreateDate' => $currentDate,
                    'UpdateDate' => $currentDate,
                    'IsMarkForDel' => 0,
                    'IsActive' => $getData['status']
                );
                //Insert Package Range Data
                $result = $obj->addPackageRange($data);
                $this->_helper->flashMessenger->addMessage("Package Range added successfully.");
                $this->_redirect("/package-range");
            } else{
               $this->view->message = 'Package Range already exists.'; 
            }
        }
    }

    public function editPackageRangeAction() {
        
        $intId = base64_decode($this->getRequest()->getParam('id'));
    
        $this->_helper->viewRenderer("add-package-range");
        $this->view->strPageTitle = "Edit Package Range";
        $this->view->strCancelButtonUrl = "package-range";
        $this->view->strFormAction = "/package-range/edit-package-range/id/".$this->getRequest()->getParam('id');
        $this->view->strIconPath = '/../public/upload/master/';
        
        $obj = new Travel_Model_TblPackageRange();
        $result = $obj->getDataByPackageRangeId($intId);
        //echo "<pre>"; print_r($result);
        
        $this->view->arrData = $result;

        if ($this->getRequest()->isPost()) {
            $getData = $this->getRequest()->getPost();
//            $date = new Zend_Date();
            $updateDate = date('Y-m-d H:i:s');
            $strPackageRangeTitle = trim($getData['title']);
            
            $intPackageRangeId = base64_decode($getData['recordId']);
            $strIcon = stripslashes($_FILES['icon']['name']);
            $strHiddenIcon = ($getData['hiddenIcon']) ? $getData['hiddenIcon'] : '';
            if (!$obj->isPackageRangeExists($strPackageRangeTitle, $intPackageRangeId)) {
                
                if(!empty($strIcon)){ 
                    
                    $strDestinationFolder = APPLICATION_PATH.'/../public/upload/master/';
                    $arrFileInfo = pathinfo($strIcon);
                    $strFileExt = $arrFileInfo['extension']; // get File Extension...
                    $strIcon = 'PackageRangeIcon_'.ucfirst($strPackageRangeTitle).'_'.time().'.'.$strFileExt; // Renamed File Name
                    $objHelper = $this->_helper->FileUpload;
                    $objHelper->upload($strDestinationFolder,$strIcon);
                    
                
                }else{
                    $strIcon = $strHiddenIcon;
                }
                
        
                $data = array(
                    'Title' => $strPackageRangeTitle,
                    'Icon'  => $strIcon,
                    'UpdateDate' => $updateDate,
                    'IsActive' => $getData['status']
                );
                //update Package Range
                $response = $obj->updatePackageRange($data, $intPackageRangeId);
                $this->_helper->flashMessenger->addMessage("Package Range updated successfully.");
                $this->_redirect("/package-range");
            } else {
                $this->view->message = 'Package Range already exists.';
            }
        } 
    }

    public function deleteRecordAction(){
        // disable layout...
        $this->_helper->layout->disableLayout();
        $intId = base64_decode($this->getRequest()->getParam('id'));
        $data = array(
                    "IsMarkForDel" => 1
                );
        $obj = new Travel_Model_TblPackageRange();
        $obj->deletePackageRange($intId,$data);

        $this->_helper->flashMessenger->addMessage("Package Range deleted successfully.");
        $this->_redirect("/package-range");
        
    }


}

Youez - 2016 - github.com/yon3zu
LinuXploit