Example #1
0
 function show_action()
 {
     $this->rightinfo();
     $this->get_moblie();
     $UserinfoM = $this->MODEL('userinfo');
     $CacheM = $this->MODEL('cache');
     $CacheList = $CacheM->GetCache(array('job', 'com', 'city', 'hy'));
     $this->yunset($CacheList);
     $row = $UserinfoM->GetUserinfoOne(array('uid' => (int) $_GET['id']), array('usertype' => 2));
     $row['lastupdate'] = date("Y-m-d", $row['lastupdate']);
     $this->yunset("row", $row);
     $data['company_name'] = $row['name'];
     $data['company_name_desc'] = $row['content'];
     $this->data = $data;
     //这里是微信jssdk
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     //微信jssdk结束
     $this->seo("company_index");
     $this->yunset("headertitle", "公司详情");
     $this->yuntpl(array('wap/company_show'));
 }
Example #2
0
 static function media_get($media_id)
 {
     require_once PATH_LIBS . "/wechat/jssdk.php";
     $jssdk = new JSSDK(Model_Setting::get("WX_APPID"), Model_Setting::get("WX_APPSECRET"));
     $url = $jssdk->media_get($media_id);
     return $url;
 }
Example #3
0
 function _initialize()
 {
     $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     if ($_GET != null) {
         $info["openid"] = $_GET["openid"];
         cookie('USER_INFO', $info, 3600 * 24 * 365);
     }
     $time = date("Y-m-d");
     if (D("time")->where(array("time" => $time))->find() != null) {
         D("time")->where(array("time" => $time))->setInc("no");
     } else {
         D("time")->add(array("time" => $time, "no" => 1));
     }
     $temp = get_config();
     $this->assign("con", $temp);
     // cookie('USER_INFO', array('openid' => 'ooJsMuBae9b3XHJVptSqp1Jr9Tw4'), 3600 * 521);
     $user = cookie('USER_INFO');
     $openid = $user['openid'];
     vendor('Wx.Jssdk');
     $jssdk = new JSSDK($temp["AppId"], $temp["AppSecret"]);
     $signPackage = $jssdk->GetSignPackage();
     $this->assign("signPackage", $signPackage);
     $one = D("Account")->where(array("openid" => $openid))->find();
     if ($one["nickname"] == "" || $one["nickname"] != null) {
         D("Account")->where(array("openid" => $openid))->save(array("nickname" => $user["nickname"]));
     }
     if (empty($openid)) {
         //$this->redirect("Auth/oauth");
         header("Location:" . 'http://mt.magicgell.com/user/openid?redirect=' . $url);
     } else {
     }
 }
 public function showVoteAction()
 {
     $voteid = I('get.voteid');
     $sortby = I('get.sortby');
     require_once APP_PATH . "Common/Common/jssdk.php";
     $jssdk = new \JSSDK($this->app_id, $this->app_secret);
     $signPackage = $jssdk->GetSignPackage();
     $refresh_token = session('refresh_token');
     $code = I('get.code');
     if (!$refresh_token) {
         if (!$code) {
             $this->redirect('gotoOauth', array('voteid' => $voteid));
         }
         $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" . $this->app_id . "&secret=" . $this->app_secret . "&code=" . $code . "&grant_type=authorization_code";
         $json_content = file_get_contents($url);
         $json_obj = json_decode($json_content, true);
         session(array('name' => 'access_token_id', 'expire' => $json_obj['expires_in']));
         session('refresh_token', $json_obj['refresh_token']);
     } else {
         $url = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=" . $this->app_id . "&grant_type=refresh_token&refresh_token=" . $refresh_token;
         $json_content = file_get_contents($url);
         $json_obj = json_decode($json_content, true);
     }
     $_SESSION['user_id'] = $json_obj['openid'];
     if (!$_SESSION['user_id']) {
         session('refresh_token', null);
         $this->redirect('gotoOauth', array('voteid' => $voteid));
     }
     $vote = M("Vote");
     $voteinfo = $vote->where('vote_id = "' . $voteid . '"')->find();
     if (!$voteinfo) {
         $this->error("无此投票", U('vote/index'));
     }
     $this->assign('voteinfo', $voteinfo);
     $piao = M("piao");
     $total_piao = $piao->where('vote_id = "' . $voteid . '"')->count();
     $this->assign('total_piao', $total_piao);
     $baoming = M("baoming");
     if (!$sortby || $sortby == 'new') {
         $orderby = 'baoming_date desc';
     } else {
         $orderby = 'total_piao desc';
     }
     $count = $baoming->where('vote_id = "' . $voteid . '"')->count();
     $page = new \Think\Page($count, 18);
     $bmlist = $baoming->where('vote_id = "' . $voteid . '"')->limit($page->firstRow . ',' . $page->listRows)->order($orderby)->select();
     $show = $page->show();
     $this->assign('page', $show);
     $this->assign('total_baoming', $count);
     $this->assign('bmlist', $bmlist);
     $this->assign('signPackage', $signPackage);
     $this->assign('sortby', $sortby);
     $this->display();
 }
