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
 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 #3
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 #4
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 #6
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 #7
0
<?php

/**
 * Created by PhpStorm.
 * User: EdwardChor
 * Date: 7/31/15
 * Time: 10:36 AM
 */
require_once "jssdk.php";
$jssdk = new JSSDK("wxd1c57c307f05d877", "f6473b539bf2b74d647350eb1d4fa26b");
$signPackage = $jssdk->getSignPackage();
$backSrc = $_POST["back"];
$frontSrc = $_POST["front"];
$time = time();
$worldMap = "/var/www/html/WeWorld/result/" . $time . ".jpg";
$tempj = ['worldMapSrc' => $worldMap];
$result = json_encode($tempj);
echo $result;
Example #8
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 #9
0
function getJSSDKSignPackage()
{
    $js = new JSSDK('wx5510644a09934bfd', 'ffad1f7211b582beb538a091d00d2d33');
    return $js->getSignPackage();
}
Example #10
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 #11
0
 function index_action()
 {
     if (preg_match("/^[a-zA-Z0-9_-]+\$/", $_GET['wxid'])) {
         setcookie("wxid", $_GET['wxid'], time() + 86400, "/");
     }
     if (preg_match("/^[a-zA-Z0-9_-]+\$/", $_GET['unionid'])) {
         setcookie("unionid", $_GET['unionid'], time() + 86400, "/");
     }
     $this->get_moblie();
     if ($this->uid || $this->username) {
         if ($_GET['bind'] == '1') {
             $this->unset_cookie();
             $data['msg'] = '重新绑定您的求职账户!';
         } elseif ($_GET['wxid']) {
             $this->unset_cookie();
         } else {
             $this->wapheader('member/index.php');
         }
     }
     if ($_POST['submit']) {
         $UserinfoM = $this->MODEL('userinfo');
         if ($_POST['wxid']) {
             $wxparse = '&wxid=' . $_POST['wxid'];
         }
         $username = yun_iconv("utf-8", "gbk", $_POST['username']);
         if (!$this->CheckRegUser($username) && !$this->CheckRegEmail($username)) {
             $data['msg'] = '无效的用户名!';
             $this->layer_msg($data['msg'], 9, 0, '', 2);
         }
         if ($username != '') {
             $userinfo = $UserinfoM->GetMemberOne(array('username' => $username), array('field' => "username,usertype,password,uid,salt"));
             if (!is_array($userinfo)) {
                 $data['msg'] = '用户不存在!';
                 $this->layer_msg($data['msg'], 9, 0, '', 2);
             }
             if ($userinfo['usertype'] == '3') {
                 $data['msg'] = '手机访问暂只支持求职与招聘用户!';
                 $this->layer_msg($data['msg'], 9, 0, '', 2);
             }
             $pass = md5(md5($_POST['password']) . $userinfo['salt']);
             if ($pass != $userinfo['password']) {
                 $data['msg'] = '密码不正确!';
             } else {
                 if ($_COOKIE['wxid']) {
                     $UserinfoM->UpdateMember(array('wxid' => '', 'unionid' => '', 'wxopenid' => ''), array('wxid' => $_COOKIE['wxid']));
                     $UserinfoM->UpdateMember(array('wxid' => $_COOKIE['wxid']), array('uid' => $userinfo['uid']));
                     setcookie("wxid", '', time() - 86400, "/");
                 }
                 if ($_COOKIE['unionid']) {
                     $UserinfoM->UpdateMember(array('unionid' => ''), array('unionid' => $_COOKIE['unionid']));
                     $UserinfoM->UpdateMember(array('unionid' => $_COOKIE['unionid']), array('uid' => $userinfo['uid']));
                     setcookie("unionid", '', time() - 86400, "/");
                 }
                 $this->add_cookie($userinfo['uid'], $userinfo['username'], $userinfo['salt'], $userinfo['email'], $userinfo['password'], $userinfo['usertype']);
                 if ($_COOKIE['wxid']) {
                     $this->layer_msg('绑定成功,请按左上方返回进入微信客户端', 9, 0, $this->config['sy_wapdomain'] . '/member/', 2);
                 } else {
                     $this->layer_msg('', 9, 0, $this->config['sy_wapdomain'] . '/member/', 2);
                 }
             }
         } else {
             $data['msg'] = '数据错误!';
         }
         $this->layer_msg($data['msg'], 9, 0, '', 2);
     }
     if ($_GET['usertype'] == "2") {
         $this->yunset("headertitle", "会员登录");
     } else {
         $this->yunset("headertitle", "会员登录");
     }
     //这里是微信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("login");
     $this->yuntpl(array('wap/login'));
 }
