<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class canned_message_model extends CI_Model {
    public function __construct()
    {
        parent::__construct();
        $this->load->database();
    }
    function save($save)
    {
        $this->db->insert('canned_messages', $save);
        return $this->db->insert_id();
    }
    function get_all()
    {
        return $this->db->get('canned_messages')->result();
    }
    function get($id)
    {
        $this->db->where('id', $id);
        return $this->db->get('canned_messages')->row();
    }
    function update($save, $id)
    {
        $this->db->where('id', $id);
        $this->db->update('canned_messages', $save);
    }
    function delete($id)
    {
        $this->db->where('id', $id);
        $this->db->delete('canned_messages');
    }
}
