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