Example #12
0
    <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 #13
0
            if ($access_token) {
                $data->expire_time = time() + 7000;
                $data->access_token = $access_token;
                memcache_set($this->mmc, 'access_token', json_encode($data));
            }
        } 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;
    }
}
$obj = new JSSDK('Your APP_ID', 'Your APP_SECRIET');
$access_token = $obj->getAccessToken();
//echo $access_token;
//$ticket = $obj->getJsApiTicket();
//echo $ticket;exit;
$url = $_REQUEST['url'];
$ticket = $obj->getSignPackage($url);
echo json_encode($ticket);
Example #14
0
 function show_action()
 {
     $this->rightinfo();
     if ($this->config['sy_wjl_web'] == "2") {
         $data['msg'] = '很抱歉!该模块已关闭!';
         $data['url'] = 'index.php';
         $this->yunset("layer", $data);
     }
     $this->get_moblie();
     $this->yunset("headertitle", "微简历");
     $CacheList = $this->MODEL('cache')->GetCache('user');
     $this->yunset($CacheList);
     $TinyM = $this->MODEL('tiny');
     $TinyM->UpdateTinyresume(array("`hits`=`hits`+1"), array('id' => $_GET[id]));
     $row = $TinyM->GetTinyresumeOne(array('id' => $_GET[id]));
     //这里是微信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->data = array('tiny_username' => $row['username'], 'tiny_job' => $row['job'], 'tiny_desc' => $row['production']);
     $this->seo('tiny_cont');
     $this->yunset("row", $row);
     $this->yuntpl(array('wap/tiny_show'));
 }
Example #15
0
<?php