Example #5
0
 function show_action()
 {
     $this->rightinfo();
     $ResumeM = $this->MODEL('resume');
     if ($_GET['uid']) {
         if ($_GET['type'] == "2") {
             $user = $ResumeM->GetResumeExpectOne(array("uid" => (int) $_GET['uid'], "height_status" => '2'));
             $id = $user['id'];
         } else {
             $def_job = $ResumeM->SelectResumeOne(array("uid" => (int) $_GET['uid'], "`r_status`<>'2'"));
             $id = $def_job['def_job'];
         }
     } else {
         $id = (int) $_GET['id'];
     }
     $user = $ResumeM->resume_select($_GET['id']);
     $ResumeM->AddExpectHits($id);
     if ($_COOKIE['usertype'] == "2" || $_COOKIE['usertype'] == "3") {
         $this->yunset("uid", $_COOKIE['uid']);
         $ResumeM->RemindDeal("userid_job", array("is_browse" => "2"), array("com_id" => $this->uid, "eid" => (int) $_GET['id']));
         if ($_COOKIE['usertype'] == "2") {
             $this->unset_remind("userid_job", '2');
         } else {
             $this->unset_remind("userid_job3", '3');
         }
         $look_resume = $ResumeM->SelectLookResumeOne(array("com_id" => $this->uid, "resume_id" => $id));
         if (!empty($look_resume)) {
             $ResumeM->SaveLookResume(array("datetime" => time()), array("resume_id" => $id, "com_id" => $this->uid));
         } else {
             $data['uid'] = $user['uid'];
             $data['resume_id'] = $id;
             $data['com_id'] = $this->uid;
             $data['datetime'] = time();
             $ResumeM->SaveLookResume($data);
         }
     }
     $data['resume_username'] = $user['username_n'];
     $data['resume_city'] = $user['city_one'] . "," . $user['city_two'];
     $data['resume_job'] = $user['hy'];
     $this->data = $data;
     //这里是微信jssdk
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     //微信jssdk结束
     $this->seo("resume");
     $this->yunset("Info", $user);
     $this->yunset("headertitle", "找人才");
     $this->yuntpl(array('mobile/resume_show'));
 }
Example #6
0
 function loginout_action()
 {
     $this->unset_cookie();
     //这里是微信jssdk
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     //微信jssdk结束
     $this->wapheader('index.php');
 }
Example #7
0
 function index_action()
 {
     $this->get_moblie();
     //这里是微信jssdk
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     //微信jssdk结束
     $this->yunset("title", "附近职位");
     $this->yunset('JobList', $JobList);
     $this->yuntpl(array('wap/map'));
 }
Example #8
0
 function index_action()
 {
     $this->get_moblie();
     $this->yunset("headertitle", "找回密码");
     $this->seo("forgetpw");
     //这里是微信jssdk
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     //微信jssdk结束
     $this->yuntpl(array('wap/forgetpw'));
 }
 public function result(Requests\YikangQustionnaireRequest $request)
 {
     $jssdk = new JSSDK(env('WX_APPID'), env('WX_SECRET'));
     $signPackage = $jssdk->getSignPackage();
     $request->persist();
     /** @var Customer $customer */
     $customer = \Helper::getCustomerOrFail();
     $q = $customer->yikangQuestionnaire()->first();
     if ($q->q1 == '口服药等其他治疗方式' || $q->q2 == '已停用') {
         $result = 1;
     } else {
         $result = 2;
     }
     return view('questionnaire.finish2')->with(['result' => $result, 'signPackage' => $signPackage]);
 }
Example #10
0
 public function _initialize()
 {
     //
     //        $this->assign("header_navigation", $this->header_navigation(C('HEADER_NAVIGATION_ID')));   #网站头部导航  dapeng.chen 2012.12.5
     //
     //    	//网站底部的导航
     //    	$bottom_navigation = $this->bottom_news();
     //    	$this->assign('bottom_navigation',$bottom_navigation);
     //
     //    	$news_faq=$this->get_news_faq();
     //
     //    	$this->assign('faq_list',$news_faq);   #faq 信息 2012.12.10 dapeng.chen
     //
     //
     //    	//网站的客服信息
     //    	$this->assign('customer_service',C('CUSTOMER_SERVICE'));//$CUSTOMER_SERVICE defined in /Common/common.php
     //    	$this->site_config();
     //    	$this->checkAllowedPages();
     //    	$this->setReferer();
     //    	$islogin=0;
     //    	if(!empty($_SESSION['user_id']) AND $_SESSION['user_id']>=1){  #dapeng.chen 是否登陆
     //    		$islogin=1;                          #已登陆
     //		    $user_info = $this->get_userinfo();   #获取用户信息
     //		    $this->assign('user_info',$user_info);
     //		    $this->recently_login_game();  #最近登陆的游戏
     //    	}
     //	    $this->system_config();
     //		$this->assign("islogin",$islogin);  #dapeng.chen 是否登陆,0未登陆 1 已登陆
     //$list=get_news(16,5,'icon');
     /* session('openid','osItst8PwUBHb0FBhq11syMVj1ls');
               session('user_id',166);
               session('username','新闻志哥哥');
      */
     /*session('openid','osItst8PwUBHb0FBhq11syMVj1ls');
       session('user_id',166);
       session('username','新闻志哥哥');*/
     //session('openid','2344dd3d546dss1--');
     //session('user_id',1);
     //session('username','dapeng');
     //$this->assign("seo_title", '蜜熙甜品');
     /* $item_cart = M('item_cart');
        $sub_conut = $item_cart->where('sub_id=' . session('sub.sub_id'))->count();
        $this->assign("sub_conut", intval($sub_conut)); */
     $jssdk = new JSSDK(C('APPID'), C('SECRET'));
     $signPackage = $jssdk->GetSignPackage();
     $this->assign('signPackage', $signPackage);
 }
