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/modules/finance/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/modules/finance/controllers/RewardPointsController.php
<?php

class Finance_RewardPointsController extends Catabatic_ValidateGtx {

    public $insuranceMdl;
    public $per_page_record = GRID_PER_PAGE_RECORD_COUNT;
    public $intLoggedinUserId;
    public $intLoggedinUserAgencySysId;
    public $_HtmlPurifier;

    public function init() {
        parent::init();
        $this->insuranceMdl = new Finance_Model_Finance();
        $sessionLogin_user = new Zend_Session_Namespace('sessionLogin_user');
        $this->intLoggedinUserId = $sessionLogin_user->intLoggedinUserId;
        $this->intLoggedinUserAgencySysId = $sessionLogin_user->intLoggedinUserAgencySysId;
        $this->_HtmlPurifier = new Zend_Filter_HtmlPurifier();
    }

    public function indexAction() {
        $userLoggedIn = $this->intLoggedinUserAgencySysId;
        $modelSet = new Travel_Model_CRM_CustomerTravelPlan();
        $listingsData = $modelSet->getRecordListingRewarPage($userLoggedIn);
        $page = $this->_getParam('page', 1);
        $listings = Zend_Paginator::factory($listingsData);
        $listings->setItemCountPerPage(25);
        $listings->setCurrentPageNumber($page);
        $this->view->trxData = $listings;
        $this->view->totalrec = $listings->getTotalItemCount();
    }
    
    public function statementAction(){
        $rwdId = $this->getRequest()->getParam('rwdId',null);
        $userLoggedIn = $this->intLoggedinUserAgencySysId;
        $modelSet = new Travel_Model_CRM_CustomerTravelPlan();
        $listingsData = $modelSet->getRecordListingRewarHistoryPage($rwdId,$userLoggedIn);
        $page = $this->_getParam('page', 1);
        $listings = Zend_Paginator::factory($listingsData);
        $listings->setItemCountPerPage(25);
        $listings->setCurrentPageNumber($page);
        $this->view->trxData = $listings;
        $this->view->totalrec = $listings->getTotalItemCount();
        $rewardData = $modelSet->getRecordListingRewarPage($userLoggedIn,$rwdId);
        $this->view->rewardData = $rewardData;
    }
    
    public function viewDetailAction() {
        $this->view->layout()->disableLayout();
        $rwdId = $this->getRequest()->getParam('action',null);
        if($rwdId) {
            $this->view->type = $rwdId;
        } else {
            echo "Please contact"; exit;
        }
    }
     public function redeemedViewDetailAction() {
        $this->view->layout()->disableLayout();
        $rwdId = $this->getRequest()->getParam('action',null);
        if($rwdId) {
            $this->view->type = $rwdId;
        } else {
            echo "Please contact"; exit;
        }
    }

    public function getProposalDetailAction() {
        $modelSet = new Travel_Model_CRM_CustomerTravelPlan();
        $returnArray = array("status" => false, "data" => []);
        $markeplaylist = array();
        if ($this->getRequest()->isPost()) {
            $response = $this->getRequest()->getPost();
            $userLoggedIn = $this->intLoggedinUserAgencySysId;
            $TPSysId = $response['packageId'];
            $listingsData = $modelSet->getQueryDetail($TPSysId, $userLoggedIn);
            if (!empty($listingsData)) {
                $returnArray = array("status" => true, "data" => $listingsData[0]);
            }
        }
        echo json_encode($returnArray);
        exit;
    }

