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/AboutsiteController.php
<?php
/***************************************************************
* Catabatic Technology Pvt. Ltd.
* File Name     : StaticpageController.php
* File Desc.    : Staticpage controller managed all staic content pages
* Created By    : Piyush Tiwari <piyush@catpl.co.in>
* Created Date  : 23 May 2018
* Updated Date  : 23 May 2018
***************************************************************/



class Admin_AboutsiteController extends Zend_Controller_Action
{


    public $dbAdapter;
    public $perPageLimit;
    public $siteurl;
    public $DIR_WRITE_MODE;



    public function init()
    {
        /*Initialize db and session access */
        $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->current_time = time();
        $this->iconUrl     = (($this->appmode == 'MODE_BETA') ? 'beta/' : '') . 'public/upload/'.$this->stylecss.'/aboutsite/';

        $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->DIR_WRITE_MODE = 0777;

       $this->table =  'tbl_about_agency';

    }



    /**
    * index() method is used to admin login for form call
    * @param Null
    * @return Array
    */

    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['rows'],
                        'page'=>$getData['page'],
            );
        $resulsetold = $crud->getCount( $this->table,['isMarkForDel' =>0],'id');
        $crud->searchArr = $searchArr;
        $resultset = $crud->rv_select_static( $this->table,['*'],['isMarkForDel' =>0 ],['id'=> 'DESC']);
                            if (count($resultset) > 0) {
                foreach ($resultset as $resultkey => $resultval) {
                    $result1[] = [
                        'id' => $resultval['id'],
                        'title' => $resultval['title'],
                        'icon' => '<img src="public/upload/'.$this->stylecss.'/aboutsite/'.$resultval['id'].'/small/'.$resultval['icon'].'" width="60px" height="60px">',
                        // 'image' => '<img src="public/upload/offers/'.$resultval['Id'].'/small/'.$resultval['image'].'" width="60px" height="60px">',

                        'isActive' => $resultval['isActive']==1?'Active':'Deactive',

                    ];
                }
            }
        $result = Zend_Json::encode($result1);
        $newResult = Zend_Json::decode($result,false);
        $finalResult["total"]=$resulsetold[0]['id'];
        $finalResult["rows"]=$newResult;
        echo json_encode($finalResult);
        exit;
        }
    }



    /**
    * editpage() method is used to admin can edit cms static page
    * @param password string
    * @return ture
    */

    public function editaboutAction()
    {
//Check admin logedin or not
        $this->checklogin();
        $crud = new Admin_Model_CRUD();
        $pId = (int)$this->getRequest()->getParam("id");
               
        if( $this->getRequest()->isPost() ) {
            $getData = $this->getRequest()->getPost();
          
                
                //-------Start Code for Approve and Publish content---------//
               if(isset($getData['save'])=="Save") {
//                         echo "<pre>";print_r($getData);die;
                   $id = $getData['id'];
               $orignalFIleName = $icon = $_FILES["icon"]["name"];
               $fileName = '';
               if (!empty($orignalFIleName)) {
                $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->iconUrl.$pId ;
                $fileExt    = $this->_helper->General->getFileExtension($orignalFIleName);
                $fileName   = $this->current_time . '.' . $fileExt;

          
            if (!file_exists($orignalFolderName)) {
                       mkdir($orignalFolderName, $this->DIR_WRITE_MODE, true);
                       }
          
           $temp_file_name = $_FILES["icon"]["tmp_name"]; // temprary file name
           @move_uploaded_file($temp_file_name, $orignalFolderName . "/" . $fileName);

               $originalLargeFolder = $orignalFolderName.'/large';
               $originalMediumFolder = $orignalFolderName.'/medium';
               $originalSmallFolder = $orignalFolderName.'/small';

               Catabatic_Helper::resizeImages($orignalFolderName,$originalLargeFolder,$fileName,$this->large_image_width,$this->large_image_height);
               Catabatic_Helper::resizeImages($orignalFolderName,$originalMediumFolder,$fileName,$this->medium_image_width,$this->medium_image_height);
               Catabatic_Helper::resizeImages($orignalFolderName,$originalSmallFolder,$fileName,$this->small_image_width,$this->small_image_height);

         
       } 
                           
                $editPageData = [                    
                    
                        'title' => ($getData['title']),  
                        'url' => ($getData['url']), 
                                                                                
                        'isActive' => ($getData['isActive']),
                ];
                                
                     if( $fileName) {
                        $editPageData['icon'] = $fileName;
                                }
//                  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/aboutsite/index");
                            }
                           
        }

        $result = $crud->getCmsdata($this->table, ['*'], ['id'=>$pId], ['id'=>'DESC']);
//        echo "<pre>";print_r($result);die;
        $editdata["id"] = @$result->id;
        $editdata["title"] = @$result->title;
        $editdata["icon"] = @$result->icon;
        $editdata["url"] = @$result->url;
        $editdata["tab"] = @$result->tab;  
       $editdata["isActive"] = @$result->isActive;
//        echo "<pre>";print_r($editdata);die;
       
        $this->view->icon = @$result->icon; 
        $this->view->editdata = $editdata;


    }


    public function addaboutAction()
    {
        $this->checklogin();
        $crud = new Admin_Model_CRUD();

        $pId = (int)$this->getRequest()->getParam("id");

        if( $this->getRequest()->isPost() ) {
            $getData = $this->getRequest()->getPost();
            $lastRow = $crud->getCmsdata($this->table, ['Id'], ['Id'], ['Id'=>'DESC']);
            $pId = $lastRow['Id'] + 1;
                //-------Start Code for Approve and Publish content---------//
               if (isset($getData['save']) == "Save") {
//                echo "<pre>";print_r($getData);die;
                $id = $getData['id'];
                $orignalFIleName = $icon = $_FILES["icon"]["name"];

                    $fileName = '';

                    if (!empty($orignalFIleName)) {
                        $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->iconUrl.$pId ;
                        $fileExt    = $this->_helper->General->getFileExtension($orignalFIleName);
                        $fileName   = $this->current_time . '.' . $fileExt;


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

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

                       $originalLargeFolder = $orignalFolderName.'/large';
                       $originalMediumFolder = $orignalFolderName.'/medium';
                       $originalSmallFolder = $orignalFolderName.'/small';

                       Catabatic_Helper::resizeImages($orignalFolderName,$originalLargeFolder,$fileName,$this->large_image_width,$this->large_image_height);
                       Catabatic_Helper::resizeImages($orignalFolderName,$originalMediumFolder,$fileName,$this->medium_image_width,$this->medium_image_height);
                       Catabatic_Helper::resizeImages($orignalFolderName,$originalSmallFolder,$fileName,$this->small_image_width,$this->small_image_height);

               }


                $savePageData = [
                    'title' => ($getData['title']),
                    'icon' =>   $fileName ,
                    'url' => ($getData['url']),
                    'tab' => (int)($getData['tab']),
                    'isActive' => ($getData['isActive']),
                    'isMarkForDel' => 0,
                ];
//                echo "<pre>";print_r($savePageData);die;
                $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/aboutsite/index");

             }


        }


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


    }
    public function addaboutviewAction()
    {
      //Check admin logedin or not
      //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['rows'],
              'page'=>$getData['page'],
  );