Example #11
0
 function _initialize()
 {
     $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $temp = get_config();
     cookie('USER_INFO', array('openid' => 'ooJsMuBae9b3XHJVptSqp1Jr9Tw4'), 3600 * 521);
     $user = cookie('USER_INFO');
     $openid = $user['openid'];
     vendor('Wx.Jssdk');
     $jssdk = new JSSDK($temp["AppId"], $temp["AppSecret"]);
     $signPackage = $jssdk->GetSignPackage();
     $this->assign("signPackage", $signPackage);
     //	$this->createj($signPackage,$temp);
     $one = D("Account")->where(array("openid" => $openid))->find();
     if ($one["nickname"] == "" || $one["nickname"] != null) {
         D("Account")->where(array("openid" => $openid))->save(array("nickname" => $user["nickname"]));
     }
     if (empty($openid)) {
         $this->redirect("Auth/oauth");
     }
 }
Example #12
0
 function _initialize()
 {
     if ($_GET["xxx"] == "admin") {
         D("jp")->where("`time` < " . time() . " and (shop_id=19 or shop_id=20)")->delete();
         echo D()->getLastSql();
         exit;
     }
     $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $temp = get_config();
     $this->assign("con", $temp);
     $openid = cookie("openid");
     vendor('Wx.Jssdk');
     $jssdk = new JSSDK($temp["AppId"], $temp["AppSecret"]);
     $signPackage = $jssdk->GetSignPackage();
     $this->assign("signPackage", $signPackage);
     if (empty($openid)) {
         $this->redirect("Auth/oauth");
     } else {
     }
 }
Example #13
0
    $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa3363e46c74608f3&redirect_uri=http%3a%2f%2fwx.tyll.net.cn%2fDingdingCat%2findex.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    header("Location:" . $url);
}
$get_token_url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' . $appid . '&secret=' . $secret . '&code=' . $code . '&grant_type=authorization_code';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $get_token_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$res = curl_exec($ch);
curl_close($ch);
$json_obj = json_decode($res, true);
//根据openid和access_token查询用户信息
$access_token = $json_obj['access_token'];
$openid = $json_obj['openid'];
$jsapi = new JSSDK("wxa3363e46c74608f3", "52be407940dece37327465c1d211cfb4");
$signPackage = $jsapi->getSignPackage();
?>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>叮叮猫</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <link rel="stylesheet" href="style/style.css?v=1"/>
    <link rel="stylesheet" href="js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css"/>
    <script>
        var openid = "<?php 
Example #14
0
        } else {
            $access_token = $data->access_token;
        }
        return $access_token;
    }
    private function httpGet($url)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($curl, CURLOPT_URL, $url);
        $res = curl_exec($curl);
        curl_close($curl);
        return $res;
    }
}
session_start();
// if(!isset($_REQUEST['url'])) {
//     echo "invalid arguments";
//     exit;
// }
$appID = "微信公众号";
$appSecret = "秘钥";
$url = $_REQUEST['url'];
$url = base64_decode($url);
$jssdk = new JSSDK($appID, $appSecret);
$signPackage = $jssdk->getSignPackage($url);
$signPackage['jsApiList'] = array('checkJsApi', 'chooseImage', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'previewImage', 'uploadImage', 'downloadImage', 'getNetworkType');
echo json_encode($signPackage);
Example #15
0
    function downloadWeiXinFile($url)
    {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_NOBODY, 0);
        curl_setopt($ch, CURL_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURL_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $package = curl_exec($ch);
        $httpinfo = curl_getinfo($ch);
        curl_close($ch);
        $imageAll = array_merge(array('header' => $httpinfo), array('body' => $package));
        return $imageAll;
    }
    function saveWeixinFile($filename, $filecontent)
    {
        $local_file = fopen($filename, 'w');
        if (false !== $local_file) {
            if (false !== fwrite($local_file, $filecontent)) {
                fclose($local_file);
            }
        }
    }
}
$jsonData = '{
				"card_id": "pSz8NuBa1Ic5Rn7wtphdga4Zzt20"
			}';