    public function redeemedRewardPointsAction() {
        $objPackage = new Travel_Model_TblPackage();
        $returnArray = array("status" => false, "data" => []);
        if ($this->getRequest()->isPost()) {
            $response = $this->getRequest()->getPost();
            $userLoggedIn = $this->intLoggedinUserAgencySysId;
            $TPSysId = isset($response['proposal_id']) ? $response['proposal_id'] : null;
            $sales_value = isset($response['sales_value']) ? $response['sales_value'] : 0;
            $percentage = 1;
            $paymentMdl = new Payment_Model_Payment();
            $points = 0;
            $currentDate = date('Y-m-d H:i:s');
            $remarks = isset($response['remarks']) ? $response['remarks'] : '';
            if ($TPSysId) {
                $modelSet = new Travel_Model_CRM_CustomerTravelPlan();
                $listingsData = $modelSet->getQueryDetail($TPSysId, $userLoggedIn);
                if (!empty($listingsData)) {
                    $agencySysId = isset($listingsData[0]['AgencySysId']) ? $listingsData[0]['AgencySysId'] : null;
                    $masterAgencySysId = isset($listingsData[0]['MasterAgencySysId']) ? $listingsData[0]['MasterAgencySysId'] : null;
                    $rewardPointSysId = $modelSet->checkRewardPoints($agencySysId, $masterAgencySysId);
                    if ((float) $sales_value > 0 && (int) $rewardPointSysId > 0) {
                        $points = $sales_value;
                        $editData = array('BalancePoints' => new Zend_Db_Expr("BalancePoints - $points"));
                        $where = array('RewardPointsSysId =?' => $rewardPointSysId);
                        $paymentMdl->updateTable("TB_Agency_Reward_Points", $editData, $where);
                        $getwalletBalence = $paymentMdl->getDetailsByUniqueId("TB_Agency_Reward_Points", "RewardPointsSysId", $rewardPointSysId);
                        $rewardpointsHistory = array(
                            "ProposalId" => $TPSysId,
                            "TrxType" => 0,
                            "SalesValue" => 0,
                            "PointsPercentage" => $percentage,
                            "CreditPoints" => $points,
                            "BalancePoints" => $getwalletBalence['BalancePoints'],
                            "Remark" => $remarks,
                            "IsMarkForDel" => 0,
                            "IsActive" => 1,
                            "CreateDate" => $currentDate,
                            "UpdateDate" => $currentDate,
                            "AgencySysId" => $agencySysId,
                            "AgentSysId" => Travel_Model_AgencyAuth::getIdentity()->UserSysId,
                            "CurrencyType" => 1,
                            "MasterAgencySysId" => $masterAgencySysId,
                            "RewardPointsSysId" => $rewardPointSysId
                        );
                        $objPackage->insertData('Tb_Agency_Reward_Points_History', $rewardpointsHistory);
                        $returnArray = array("status" => true, "data" => $listingsData[0]);
                    }
                }
            }
        }
        echo json_encode($returnArray);
        exit;
    }

    public function addRewardPointsAction(){
        $returnArray = array("status" => false, "data" => []);
        if ($this->getRequest()->isPost()) {
            $mdlRewards = new Travel_Model_TblRewardPoints;
            $response = $this->getRequest()->getPost();
            $TPSysId = isset($response['proposal_id']) ? $response['proposal_id'] : null;
            $UserSysId = $this->intLoggedinUserAgencySysId;
            $PointType = isset($response['PointType']) ? $response['PointType'] : null;
            $B2bAgencySysId = isset($response['agencySysId']) ? $response['agencySysId'] : null;
            $masterAgencySysId = isset($response['masterAgencySysId']) ? $response['masterAgencySysId'] : null;
            $pointsPersentage = isset($response['rewardpercentage']) ? $response['rewardpercentage'] : null;
            $points = isset($response['rewardpoint']) ? $response['rewardpoint'] : 0;
            $SalesValue = isset($response['sales_value']) ? $response['sales_value'] : 0;
            $Remark = isset($response['remarks']) ? $response['remarks'] : '';
           
            if($PointType==1){
                $Remark = "Welcome To Registration";
                $type = 2;
                $returnArray = $mdlRewards->addRewardsPoints($B2bAgencySysId, $masterAgencySysId, $points, $UserSysId, $pointsPersentage, $SalesValue, $Remark, $type);
            } else{
                $type = 1;  
                if($TPSysId){
                    $modelSet = new Travel_Model_CRM_CustomerTravelPlan();
                    $listingsData = $modelSet->getQueryDetail($TPSysId, $UserSysId);
                    if(!empty($listingsData)){
                    $B2bAgencySysId = isset($listingsData[0]['AgencySysId']) ? $listingsData[0]['AgencySysId'] : null;
                    $masterAgencySysId = isset($listingsData[0]['MasterAgencySysId']) ? $listingsData[0]['MasterAgencySysId'] : null;
                    $returnArray = $mdlRewards->addRewardsPoints($B2bAgencySysId, $masterAgencySysId, $points, $UserSysId, $pointsPersentage, $SalesValue, $Remark, $type,$TPSysId);
                    }
                } 
            }
        }
        echo json_encode($returnArray);
        exit;
    }

