예제 #1
0
 public function doMobileplay()
 {
     global $_W, $_GPC;
     $weixin = new jssdk();
     $wx = $weixin->getSign();
     $serverid = $_GPC['serverId'];
     $date = $_GPC['date'];
     $recordtime = $_GPC['recordtime'];
     $qr = $_W['attachurl'] . '/qrcode_' . $account['acid'] . '.jpg';
     include $this->template('play');
 }
예제 #2
0
파일: site.php 프로젝트: aspnmy/weizan
 public function doMobilelogpost()
 {
     global $_W, $_GPC;
     $this->Checkedservername();
     $this->Checkeduseragent();
     $rid = $_GPC['rid'];
     $sql = "SELECT * FROM " . tablename(xhw_voice_setting) . " WHERE weid = '{$_W['uniacid']}'";
     $arr = pdo_fetch($sql);
     $openidpass = $arr['openidpass'];
     if (empty($_GPC['code']) && $openidpass) {
         require_once IA_ROOT . "/addons/xhw_voice/jssdk.class.php";
         $weixin = new jssdk($jie = '0', $url = '');
         $wx = $weixin->get_sign();
         $weixin->get_code($_W['siteurl']);
     }
     if ($openidpass) {
         $followpass = $arr['followpass'];
         $code = $_GPC['code'];
         if ($code) {
             require_once IA_ROOT . "/addons/xhw_voice/jssdk.class.php";
             $weixin = new jssdk($jie = '0', $url = '');
             $wx = $weixin->get_sign();
             $data = $weixin->get_openid($code);
             $openid = $data['openid'];
             if ($followpass != '1') {
                 $sql = "SELECT * FROM " . tablename(mc_mapping_fans) . " WHERE openid = '{$openid}'";
                 $arr = pdo_fetch($sql);
                 if ($arr['follow'] != '1') {
                     echo "<script>alert('请仔细阅读活动说明');location.href='" . $follow_url . "';</script>";
                     die;
                 }
             }
         }
         if (empty($openid)) {
             $this->doCheckedMobile($rid);
         }
     } else {
         $this->doCheckedMobile($rid);
         $openid = $_W['fans']['from_user'];
     }
     $id = $_GPC['id'];
     $openid = $_W['fans']['from_user'];
     $sql = "SELECT * FROM " . tablename(xhw_voice) . " WHERE weid = '{$_W['uniacid']}' AND id = '{$rid}'";
     $arr = pdo_fetchall($sql);
     $mynum = $arr['0']['mynum'];
     $day = $arr['0']['day'];
     $follow_url = $arr['0']['follow_url'];
     $url = $this->createmobileUrl('item', array('do' => 'item', 'id' => $id));
     if ($arr['0']['starttime'] - time() > 0) {
         echo "<script>alert('活动还未开始!');location.href='{$follow_url}';</script>";
         die;
     } elseif ($arr['0']['endtime'] - time() < 0) {
         echo "<script>alert('活动已经结束!');location.href='{$url}';</script>";
         die;
     }
     $today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
     if ($day) {
         $today = 1;
     }
     $tomorrow = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y'));
     $sql = "SELECT COUNT(*) FROM " . tablename(xhw_voice_log) . " WHERE openid = '{$openid}' AND rid = '{$rid}' AND numid = '{$id}' AND time > " . $today;
     //查询是否有投票记录
     if (pdo_fetchcolumn($sql)) {
         if ($day) {
             echo "<script>alert('您已经投过了,只能为同一个投票一次!');location.href='{$url}';</script>";
             //不可重复投票限制
             die;
         }
         echo "<script>alert('您已经投过啦,每天可投一次,明天再来吧!');location.href='{$url}';</script>";
         die;
     }
     $mylognum = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('xhw_voice_log') . " WHERE openid = '{$openid}' AND rid = '{$rid}' AND time > " . $today . ' AND time < ' . $tomorrow);
     if ($mynum == "0") {
         $mynum = "100000";
     }
     if ($mylognum >= $mynum) {
         echo "<script>alert('您今天已达投票上限,明天再来吧!');location.href='{$url}';</script>";
         die;
     } else {
         $data = array('rid' => $rid, 'openid' => $openid, 'numid' => $id, 'ip' => $_W['clientip'], 'time' => time());
         $arr = pdo_fetchall("SELECT * FROM " . tablename(xhw_voice_reg) . " WHERE id = '{$id}' AND pass = '******'");
         if (empty($arr)) {
             echo "<script>alert('还未审核通过,禁止投票!');location.href='{$url}';</script>";
             die;
         }
         pdo_insert(xhw_voice_log, $data);
         $num = intval($arr[0]['num']);
         $num = $num + 1;
         $data = array('num' => $num);
         pdo_update('xhw_voice_reg', $data, array('id' => $id));
         echo "<script>alert('投票成功,感谢您的支持!');location.href='{$url}';</script>";
         die;
     }
     include $this->template('item');
 }
