wsq_join_validation.inc.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: install.php 34718 2014-07-14 08:56:39Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. if(!$_G['uid']) {
  12. showmessage('not_loggedin', NULL, array(), array('login' => 1));
  13. }
  14. $tid = intval($_GET['tid']);
  15. $seccode = intval($_GET['seccode']);
  16. $siteid = $_G['wechat']['setting']['wsq_siteid'];
  17. $items = DB::fetch_first("SELECT * FROM ".DB::table('xj_event')." WHERE tid=$tid");
  18. $thread = DB::fetch_first("SELECT * FROM ".DB::table('forum_thread')." WHERE tid=$tid");
  19. $setting = unserialize($items['setting']);
  20. //ÅжÏÊDz»ÊǹÜÀíÍŶÓ
  21. $event_admin = false;
  22. if($_G['username']){
  23. if(in_array($_G['username'],$setting['event_admin'])){
  24. $event_admin = true;
  25. }
  26. }
  27. if($thread['authorid'] != $_G['uid'] && $event_admin == false){
  28. showmessage('quickclear_noperm');
  29. }
  30. $apply = DB::fetch_first("SELECT * FROM ".DB::table('xj_eventapply')." WHERE seccode=$seccode");
  31. if(!$apply){
  32. showmessage('undefined_action');
  33. }
  34. $applyid = intval($_GET['applyid']);
  35. $thread = DB::fetch(DB::query("SELECT subject FROM ".DB::table('forum_thread')." WHERE tid = $tid"));
  36. if($_GET['action'] == 'use'){
  37. $result = array();
  38. require_once DISCUZ_ROOT.'./source/plugin/wechat/wechat.lib.class.php';
  39. if($apply['secstate']>0){
  40. $result['showmessage'] = $_G['charset']=='gbk'?iconv('GBK','UTF-8',lang('plugin/xj_event', 'rcjwxhysy')):lang('plugin/xj_event', 'rcjwxhysy');
  41. $result['tourl'] = WeChatHook::getPluginUrl('xj_event:wsq_join_validation', array('tid' => $tid,'seccode'=>$seccode));
  42. $result['full'] = 2;
  43. echo json_encode($result);
  44. exit;
  45. }
  46. DB::update("xj_eventapply",array('secstate'=>1),"seccode=$seccode");
  47. $result['showmessage'] = $_G['charset']=='gbk'?iconv('GBK','UTF-8',lang('plugin/xj_event', 'rcjsycg')):lang('plugin/xj_event', 'rcjsycg');
  48. $result['tourl'] = WeChatHook::getPluginUrl('xj_event:wsq_join_validation', array('tid' => $tid,'seccode'=>$seccode));
  49. $result['full'] = 1;
  50. echo json_encode($result);
  51. exit;
  52. }
  53. ?>
  54. <script type="text/javascript" src="http://wsq.discuz.com/cdn/discuz/js/openjs.js"></script>
  55. <script>
  56. var menu = new Array();
  57. WSQ.initBtmBar(menu);
  58. WSQ.showBtmBar();
  59. WSQ.initPlugin({name:'<?php echo lang('plugin/xj_event', 'rucjyz'); ?>'});
  60. </script>
  61. <style type="text/css">
  62. #container {margin:5px;}
  63. body {height:100%;}
  64. .input1{padding:14px; line-height:14px; width:100%;-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius:4px; border:1px solid #d8d8d8;}
  65. 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;}
  66. .selectdiv{margin-top:0px;outline:none;-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius:4px; border:1px solid #d8d8d8;position:relative;}
  67. .checkbox {
  68. width: 19px;
  69. height: 25px;
  70. padding: 0 5px 0 0;
  71. background: url(checkbox.png) no-repeat;
  72. display: block;
  73. float: left;
  74. }
  75. label{float:left; font-size:14px; line-height:30px;}
  76. </style>
  77. <script type="text/javascript" src="source/plugin/xj_event/js/jquery.js"></script>
  78. <script type="text/javascript">
  79. $(function(){
  80. $("#yzbtn").click(function(){
  81. $.ajax({
  82. type: 'POST',
  83. url: '<?php echo $_G['siteurl']; ?>plugin.php?id=xj_event:wsq_join_validation&tid=<?php echo $tid; ?>&seccode=<?php echo $seccode; ?>&action=use',
  84. //data: {level:'fff', roomnumber:'bbb'},
  85. data:$('#bmform').serialize(),
  86. dataType: 'json',
  87. cache: false,
  88. error: function(){
  89. alert('error');
  90. return false;
  91. },
  92. success:function(json){
  93. if(json.full == 2){
  94. alert(json.showmessage);
  95. if(json.tourl != null){
  96. top.location.href=json.tourl;
  97. }
  98. return false;
  99. }
  100. if(json.full == 1){
  101. alert(json.showmessage);
  102. if(json.tourl != null){
  103. top.location.href=json.tourl;
  104. }
  105. return true;
  106. }else{
  107. alert('error');
  108. return false;
  109. }
  110. }
  111. });
  112. });
  113. });
  114. </script>
  115. </head>
  116. <body>
  117. <div style="margin:20px 10px;">
  118. <div style=" border:1px solid #ccc; background-color:#fff; padding:15px;">
  119. <div style="font-weight:bold; line-height:28px;">
  120. <?php echo $thread['subject']; ?>
  121. </div>
  122. <div style="font-size:12px; line-height:24px; padding:10px 0px;">
  123. <div style="float:left; width:40%;"><?php echo lang('plugin/xj_event', 'chanci'); ?>:<?php echo $setting['session'][$apply['session']]; ?></div>
  124. <div style="float:right; width:40%; text-align:right;"><?php echo lang('plugin/xj_event', 'renshu'); ?>:<?php echo $apply['applynumber']; ?></div>
  125. </div>
  126. <div style="clear:both; height:10px;"></div>
  127. <div style="padding:20px; border-top:1px solid #aaa; text-align:center;">
  128. <span style="font-size:20px;font-family: Microsoft YaHei;"><?php echo lang('plugin/xj_event', 'yanzhenma'); ?>:<?php echo $apply['seccode']; ?></span>
  129. <?php if($apply['secstate']==0){ ?>
  130. <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>
  131. <?php }else{ ?>
  132. <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>
  133. <?php } ?>
  134. </div>
  135. <div style="font-size:12px; color:#999; line-height:18px;">
  136. <?php echo lang('plugin/xj_event', 'smhdzzzyzyhbm'); ?>
  137. </div>
  138. </div>
  139. </div>
  140. </body>
  141. </html>