<?php
defined('IN_IA') or exit('Access Denied');
require_once '../framework/library/qrcode/phpqrcode.php';
define('ROOT_PATH', str_replace('site.php', '', str_replace('\\', '/', __FILE__)));
require_once ROOT_PATH."getip/IP.class.php";
require_once "jssdk.php";
class haoman_bingoModuleSite extends WeModuleSite {
public function getip($a,$i,$rid){
global $_GPC, $_W;
$fansip = $_W['clientip'];
$allowip = explode(",",$a);
$isallowip = $i;
$fansip = IP::find($fansip);
switch($isallowip){
case 1:
if(!in_array($fansip[2],$allowip)){
header("HTTP/1.1 301 Moved Permanently");
header("Location: {$this->createMobileUrl('other',array('id'=>$rid,'type'=>2))}");
exit();
}
break;
case 2:
if(in_array($fansip[2],$allowip)){
header("HTTP/1.1 301 Moved Permanently");
header("Location: {$this->createMobileUrl('other',array('id'=>$rid,'type'=>2))}");
exit();
}
break;
default:
}
}
//非微信打开和限制IP地打开
public function doMobileother(){
global $_W,$_GPC;
$rid = intval($_GPC['id']);
$type = $_GPC['type'];
$uniacid = $_W['uniacid'];
if (empty($rid)) {
message('抱歉,参数错误!!', '', 'error');//调试代码
}
if (empty($from_user)) {
// $this->message(array("status" => 2, "msg" => '获取不到您的OpenID,请从新进入活动页面'), "");
}
$reply = pdo_fetch("select * from " . tablename('haoman_bingo_reply') . " where rid = :rid order by `id` desc", array(':rid' => $rid));
$rule_keyword = pdo_fetch("select * from " . tablename('rule_keyword') . " where rid = :rid and uniacid=:uniacid", array(':rid' => $rid, ':uniacid' => $_W['uniacid']));
$key_word = $rule_keyword['content'];
$send_name = $this->substr_cut($_W['account']['name'],30);
include $this->template('other');
}
public function doMobileappkey(){
global $_GPC, $_W;
$rid = intval($_GPC['id']);
$latitude = $_GPC['lat'];
$longitude = $_GPC['lon'];
$appkey = $_GPC['appkey'];
$reply = pdo_fetch("select * from " . tablename('haoman_bingo_reply') . " where rid = :rid order by `id` desc", array(':rid' => $rid));
// $this->message(array("success" => 1, "msg" => "432434234"), "");
if (empty($latitude) || empty($longitude)) {
$data = array(
'success' => 100,
'msg' => "获取位置失败",
);
//$this->message('位置获取失败');
}
$url = "http://api.map.baidu.com/geocoder/v2/?ak=" . $reply['bd_key'] . "&location=" . $latitude . "," . $longitude . "&output=json&pois=0";
load()->func('communication');
$response = ihttp_get($url);
if (!is_error($response)) {
$data = @json_decode($response['content'], true);
if (empty($data) || $data['status'] != 0) {
// $this->message('位置获取失败:' . $data['message'] . '(' . $data['status'] . ')');
$data = array(
'success' => 100,
'msg' => "获取位置失败",
);
} else {
$data = $data['result'];
$address = '';
if (!empty($data['addressComponent'])) {
$address = $data['addressComponent'];
}
if (empty($address['city'])) {
$data = array(
'success' => 100,
'msg' => "获取位置失败",
);
} else {
foreach ($address as $key => $value) {
if ($key == 'province') {
$province = $value;
}
if ($key == 'city') {
$city = $value;
// $city = str_replace("市", "", $city);
}
if ($key == 'district') {
$district = $value;
}
}
}
$address = $province . $city . $district;
$add_sf = explode(',',$reply['address_sf']);
$add_sq = explode(',',$reply['address_sq']);
$add_qx = explode(',',$reply['address_qx']);
$result = in_array($province, $add_sf);
$result1 = in_array($city, $add_sq);
$result2 = in_array($district, $add_qx);
if($result){
$data = array(
'success' => 1,
'msg' => '可参加活动',
);
}
elseif($result1){
$data = array(
'success' => 1,
'msg' => '可参加活动',
);
}
elseif($result2){
$data = array(
'success' => 1,
'msg' => '可参加活动',
);
}
else{
$data = array(
'success' => 100,
'msg' => '您不在允许参加的活动范围内!',
);
}
//$this->returnSuccess('城市定位成功', $address);
}
} else {
$data = array(
'success' => 100,
'msg' => '位置获取失败,请重试',
);
// $this->returnError('位置获取失败,请重试');
}
echo json_encode($data);
}
public function doMobilegetlbs(){
global $_GPC, $_W;
//$id = intval($_GPC['id']);
$lat1 = $_GPC['lat'];
$lon1 = $_GPC['lon'];
$allowlbsip = explode("|",$_GPC['lbsip']);
$lat2 = $allowlbsip[0];
$lon2 = $allowlbsip[1];
$dis = intval($allowlbsip[3]);
$res = intval($this->getDistance($lat1,$lon1,$lat2,$lon2));
if ($res <= $dis) {
$data = array(
'success' => 1,
'msg' => '您可以正常参加活动!',
);
} else {
$data = array(
'success' => 100,
'msg' => '您不在允许参加的活动范围内!',
);
}
echo json_encode($data);
}
//根据经纬度计算距离 其中A($lat1,$lng1)、B($lat2,$lng2)
public function getDistance($lat1,$lng1,$lat2,$lng2) {
//地球半径
$R = 6378137;
//将角度转为狐度
$radLat1 = deg2rad($lat1);
$radLat2 = deg2rad($lat2);
$radLng1 = deg2rad($lng1);
$radLng2 = deg2rad($lng2);
//结果
$s = acos(cos($radLat1)*cos($radLat2)*cos($radLng1-$radLng2)+sin($radLat1)*sin($radLat2))*$R;
// $s = 2*asin(sqrt(pow(sin(($radLat1-$radLat2)/2),2)+cos($radLat1)*cos($radLat2)*pow(sin(($radLng1-$radLng2)/2),2)))*$R;
//精度
$s = round($s* 10000)/10000;
return round($s);
}
//打开大屏幕
public function doMobileshowdpm() {
global $_GPC, $_W;
$rid = intval($_GPC['id']);
$uniacid = $_W['uniacid'];
$reply = pdo_fetch("select * from " . tablename('haoman_bingo_reply') . " where rid = :rid order by `id` desc", array(':rid' => $rid));
$status = pdo_fetch("select * from " . tablename('haoman_bingo_status') . " where rid = :rid limit 1", array(':rid' => $rid));
if ($reply == false) {
message('抱歉,活动已经结束,下次再来吧!', '', 'error');
}
if(empty($status)){
$insert = array(
'rid' => $rid,
'uniacid' => $_W['uniacid'],
'pici' => 1,
'status' => 0,
);
pdo_insert('haoman_bingo_status', $insert);
$status['status']=0;
$status['pici']=1;
}else{
if($status['pici']==0){
pdo_update('haoman_bingo_status', array('pici' => 1), array('id' => $status['id']));
$status['pici']=1;
}
// if($status['status']==1){
// pdo_update('haoman_bingo_status', array('status' => 0), array('id' => $status['id']));
// }
if($status['status']==2 || $status['status']==1){
pdo_update('haoman_bingo_status', array('status' => 0,'pici'=>$status['pici']+1), array('id' => $status['id']));
$status['pici']=$status['pici']+1;
}
}
$diffTime = empty($reply['daojishi']) ? 10 : intval($reply['daojishi']);
$DaojishiTime = empty($reply['gameTime']) ? 60 : intval($reply['gameTime']);
$rulesImg = empty($reply['rulesPicture']) ? '../addons/haoman_bingo/bingo/rules.png' : tomedia($reply['rulesPicture']);
$wrapBg = empty($reply['indexPicture']) ? '../addons/haoman_bingo/bingo/bg1.jpg' : tomedia($reply['indexPicture']);
$imgName = "haomanbingo".$_W['uniacid'].$rid;
$imgUrl = "../addons/haoman_bingo/qrcode/".$imgName.".png";
$QrPicture = empty($reply['QrPicture']) ? $imgUrl : tomedia($reply['QrPicture']);
include $this->template('dpm_binggo');
}
//获取最近参与人数
public function doMobileGetJoinedUser() {
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$rid = intval($_GPC['rid']);
$max_id = intval($_GPC['max_id']);
$pici = intval($_GPC['pici']);
$total = pdo_fetchcolumn("select count(id) from " . tablename('haoman_bingo_runni
没有合适的资源?快使用搜索试试~ 我知道了~
功能模块 Bingo大屏幕1.3.7源码
共113个文件
png:60个
html:21个
php:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 69 浏览量
2022-02-18
10:56:23
上传
评论
收藏 2.94MB ZIP 举报
温馨提示
功能模块 Bingo大屏幕1.3.7源码
资源推荐
资源详情
资源评论
收起资源包目录
功能模块 Bingo大屏幕1.3.7源码 (113个子文件)
game.css 23KB
game.css 23KB
style.css 4KB
style.css 4KB
17monipdb.dat 2.53MB
form.html 45KB
dpm_binggo.html 19KB
newmbinggo.html 15KB
mbinggo.html 12KB
hsetting.html 9KB
fanslist.html 7KB
cashprize.html 6KB
awardlist.html 5KB
bingoshow.html 5KB
information.html 4KB
bingodetails.html 4KB
manage.html 4KB
other.html 3KB
duijiang.html 3KB
hexiao.html 2KB
axq.html 2KB
axq2.html 1KB
jiequan.html 1KB
index.html 307B
index.html 307B
index.html 307B
ziliaotop.jpg 76KB
bg1.jpg 52KB
bg1.jpg 28KB
lottery-default.jpg 27KB
preview.jpg 7KB
icon.jpg 4KB
jquery-1.7.1.min.js 92KB
jquery-1.7.1.min.js 92KB
game.js 17KB
jquery.transit.min.js 7KB
tabControl.js 6KB
modernizr.custom.17774.js 3KB
bacmusic.mp3 576KB
fail.mp3 13KB
site.php 117KB
upgrade.php 46KB
install.php 11KB
module.php 8KB
jssdk.php 5KB
IP.class.php 3KB
license.php 1KB
uninstall.php 859B
processor.php 618B
code-bg3.png 76KB
btn1.png 70KB
pop2.png 66KB
txt2.png 62KB
rules.png 34KB
bord.png 27KB
pop1-shadow.png 23KB
footer.png 23KB
bord.png 21KB
pop1.png 17KB
btn2.png 14KB
code-bg.png 13KB
num-bg-o.png 10KB
num-bg-o.png 10KB
num-bg-b.png 9KB
num-bg-b.png 9KB
num-bg-g.png 9KB
num-bg-g.png 9KB
num-bg-n.png 9KB
num-bg-n.png 9KB
num-bg-i.png 9KB
num-bg-i.png 9KB
icn.png 8KB
icn.png 8KB
light10.png 6KB
light8.png 6KB
txt1.png 6KB
light3.png 6KB
o2.png 5KB
o2.png 5KB
num-bg5.png 4KB
n.png 4KB
n.png 4KB
g3.png 4KB
g3.png 4KB
b2.png 4KB
b2.png 4KB
btn1.png 4KB
i2.png 4KB
i2.png 4KB
btn2.png 4KB
p6.png 4KB
time-bg.png 3KB
light4.png 3KB
txt3.png 3KB
p2.png 3KB
num-bg1.png 3KB
num-bg2.png 3KB
fly1.png 3KB
p3.png 2KB
no1.png 2KB
共 113 条
- 1
- 2
资源评论
智慧浩海
- 粉丝: 1w+
- 资源: 5152
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功