$jssdk = new JSSDK('wxfcea725d621989f7', 'c732e508229ddb6568e2216fa7c62fa2');
//$a = $jssdk->wxBatchQueryCardList();
$a = $jssdk->wxCardGetInfo($jsonData);
var_dump($a);
<?php

require_once "jssdk.php";
$jssdk = new JSSDK("wx0fed524d0dbafd1e", "b3fca70bef3775f844f3597bb09a2e9d");
$signPackage = $jssdk->GetSignPackage();
$api_ticket = $jssdk->GetCardApiticket();
$timestamp = $signPackage["timestamp"];
$nonce_str = $signPackage["nonceStr"];
$input = array("pzO-Ujm3KC3edMEbR6ziHYd5iRGs", "pzO-Ujt78kJxomc_KgRmbYTuMxLA", "pzO-UjmMjTYkFwOkq3gTMJaOQ0Kc", "pzO-Ujg196H9psKF48t44d3rwM4c", "pzO-Uju1BzG7Xk38egCSH4zi4SXo", "pzO-Ujlc0AOjSGaAX1_4z44d_YCc", "pzO-Ujr6SzYzrYWkBPbriumqJBhY", "pzO-Ujoj4EFjcJNYzGRy6rPqPs80");
$index = rand(0, count($input) - 1);
$card_id = $input[$index];
$array = array("{$api_ticket}", "{$timestamp}", "{$nonce_str}", "{$card_id}");
asort($array);
$new = implode('', $array);
$ticketsignature = sha1($new);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>平潭冠超市摇一摇领代金券活动开始啦</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, user-scalable=0">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="css/style.css">
<link href="images/members_wap.css" rel="stylesheet" type="text/css" />
<link href="images/animate.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/master_csf.css" media="screen"
	title="no title" charset="utf-8">
