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