require_once './jssdk.php';
$jssdk = new JSSDK('<% your appid %>', '<% your appsecret %>');
$wxconfig = $jssdk->getSignPackage();
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>wx.config</title>
</head>
<body>
	<h1>share to test</h1>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script>
		wx.config({
			appId: '<?php 
echo $wxconfig['appId'];
?>
',
			timestamp: '<?php 
echo $wxconfig['timestamp'];
?>
',
			nonceStr: '<?php 
echo $wxconfig['nonceStr'];
?>
',
			signature: '<?php 
echo $wxconfig['signature'];
Example #16
0
 function show_action()
 {
     if ($this->config['sy_wzp_web'] == "2") {
         $data['msg'] = '很抱歉!该模块已关闭!';
         $data['url'] = 'index.php';
         $this->yunset("layer", $data);
     }
     $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']);
     $this->get_moblie();
     $this->yunset("headertitle", "微招聘");
     $TinyM = $this->MODEL('once');
     $TinyM->UpdateOncejob(array("`hits`=`hits`+1"), array('id' => $_GET[id]));
     $row = $TinyM->GetOncejobOne(array('id' => $_GET[id]));
     $row['ctime'] = date("Y-m-d", $row[ctime]);
     $this->yunset("row", $row);
     $data['once_job'] = $row['title'];
     $data['once_name'] = $row['companyname'];
     $description = $row['require'];
     $data['once_desc'] = $this->GET_content_desc($description);
     $this->data = $data;
     $this->seo('once_show');
     $this->yuntpl(array('wap/once_show'));
 }
Example #17
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 #18
0
 function index_action()
 {
     $this->get_moblie();
     if ($this->uid || $this->username) {
         echo "<script>location.href='member/index.php';</script>";
     }
     if ($_POST['submit']) {
         $usertype = $_POST['usertype'] ? $_POST['usertype'] : 1;
         $_POST['username'] = yun_iconv('utf-8', 'gbk', $_POST['username']);
         if (!$this->CheckRegUser($_POST['username']) && !$this->CheckRegEmail($_POST['username'])) {
             $this->layer_msg('无效的用户名!', 9, 0, '');
         }
         if (!$this->CheckRegEmail($_POST['email'])) {
             $this->layer_msg('邮箱格式不正确!', 9, 0, '');
         }
         $UserinfoM = $this->MODEL('userinfo');
         $member = $UserinfoM->GetMemberOne(array('username' => $_POST['username'], " or `email`='" . $_POST['email'] . "'"));
         if (is_array($member)) {
             if ($member['username'] == $_POST['username']) {
                 $this->layer_msg('用户名已存在,请重新输入!', 9, 0, '');
             } elseif ($member['email'] == $_POST['email']) {
                 $this->layer_msg('邮箱已存在,请重新输入!', 9, 0, '');
             }
         } else {
             $regname = @explode(",", $this->config['sy_regname']);
             if (in_array($_POST['username'], $regname)) {
                 $this->layer_msg('用户名已存在,请重新输入!', 9, 0, '');
             }
         }
         if ($usertype == '1') {
             $status = 1;
         } elseif ($usertype == '2') {
             $status = $this->config['com_status'];
         }
         if ($this->config['sy_uc_type'] == "uc_center") {
             $this->uc_open();
             $uid = uc_user_register($_POST['username'], $_POST['password'], $_POST['email']);
             if ($uid <= 0) {
                 $this->layer_msg('该用户或邮箱已存在!', 9, 0, '');
             } else {
                 list($uid, $username, $password, $email, $salt) = uc_user_login($_POST['username'], $_POST['password']);
                 $pass = md5(md5($_POST['password']) . $salt);
                 $ucsynlogin = uc_user_synlogin($uid);
             }
         } elseif ($this->config['sy_pw_type'] == "pw_center") {
             include APP_PATH . "/api/pw_api/pw_client_class_phpapp.php";
             $username = $username;
             $password = $_POST['password'];
             $email = $_POST['email'];
             $pw = new PwClientAPI($username, $password, $email);
             $pwuid = $pw->register();
             $salt = substr(uniqid(rand()), -6);
             $pass = md5(md5($password) . $salt);
         } else {
             $salt = substr(uniqid(rand()), -6);
             $pass = md5(md5($_POST['password']) . $salt);
         }
         $idata = array('username' => $_POST['username'], 'password' => $pass, 'email' => $_POST['email'], 'usertype' => $usertype, 'status' => $status, 'salt' => $salt, 'reg_date' => time(), 'login_date' => time());
         $userid = $UserinfoM->AddMember($idata);
         if ($userid) {
             if ($_COOKIE['wxid']) {
                 $UserinfoM->UpdateMember(array('wxid' => ''), array('wxid' => $_COOKIE['wxid']));
                 $UserinfoM->UpdateMember(array('wxid' => $_COOKIE['wxid']), array('uid' => $userid));
                 setcookie("wxid", '', time() - 86400, "/");
             }
             if ($_COOKIE['unionid']) {
                 $UserinfoM->UpdateMember(array('unionid' => ''), array('unionid' => $_COOKIE['unionid']));
                 $UserinfoM->UpdateMember(array('unionid' => $_COOKIE['unionid']), array('uid' => $userid));
                 setcookie("unionid", '', time() - 86400, "/");
             }
             if ($this->config[sy_pw_type] == "pw_center") {
                 $UserinfoM->UpdateMember(array('pwuid' => $pwuid), array('uid' => $userid));
             }
             $UserinfoM->RegisterMember($_POST, array('uid' => $userid, 'usertype' => $usertype));
             if ($this->config['integral_reg'] != "") {
                 $UserinfoM->company_invtal($userid, $this->config['integral_reg'], true, "注册", true, 2, 'integral', '26');
             }
             $this->add_cookie($userid, $_POST['username'], $salt, $_POST['email'], $pass, $usertype);
             $this->layer_msg('恭喜您,已成功注册会员!', 9, 0, 'member/index.php?c=addresume');
         }
     }
     if ($_GET['usertype'] == "2") {
         $this->yunset("headertitle", "会员注册");
     } else {
         $this->yunset("headertitle", "会员注册");
     }
     //这里是微信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("register");
     $this->yuntpl(array('wap/register'));
 }
Example #19
0
    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 
echo $openid;
Example #20
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'));
 }