You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
- /*
- * wechat 2.0
- * Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
- * Date: 2016.7.12
- * Something is to pay QQ1062140302
- */
- //获取jssdk配置
- require_once __DIR__.'/../jssdk/jssdk_wx.php';
- //require_once __DIR__.'/../Common/Config.php';
- require_once __DIR__.'/../Common_fx/Mysql.php';
- $pdo = conn();
- header("Access-Control-Allow-Origin:*");
- $jssdk = new JSSDK(APPID, APPSECRET);
- if (isset($_POST['url'])){
- $url=$_POST['url'];
- }else{
- $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
- $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
- }
- if(isset($_POST["bus_no"]))
- $order_bus_no = $_POST["bus_no"];
- else
- $order_bus_no ='000';
- //$order_driver_name = $rowset[0]["SEND_DRIVER_NAME"];
- $sql = "SELECT b.PROPERTY FROM base_resource a LEFT JOIN `base_resource_property` b on a.RES_ID =b.RES_ID where b.TYPE_ID=283 and a.RES_NAME ='".$order_bus_no."'";
- //$pdo = conn();
- $result = $pdo -> query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
-
- if(isset($rowset[0]['PROPERTY'])){
- $ifgps ='1';
- $position = get_position($rowset[0]['PROPERTY']);
- $j = $position['j'];
- $w = $position['w'];
- $speed = $position['speed'];
- }else{
- $ifgps ='0';
- $j = '0';
- $w = '0';
- $speed = '0';
- }
-
- $signPackage = $jssdk->GetSignPackage($url);
- $signPackage['j'] =$j;
- $signPackage['w'] =$w;
- $signPackage['speed'] =$speed;
- $signPackage['ifgps'] =$ifgps;
-
-
-
- echo json_encode($signPackage);
|