403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/adeetie/application/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/adeetie/application/models/Mfcuser.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Mfcuser extends CI_Model{

    protected $tableName = 'facilation_users'; 
 
    function usermodel() {
       return array(
            'name'          => $this->input->post('name'),
            'email_id'      => $this->input->post('email_id'),
            'designation'     => $this->input->post('designation'),
            'contact_no'    => $this->input->post('contact_no')
        );
    }
    
    function add_user(){        
   
        $arr = $this->usermodel();
        if(!empty($this->input->post('password'))) {
           $arr['password'] = password_hash($this->input->post('password'), PASSWORD_DEFAULT);
        }
   

        $arr['user_id'] = uniqid();
        $arr['created_by'] = json_encode([
            'email_id' => $this->session->userdata('email_id'),
            'name' => $this->session->userdata('name'),
            'user_id' => $this->session->userdata('user_id')
        ]);

        $this->db->insert($this->tableName, $arr);
        if( $this->db->affected_rows() > 0 ) {
            $id = $this->db->insert_id();
            $this->session->set_flashdata('message','Successfully added');
            redirect('console/users', 'refresh');

        } else {
           $this->session->set_flashdata('error','Unknown error'); 
           redirect('console/users', 'refresh');
        }
        
    }
    
    
     function update_user($id) {
        
        $arr = $this->usermodel();
        if(!empty($this->input->post('password'))) {
            $arr['password'] = password_hash($this->input->post('password'), PASSWORD_DEFAULT);
        }

        $this->db->where('user_id', $id);
        $this->db->update( $this->tableName, $arr );
         
        if( $this->db->affected_rows() > 0 ) {
            $this->session->set_flashdata( 'message','Successfully Updated' );
            redirect('console/users', 'refresh');
        } else {
           $this->session->set_flashdata('error','Updation failed'); 
           redirect('console/users', 'refresh');
        }
        
    }
    
    
   function get_all_user() {
    $query = $this->db->get($this->tableName);
        if( $query->num_rows() > 0 ) {
            return $query->result_array();
        }
   }

   function get_user_byid($id) {
    $this->db->where('user_id', $id);
    $sql = $this->db->get($this->tableName);
    if ($sql->num_rows() > 0) {
            return $sql->row_array();
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit