<?php
include_once("$config[webroot]/module/offer/includes/offer_class.php");

class offer_api extends offer
{
	function offer_api()
	{
		parent::offer();
	}
	
	function update_uid($array)
	{	
		$this->offer_merge_user($array);
	}
	
	function delete_by_uid($array)
	{
		$userid=$array['uid'];
		$company_id=$array['company_id'];
		
		if(!empty($userid))
		{
			$this->db->query("select id,userid from ".INFO." where userid='$array[uid]'");
			$res=$this->db->getRows();
			foreach($res as $v)
			{
				$this->del_info($v['id'],$v['userid']);
			}
		}
		
		if(!empty($company_id))
		{
			$this->db->query("select id,userid from ".INFO." where company_id='$company_id'");
			$res=$this->db->getRows();
			foreach($res as $v)
			{
				$this->del_info($v['id'],$v['userid']);
			}
		}
		
		return true;
	}
}
?>