403Webshell
Server IP : 68.178.202.69  /  Your IP : 216.73.216.122
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/public_html/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/ikioworld/public_html/application/controllers/admin/Clearance.php
<?php
class clearance 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('clearancemodel','',TRUE);     
       
       $data = array(
         'header' => $this->load->view('admin/assets/header', '', TRUE),  
         'footer' => $this->load->view('admin/assets/footer', '', TRUE),
      );
      
      
      $num_records = $this->clearancemodel->get_total_records();
     
     
      $data['num_records']  = $num_records;
      $base_url=base_url().'admin/clearance/index';
      $start_index=$this->uri->segment($this->uri->total_segments());
      $default_page_size = 5;
      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->clearancemodel->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/clearance/index',$data);
   }
   function add(){
       $this->load->helper(array('form', 'url'));
       $this->load->library(array('session','pagination'));
        $this->load->model('clearancemodel','',TRUE);     
        
       if(!empty($this->input->post())){
          $insert_id=$this->clearancemodel->add($this->input->post());
        
          self::upload_file($insert_id,$_FILES,'clearance_image','add');
           self::upload_file($insert_id,$_FILES,'clearance_icon','add');
          
          $this->session->set_flashdata('message',"clearance has been added.");
          redirect("admin/clearance");  
       }
       
       $data = array(
         'header' => $this->load->view('admin/assets/header', '', TRUE),  
         'footer' => $this->load->view('admin/assets/footer', '', TRUE),
      );
      $this->load->view('admin/clearance/add',$data);
   }
   
   function edit($id){
       
       $this->load->helper(array('form', 'url'));
       $this->load->library(array('session','pagination'));
       $this->load->model('clearancemodel','',TRUE);     
      
       $data = array(
         'header' => $this->load->view('admin/assets/header', '', TRUE),  
         'footer' => $this->load->view('admin/assets/footer', '', TRUE),
        );
       $data['record']=$this->clearancemodel->fetch_details($id);
       if(!empty($this->input->post())){
          $result=$this->clearancemodel->edit($id,$this->input->post());
          if($result){
            self::upload_file($id,$_FILES,'clearance_image','edit');  
             self::upload_file($id,$_FILES,'clearance_icon','edit');
          
          }
        //   $sql=$this->db->query('INSERT into clearance_logs (clearance_id) values('.$id.')');
          $this->session->set_flashdata('message',"clearance has been updated.");
          redirect("admin/clearance");
       }
       $this->load->view('admin/clearance/edit',$data);
   }
     function upload_file($id,$fileArray,$column,$for='add'){
      if($id!='' && !empty($fileArray) && $fileArray[$column]['error']=="0" && $column!=''){
          
            $record=$this->clearancemodel->fetch_details($id);
              $file_name=$fileArray[$column]['name'];
            if($for=="edit"){
                @unlink(FCPATH."uploads/clearance/".$record->$column);
            }
            $ffdsf=$this->clearancemodel->edit($id,[$column=>$file_name]);
            move_uploaded_file($fileArray[$column]['tmp_name'],FCPATH."uploads/clearance/".$file_name);
            
       }
   }
   
   function delete($id){
       $this->load->helper(array('form', 'url'));
       $this->load->library(array('session','pagination'));
       $this->load->model('clearancemodel','',TRUE);     
       if($id!=''){
         $this->clearancemodel->deleteclearance($id);
         $this->session->set_flashdata('message',"clearance has been deleted.");
         redirect("admin/clearance");  
       }
   }

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

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

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

      }
      redirect("admin/clearance");
     }
     
    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('clearancemodel','',TRUE);    
      
   $filename = 'clearance_'.date('Ymd').'.csv'; 
   header("Content-Description: File Transfer"); 
   header("Content-Disposition: attachment; filename=$filename"); 
   header("Content-Type: application/csv; "); 
   // get data 
   $productData = $this->clearancemodel->get_export_data();
   // file creation 
   $file = fopen('php://output', 'w');
   $header = array("clearance_name","clearance_image","clearance_icon","slug"); 
   fputcsv($file, $header);
   foreach ($productData as $key=>$line){
     fputcsv($file,$line); 
   }
   fclose($file); 
   exit; 
  }

  function delete_clearance()

  {
   $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('clearancemodel','',TRUE);    
 
   if($this->input->post('checkbox_value'))
   {
    $id = $this->input->post('checkbox_value');
   
    for($count = 0; $count < count($id); $count++)
    {
     $this->clearancemodel->delete_clearance($id[$count]);
    }
   }
  }
 
 


     
}

Youez - 2016 - github.com/yon3zu
LinuXploit