class RoomModel extends CI_Model {

    public function get_all_rooms() {
        $query = $this->db->get('rooms');
        return $query->result();
    }

    public function insert_room($data) {
        return $this->db->insert('rooms', $data);
    }

    public function get_room_by_id($id) {
        $query = $this->db->get_where('rooms', array('room_id' => $id));
        return $query->row();
    }

    public function update_room($id, $data) {
        $this->db->where('room_id', $id);
        return $this->db->update('rooms', $data);
    }

    public function delete_room($id) {
        $this->db->where('room_id', $id);
        return $this->db->delete('rooms');
    }
}
