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/b2c.hellogtx.com/application/admin/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2c.hellogtx.com/application/admin/controllers/PopbannerController.php
<?php
    class Admin_PopbannerController extends Zend_Controller_Action
    {
        public $dbAdapter;
        public $perPageLimit;
        public $siteurl;
        public $DIR_WRITE_MODE;
    
    
        
        public function init()
        {
    
            /*Initialize db and session access */
            parent::init();
            $aConfig = $this->getInvokeArg('bootstrap')->getOptions();
            $this->view->siteurl = $this->siteurl = $aConfig['bootstrap']['siteUrl'];
            $this->view->stylecss = $this->stylecss = $aConfig['bootstrap']['stylecss'];
            $this->appmode = $aConfig['bootstrap']['appmode'];
            $this->per_page_record   = 20;
    
            $this->dbAdapter = Zend_Db_Table::getDefaultAdapter();
    
            $auth        = Zend_Auth::getInstance();
            $authStorage = $auth->getStorage()->read();
            $this->username      = $authStorage->username;
            $this->admin_type    = $authStorage->role;
            $this->large_image_width = $aConfig['bootstrap']['large_image_width'];
            $this->large_image_height = $aConfig['bootstrap']['large_image_height'];
            $this->medium_image_width = $aConfig['bootstrap']['medium_image_width'];
            $this->medium_image_height = $aConfig['bootstrap']['medium_image_height'];
            $this->small_image_width = $aConfig['bootstrap']['small_image_width'];
            $this->small_image_height = $aConfig['bootstrap']['small_image_height'];
    
            $this->table = 'tbl_popbanner';
            $this->current_time = time();
            $this->imageUrl     = (($this->appmode == 'MODE_BETA') ? 'beta/' : '') . 'public/upload/' . $this->stylecss . '/popbanner/';
            $this->DIR_WRITE_MODE = 0777;
        }
        public function indexAction()
        {
            //Check admin logedin or not
            
            $this->checklogin();
            $this->view->messages = $this->_helper->flashMessenger->getMessages();
            $crud   = new Admin_Model_CRUD();
            $getData = array();
            if ($this->getRequest()->isPost()) {
                $getData = $this->getRequest()->getPost();
                
                $searchArr = array(
                    'title' => $getData['title'],
                    'rows' => $getData['rofferIdows'],
                    'page' => $getData['page'],
                );
                
                $resulsetold = $crud->getCount($this->table,['isMarkForDel' => 0], 'Id');
                //echo "<pre>";print_r($resulsetold);die;
                $crud->searchArr = $searchArr;
                $resultset = $crud->rv_select_all($this->table, ['*'], ['isMarkForDel' => 0] ,['Id ' => 'DESC']);
                if (count($resultset) > 0) {
                    foreach ($resultset as $resultkey => $resultval) {
                        $checked = ($resultval['displayOnHome'] == 1) ? 'checked' : '';
                        $expiryDate = explode('-', $resultval['expiryDate']);
                        $result1[] = [
                            'Id' => $resultval['Id'],
                            'title' => $resultval['title'],
                            'description' => $resultval['description'],
                            'buttonName' => $resultval['buttonName'],
                            
                            'expiryDate' => $expiryDate[2] . '/' . $expiryDate[1] . '/' . $expiryDate[0],
                            'image' => '<img src="public/upload/' . $this->stylecss . '/popbanner/' . $resultval['Id'] . '/' . $resultval['imagetop'] . '" width="60px" height="60px">',
                            
                            
                        ];
                    }
                }
    
                $result = Zend_Json::encode($result1);
                $newResult = Zend_Json::decode($result, false);
                $finalResult["total"] = $resulsetold[0]['Id'];
                $finalResult["rows"] = $newResult;
    
                echo json_encode($finalResult);
                exit;
            }
        }
        public function addpopAction()
        {
            $this->checklogin();
            $crud = new Admin_Model_CRUD();
			 $this->objMdl = new Admin_Model_CRUD();
			
			 $destinationsresult = $this->objMdl->rv_select_all('tb_tbb2c_destinations', ['Title'], ['IsMarkForDel' => 0],['Title'=>'ASC']);
			 $this->view->destinationsresult = $destinationsresult;
            //         echo "<pre>";print_r($destinationsresult);die;

            if ($this->getRequest()->isPost()) {
                $getData = $this->getRequest()->getPost();
                $lastRow = $crud->getCmsdata($this->table, ['Id'], ['Id'], ['Id' => 'DESC']);
                $pId = $lastRow['Id'] + 1;
                if (isset($getData['save']) == "Save") {
                    //                         echo "<pre>";print_r($getData);die;
                    $id = $getData['id'];
                    
					$orignalFIleNametop = $image = $_FILES["imagetop"]["name"];
                    $fileNametop = '';
                    if (!empty($orignalFIleNametop)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->imageUrl . $pId;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleNametop);
                        $fileNametop   = $this->current_time . 'top.' . $fileExt;


                        if (!file_exists($orignalFolderName)) {
                            mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                        }

                        $temp_file_name = $_FILES["imagetop"]["tmp_name"]; // temprary file name
                        @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileNametop);

                    }
					$orignalFIleNameleft = $image = $_FILES["imageleft"]["name"];
                    $fileNameleft = '';
                    if (!empty($orignalFIleNameleft)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->imageUrl . $pId;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleNameleft);
                        $fileNameleft   = $this->current_time . 'left.' . $fileExt;


                        if (!file_exists($orignalFolderName)) {
                            mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                        }

                        $temp_file_name = $_FILES["imageleft"]["tmp_name"]; // temprary file name
                        @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileNameleft);

                    }
					$orignalFIleNameright = $image = $_FILES["imageright"]["name"];
                    $fileNameright = '';
                    if (!empty($orignalFIleNameright)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->imageUrl . $pId;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleNameright);
                        $fileNameright   = $this->current_time . 'right.' . $fileExt;


                        if (!file_exists($orignalFolderName)) {
                            mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                        }

                        $temp_file_name = $_FILES["imageright"]["tmp_name"]; // temprary file name
                        @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileNameright);

                    }

                    $expiryDate = explode('/', $getData['expiryDate']);
                    $savePageData = [
                        'title' => ($getData['title']),
                        'description' => ($getData['description']),
                        'buttonName' => ($getData['buttonName']),
                       // 'expiryDate' => $expiryDate[2] . '-' . $expiryDate[1] . '-' . $expiryDate[0],
                        'url' => ($getData['url']),
                        'image' =>   $fileName,
                        'imagetop' =>   $fileNametop,
                        'imageleft' =>   $fileNameleft,
                        'imageright' =>   $fileNameright,
                        'urltop' =>   ($getData['urltop']),
                        'urlleft' =>   ($getData['urlleft']),
                        'urlright' =>   ($getData['urlright']),
                    ];
					
					
					
                    $crud->rv_insert($this->table, $savePageData);
                    $this->view->successMessage = "Page content has been saved successfully.";
                    $this->_helper->flashMessenger->addMessage("Page content has been added successfully.");
                    $this->_redirect("/admin/popbanner/index");
                }
            }


            $this->view->messages   = $this->_helper->flashMessenger->getMessages();
        }
        public function editpopAction()
        {
            
            //Check admin logedin or not
            $this->checklogin();
            $crud = new Admin_Model_CRUD();
            $pId = (int)$this->getRequest()->getParam("id");
			 $this->objMdl = new Admin_Model_CRUD();
			 $destinationsresult = $this->objMdl->rv_select_all('tb_tbb2c_destinations', ['Title'], ['IsMarkForDel' => 0],['Title'=>'ASC']);
			 $this->view->destinationsresult = $destinationsresult;
            // echo "####################<pre>"; print_r($this->getRequest()->isPost());echo "</pre>";die;
            if ($this->getRequest()->isPost()) {
                $getData = $this->getRequest()->getPost();
                //-------Start Code for Approve and Publish content---------//
                if (isset($getData['save']) == "Save") {

                    $id = $getData['id'];
                    $orignalFIleNametop = $image = $_FILES["imagetop"]["name"];
                    $fileNametop = '';
                    if (!empty($orignalFIleNametop)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->imageUrl . $pId;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleNametop);
                        $fileNametop   = $this->current_time . 'top.' . $fileExt;


                        if (!file_exists($orignalFolderName)) {
                            mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                        }

                        $temp_file_name = $_FILES["imagetop"]["tmp_name"]; // temprary file name
                        @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileNametop);

                    }
                 $orignalFIleNameleft = $image = $_FILES["imageleft"]["name"];
                    $fileNameleft = '';
                    if (!empty($orignalFIleNameleft)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->imageUrl . $pId;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleNameleft);
                        $fileNameleft   = $this->current_time . 'left.' . $fileExt;


                        if (!file_exists($orignalFolderName)) {
                            mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                        }

                        $temp_file_name = $_FILES["imageleft"]["tmp_name"]; // temprary file name
                        @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileNameleft);

                    }
					$orignalFIleNameright = $image = $_FILES["imageright"]["name"];
                    $fileNameright = '';
                    if (!empty($orignalFIleNameright)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->imageUrl . $pId;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleNameright);
                        $fileNameright   = $this->current_time . 'right.' . $fileExt;


                        if (!file_exists($orignalFolderName)) {
                            mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                        }

                        $temp_file_name = $_FILES["imageright"]["tmp_name"]; // temprary file name
                        @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileNameright);

                    }
    
                    $expiryDate = explode('/', $getData['expiryDate']);
                    $editPageData = [
                        'title' => ($getData['title']),
                        'description' => ($getData['description']),
                        'buttonName' => ($getData['buttonName']),
                        'isActive' => ($getData['isActive']),
                       // 'expiryDate' => $expiryDate[2] . '-' . $expiryDate[1] . '-' . $expiryDate[0],
                        'url' => ($getData['url']),
						'urltop' =>   ($getData['urltop']),
                        'urlleft' =>   ($getData['urlleft']),
                        'urlright' =>   ($getData['urlright']),
                    ];
    
                    if ($fileNametop != '') {
                        $editPageData['imagetop'] = $fileNametop;
                    }
					 if ($fileNameleft != '') {
                        $editPageData['imageleft'] = $fileNameleft;
                    }
					 if ($fileNameright != '') {
                        $editPageData['imageright'] = $fileNameright;
                    }
                    //                 echo "<pre>";print_r($editPageData);die;
                    $crud->rv_update($this->table, $editPageData, ['Id =?' => $pId]);
                    $this->view->successMessage = "Page content has been saved successfully.";
                    $this->_helper->flashMessenger->addMessage("Page content has been updated successfully.");
                    $this->_redirect("/admin/popbanner/index");
                }
            }
    
            $result = $crud->getCmsdata($this->table, ['*'], ['Id' => $pId], ['Id' => 'DESC']);
    
            $editdata["Id"] = @$result->Id;
            $editdata["title"] = @$result->title;
            $editdata["description"] = @$result->description;
            $editdata["buttonName"] = @$result->buttonName;
            $editdata["isActive"] = @$result->isActive;
            $editdata["image"] = @$result->image;
            $expiryDate = explode('-', $result->expiryDate);
            $editdata["expiryDate"] = $expiryDate[2] . '/' . $expiryDate[1] . '/' . $expiryDate[0];
			
            $editdata["imagetop"] = @$result->imagetop;
            $editdata["imageleft"] = @$result->imageleft;
            $editdata["imageright"] = @$result->imageright;
            $editdata["urltop"] = @$result->urltop;
            $editdata["urlleft"] = @$result->urlleft;
            $editdata["urlright"] = @$result->urlright;
             
    
            $this->view->image = @$result->image;
            $this->view->editdata = $editdata;
        }
        public function deletepopAction()
        {
            $this->checklogin();
            $crud = new Admin_Model_CRUD();
            $tId = (int) $this->getRequest()->getParam("id");
            //echo $tId;die;
            if ($tId) {
                $checkdata = $crud->rv_select_row($this->table, ['Id'], ['Id' => $tId], ['Id' => 'asc']);
                if (count($checkdata) > 0) {
                    $crud->rv_update($this->table, ['isMarkForDel' => 1], ['Id  =?' => $tId]);
                    $this->_helper->flashMessenger->addMessage("Deleted successfully.");
                    $this->_redirect("/admin/popbanner/index");
                } else {
                    die('Oops some thing wrong!!.');
                }
            }
        }
        public function checklogin()
        {
            if (($this->admin_type == "superadmin") || ($this->admin_type == "admin")) {
                $auth = Zend_Auth::getInstance();
                $hasIdentity = $auth->hasIdentity();
                /*************** check admin identity ************/
                if (!$hasIdentity) {
                    $this->_redirect('admin/index/index');
                }
            } else {
                $this->_redirect('admin/index/index');
            }
        }
    }
?>

Youez - 2016 - github.com/yon3zu
LinuXploit