天生创想OA短信接口修改

今天朋友公司的OA系统想实现提醒的功能,说这样有短信提醒更方便,也更加有效率,方便.但由于它们公司的技术不懂php代码,想让我给它修改一下代码,它把相关文件发过来之后,我看了一下,是比较简单的 我还是推荐它用56短信网的短信接口,网址:http://www.56dxw.com,我把代码写出来,以供大家参考。

首先我们要找到调用短信接口的文件,

include文件下的sms.class.php文件,这个是调用短信接口核心文件


//手机短信发送
function PHONE_ADD_POST($person=0,$content=0,$receiveperson=0,$type=0,$url=0,$userid=0){
    
	$personfor=explode(',',$person);//手机
	$receivepersonfor=explode(',',$receiveperson);//姓名
	$channelid = random(6);
	$ugcode_vod= new ugcode();
	$contentgdb2312=$ugcode_vod->ugcode_vod(1,$content);
	for($i=0;$i<sizeof($personfor);$i++){
		if(trim($personfor[$i])!=''){
			$date=get_date('Y-m-d H:i:s',PHP_TIME);
			
                        //56短信网为您提供优质的短信接口服务【56短信网】  网址:http://www.56dxw.com
			$msg="所有员工,请及时到会议室开会【OAl办公】";
			$msg=urlencode(mb_convert_encoding($msg, 'gbk' ,'utf-8'))
			!$personfor[$i] && die('手机号必填');
			!$msg && die('发生内容必填');

			//接口信息url
			echo sendnote($personfor[$i],$msg);
			$phoneurl = "1";
			//$res = Utility::HttpRequest($phoneurl);
			$res = '1';
			if($res!='' && $phoneurl!=''){
				$type='1';
			}else{
				$type='2';
			}
			//数据入库
			$send = array();
			$send['content']=$content;
			$send['receivephone']=$personfor[$i];
			$send['sendperson']=$userid;
			$send['receiveperson']=$receivepersonfor[$i];
			$send['date']=$date;
			$send['type']=$type;
			$send['channelid']=$channelid;
			insert_db(DB_JT.'phone_send',$send);
			sleep(1);
		}
	}	
}


function sendnote($mobtel,$msg){
 global $username,$userpwd,$smsnumber,$comid;
	//帐号配置文件
			$comid= "70"; //企业ID
			$username= "test2"; //用户名
			$userpwd= "test2zz"; //密码
			$smsnumber= "10690"; //所用平台

 $url = "http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=$comid&username=$username&userpwd=$userpwd&handtel=$mobtel&sendcontent=$msg&sendtime=&smsnumber=$smsnumber";
 $string = file_get_contents($url);
 return  rstr($string);
}










记得开启短信提醒这个功能哦,如图:



天生创想OA短信接口修改_第1张图片








其实挺简单的,不复杂的,如果大家在接入到遇到什么问题,可以加微信:jjzaihaozhe

你可能感兴趣的:(天生创想OA短信接口修改,OA短信接口修改)