<?php
class Banner_master_model extends CI_Model {
	
	private $tbl_person= 'tbl_promotion_master';
	
	function __construct(){
		parent::__construct();
	}
	
	function list_all(){
		$this->db->order_by('promotion_id','asc');
		return $this->db->get();
	}
	
	function count_all(){
		return $this->db->count_all($this->tbl_person);
	}
	
	function get_paged_list($limit = 100000, $offset = 0){
		$this->db->order_by('promotion_id','asc');
		return $this->db->get($this->tbl_person, $limit, $offset);
	}
	
	function get_by_id($id){
		$this->db->where('promotion_id', $id);
		return $this->db->get($this->tbl_person);
	}
	
	function save($person){
		$this->db->insert($this->tbl_person, $person);
		return $this->db->insert_id();
	}
	
	function update($id, $person){
		$this->db->where('promotion_id', $id);
		$this->db->update($this->tbl_person, $person);
		return $this->db->affected_rows();
	}
	
	function delete($id){
		$this->db->where('promotion_id', $id);
		$this->db->delete($this->tbl_person);		
		return $this->db->affected_rows();
	}
	
	function get_employee_list(){
	$this->db->order_by('promotion_id','asc');
    return $this->db->get('tbl_promotion_master');
	
	}

}

?>