<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Role_model extends CI_Model 
{
    public function get_all_role_name()
    {
        return $this->db->get('role_name')->result();
    }

    public function get_role_by_id($id)
    {
        $this->db->where('role_id', $id);
        return $this->db->get('role_name')->row();
    }

    public function add_new_role()
    {
        $data = array(
            'role_name' => $this->input->post('role_name'),
            'role_status'  => 1,
            'role_created_on' => date('Y-m-d')
        );

        $this->db->insert('role_name', $data);
        return $this->db->insert_id();
    }
}
