3_xj_event_event_join_modify.tpl.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <?php if(!defined('IN_DISCUZ')) exit('Access Denied'); ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  6. <title>我��加</title>
  7. <link href="source/plugin/xj_event/ui/jquery-ui.css" rel="stylesheet">
  8. <style>
  9. body{ font-size:12px; padding:0px 10px;font-family: "Microsoft YaHei" ! important;}
  10. #dialog label, #dialog input { display:block; }
  11. #dialog label { margin-top: 0.5em; }
  12. #dialog input, #dialog textarea { width: 95%; }
  13. #tabs { margin-top: 1em; }
  14. #tabs li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; }
  15. #add_tab { cursor: pointer; }
  16. </style>
  17. <script src="source/plugin/xj_event/ui/jquery.1.10.2.js" type="text/javascript"></script>
  18. <script src="source/plugin/xj_event/ui/jquery-ui.js" type="text/javascript"></script>
  19. <script src="source/plugin/xj_event/module/wsqcenter/js/jquery.form.js" type="text/javascript"></script>
  20. <script>
  21. $(function() {
  22. var event_number_max = <?php echo $items['event_number_max'];?>;
  23. var tabCounter = <?php echo $tabCounter;?>,weinum = <?php echo $tabCounter;?>,
  24. tabTemplate = "<li><a href='#<?php echo href;?>'>#<?php echo label;?></a> </li>";
  25. var tabs = $( "#tabs" ).tabs();
  26. $("#button").button().click(function(event) {
  27. if(weinum<=event_number_max){
  28. addTab();
  29. }
  30. });
  31. tabs.delegate( "span.ui-icon-close", "click", function() {
  32. var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" );
  33. $( "#" + panelId ).remove();
  34. tabs.tabs( "refresh" );
  35. //Ë¢ÐÂÒ»ÏÂλÊý
  36. weinum = 1;
  37. $('#tabs ul li').each(function(index) {
  38. $(this).children("a").html('第'+weinum+'�');
  39. weinum++;
  40. });
  41. });
  42. //µØÇøÑ¡Ôñ
  43. var residecity;
  44. $(".residecity").button();
  45. $("body").on("click",".residecity", function () {
  46. residecity = $(this);
  47. $.ajax({
  48. cache: false,
  49. type: "POST",
  50. url: 'plugin.php?id=xj_event:city&level=1',
  51. dataType: 'html',
  52. async: true,
  53. error: function(request) {
  54. alert("Connection error");
  55. },
  56. success: function(html) {
  57. residecity.hide();
  58. residecity.next().html(html);
  59. }
  60. });
  61. });
  62. $("body").on("change","#province",function(){
  63. var province = $(this).val();
  64. $.ajax({
  65. cache: false,
  66. type: "POST",
  67. url: 'plugin.php?id=xj_event:city&level=2&province='+province,
  68. dataType: 'html',
  69. async: true,
  70. error: function(request) {
  71. alert("Connection error");
  72. },
  73. success: function(html) {
  74. residecity.next().html(html);
  75. }
  76. });
  77. // alert($(this).find("option:selected").text());
  78. });
  79. $("body").on("change","#city",function(){
  80. var city = $(this).val();
  81. var province = $("#province").val();
  82. $.ajax({
  83. cache: false,
  84. type: "POST",
  85. url: 'plugin.php?id=xj_event:city&level=2&province='+province+'&city='+city,
  86. dataType: 'html',
  87. async: true,
  88. error: function(request) {
  89. alert("Connection error");
  90. },
  91. success: function(html) {
  92. residecity.next().html(html);
  93. }
  94. });
  95. });
  96. $("body").on("change","#county",function(){
  97. var county = $(this).val();
  98. var province = $("#province").val();
  99. var city = $("#city").val();
  100. $.ajax({
  101. cache: false,
  102. type: "POST",
  103. url: 'plugin.php?id=xj_event:city&level=3&province='+province+'&city='+city+'&county='+county,
  104. dataType: 'html',
  105. async: true,
  106. error: function(request) {
  107. alert("Connection error");
  108. },
  109. success: function(html) {
  110. if(html.indexOf('<!--end-->')>-1){
  111. residecity.prev().html($("#province").find("option:selected").text() + $("#city").find("option:selected").text() + $("#county").find("option:selected").text());
  112. residecity.prev().prev().val($("#province").find("option:selected").text() + $("#city").find("option:selected").text() + $("#county").find("option:selected").text());
  113. residecity.next().html('');
  114. residecity.show();
  115. }else{
  116. residecity.next().html(html);
  117. }
  118. }
  119. });
  120. });
  121. $("body").on("change","#town",function(){
  122. residecity.prev().html($("#province").find("option:selected").text() + $("#city").find("option:selected").text() + $("#county").find("option:selected").text() + $("#town").find("option:selected").text());
  123. residecity.prev().prev().val($("#province").find("option:selected").text() + $("#city").find("option:selected").text() + $("#county").find("option:selected").text() + $("#town").find("option:selected").text());
  124. residecity.next().html('');
  125. residecity.show();
  126. });
  127. //ÉúÈÕʱÆÚÑ¡Ôñ
  128. $("body").on("focus",".dateselect",function(){
  129. $(this).next().html('<input type="text" id="datepicker">');
  130. $( "#datepicker" ).datepicker({
  131. defaultDate: '<?php echo $mybirthday;?>',
  132. monthNamesShort:['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '�月', '�月', '�一月', '�二月'],
  133. dayNamesMin :['日', '一', '二', '三', '四', '五', '六'],
  134. changeMonth: true,
  135. changeYear: true,
  136. dateFormat: 'yy-mm-dd',
  137. onClose: function( selectedDate ) {
  138. //$( "#to" ).datepicker( "option", "minDate", selectedDate );
  139. $(this).parent().prev().val(selectedDate);
  140. $(this).parent().prev().show();
  141. $(this).parent().html('');
  142. }
  143. });
  144. $(this).hide();
  145. $(this).next().find("input").focus();
  146. });
  147. //Ìá½»
  148. $("#sumbit").button().click(function(event) {
  149. var postjson = [];
  150. var a = false;
  151. $('#tabs ul li').each(function(index) {
  152. var json = {};
  153. $('#'+$(this).attr('aria-controls')+' input').each(function(index) {
  154. if($(this).attr('type')=='text' || $(this).attr('type')=='hidden'){
  155. json[$(this).attr('name')] = $(this).val();
  156. }
  157. if($(this).attr('type')=='checkbox'){
  158. if($(this).is(':checked')){
  159. var checkboxname = $(this).attr('name').replace('[]','');
  160. if(json[checkboxname]){
  161. json[checkboxname] = json[checkboxname] + ',' + $(this).val();
  162. }else{
  163. json[checkboxname] = $(this).val();
  164. }
  165. }
  166. }
  167. if( $(this).attr('type')=='radio'){
  168. if($(this).is(':checked')){
  169. json[$(this).attr('name')] = $(this).val();
  170. }
  171. }
  172. });
  173. $('#'+$(this).attr('aria-controls')+' select').each(function(index) {
  174. json[$(this).attr('name')] = $(this).val();
  175. });
  176. //ÅжÏÊÇ·ñÓпյÄÊý¾Ý
  177. if(JSON.stringify(json).indexOf('""')>-1){
  178. a = true;
  179. }
  180. $('#'+$(this).attr('aria-controls')+' textarea').each(function(index) {
  181. json[$(this).attr('name')] = $(this).val();
  182. });
  183. postjson.push(json);
  184. });
  185. //alert(JSON.stringify(postjson));
  186. //ÅжÏÊÇ·ñÓпյÄÊý¾Ý
  187. if(a){
  188. showmessage('报�资料请填写完整');
  189. return;
  190. }
  191. var postdata = JSON.stringify(postjson);
  192. $('#tabs').hide();
  193. $('#sumbit').hide();
  194. $.ajax({
  195. cache: false,
  196. type: "POST",
  197. url: 'plugin.php?id=xj_event:event_join_modify&tid=<?php echo $tid;?>&action=modifyfull&formhash=<?php echo $_G['formhash'];?>',
  198. data: postdata,
  199. dataType: 'json',
  200. async: true,
  201. error: function(request) {
  202. alert("Connection error");
  203. $('#tabs').show();
  204. $('#sumbit').show();
  205. },
  206. success: function(json) {
  207. if(json.full == 1){
  208. showmessage(json.message);
  209. $('body,html').animate({scrollTop:0},0);
  210. if(json.url){
  211. window.parent.parent.location.href=json.url;
  212. }else{
  213. window.parent.parent.location.href='forum.php?mod=viewthread&tid=<?php echo $tid;?>';
  214. }
  215. return true;
  216. }else if(json.full == 2){
  217. $('#tabs').show();
  218. $('#sumbit').show();
  219. showmessage(json.message);
  220. $('body,html').animate({scrollTop:0},1000);
  221. return false;
  222. }
  223. }
  224. });
  225. });
  226. function addTab() {
  227. var label = '' || "Tab " + tabCounter,
  228. id = "tabs-" + tabCounter,
  229. li = "<li><a href='#"+id+"'>第"+weinum+"�</a><span class='ui-icon ui-icon-close' role='presentation'>Remove Tab</span></li>",
  230. tabContentHtml = '' || "Tab " + tabCounter + " content.";
  231. tabs.find( ".ui-tabs-nav" ).append( li );
  232. tabs.append( "<div id='"+id+"' aria-labelledby='ui-id-"+tabCounter+"' class='ui-tabs-panel ui-widget-content ui-corner-bottom' role='tabpanel' aria-hidden='true' style='display: none;'>"+$("#bmtemplate").html()+"</div>" );
  233. tabs.tabs( "refresh" );
  234. tabCounter++;
  235. weinum++;//µÚ¼¸Î»Î»ÊýÔö¼Ó
  236. }
  237. function showmessage(mm){
  238. $('#warning_mm').html(mm);
  239. $('#warning').show();
  240. function closemm(){
  241. $('#warning').hide();
  242. clearTimeout(mmtime);
  243. }
  244. var mmtime = setTimeout(function(){
  245. closemm()
  246. },4000);
  247. }
  248. });
  249. </script>
  250. </head>
  251. <body>
  252. <div class="ui-widget" id="warning" style="display:none;">
  253. <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
  254. <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span><span id="warning_mm"></span></p>
  255. </div>
  256. </div>
  257. <!-- Tabs -->
  258. <div id="tabs">
  259. <ul>
  260. <?php if(is_array($apply)) foreach($apply as $key => $value) { ?> <?php $i = $key+1?><li><a href="#tabs-<?php echo $i;?>">第<?php echo $i;?>�</a><?php if($i>1) { ?><span class="ui-icon ui-icon-close" role="presentation">Remove Tab</span><?php } ?></li>
  261. <?php } ?>
  262. <button id="button"><span class="ui-icon ui-icon-plus"></span></button>
  263. </ul>
  264. <?php if(is_array($apply)) foreach($apply as $key => $value) { ?> <?php $i = $key+1?><div id="tabs-<?php echo $i;?>">
  265. <?php if($setting['session']) { ?>
  266. <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  267. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;">活动场次</div>
  268. <select name="session" style="width:120px;">
  269. <?php if(is_array($setting['session'])) foreach($setting['session'] as $s_key => $s_value) { ?> <option value="<?php echo $s_key;?>" <?php if($value['session'] == $s_key) { ?>selected="selected"<?php } ?>><?php echo $s_value;?></option>
  270. <?php } ?>
  271. </select>
  272. </div>
  273. <?php } ?>
  274. <?php if($setting['cost']) { ?>
  275. <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  276. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;">报�类型</div>
  277. <select name="costclass" style="width:120px;">
  278. <?php if(is_array($setting['cost'])) foreach($setting['cost'] as $cvalue) { ?> <option value="<?php echo $cvalue['id'];?>" <?php if($cvalue['id'] == $value['ufielddata']['costclass']) { ?>selected<?php } ?>><?php echo $cvalue['cost_name'];?></option>
  279. <?php } ?>
  280. </select>
  281. </div>
  282. <?php } ?>
  283. <?php if(!empty($selectuserfield)) { ?>
  284. <?php if(is_array($selectuserfield)) foreach($selectuserfield as $fieldid) { ?> <?php if($settings[$fieldid]['available']) { ?>
  285. <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  286. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;"><?php echo $settings[$fieldid]['title'];?></div>
  287. <?php if($settings[$fieldid]['formtype'] != 'file') { ?>
  288. <?php if($settings[$fieldid]['formtype'] == 'checkbox') { ?>
  289. <?php echo $value['ufielddata'][$fieldid];?>
  290. <?php } elseif($fieldid == 'residecity') { ?>
  291. <?php echo str_replace('value=""><span></span>','value="'.$value[ufielddata][$fieldid].'"><span>'.$value[ufielddata][$fieldid].'</span>',$htmls[$fieldid]);?> <?php } elseif($settings[$fieldid]['formtype'] == 'select') { ?>
  292. <?php echo str_replace('value="'.$value[ufielddata][$fieldid].'"','value="'.$value[ufielddata][$fieldid].'" selected',$htmls[$fieldid]);?> <?php } else { ?>
  293. <?php echo str_replace('value=""','value="'.$value[ufielddata][$fieldid].'"',$htmls[$fieldid]);?> <?php } ?>
  294. <?php } else { ?>
  295. <input id="activitypic_<?php echo $fieldid;?>" type="text" tabindex="1" value="" placeholder="请输入图片地�" class="px" name="<?php echo $fieldid;?>" onblur="if(!this.value.match(/^https?:\/\/.+\/.+\.(jpg|png|gif|jpeg|bmp)$/i)){ $('showerror_<?php echo $fieldid;?>').innerHTML='图片地�错误';}else{ $('showerror_<?php echo $fieldid;?>').innerHTML='&nbsp;';}">
  296. <?php } ?>
  297. </div>
  298. <?php } ?>
  299. <?php } ?>
  300. <?php } ?>
  301. <?php if(!empty($myuserfield)) { ?>
  302. <?php if(is_array($value['myuserfield'])) foreach($value['myuserfield'] as $val) { ?> <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  303. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;"><?php echo $val['title'];?></div>
  304. <?php echo $val['html'];?>
  305. </div>
  306. <?php } ?>
  307. <?php } ?>
  308. <div style=" padding:10px 10px;">
  309. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;">留言</div>
  310. <textarea name="message" maxlength="100" cols="38" rows="3" class="pt" tabindex="4"><?php echo $value['bmmessage'];?></textarea>
  311. </div>
  312. </div>
  313. <?php } ?>
  314. </div>
  315. <div style="padding:10px; text-align:center;">
  316. <button id="sumbit">�存</button>
  317. </div>
  318. <div id="bmtemplate" style="display:none;">
  319. <?php if($setting['session']) { ?>
  320. <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  321. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;">活动场次</div>
  322. <select id="selectmenu" name="session" style="width:120px;">
  323. <option value="" selected="selected">请选择</option>
  324. <?php if(is_array($setting['session'])) foreach($setting['session'] as $key => $value) { ?> <option value="<?php echo $key;?>"><?php echo $value;?></option>
  325. <?php } ?>
  326. </select>
  327. </div>
  328. <?php } ?>
  329. <?php if($setting['cost']) { ?>
  330. <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  331. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;">报�类型</div>
  332. <select name="costclass" style="width:120px;">
  333. <?php if(is_array($setting['cost'])) foreach($setting['cost'] as $value) { ?> <option value="<?php echo $value['id'];?>"><?php echo $value['cost_name'];?></option>
  334. <?php } ?>
  335. </select>
  336. </div>
  337. <?php } ?>
  338. <?php if(!empty($selectuserfield)) { ?>
  339. <?php if(is_array($selectuserfield)) foreach($selectuserfield as $fieldid) { ?> <?php if($settings[$fieldid]['available']) { ?>
  340. <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  341. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;"><?php echo $settings[$fieldid]['title'];?></div>
  342. <?php if($settings[$fieldid]['formtype'] != 'file') { ?>
  343. <?php echo $htmls[$fieldid];?>
  344. <?php } else { ?>
  345. <input id="activitypic_<?php echo $fieldid;?>" type="text" tabindex="1" value="" placeholder="请输入图片地�" class="px" name="<?php echo $fieldid;?>" onblur="if(!this.value.match(/^https?:\/\/.+\/.+\.(jpg|png|gif|jpeg|bmp)$/i)){ $('showerror_<?php echo $fieldid;?>').innerHTML='图片地�错误';}else{ $('showerror_<?php echo $fieldid;?>').innerHTML='&nbsp;';}">
  346. <?php } ?>
  347. </div>
  348. <?php } ?>
  349. <?php } ?>
  350. <?php } ?>
  351. <?php if(!empty($myuserfield)) { ?>
  352. <?php if(is_array($myuserfield)) foreach($myuserfield as $value) { ?> <div style=" padding:10px 10px; border-bottom:1px dashed #CCC;">
  353. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;"><?php echo $value['title'];?></div>
  354. <?php echo $value['html'];?>
  355. </div>
  356. <?php } ?>
  357. <?php } ?>
  358. <?php if(in_array('bmmessage',$selectuserfield)) { ?>
  359. <div style=" padding:10px 10px;">
  360. <div style="width:80px; float:left; line-height:30px; font-size:12px; color:#999;">留言</div>
  361. <textarea name="message" maxlength="100" cols="38" rows="3" class="pt" tabindex="4"></textarea>
  362. </div>
  363. <?php } ?>
  364. </div>
  365. <script language="javascript">
  366. $(function(){
  367. //ÉÏ´«Í¼Æ¬
  368. $("body").on("change",".uploadfile",function(){
  369. var showimg = $(this).parent().parent().find('.showimg');
  370. var bar = $(this).parent().parent().find('.bar');
  371. var uploadcover = $(this).parent().parent().find('.uploadcover');
  372. var uploaderror = $(this).parent().parent().find('.uploaderror');
  373. var inputtext = $(this).parent().parent().find('.inputtext');
  374. bar.show();
  375. $(this).parent().parent().find('form').ajaxSubmit({
  376. dataType: 'json',
  377. beforeSend: function() {
  378. //showimg.empty();
  379. var percentVal = '0%';
  380. bar.width(percentVal);
  381. },
  382. uploadProgress: function(event, position, total, percentComplete) {
  383. var percentVal = percentComplete + '%';
  384. bar.width(percentVal);
  385. },
  386. success: function(data) {
  387. if(data.error){
  388. alert(data.error);
  389. var percentVal = '0%';
  390. bar.width(percentVal);
  391. return;
  392. }
  393. //progress.hide();
  394. bar.hide();
  395. //files.html("<b>"+data.name+"("+data.size+"k)</b> <span class='delimg' rel='"+data.pic+"'>ɾ³ý</span>");
  396. if(data.pic!=null){
  397. var img = "<?php echo $_G['siteurl'];?>"+data.dir+data.pic;
  398. inputtext.val(img);
  399. showimg.html("<img src='"+img+"' style='width:100%;'>");
  400. uploadcover.hide();
  401. }
  402. },
  403. error:function(xhr){
  404. bar.width('0');
  405. uploaderror.html(xhr.responseText);
  406. }
  407. });
  408. });
  409. });
  410. </script>
  411. </body>
  412. </html>