<?php
defined('IN_YUNYECMS') or exit('No permission.');
core::load_class('common',false);
core::load_fun('content');
core::load_fun('tree');
core::load_fun('shop');
class sendsms  {    
       public function regcode() {
		  $phone=$_POST['mobile'];
		  if($phone==''){
		    echo "phonenull";
			exit;
			}	
		  if(!is_numeric($phone)){
			   echo "phoneerror"; 
			   exit;
		  }
		$yanzhengma=mt_rand(100000,999999);
		$_SESSION['regcode']=$yanzhengma;
		$signName="云业汇";   
		$templateCode="SMS_208130030";
		$phoneNumbers=$phone;
		$templateParam=Array(  // 短信模板中字段的值
        "code"=>$_SESSION['regcode']
         );	
		$retrundata= sendsms($signName,$templateCode, $phoneNumbers,$templateParam);
		exit($retrundata['Code']);
       }
	
     public function findpwdcode() {
		$phone=$_POST['mobile'];
		if($phone==''){
		    echo "phonenull";
			exit;
			}	
		  if(!is_numeric($phone)){
			   echo "phoneerror";
			   exit;
		  }
		$yanzhengma=mt_rand(100000,999999);
		$_SESSION['findpwdcode']=$yanzhengma;
		$signName="云业汇";   
		$templateCode="SMS_208130029";
		$phoneNumbers=$phone;
		$templateParam=Array(  // 短信模板中字段的值
        "code"=>$_SESSION['findpwdcode']
         );	
		$retrundata= sendsms($signName,$templateCode, $phoneNumbers,$templateParam);
		exit($retrundata['Code']);
       }
	
     public function logincode() {
		$phone=$_POST['mobile'];
		if($phone==''){
		    echo "phonenull";
			exit;
			}	
		  if(!is_numeric($phone)){
			   echo "phoneerror";
			   exit;
		  }
		$yanzhengma=mt_rand(100000,999999);
		$_SESSION['logincode']=$yanzhengma;
		$signName="云业汇";   
		$templateCode="SMS_208130032";
		$phoneNumbers=$phone;
		$templateParam=Array(  // 短信模板中字段的值
        "code"=>$_SESSION['logincode']
         );	
		$retrundata= sendsms($signName,$templateCode, $phoneNumbers,$templateParam);
		exit($retrundata['Code']);
       }
	
       public function goodscode() {
		$phone=$_POST['mobile'];
		if($phone==''){
		    echo "phonenull";
			exit;
			}	
		  if(!is_numeric($phone)){
			   echo "phoneerror";
			   exit;
		  }
		$yanzhengma=mt_rand(100000,999999);
		$_SESSION['regcode']=$yanzhengma;
		$signName="云业汇";   
		$templateCode="SMS_181868496";
		$phoneNumbers=$phone;
		$templateParam=Array(  // 短信模板中字段的值
        "sn"=>$_SESSION['regcode']
         );	
		$retrundata= sendsms($signName,$templateCode, $phoneNumbers,$templateParam);
		exit($retrundata['Code']);
       }


	 public function editpwdcode() {
		$phone=$_POST['Mobile'];
		if($phone==''){
		    echo "phonenull";
			exit;
			}	
		  if(!is_numeric($phone)){
			   echo "phoneerror";
			   exit;
		  }
		$yanzhengma=mt_rand(100000,999999);
		$_SESSION['editpwdcode']=$yanzhengma;
		$signName="云业汇";   
		$templateCode="SMS_208130029";
		$phoneNumbers=$phone;
		$templateParam=Array(  // 短信模板中字段的值
        "code"=>$_SESSION['editpwdcode']
         );	
		$retrundata= sendsms($signName,$templateCode, $phoneNumbers,$templateParam);
		exit($retrundata['Code']);
       }
	
/*     public function test() {
		$phone='15937957328';
		$yanzhengma=mt_rand(100000,999999);
		$_SESSION['regcode']=$yanzhengma;
		$signName="云业汇";   
		$templateCode="SMS_161700292";
		$phoneNumbers=$phone;
		$templateParam=Array(  // 短信模板中字段的值
        "code"=>$_SESSION['regcode']
         );	
		sendsms($signName,$templateCode, $phoneNumbers,$templateParam); 
       }	*/	
	
}
?>