$resulsetold = $crud->getCount('addabout_test_vik',['status' =>1 ],'id');
$crud->searchArr = $searchArr;
$resultset = $crud->rv_select_static('addabout_test_vik',['*'],['status' =>1 ],['id'=> 'DESC']);
                  if (count($resultset) > 0) {
      foreach ($resultset as $resultkey => $resultval) {
          $result1[] = [
              'id' => $resultval['id'],
              'title' => $resultval['title'],
              'name' => $resultval['name'],
              'icon' => '<img src="public/upload/'.$this->stylecss.'/aboutsite/'.$resultval['id'].'/small/'.$resultval['icon'].'" width="60px" height="60px">',
              'email' => $resultval['email'],
              'status' => $resultval['status']==1?'Active':'Deactive'
          ];
      }
  }
$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 addabouttestAction()
    {

          $this->checklogin();
          $crud = new Admin_Model_CRUD();

          $pId = (int)$this->getRequest()->getParam("id");

          if( $this->getRequest()->isPost() ) {
              $getData = $this->getRequest()->getPost();
              $lastRow = $crud->getCmsdata($this->table, ['Id'], ['Id'], ['Id'=>'DESC']);
              $pId = $lastRow['Id'] + 1;
                  //-------Start Code for Approve and Publish content---------//
                 if (isset($getData['save']) == "Save") {
      //                echo "<pre>";print_r($getData);die;
                  $id = $getData['id'];
                  $orignalFIleName = $icon = $_FILES["icon"]["name"];

                      $fileName = '';

                      if (!empty($orignalFIleName)) {
                          $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->iconUrl.$pId ;
                          $fileExt    = $this->_helper->General->getFileExtension($orignalFIleName);
                          $fileName   = $this->current_time . '.' . $fileExt;


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

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

                         $originalLargeFolder = $orignalFolderName.'/large';
                         $originalMediumFolder = $orignalFolderName.'/medium';
                         $originalSmallFolder = $orignalFolderName.'/small';

                         Catabatic_Helper::resizeImages($orignalFolderName,$originalLargeFolder,$fileName,$this->large_image_width,$this->large_image_height);
                         Catabatic_Helper::resizeImages($orignalFolderName,$originalMediumFolder,$fileName,$this->medium_image_width,$this->medium_image_height);
                         Catabatic_Helper::resizeImages($orignalFolderName,$originalSmallFolder,$fileName,$this->small_image_width,$this->small_image_height);


                 }


                  $savePageData = [
                      'title' => ($getData['title']),
                      'name' => ($getData['name']),
                      'icon' =>  $fileName,
                      'email' => ($getData['email']),
                      'password' => ($getData['password']),
                      'status' => ($getData['status'])
                  ];
                //  echo "<pre>";print_r($savePageData);die;
                  $crud->rv_insert('addabout_test_vik', $savePageData);
                  $this->view->successMessage = "Page content has been saved successfully.";
                  $this->_helper->flashMessenger->addMessage("Page content has been added successfully.");
                  $this->_redirect("/admin/aboutsite/addaboutview");

               }


          }


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



    public function deleteaboutAction() {
        $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/aboutsite/index");
            } else {
                die('Oops some thing wrong!!.');
            }
        }
    }


    public function addaboutdeleteAction() {
        $this->checklogin();
        $crud = new Admin_Model_CRUD();
        $tId = (int) $this->getRequest()->getParam("id");
    //    echo $tId;die;
        if ($tId) {
            $checkdata = $crud->rv_select_row('addabout_test_vik', ['id'], ['id' => $tId], ['id' => 'asc']);
            if (count($checkdata) > 0) {
                $crud->rv_update('addabout_test_vik', ['status'=> 1], ['id =?'=>$tId]);
                $this->_helper->flashMessenger->addMessage("Deleted successfully.");
                $this->_redirect("/admin/aboutsite/addaboutview");
            } else {
                die('Oops some thing wrong!!.');
            }
        }
    }

    public function addabouteditAction()
    {
      //Check admin logedin or not
              $this->checklogin();
              $crud = new Admin_Model_CRUD();
              $pId = (int)$this->getRequest()->getParam("id");

              if( $this->getRequest()->isPost() ) {
                  $getData = $this->getRequest()->getPost();


                      //-------Start Code for Approve and Publish content---------//
                     if(isset($getData['save'])=="Save") {
      //                         echo "<pre>";print_r($getData);die;
                         $id = $getData['id'];
                     $orignalFIleName = $icon = $_FILES["icon"]["name"];
                     $fileName = '';
                     if (!empty($orignalFIleName)) {
                      $orignalFolderName  = $_SERVER["DOCUMENT_ROOT"] . "/" . $this->iconUrl.$pId ;
                      $fileExt    = $this->_helper->General->getFileExtension($orignalFIleName);
                      $fileName   = $this->current_time . '.' . $fileExt;


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

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

                     $originalLargeFolder = $orignalFolderName.'/large';
                     $originalMediumFolder = $orignalFolderName.'/medium';
                     $originalSmallFolder = $orignalFolderName.'/small';

                     Catabatic_Helper::resizeImages($orignalFolderName,$originalLargeFolder,$fileName,$this->large_image_width,$this->large_image_height);
                     Catabatic_Helper::resizeImages($orignalFolderName,$originalMediumFolder,$fileName,$this->medium_image_width,$this->medium_image_height);
                     Catabatic_Helper::resizeImages($orignalFolderName,$originalSmallFolder,$fileName,$this->small_image_width,$this->small_image_height);


             }

                      $editPageData = [
                              'title' => ($getData['title']),
                              'name' => ($getData['name']),
                              'email' => ($getData['email']),
                              'password' => ($getData['password']),
                              'status' => ($getData['status'])
                      ];

                           if( $fileName) {
                              $editPageData['icon'] = $fileName;
                                      }
                    //    echo "<pre>";print_r($editPageData);die;
                                      $crud->rv_update('addabout_test_vik', $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/aboutsite/addaboutview");
                                  }

              }

              $result = $crud->getCmsdata('addabout_test_vik', ['*'], ['id'=>$pId], ['id'=>'DESC']);
      //       echo "<pre>";print_r($result);die;
              $editdata["id"] = @$result->id;
              $editdata["title"] = @$result->title;
              $editdata["name"] = @$result->name;
              $editdata["icon"] = @$result->icon;
              $editdata["email"] = @$result->email;
              $editdata["password"] = @$result->password;
              $editdata["status"] = @$result->status;






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

              $this->view->icon = @$result->icon;
              $this->view->editdata = $editdata;
    }



    public function sanitize_data($string) {
	$searchArr=array("iframe","script","document","write","alert","%","@","$",";","+","|","#","<",">",")","(","'","\'",",","and "," &","& ","and"," and","0","1","2","3","4","5","6","7","8","9");
	$input_data = strtolower($string);
	$input_data = str_replace($searchArr,"",$input_data);

        $input_data= str_replace(" ","-",$input_data);
        //echo $input_data; die;
        return $input_data;
    }



    /**
    * checklogin() method is used to check admin logedin or not
    * @param Null
    * @return Array
    */
    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