application/controllers/App.php
/**
     * Add user to access the system
     * 
     * @param type $user_id
     */
Add user to access the system


Add user to access the system
public function addUser($user_id = null)
    {
        $data = [
            'applicationName' => 'Komatsu NA Maintenance Log',
            'title' => 'Komatsu NA Maintenance Log',
            'assetDirectory' => $this->appDir . '/assets/',
            'assetDirectoryCustom' => $this->appDir . '/assets/templates/komatsuna/' 
        ];
        $this->load->library('template');
        $this->load->model('User_model');
        $data['flashdata'] = $this->session->flashdata();
        $user = (!is_null($user_id) ? $this->User_model->findOne($user_id) : []);
        $data['user_id'] = (!is_null($user_id) ? $user_id : 0);
        $data['user_first_name'] = (!empty($user) ? $user->first_name : '');
        $data['user_last_name'] = (!empty($user) ? $user->last_name : '');
        $data['user_email_address'] = (!empty($user) ? $user->email_address : '');
        $data['user_role'] = (!empty($user) ? $user->role : '');
		$data['user_user_group'] = (!empty($user) && !is_null($user->user_group) ? $user->user_group : '');
        $data['user_active'] = (!empty($user) ? $user->active : '');
        $data['body'] = $this->load->view('templates/bootstrap/authenticated/app/users/add', $data, true);
        $this->template->load('authenticated_default_bootstrap-4.0.0.php', null, $data);
    }
public function addUser ( $ user_id = null ) { $ data = [ 'applicationName' => 'Komatsu NA Maintenance Log' , 'title' => 'Komatsu NA Maintenance Log' , 'assetDirectory' => $ this -> appDir . '/assets/' , 'assetDirectoryCustom' => $ this -> appDir . '/assets/templates/komatsuna/' ] ; $ this -> load -> library ( 'template' ) ; $ this -> load -> model ( 'User_model' ) ; $ data [ 'flashdata' ] = $ this -> session -> flashdata ( ) ; $ user = ( ! is_null ( $ user_id ) ? $ this -> User_model -> findOne ( $ user_id ) : [ ] ) ; $ data [ 'user_id' ] = ( ! is_null ( $ user_id ) ? $ user_id : 0 ) ; $ data [ 'user_first_name' ] = ( ! empty ( $ user ) ? $ user -> first_name : '' ) ; $ data [ 'user_last_name' ] = ( ! empty ( $ user ) ? $ user -> last_name : '' ) ; $ data [ 'user_email_address' ] = ( ! empty ( $ user ) ? $ user -> email_address : '' ) ; $ data [ 'user_role' ] = ( ! empty ( $ user ) ? $ user -> role : '' ) ; $ data [ 'user_user_group' ] = ( ! empty ( $ user ) && ! is_null ( $ user -> user_group ) ? $ user -> user_group : '' ) ; $ data [ 'user_active' ] = ( ! empty ( $ user ) ? $ user -> active : '' ) ; $ data [ 'body' ] = $ this -> load -> view ( 'templates/bootstrap/authenticated/app/users/add' , $ data , true ) ; $ this -> template -> load ( 'authenticated_default_bootstrap-4.0.0.php' , null , $ data ) ; }
Add user to access the system
Add user to access the system