AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.216.139
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_projetos/sopizzas/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_projetos/sopizzas/application/controllers/categorymanagement.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class CategoryManagement extends MY_Controller {

  function __construct()
  {
     parent::__construct();
     $this->load->helper("url");
     $this->load->helper('form');
     $this->load->library('form_validation');
     $this->load->library('javascript'); 
     $this->load->library('Ajax_pagination');
     $this->perPage = ROW_PER_PAGE;
     $this->load->model('menumanagement_model');
     $session_data = $this->session->userdata('logged_in');
     //if(empty($session_data)) { redirect('superadmin', 'refresh'); }  
     if($this->session->userdata('user_language'))
      {
        $language = $this->session->userdata('user_language');
      }
      else
      {
        $language = $this->config->item("language");
      }
      $data['user_language'] =  $language;
      $this->lang->load('superAdmin', $language);  
     
  }

  function index( $offset = 0 )
  {
   if ($this->input->server('REQUEST_METHOD') == 'POST')
      {
        if ($this->input->post('EditId') == '') {
          $this->addCategory();
        }
        else if($this->input->post('EditId') != '') {
          $this->editCategory();
        }
        if($this->input->post('ActionTab')=='SiteInfo')
        {
          $this->websettings_site();
        }

        if($this->input->post('ActionTab')=='SiteContact')
        {
          $this->websettings_contact();
        } 

        if($this->input->post('ActionTab')=='SiteVAT')
        {
          $this->websettings_VAT();
        } 
        if($this->input->post('ActionTab')=='SiteOffline')
        {
          $this->websettings_Offline();
        } 
        if($this->input->post('ActionTab')=='SiteTwilio')
        {
          $this->websettings_Twilio();
        } 
        if($this->input->post('ActionTab')=='SiteDocusign')
        {
          $this->websettings_DocuSign();
        } 


      }else
      {
        $this->showCategoryList();
      }
  }

  function showCategoryList() {
    $SearchBy = '';
    $PerPage = $this->input->post('Per_Page');
    if(!$PerPage){
      $PerPage = $this->perPage;
    }else{
      $PerPage = $PerPage;
    }
    //total rows count
    $totalRec = count($this->menumanagement_model->get_category_list());
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'categorymanagement/ajaxPaginationDataCategory/'.$SearchBy;
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $PerPage;
    $this->ajax_pagination->initialize($config);
    //get the posts data
    $data['CategoryList'] = $this->menumanagement_model->get_category_list(array('limit'=>$PerPage), $SearchBy);
  

    $query['CategoryTotal'] =$this->menumanagement_model->CategoryStatistics($status='');
    $query['CategoryActive'] =$this->menumanagement_model->CategoryStatistics($status='1');
    $query['CategoryInactive'] =$this->menumanagement_model->CategoryStatistics($status='0');
    $query['RestaurantList'] = $this ->menumanagement_model -> RestaurantList();
    $data['title']="Menu Category";  
    $query['SiteTab'] ='menu_category';
    $data['page']="menu_category";  
    $this->load->view('superadmin/header',$data);
    $this->load->view('superadmin/main-sidebar');
    $this->load->view('superadmin/category',$query);
    $this->load->view('superadmin/footer');
  }
  function ajaxPaginationDataCategory(){
    $page = $this->input->post('page');
    if(!$page){
        $offset = 0;
    }else{
        $offset = $page;
    }


    $action = $this->input->post('action');
    /*if(!$action){
        $action = '';
    }else{
        $action = $action;
    }*/


    $perpage = $this->input->post('per_page');
    if(!$perpage){
        $perpage = $this->perPage;
    }else{
        $perpage = $perpage;
    }

    $action2 = $this->input->post('action2');
    if(!$action2){
        $action2 = '0';
    }else{
        $action2 = $action2;
    }
    
    //total rows count
    $totalRec = count($this->menumanagement_model->get_category_list($params = array(), $action,$action2));
    
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'categorymanagement/ajaxPaginationDataCategory';
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $perpage;
    $config['action']      = $action;
    $config['action2']     = $action2;
    $this->ajax_pagination->initialize($config);
    
    //get the posts data
    $data['CategoryList'] = $this->menumanagement_model->get_category_list(array('start'=>$offset,'limit'=>$perpage),$action,$action2);
    $data['title']="Category";  
    $data['page']="menu_category";
    $data['perPageCount'] = $page;
    /*** Remember what was the last page start ***/
    if ($this->input->post('pagination') != '') {
      $myPage = $this->input->post('page');
      $myAction = $this->input->post('action');
      $myPerPage = $this->input->post('per_page');
      $myAction2 = $this->input->post('action2');
      $paginationArray = array('page' => $myPage, 'action' => $myAction, 'per_page' => $myPerPage, 'action2' => $myAction2, 'page_name' => $data['page'], 'pagination' => $this->input->post('pagination'));
      if ($this->session->userdata('paginationArray')) {
        $this->session->unset_userdata('paginationArray');
      }
      $this->session->set_userdata('paginationArray', $paginationArray);
    }
    /*** Remember what was the last page end ***/
    $this->load->view('superadmin/category-list-ajax', $data, false);
  }

  function addCategory() {
    $now = date('Y-m-d H:i:s');
    $this->form_validation->set_rules('maincatename', 'Category Name', 'trim|required|xss_clean|callback_isCategoryExist');
    if ($this->form_validation->run() == FALSE) {
      $this->showCategoryList();
    }
    else {
      $this->db->trans_start();
      $data_in = array(
        'maincatename'       =>  $this->input->post('maincatename'),
        'maincatedesc'       =>  $this->input->post('maincatedesc'),
        'status'             =>  $this->input->post('status'),
        'restaurant_id'             =>  $this->input->post('restaurant_id'),
        'addeddate'          => $now
      );
      $this->db->insert('rt_category_main', $data_in);
      $this->db->trans_complete();
      $this->session->set_flashdata('success_msg', $this->input->post('maincatename').' is successfully saved');
      redirect('superadmin/categorymanagement');
    }
  }

  function editCategory() {
    $EditId = $this->input->post('EditId');
    $this->form_validation->set_rules('maincatename', 'Category Name', 'trim|required|xss_clean|callback_isCategoryExist');
    if ($this->form_validation->run() == FALSE) {
      $this->showCategoryList();
    }
    else {
      $this->db->trans_start();
      $data_up = array(
        'maincatename'   =>  htmlspecialchars($this->input->post('maincatename')),
        'maincatedesc'   =>  htmlspecialchars($this->input->post('maincatedesc')),
        'restaurant_id'   =>  $this->input->post('restaurant_id'),
        'status'   =>  $this->input->post('status')
      );
      $this->db->where('maincateid', $EditId);
      $this->db->update('rt_category_main', $data_up);
      $this->db->trans_complete();
      //echo $this->db->last_query(); exit();
      $this->session->set_flashdata('success_msg', $this->input->post('maincatename').' is successfully updated');
      redirect('superadmin/categorymanagement');
    }
  }

  function isCategoryExist() {
    $maincatename = $this->input->post('maincatename');
    $restaurant_id =  $this->input->post('restaurant_id');
    $maincateid = $this->input->post('EditId');
    $is_exist = $this->menumanagement_model->isCategoryExist($maincateid, $maincatename, $restaurant_id);
    if ($is_exist) {
      $this->form_validation->set_message('isCategoryExist', 'Category Name already exist');
      return false;
    }
    else {
      return true;
    }
  }

}

Anon7 - 2022
AnonSec Team