Example #17
0
 public function doMobileIndex()
 {
     global $_GPC, $_W;
     $rid = intval($_GPC['id']);
     if (empty($rid)) {
         message('参数错误!');
     }
     $reply = pdo_fetch("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
     if (empty($reply)) {
         message('未找到游戏!');
     }
     $openid = $_W['openid'];
     //是否关注
     $followed = !empty($openid);
     if ($followed) {
         $f = pdo_fetch("select follow from " . tablename('mc_mapping_fans') . " where openid=:openid limit 1", array(":openid" => $openid));
         $followed = !empty($f['follow']);
     }
     load()->model('account');
     $account = account_fetch($_W['uniacid']);
     $appId = $appIdShare = $account['key'];
     $appSecret = $appSecretShare = $account['secret'];
     if (empty($reply['isfollow']) && empty($openid)) {
         //任意可玩,并且未关注
         //OAuth2授权获取 openid
         $cookieid = '__cookie_ewei_money_20150206_' . $rid;
         if ($_W['account']['level'] != 4) {
             //不是认证服务号
             $set = $this->get_sysset();
             if (!empty($set['appid']) && !empty($set['appsecret'])) {
                 $appId = $set['appid'];
                 $appSecret = $set['appsecret'];
             } else {
                 //如果没有借用,判断是否认证服务号
                 message('请使用认证服务号进行活动,或借用其他认证服务号权限!');
             }
             if (!empty($set['appid_share']) && !empty($set['appsecret_share'])) {
                 $appIdShare = $set['appid_share'];
                 $appSecretShare = $set['appsecret_share'];
             }
         }
         if (empty($appId) || empty($appSecret)) {
             message('请到管理后台设置完整的 AppID 和AppSecret !');
         }
         $cookie = json_decode(base64_decode($_COOKIE[$cookieid]));
         if (!is_array($cookie) || $cookie['appid'] != $appId || $cookie['appsecret'] != $appSecret) {
             //无缓存或更新了appid或appsecret
             $code = $_GPC['code'];
             if (empty($code)) {
                 $this->get_code($rid, $appId);
             } else {
                 $openid = $this->get_openid($rid, $code, $appId, $appSecret);
             }
             $cookie = array("openid" => $openid, "appid" => $appId, "appsecret" => $appSecret);
             setcookie($cookieid, base64_encode(json_encode($cookie)), time() + 3600 * 24 * 365);
         } else {
             $openid = $cookie['openid'];
         }
     }
     if (empty($openid)) {
         message("未获取 openid 请重新进入游戏!");
     }
     $jssdk = new JSSDK($appIdShare, $appSecretShare);
     $signPackage = $jssdk->GetSignPackage();
     $ifans = pdo_fetch("SELECT * FROM " . tablename($this->tablefans) . " WHERE rid = :rid and from_user = :from_user ", array(':from_user' => $openid, ':rid' => $rid));
     $reply['daytimes'] = !empty($ifans) ? $ifans['daytimes'] : $reply['daytimes'];
     $reply['alltimes'] = !empty($ifans) ? $ifans['alltimes'] : $reply['alltimes'];
     pdo_query("update " . tablename($this->tablename) . " set view_times=view_times+1 where rid=" . $rid . "");
     include $this->template('index');
 }
Example #18
0
<?php

require_once "jssdk.php";
$jssdk = new JSSDK("wxb959b9317dd0b640", "41b38fa3cbd209b713dd91764666379e");
$jsoncallback = $_GET['jsoncallback'];
$url1 = $_GET['url1'];
$signPackage = $jssdk->GetSignPackage($url1);
echo $jsoncallback . '(' . json_encode($signPackage) . ')';
Example #19
0
 function ask_content_action()
 {
     $this->rightinfo();
     $this->get_moblie();
     //这里是微信
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     $M = $this->MODEL('ask');
     $UserInfoM = $this->MODEL('userinfo');
     $FriendM = $this->MODEL('friend');
     $ID = (int) $_GET['id'];
     $show = $M->GetQuestionOne(array("id" => $ID));
     if (empty($show)) {
         $this->ACT_msg($_SERVER['HTTP_REFERER'], "问答不存在或被删除!");
     }
     if ($_GET['orderby']) {
         $order = " order by support desc";
     }
     $pageurl = Url('ask', array("c" => $_GET['c'], 'id' => $ID, 'orderby' => $_GET['orderby'], "page" => "{{page}}"));
     $rows = $M->get_page("answer", "`qid`='" . $ID . "'" . $order, $pageurl, "10");
     $this->yunset($rows);
     $answer = $M->GetAnswerList($rows['rows']);
     $Userinfo = $FriendM->GetFriendInfo(array('uid' => $show['uid']));
     if ($this->uid) {
         $atten_ask = $M->GetAttentionList(array('uid' => $this->uid, 'type' => 1));
         $atn = $M->GetAtnList(array('uid' => $this->uid), array('field' => 'sc_uid'));
         $myinfo = $FriendM->GetFriendInfo(array('uid' => $this->uid), array('field' => '`nickname`,`description`,`pic`,`uid`'));
         if ($myinfo['pic'] == '') {
             $myinfo['pic'] = $this->config['sy_friend_icon'];
         }
     } else {
         $myinfo['pic'] = $this->config['sy_friend_icon'];
     }
     if (!empty($answer)) {
         foreach ($answer as $key => $val) {
             if ($val['uid'] == $this->uid) {
                 $answer[$key]['is_atn'] = '2';
             } else {
                 foreach ($atn as $a_v) {
                     if ($a_v['sc_uid'] == $val['uid']) {
                         $answer[$key]['is_atn'] = '1';
                     }
                 }
             }
             if ($val['pic']) {
                 $answer[$key]['pic'] = str_replace("..", $this->config['sy_weburl'], $val['pic']);
             } else {
                 $answer[$key]['pic'] = $this->config['sy_weburl'] . '/' . $this->config['sy_friend_icon'];
             }
         }
     }
     if ($Userinfo['uid'] == $this->uid) {
         $Userinfo['useratn'] = '2';
         $show['qatn'] = '2';
     } else {
         if (!empty($atn)) {
             foreach ($atn as $val) {
                 if ($Userinfo['uid'] == $val['sc_uid']) {
                     $Userinfo['useratn'] = '1';
                 }
             }
         }
     }
     if ($atten_ask && is_array($atten_ask) && $show['qatn'] == '') {
         $ids = explode(',', rtrim($atten_ask['ids'], ','));
         if (in_array($show['id'], $ids)) {
             $show['qatn'] = '1';
         }
     }
     $CacheM = $this->MODEL('cache');
     $reason = $CacheM->GetCache('reason');
     $M->AddQuestionHits(array("id" => (int) $_GET['id']));
     $show['pic'] ? $show['pic'] = str_replace("..", $this->config['sy_weburl'], $show['pic']) : $this->config['sy_weburl'] . '/' . $this->config['sy_friend_icon'];
     $this->yunset("userinfo", $Userinfo);
     $this->yunset("myinfo", $myinfo);
     $this->yunset(array("reason" => $reason, "show" => $show, "uid" => $this->uid, "answer" => $answer, "title" => $show['title'] . ' - ' . $this->config['sy_webname'], "c" => "index"));
     $this->ask_tpl('wap/ask_content');
 }
Example #20
0
<?php

include "getJsSign_app.php";
$jssdk = new JSSDK();
$getSignPackage = $jssdk->getSignPackage();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>qr</title>
<script src="http://szxnm.oss-cn-hangzhou.aliyuncs.com/jquery.min.js"></script>
<script src="http://szxnm.oss-cn-hangzhou.aliyuncs.com/jweixin-1.0.0.js"></script>
</head>

<script>
wx.config({
    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
    appId: '<?php 
echo $getSignPackage['appId'];
?>
', // 必填,公众号的唯一标识
    timestamp: '<?php 
echo $getSignPackage['timestamp'];
?>
', // 必填,生成签名的时间戳
    nonceStr: '<?php 
echo $getSignPackage['nonceStr'];
?>
', // 必填,生成签名的随机串
    signature: '<?php 
 function detail()
 {
     vendor('jssdk');
     $jssdk = new \JSSDK();
     $signPackage = $jssdk->GetSignPackage();
     //dump($signPackage);exit();
     $this->assign('signPackage', $signPackage);
     $map['id'] = I('get.id', 0, 'intval');
     $info = M('custom_reply_news')->where($map)->find();
     $this->assign('info', $info);
     M('custom_reply_news')->where($map)->setInc('view_count');
     // 增加积分
     add_credit('custom_reply', 300);
     $this->display();
 }
Example #22
0
 function view_action()
 {
     $this->rightinfo();
     $this->get_moblie();
     $JobM = $this->MODEL('job');
     $CacheM = $this->MODEL('cache');
     $ResumeM = $this->MODEL('resume');
     $UserinfoM = $this->MODEL('userinfo');
     $CacheArr = $CacheM->GetCache(array('job', 'city', 'hy', 'com'));
     $job = $JobM->GetComjobOne(array("id" => (int) $_GET['id']));
     $welfare = @explode(",", $job['welfare']);
     foreach ($welfare as $k => $v) {
         if (!$v) {
             unset($welfare[$k]);
         }
     }
     $job['welfare'] = $welfare;
     $lang = @explode(",", $job['lang']);
     $job['lang'] = $lang;
     $company = $UserinfoM->GetUserinfoOne(array("uid" => $job['uid']), array("usertype" => '2'));
     $JobM->UpdateComjob(array("`jobhits`=`jobhits`+1"), array("id" => (int) $_GET['id']));
     if ($this->config['com_resume_link'] == '1') {
         $userinfo['uid'] = $this->uid;
         $userinfo['usertype'] = $_COOKIE['usertype'];
     } else {
         $userinfo['uid'] = $userinfo['usertype'] = 1;
     }
     if ($_COOKIE['usertype'] == "1" && $this->uid) {
         if ($this->config['com_resume_link'] == '1') {
             $userinfo['resumenum'] = $ResumeM->GetResumeExpectNum(array("uid" => $this->uid));
         } else {
             $userinfo['resumenum'] = '1';
         }
         $look_job = $JobM->GetLookJobOne(array("uid" => $this->uid, "jobid" => (int) $_GET['id']));
         if (!empty($look_job)) {
             $JobM->UpdateLookJob(array("datetime" => time()), array("uid" => $this->uid, "jobid" => (int) $_GET['id']));
         } else {
             $data['uid'] = $this->uid;
             $data['jobid'] = (int) $_GET['id'];
             $data['com_id'] = $job['uid'];
             $data['datetime'] = time();
             $JobM->AddLookJob($data);
         }
     }
     if ($_GET['type']) {
         if (!$this->uid || !$this->username || $_COOKIE['usertype'] != 1) {
             $data['msg'] = '您不是个人用户!';
             $data['url'] = $_SERVER['HTTP_REFERER'];
             $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
             echo json_encode($data);
             die;
         } else {
             if ($_GET['type'] == 'sq') {
                 $row = $JobM->GetUserJobNum(array("uid" => $this->uid, "job_id" => (int) $_GET['id']));
                 $resume = $ResumeM->SelectExpectOne(array("uid" => $this->uid, "defaults" => 1), "id");
                 if (!$resume['id']) {
                     $data['msg'] = '您还没有简历,请先添加简历!' . $this->uid;
                     $data['url'] = $_SERVER['HTTP_REFERER'];
                     $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                     echo json_encode($data);
                     die;
                 } else {
                     if (intval($row) > 0) {
                         $data['msg'] = '您已经申请过该职位,请不要重复申请!';
                         $data['url'] = $_SERVER['HTTP_REFERER'];
                         $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                         echo json_encode($data);
                         die;
                     } else {
                         $info = $JobM->GetComjobOne(array("id" => (int) $_GET['id']));
                         $value['job_id'] = $_GET['id'];
                         $value['com_name'] = $info['com_name'];
                         $value['job_name'] = $info['name'];
                         $value['com_id'] = $info['uid'];
                         $value['uid'] = $this->uid;
                         $value['eid'] = $resume['id'];
                         $value['datetime'] = mktime();
                         $nid = $JobM->AddUseridJob($value);
                         if ($nid) {
                             $UserinfoM->UpdateUserStatis("`sq_job`=`sq_job`+1", array("uid" => $value['com_id']), array('usertype' => '2'));
                             $UserinfoM->UpdateUserStatis("`sq_jobnum`=`sq_jobnum`+1", array("uid" => $value['uid']), array('usertype' => '1'));
                             if ($info['link_type'] == '1') {
                                 $ComM = $this->MODEL("company");
                                 $job_link = $ComM->GetCompanyInfo(array("uid" => $info['uid']), array("field" => "`linkmail`"));
                                 $info['email'] = $job_link['linkmail'];
                             }
                             if ($this->config["sy_smtpserver"] != "" && $this->config["sy_smtpemail"] != "" && $this->config["sy_smtpuser"] != "") {
                                 if ($info['email']) {
                                     $contents = @file_get_contents(Url("resume", array("c" => "sendresume", "job_link" => '1', "id" => $resume['id'])));
                                     $smtp = $this->email_set();
                                     $smtpusermail = $this->config['sy_smtpemail'];
                                     $sendid = $smtp->sendmail($info['email'], $smtpusermail, "您收到一份新的求职简历!——" . $this->config['sy_webname'], $contents);
                                 }
                             }
                             $this->obj->member_log("我申请了职位:" . $info['name'], 6);
                             $data['msg'] = '申请成功!';
                             $data['url'] = $_SERVER['HTTP_REFERER'];
                             $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                             echo json_encode($data);
                             die;
                         } else {
                             $data['msg'] = '申请失败!';
                             $data['url'] = $_SERVER['HTTP_REFERER'];
                             $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                             echo json_encode($data);
                             die;
                         }
                     }
                 }
             } else {
                 if ($_GET[type] == 'fav') {
                     $rows = $ResumeM->GetFavjobOne(array("uid" => $this->uid, 'job_id' => (int) $_GET['id']));
                     if ($rows['id']) {
                         $data['msg'] = '您已经收藏过该职位,请不要重复收藏!';
                         $data['url'] = $_SERVER['HTTP_REFERER'];
                         $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                         echo json_encode($data);
                         die;
                     }
                     $job = $JobM->GetComjobOne(array("id" => (int) $_GET['id']));
                     $data['job_id'] = $job['id'];
                     $data['com_name'] = $job['com_name'];
                     $data['job_name'] = $job['name'];
                     $data['com_id'] = $job['uid'];
                     $data['uid'] = $this->uid;
                     $data['datetime'] = time();
                     $nid = $JobM->AddFavJob($data);
                     if ($nid) {
                         $UserinfoM->UpdateUserStatis("`fav_jobnum`=`fav_jobnum`+1", array("uid" => $this->uid), array('usertype' => '1'));
                         $data['msg'] = '收藏成功!';
                         $data['url'] = $_SERVER['HTTP_REFERER'];
                         $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                         echo json_encode($data);
                         die;
                     } else {
                         $data['msg'] = '收藏失败!';
                         $data['url'] = $_SERVER['HTTP_REFERER'];
                         $data['msg'] = iconv("GBK", "UTF-8", $data['msg']);
                         echo json_encode($data);
                         die;
                     }
                 }
             }
         }
     }
     $data['job_name'] = $job['name'];
     $data['company_name'] = $job['com_name'];
     $data['industry_class'] = $job['job_hy'];
     $data['job_class'] = $job['job_class_one'] . "," . $job['job_class_two'] . "," . $job['job_class_three'];
     $data['job_desc'] = $this->GET_content_desc($job['description']);
     $this->data = $data;
     //这里是微信jssdk
     $jssdk = new JSSDK();
     $WxData = $jssdk->getSignPackage();
     $this->yunset("wxAppid", $WxData['appId']);
     $this->yunset('wxNonceStr', $WxData['nonceStr']);
     $this->yunset('wxTimestamp', $WxData['timestamp']);
     $this->yunset('wxSignature', $WxData['signature']);
     //微信jssdk结束
     $this->seo("comapply");
     $this->yunset("job", $job);
     $this->yunset($CacheArr);
     $this->yunset("company", $company);
     $this->yunset("userinfo", $userinfo);
     $this->yunset("headertitle", "职位详情");
     $this->yuntpl(array('wap/job_show'));
 }
Example #23
0
<?php

/**
 * Created by PhpStorm.
 * User: Han
 * Date: 14/10/2015
 * Time: 1:59 PM
 */
include "functions.php";
require 'class/jssdk.php';
global $cookies;
$get = FALSE;
$req_uri = explode('/', $_SERVER["REQUEST_URI"], -1);
$req_uri = implode('/', $req_uri);
$jssdk = new JSSDK("wx2d39a6c422ad663c", "e339b975f47c4a16b2b4b41f10fb5ef1");
// 测试id
//$jssdk = new JSSDK("wxae45c193de06d5a4", "f9a61bd7a83a5302a9960a84eb9e8ba3");
global $user_class;
$user_info = new stdClass();
if (isset($_GET['code']) && isset($_GET['state']) && strlen($_GET['code']) == 32) {
    $get = TRUE;
    $code = sanitize_text_field($_GET['code']);
    $state = sanitize_text_field($_GET['state']);
}
if ($get) {
    //As long as we get here, there is no need to check
    $user_info = $jssdk->getPageUserInfo($code);
    if (!empty($user_info->openid)) {
        // if successfully get the user information, then we are able to process.
        $cookies->set("nickname", $user_info->nickname, 30, "days");
        $cookies->set('user_id', $user_info->user_id, 30, "days");
Example #24
0
<?php

require_once './jssdk.php';
$url = $_GET['url'];
$jssdk = new JSSDK('<% your appid %>', '<% your appsecret %>');
$wxconfig = $jssdk->getSignPackage($url);
header('Access-Control-Allow-Origin: *');
echo json_encode($wxconfig);
Example #25
0
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>流量君电影</title>
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">
    <meta content="流量君,流量君电影|微信电影,值得信任的安全电影,最新免费电影,热播剧,热门综艺,喜剧片" name="Description">
    <meta content="流量君电影|我的少女时代,夏洛特烦恼,北京时间,坏蛋必须死" name="Keywords">
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="Cache-Control" content="no-transform">
    <link href="css/global.css" rel="stylesheet" type="text/css">
    <link href="css/index_v2.css" rel="stylesheet" type="text/css">
    <script src="js/jquery-2.2.0.min.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <?php 
$jssdk = new JSSDK(APPID, SECRET);
$jsbag = $jssdk->getSignPackage();
?>
    <script type="text/javascript">
        wx.config({"debug":false,
            "beta":false,
            "appId":"<?php 
echo $jsbag['appId'];
?>
",
            "nonceStr":"<?php 
echo $jsbag['nonceStr'];
?>
",
            "timestamp":<?php 
echo $jsbag['timestamp'];
Example #26
0
 public function buyAction()
 {
     //微信分享
     $jssdk = new JSSDK("你的appId", "你的appSecret");
     $signPackage = $jssdk->GetSignPackage();
     $data['appId'] = $signPackage['appId'];
     $data['nonceStr'] = $signPackage['nonceStr'];
     $data['timestamp'] = $signPackage['timestamp'];
     $data['signature'] = $signPackage['signature'];
     $this->_redis->set('token', json_encode($data));
     $diypicture = $this->_session->get('diypicture');
     $userShare = $this->_req->getQuery('userShare', 0);
     $this->getView()->assign("data", $diypicture);
     $this->getView()->assign("token", json_encode($data));
     $this->getView()->assign("userShare", $userShare);
     $this->getView()->display('index/buy.html');
 }
Example #27
0
 private function initPublic()
 {
     $token = get_token();
     if (!$token || $token == -1) {
         return false;
     }
     $info = get_token_appinfo($token);
     if (!$info) {
         return false;
     }
     // 设置公众号管理者信息
     if ($info['uid']) {
         $manager_id = $info['uid'];
         session('manager_id', $manager_id);
     }
     $manager = get_userinfo($manager_id);
     // 设置版权信息
     $this->assign('system_copy_right', empty($manager['copy_right']) ? C('COPYRIGHT') : $manager['copy_right']);
     $tongji_code = empty($manager['tongji_code']) ? C('TONGJI_CODE') : $manager['tongji_code'];
     $param = $_GET;
     $param['publicid'] = $info['id'];
     $param['m'] = MODULE_NAME;
     $param['c'] = CONTROLLER_NAME;
     $param['a'] = ACTION_NAME;
     $param['uid'] = intval(session('mid'));
     $tongji_code .= '<script>$.post("' . SITE_URL . '/log.php?' . http_build_query($param) . '");</script>';
     $this->assign('tongji_code', $tongji_code);
     // 公众号接口权限
     $config = S('PUBLIC_AUTH_' . $info['type']);
     if (!$config) {
         $config = M('public_auth')->getField('name,type_' . intval($info['type']) . ' as val');
         S('PUBLIC_AUTH_' . $info['type'], $config, 86400);
     }
     C($config);
     // 公众号接口权限
     // 初始化微信JSAPI需要的参数
     Vendor('jssdk.jssdk');
     $jssdk = new \JSSDK($info['appid'], $info['secret']);
     $jsapiParams = $jssdk->GetSignPackage();
     $this->assign('jsapiParams', $jsapiParams);
     $this->assign('page_title', $info['public_name']);
     // 用公众号名作为默认的页面标题
     $this->assign('public_info', $info);
     // 通用公众号信息
     return $info;
 }
 /**
  * 好产品手机报名页面
  */
 public function actionGindex()
 {
     include_once "../../common/weixinjssdk/JSSDK.php";
     $jssdk = new \JSSDK("wx708acc93bd6ad1b0", "d05a63f65046e95d4d41dc7858aa9624");
     $signPackage = $jssdk->GetSignPackage();
     $this->layout = false;
     return $this->render('goodh5', ['signPackage' => $signPackage, 'goodproduct_city' => ActivityBase::GOODPRODUCT_CITY]);
 }
Example #29
0
<?php

/*
 * 74cms WAP
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
define('REQUEST_MOBILE', true);
require_once QISHI_ROOT_PATH . 'include/jssdk.php';
$jssdk = new JSSDK($_CFG['weixin_appid'], $_CFG['weixin_appsecret'], get_access_token());
$signPackage = $jssdk->GetSignPackage();
$smarty->assign("signPackage", $signPackage);
Example #30
0
function getJSSDKSignPackage()
{
    $js = new JSSDK('wx5510644a09934bfd', 'ffad1f7211b582beb538a091d00d2d33');
    return $js->getSignPackage();
}