HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //var/www/html/pmw24/driver_settlement/old/application/models/admin/Mrole.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mrole extends CI_Model {



    /*
    author: soumya hazra
    purpose: add Role
    date: 9-9-2019
    */
    public function submitrole($data)
    {
        $this->db->insert('master_role', $data);
        return true;
    }

    /*
    author: soumya hazra
    purpose: Get Active roles
    date: 9-9-2019
    */
    public function get_role()
    {
        $result = array();

        $this->db->select('*');
        $this->db->from('master_role');                
        $this->db->where('is_active',1);                
        $query = $this->db->get();
        $result = $query->result_array();
        return $result;
    }    

    /*
    author: soumya hazra
    purpose: Get In-Active roles
    date: 9-9-2019
    */
    public function get_inactive_role()
    {
        $result = array();

        $this->db->select('*');
        $this->db->from('master_role');                
        $this->db->where('is_active',0);                
        $query = $this->db->get();
        $result = $query->result_array();
        return $result;
    }



    /*
    author: soumya hazra
    purpose: Set a role deactive
    date: 9-9-2019
    */
    public function set_deactive_role($rid)
    {

        $this->db->set('is_active',0);                    
        $this->db->where('role_id',$rid);                    
        $this->db->update('master_role'); 

        return true;     

    }
    /*
    author: soumya hazra
    purpose: Set a role active
    date: 9-9-2019
    */
    public function set_active_role($rid)
    {

        $this->db->set('is_active',1);                    
        $this->db->where('role_id',$rid);                    
        $this->db->update('master_role'); 

        return true;     

    }
     /*
    author: soma
    purpose: Get singel role
    date: 18-9-2019
    */
    public function get_singl_role($role_id)
    {
        $result =  array();
        $this->db->select('*');
        $this->db->from('master_role');       
        $this->db->where('role_id',$role_id);       
        $query = $this->db->get();
       // echo $this->db->last_query();die;
        $result = $query->row_array();
        return $result;
    }


    /*
    author: soma
    purpose: Update role
    date: 18-9-2019
    */
    public function updaterole($role_name,$updated_by,$role_id)
    {       
        $this->db->set('role_name',$role_name); 
        $this->db->set('updated_by',$updated_by);       
        $this->db->set('updated_ts',date('Y-m-d H:i:s'));       
        $this->db->where('role_id',$role_id);
        $this->db->Update('master_role');

        return true;
    }


}