|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- /*
- Author:XM
- Compeny:Spiders Travel
- */
- function writeLog($log,$file=''){
- $dir=__DIR__."/Log/";
- if (!is_dir($dir)){
- mkdir($dir);
- }
- $filename=$dir.date("Y-m-d").".log";
- file_put_contents($filename, date("Y-m-d H:i:s")."\t".$log.PHP_EOL,FILE_APPEND);
- }
- function makeSign($array){
- $str='';
- foreach ($array as $v){
- $str.=$v;
- }
- return sha1($str.TOKEN);
- }
- function getUserId(){
- if (isset($_COOKIE['xm_data'])){
- $xm_data=$_COOKIE['xm_data'];
- $data=unserialize($xm_data);
- $id=$data['id'];
- $user=$data['user'];
- $checkToken=$data['token'];
- $list=$data['list'];
- $token=makeSign(array($id,$user,serialize($list)));
- if ($checkToken == $token){
- return $id;
- }else{
- return false;
- }
- }else{
- return false;
- }
- }
- function httpRequest($url,$data=null){
- $ch=curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- if (!empty($data)){
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- }
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $output=curl_exec($ch);
- curl_close($ch);
- return $output;
- }
- function sendTelMessage($phones,$user_name,$content,$order_id){
- //$phones='13023280550;';
-
- //$url='http://www.mxtong.net.cn/GateWay/Services.asmx/DirectSend?UserID=995596&Account=alert&Password=zzcx8888&Phones='.$phones.'&Content='.$content.'【蜘蛛行】&SendTime=&SendType=1&PostFixNumber=';
- $url='http://hprpt2.eucp.b2m.cn:8080/sdkproxy/sendsms.action?cdkey=8SDK-EMY-6699-RISUM&password=175348&phone='.$phones.'&message=【蜘蛛行】'.$content;
- $response=httpRequest($url);
- writeLog($url.'$response::'.$response);
- return $response;
- }
-
-
- function getSendMessage( $good_type, $cus_name, $start_date, $good_name = "", $org_address = "" ) {
- if( $good_type == 1 ) {
- $send_message = sprintf( "%s预订的%s迪士尼单日往返直通车支付成功,出发时间为%s,请提前10分钟在%s等候上车。", $cus_name, $start_date, $start_date, $org_address);
- } else if( $good_type == 2 ){
- $send_message = sprintf( "%s预订的%s%s支付成功,请凭有效证件在园区闸口检票入园。联系客服:021-33280578。", $cus_name, $start_date, $good_name);
- } else {
- $send_message = sprintf( "%s预订的%s%s支付成功,请凭取票人姓名、手机号在剧场入口侧兑票机兑票入场。", $cus_name, $start_date, $good_name);
- }
- return $send_message;
- }
-
|