<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Coupon_model extends CI_Model{
	
	 
	public function get_coupons() { 
		return $this->db->select('*')->from('coupons')->get()->result_array();
	}
	

	public function Coupon_delete($cu_id) { 
	
			$this->db->where('cu_id', $cu_id);
    		$this->db->delete('coupons');
    		return true;
		
	}
	public function get_coupon($id) { 
		return $this->db->select('*')->from('coupons')->where('cu_id',$id)->get()->result_array();
	}
	public function edit_coupon() { 
		$this->db->where('cu_id',$this->input->post('cu_id'));
		return $this->db->update('coupons',$this->input->post());
	}

} 