    // public function saveRewardPointsAction() {
    //     $objPackage = new Travel_Model_TblPackage();
    //     $returnArray = array("status" => false, "data" => []);
    //     if ($this->getRequest()->isPost()) {
    //         $response = $this->getRequest()->getPost();
    //         $userLoggedIn = $this->intLoggedinUserAgencySysId;
    //         $TPSysId = isset($response['proposal_id']) ? $response['proposal_id'] : null;
    //         $sales_value = isset($response['sales_value']) ? $response['sales_value'] : 0;
    //         $percentage = 1;
    //         $paymentMdl = new Payment_Model_Payment();
    //         $points = 0;
    //         $currentDate = date('Y-m-d H:i:s');
    //         $remarks = isset($response['remarks']) ? $response['remarks'] : '';
    //         if ($TPSysId) {
    //             $modelSet = new Travel_Model_CRM_CustomerTravelPlan();
    //             $listingsData = $modelSet->getQueryDetail($TPSysId, $userLoggedIn);
    //             if (!empty($listingsData)) {
    //                 $agencySysId = isset($listingsData[0]['AgencySysId']) ? $listingsData[0]['AgencySysId'] : null;
    //                 $masterAgencySysId = isset($listingsData[0]['MasterAgencySysId']) ? $listingsData[0]['MasterAgencySysId'] : null;
    //                 $rewardPointSysId = $modelSet->checkRewardPoints($agencySysId, $masterAgencySysId);
    //                 if ((float) $sales_value > 0 && (int) $rewardPointSysId > 0) {
    //                     $points = ($sales_value * $percentage) / 100;
    //                     $editData = array('BalancePoints' => new Zend_Db_Expr("BalancePoints + $points"));
    //                     $where = array('RewardPointsSysId =?' => $rewardPointSysId);
    //                     $paymentMdl->updateTable("TB_Agency_Reward_Points", $editData, $where);
    //                     $getwalletBalence = $paymentMdl->getDetailsByUniqueId("TB_Agency_Reward_Points", "RewardPointsSysId", $rewardPointSysId);
    //                     $rewardpointsHistory = array(
    //                         "ProposalId" => $TPSysId,
    //                         "TrxType" => 1,
    //                         "SalesValue" => $sales_value,
    //                         "PointsPercentage" => $percentage,
    //                         "CreditPoints" => $points,
    //                         "BalancePoints" => $getwalletBalence['BalancePoints'],
    //                         "Remark" => $remarks,
    //                         "IsMarkForDel" => 0,
    //                         "IsActive" => 1,
    //                         "CreateDate" => $currentDate,
    //                         "UpdateDate" => $currentDate,
    //                         "AgencySysId" => $agencySysId,
    //                         "AgentSysId" => Travel_Model_AgencyAuth::getIdentity()->UserSysId,
    //                         "CurrencyType" => 1,
    //                         "MasterAgencySysId" => $masterAgencySysId,
    //                         "RewardPointsSysId" => $rewardPointSysId
    //                     );
    //                     $objPackage->insertData('Tb_Agency_Reward_Points_History', $rewardpointsHistory);
    //                     $returnArray = array("status" => true, "data" => $listingsData[0]);
    //                 }
    //             }
    //         }
    //     }
    //     echo json_encode($returnArray);
    //     exit;
    // }

}

Youez - 2016 - github.com/yon3zu
LinuXploit