<?php
if (!defined('IN_PHPMPS')) {
    die('Access Denied');
}

/*	
 *
 *	SMS Class
 * 
 */
class SMS {
	var $config;
	var $c;
	var $req;
	
	function __construct($config) {
		$this->config = $config;
		
		include "SDK/TopSdk.php";
		$this->c = new TopClient;
		$this->req = new AlibabaAliqinFcSmsNumSendRequest;
	}
	
	function send($param) {
		$this->c->appkey = $this->config['appkey'];
		$this->c->secretKey = $this->config['secret'];
		$this->c->format = "json";
		
		$this->req->setSmsType("normal");
		$this->req->setSmsFreeSignName($param['sign']);
		$this->req->setSmsParam($param['param']);
		$this->req->setRecNum($param['phone']);
		$this->req->setSmsTemplateCode($param['template']);
		return $this->c->execute($this->req);
	}
}
?>