예제 #3
0
파일: site.php 프로젝트: eduNeusoft/weixin
 public function doMobilereg()
 {
     global $_W, $_GPC;
     $this->Checkedservername();
     $this->Checkeduseragent();
     $weid = $_W['uniacid'];
     $id = $_GPC['id'];
     require_once IA_ROOT . "/addons/xhw_picvote/jssdk.class.php";
     $weixin = new jssdk($jie = '0', $url = '');
     $wx = $weixin->get_sign();
     $sql = "SELECT * FROM " . tablename(xhw_picvote_setting) . " WHERE weid = '{$_W['uniacid']}'";
     $arr = pdo_fetch($sql);
     $openidpass = $arr['openidpass'];
     if (empty($_GPC['code']) && $openidpass) {
         $weixin->get_code($_W['siteurl']);
     }
     if ($openidpass) {
         $followpass = $arr['followpass'];
         $code = $_GPC['code'];
         if ($code) {
             $data = $weixin->get_openid($code);
             $openid = $data['openid'];
             if ($followpass != '1') {
                 $sql = "SELECT * FROM " . tablename(mc_mapping_fans) . " WHERE openid = '{$openid}'";
                 $arr = pdo_fetch($sql);
                 if ($arr['follow'] != '1') {
                     $this->doCheckedMobile($id);
                     die;
                 }
             }
         }
         if (empty($openid)) {
             $this->doCheckedMobile($id);
         }
     } else {
         $this->doCheckedMobile($id);
         $openid = $_W['fans']['from_user'];
     }
     $sql = "SELECT * FROM " . tablename('xhw_picvote_reg') . " WHERE `rid` = '{$id}' AND `openid` = '{$openid}' AND weid = '{$weid}'";
     $arr = pdo_fetchall($sql);
     if ($arr) {
         $phone = $arr[0]['phone'];
         $nickname = $arr[0]['nickname'];
     } else {
         $list = pdo_fetch("SELECT b.mobile,b.nickname,b.realname FROM " . tablename('mc_mapping_fans') . " a, " . tablename('mc_members') . " b WHERE a.openid = '{$openid}' AND a.uid=b.uid");
         $phone = $list['mobile'];
         $nickname = $list['realname'];
     }
     $title = $arr[0]['title'];
     $img = explode("|", $arr[0]['img']);
     $sql = "SELECT * FROM " . tablename(xhw_picvote) . " WHERE weid = '{$_W['uniacid']}' AND id = '{$id}'";
     $arr = pdo_fetchall($sql);
     $submit_url = $arr['0']['submit_url'];
     include $this->template('reg');
 }
예제 #4
0
  var phoneScale = phoneWidth / 640;
  var ua = navigator.userAgent;
  if (/Android (\d+\.\d+)/.test(ua)) {
      var version = parseFloat(RegExp.$1);
      if (version > 2.3) {
          document.write('<meta name="viewport" content="width=640, minimum-scale = '+phoneScale+', maximum-scale = '+phoneScale+', target-densitydpi=device-dpi">');
      } else {
          document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
      }
  } else {
      document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
  }
  </script>
  <?php 
require_once 'js.php';
$jssdk = new jssdk();
?>
<script type="text/javascript">
    wx.config({
        debug: false,// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
        appId: 'wxff2dca758220e172',// 必填,公众号的唯一标识
        timestamp:"<?php 
echo $jssdk->timestamp;
?>
",// 必填,生成签名的时间戳
        nonceStr: "<?php 
echo $jssdk->nonceStr;
?>
",// 必填,生成签名的随机串
        signature: "<?php 
echo $jssdk->get_signature();
예제 #5
0
'>下 一 页</a>
					<?php 
    }
    ?>
					<?php 
}
?>
				</div>

	
</section>	 


    <?php 
require_once IA_ROOT . "/addons/xhw_picvote/jssdk.class.php";
$weixin = new jssdk($jie = '0', $url = '');
$wx = $weixin->get_sign();
?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>  
<script type="text/javascript">
  wx.config({
      appId: "<?php 
echo $wx['appId'];
?>
",
      timestamp: <?php 
echo $wx['timestamp'];
?>
,
      nonceStr: "<?php 
echo $wx['nonceStr'];
 public function run()
 {
     $jssdk = new jssdk($this->appid, $this->appsecret);
     $this->wxJsSign = $jssdk->GetSignPackage();
     $this->render('wxjs');
 }