<?php defined('BASEPATH')or exit('NO DIrect Access is Allowed');?>
<?php

class Importmodel extends CI_Model {
    
    function __construct() {
        parent::__construct();
		$this->db->trans_strict(TRUE);
        
    }
     
    public function insert_category($data) {
        $this->db->insert('category', $data);
    }
	public function duplicate_category($category,$category_code){
			$query=$this->db->select('id')->from('category')->where('category',$category)
			->where('category_code',$category_code)
			->get();
			return $query->num_rows();
	}
	public function update_category($category,$description,$category_code){
		$this->db->set('description',$description);
		$this->db->where('category',$category);
		$this->db->where('category_code',$category_code);
		
		$this->db->update('category');
	}

	
	
}
/*END OF FILE*/
