<?php
class Cmerchantmodel extends CI_Model {

	var $id;
	var	$record_state=0;
	var	$dmo_id = "";
	var	$type = "";
	var	$name="";
	var	$termsconditions="";
	var	$description = "";
	var	$categories = "";
	var	$images="";
	var	$country="";
	var	$merchantcode="";
	var	$ussdcode;

	function __construct()
    {
        parent::__construct();
	}

	function get($condition="")
   {
        if(!empty($condition))
		   $this->db->where($condition);

		$this->db->order_by('ussdcode','asc');
		   
        return $this->db->get('cross_industry_merchants');
    }

	
	function update($data,$where){
		return $this->db->update('cross_industry_merchants',$data,$where);
	}

    function insert($obj)
    {      
		$this->record_state = 0;  
		$this->dmo_id = $obj['dmo_id'];
		$this->type = $obj['type'];
		$this->name=$obj['name'];
		$this->termsconditions=$obj['termsconditions'];
		$this->description = $obj['description'];
		$this->categories = $obj['categories'];
		$this->images=$obj['images'];
		$this->country=$obj['country'];
		$this->merchantcode=$obj['merchantcode'];
		return $this->db->insert('cross_industry_merchants',$this);
	}

	function insert_local($obd)
    {      
		return $this->db->insert('cross_industry_merchants',$obd);
	}
	
}