Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

75 linhas
2.4 KiB

  1. <?php
  2. /*
  3. Author:XM
  4. Compeny:Spiders Travel
  5. */
  6. function writeLog($log,$file=''){
  7. $dir=__DIR__."/Log/";
  8. if (!is_dir($dir)){
  9. mkdir($dir);
  10. }
  11. $filename=$dir.date("Y-m-d").".log";
  12. file_put_contents($filename, date("Y-m-d H:i:s")."\t".$log.PHP_EOL,FILE_APPEND);
  13. }
  14. function makeSign($array){
  15. $str='';
  16. foreach ($array as $v){
  17. $str.=$v;
  18. }
  19. return sha1($str.TOKEN);
  20. }
  21. function getUserId(){
  22. if (isset($_COOKIE['xm_data'])){
  23. $xm_data=$_COOKIE['xm_data'];
  24. $data=unserialize($xm_data);
  25. $id=$data['id'];
  26. $user=$data['user'];
  27. $checkToken=$data['token'];
  28. $list=$data['list'];
  29. $token=makeSign(array($id,$user,serialize($list)));
  30. if ($checkToken == $token){
  31. return $id;
  32. }else{
  33. return false;
  34. }
  35. }else{
  36. return false;
  37. }
  38. }
  39. function httpRequest($url,$data=null){
  40. $ch=curl_init();
  41. curl_setopt($ch, CURLOPT_URL, $url);
  42. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  43. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  44. if (!empty($data)){
  45. curl_setopt($ch, CURLOPT_POST, 1);
  46. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  47. }
  48. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  49. $output=curl_exec($ch);
  50. curl_close($ch);
  51. return $output;
  52. }
  53. function sendTelMessage($phones,$user_name,$content,$order_id){
  54. //$phones='13023280550;';
  55. //$url='http://www.mxtong.net.cn/GateWay/Services.asmx/DirectSend?UserID=995596&Account=alert&Password=zzcx8888&Phones='.$phones.'&Content='.$content.'【蜘蛛行】&SendTime=&SendType=1&PostFixNumber=';
  56. $url='http://hprpt2.eucp.b2m.cn:8080/sdkproxy/sendsms.action?cdkey=8SDK-EMY-6699-RISUM&password=175348&phone='.$phones.'&message=【蜘蛛行】'.$content;
  57. $response=httpRequest($url);
  58. writeLog($url.'$response::'.$response);
  59. return $response;
  60. }
  61. function getSendMessage( $good_type, $cus_name, $start_date, $good_name = "", $org_address = "" ) {
  62. if( $good_type == 1 ) {
  63. $send_message = sprintf( "%s预订的%s迪士尼单日往返直通车支付成功,出发时间为%s,请提前10分钟在%s等候上车。", $cus_name, $start_date, $start_date, $org_address);
  64. } else if( $good_type == 2 ){
  65. $send_message = sprintf( "%s预订的%s%s支付成功,请凭有效证件在园区闸口检票入园。联系客服:021-33280578。", $cus_name, $start_date, $good_name);
  66. } else {
  67. $send_message = sprintf( "%s预订的%s%s支付成功,请凭取票人姓名、手机号在剧场入口侧兑票机兑票入场。", $cus_name, $start_date, $good_name);
  68. }
  69. return $send_message;
  70. }