403Webshell
Server IP : 127.0.0.1  /  Your IP : 192.168.99.1
Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9
System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64
User : Administrator ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /laragon/www/sop2/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /laragon/www/sop2/application/controllers/Setting.php
<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Setting extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        if (!$this->session->userdata('email')) {
            redirect('auth');
        }
    }

    public function index()
    {

        $data['title'] = 'User And Password';
        $data['title2'] = 'Management user and password';
        $data['user'] = $this->db->get_where('user', ['email' => $this->session->userdata('email')])->row_array();
        
        $this->db->select('user.*, jobs.user_id, jobs.job_name');
        $this->db->from('user');
        $this->db->join('jobs', 'user.id = jobs.user_id', 'left');
        $this->db->order_by('id', 'asc');        
        $data['userpass'] = $this->db->get()->result_array();

        $data['job'] = $this->db->get('jobs')->result_array();

        if ($this->form_validation->run() == false) {
            $this->load->view('templates/header', $data);
            $this->load->view('templates/sidebar', $data);
            $this->load->view('templates/topbar', $data);
            $this->load->view('setting/index', $data);
            $this->load->view('templates/footer');
        } else {
            $this->db->insert('user', ['menu' => $this->input->post('menu')]);
            $this->session->set_flashdata('message', '<div class="alert alert-success" role="alert">New menu added! </div>');
            redirect('setting');
        }
    }

    public function edit()
    {

        $this->form_validation->set_rules('name', 'Input Name', 'required|trim');
        $this->form_validation->set_rules('role_id', 'Input Role ID', 'required|trim');

        if($this->form_validation->run()==FALSE){
            $this->load->view('templates/header', $data);
            $this->load->view('templates/sidebar', $data);
            $this->load->view('templates/topbar', $data);
            $this->load->view('setting/index', $data);
            $this->load->view('templates/footer');
        }else{
            $user_id = $this->input->post('id');
            $jobid = $this->input->post('job_id');

            $data=array(
                "name" => $_POST['name'],
                "role_id" => $_POST['role_id']
            );

            $this->db->where('id', $user_id);
            $this->db->update('user', $data);

            echo $user_id;

            if(isset($_POST['job_id'])){
                $this->db->set('user_id', $user_id);
                $this->db->where('id', $jobid);
                $this->db->update('jobs');                  
            }

            $this->session->set_flashdata('message', '<div class="alert alert-success" role="alert">Account Changed! </div>');
            redirect('setting/index');
        }
    }
 
    public function hapus($id)
    {
        if($id == ""){
            $this->session->set_flashdata('message','<div class="alert alert-warning" role="alert">User cannot deleted! </div>');
            redirect('setting/index');
        }else{
            $this->db->where('id', $id);
            $this->db->delete('user');
            $this->session->set_flashdata('message','<div class="alert alert-success" role="alert">User has been deleted! </div>');
            redirect('setting/index');
        }
    }


}

Youez - 2016 - github.com/yon3zu
LinuXploit