<?PHP
	class m_channel extends CI_Model{
		
		public function __construct()
		{
			parent::__construct();
		}
		
		function insert($data)
		{
			$this->db->insert('channel',$data);
		}
		
		function showList()
		{
			$query = $this->db->get('channel');
			return $query->result_array();
		}
		
		function update($id,$data)
		{
			$this->db->where('channelId',$id);
			$this->db->update('channel',$data);
		}
		
		function showDetail($id)
		{
			$query = $this->db->get_where('channel',array('channelId'=> $id));
			return $query->row_array();
		}
		
		function delete($id)
		{
			$this->db->where('channelId',$id);
			$this->db->delete('channel');
		}
	}
?>