File: //var/www/html/taxicamera/old/applicationold/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;
}
}