<?php
/*
	[Phpup.Net!] (C)2009-2011 Phpup.net.
	This is NOT a freeware, use is subject to license terms

	$Id: email.php 2010-08-24 10:42 $
*/

if(!defined('IN_PHPUP')) {
	exit('Access Denied');
}
class fetion
{
	function fetion($sms=array())
	{
		$this->user=$sms['user']?$sms['user']:$GLOBALS['setting']['sms_user'];
		$this->api='http://gateway.woxp.cn:6630/utf8/web_api/';
		$this->password=md5($sms['password']?$sms['password']:$GLOBALS['setting']['sms_password']);
		$this->SmsKind=10783;
	}
	function send($mobile,$content,$showurl=false)
	{
		include ROOT_PATH.'/inc/curl.class.php';
		
		$url=$this->api.'?x_eid='.$this->SmsKind.'&x_uid='.$this->user.'&x_pwd_md5='.$this->password.'&x_ac=10&x_gate_id=300&x_target_no='.$mobile.'&x_memo='.str_replace(' ','',$content);
		
		if($showurl)
		{
			return $url;
		}
		else
		{
			$curl=new curl();
			$result=$curl->get($url);
			return $result;
		}
	}
}