123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?php
- /**
- * [Discuz!] (C)2001-2099 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- *
- * $Id: install.php 34718 2014-07-14 08:56:39Z nemohou $
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- if(!$_G['uid']) {
- showmessage('not_loggedin', NULL, array(), array('login' => 1));
- }
- $tid = intval($_GET['tid']);
- $seccode = intval($_GET['seccode']);
- $siteid = $_G['wechat']['setting']['wsq_siteid'];
- $items = DB::fetch_first("SELECT * FROM ".DB::table('xj_event')." WHERE tid=$tid");
- $thread = DB::fetch_first("SELECT * FROM ".DB::table('forum_thread')." WHERE tid=$tid");
- $setting = unserialize($items['setting']);
- //ÅжÏÊDz»ÊǹÜÀíÍŶÓ
- $event_admin = false;
- if($_G['username']){
- if(in_array($_G['username'],$setting['event_admin'])){
- $event_admin = true;
- }
- }
- if($thread['authorid'] != $_G['uid'] && $event_admin == false){
- showmessage('quickclear_noperm');
- }
- $apply = DB::fetch_first("SELECT * FROM ".DB::table('xj_eventapply')." WHERE seccode=$seccode");
- if(!$apply){
- showmessage('undefined_action');
- }
- $applyid = intval($_GET['applyid']);
- $thread = DB::fetch(DB::query("SELECT subject FROM ".DB::table('forum_thread')." WHERE tid = $tid"));
- if($_GET['action'] == 'use'){
- $result = array();
- require_once DISCUZ_ROOT.'./source/plugin/wechat/wechat.lib.class.php';
-
- if($apply['secstate']>0){
- $result['showmessage'] = $_G['charset']=='gbk'?iconv('GBK','UTF-8',lang('plugin/xj_event', 'rcjwxhysy')):lang('plugin/xj_event', 'rcjwxhysy');
- $result['tourl'] = WeChatHook::getPluginUrl('xj_event:wsq_join_validation', array('tid' => $tid,'seccode'=>$seccode));
- $result['full'] = 2;
- echo json_encode($result);
- exit;
- }
- DB::update("xj_eventapply",array('secstate'=>1),"seccode=$seccode");
- $result['showmessage'] = $_G['charset']=='gbk'?iconv('GBK','UTF-8',lang('plugin/xj_event', 'rcjsycg')):lang('plugin/xj_event', 'rcjsycg');
- $result['tourl'] = WeChatHook::getPluginUrl('xj_event:wsq_join_validation', array('tid' => $tid,'seccode'=>$seccode));
- $result['full'] = 1;
- echo json_encode($result);
- exit;
- }
- ?>
- <script type="text/javascript" src="http://wsq.discuz.com/cdn/discuz/js/openjs.js"></script>
- <script>
- var menu = new Array();
- WSQ.initBtmBar(menu);
- WSQ.showBtmBar();
- WSQ.initPlugin({name:'<?php echo lang('plugin/xj_event', 'rucjyz'); ?>'});
- </script>
-
-
- <style type="text/css">
- #container {margin:5px;}
- body {height:100%;}
- .input1{padding:14px; line-height:14px; width:100%;-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius:4px; border:1px solid #d8d8d8;}
- select{height:42px;-webkit-appearance:none;appearance:none;border:none;font-size:14px;padding:0px 10px;display:block;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color: #FFFFFF;color:#aaa;border-radius:4px;}
- .selectdiv{margin-top:0px;outline:none;-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius:4px; border:1px solid #d8d8d8;position:relative;}
- .checkbox {
- width: 19px;
- height: 25px;
- padding: 0 5px 0 0;
- background: url(checkbox.png) no-repeat;
- display: block;
- float: left;
- }
- label{float:left; font-size:14px; line-height:30px;}
- </style>
- <script type="text/javascript" src="source/plugin/xj_event/js/jquery.js"></script>
- <script type="text/javascript">
- $(function(){
- $("#yzbtn").click(function(){
- $.ajax({
- type: 'POST',
- url: '<?php echo $_G['siteurl']; ?>plugin.php?id=xj_event:wsq_join_validation&tid=<?php echo $tid; ?>&seccode=<?php echo $seccode; ?>&action=use',
- //data: {level:'fff', roomnumber:'bbb'},
- data:$('#bmform').serialize(),
- dataType: 'json',
- cache: false,
- error: function(){
- alert('error');
- return false;
- },
- success:function(json){
- if(json.full == 2){
- alert(json.showmessage);
- if(json.tourl != null){
- top.location.href=json.tourl;
- }
- return false;
- }
- if(json.full == 1){
- alert(json.showmessage);
- if(json.tourl != null){
- top.location.href=json.tourl;
- }
- return true;
- }else{
- alert('error');
- return false;
- }
- }
- });
- });
- });
- </script>
- </head>
- <body>
- <div style="margin:20px 10px;">
- <div style=" border:1px solid #ccc; background-color:#fff; padding:15px;">
- <div style="font-weight:bold; line-height:28px;">
- <?php echo $thread['subject']; ?>
- </div>
- <div style="font-size:12px; line-height:24px; padding:10px 0px;">
- <div style="float:left; width:40%;"><?php echo lang('plugin/xj_event', 'chanci'); ?>:<?php echo $setting['session'][$apply['session']]; ?></div>
- <div style="float:right; width:40%; text-align:right;"><?php echo lang('plugin/xj_event', 'renshu'); ?>:<?php echo $apply['applynumber']; ?></div>
- </div>
- <div style="clear:both; height:10px;"></div>
- <div style="padding:20px; border-top:1px solid #aaa; text-align:center;">
- <span style="font-size:20px;font-family: Microsoft YaHei;"><?php echo lang('plugin/xj_event', 'yanzhenma'); ?>:<?php echo $apply['seccode']; ?></span>
- <?php if($apply['secstate']==0){ ?>
- <a href="javascript:" id="yzbtn" style="line-height:35px; height:35px; display:block; background-color:#448fc8; margin:30px;-moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px; color:#FFF; font-size:14px;"><?php echo lang('plugin/xj_event', 'qdsyrcj'); ?></a>
- <?php }else{ ?>
- <a href="javascript:" style="line-height:35px; height:35px; display:block; background-color:#aaa; margin:30px;-moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius:3px; color:#FFF; font-size:14px;"><?php echo lang('plugin/xj_event', 'rcjyjsy'); ?></a>
- <?php } ?>
- </div>
- <div style="font-size:12px; color:#999; line-height:18px;">
- <?php echo lang('plugin/xj_event', 'smhdzzzyzyhbm'); ?>
- </div>
- </div>
-
- </div>
- </body>
- </html>
|