%%92^92F^92F79C85%%interactive_survey_input_question.html.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <?php /* Smarty version 2.6.17, created on 2018-04-25 15:06:49
  2. compiled from admin/activity/interactive_survey_input_question.html */ ?>
  3. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  4. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
  5. $this->_tpl_vars = $_smarty_tpl_vars;
  6. unset($_smarty_tpl_vars);
  7. ?>
  8. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  9. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
  10. $this->_tpl_vars = $_smarty_tpl_vars;
  11. unset($_smarty_tpl_vars);
  12. ?>
  13. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  14. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
  15. $this->_tpl_vars = $_smarty_tpl_vars;
  16. unset($_smarty_tpl_vars);
  17. ?>
  18. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  19. $this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
  20. $this->_tpl_vars = $_smarty_tpl_vars;
  21. unset($_smarty_tpl_vars);
  22. ?>
  23. <style>
  24. .set-nav {
  25. margin: 0 auto;
  26. }
  27. .set-nav-hr {
  28. background-color: #ddd;
  29. height: 1px;
  30. position: relative;
  31. }
  32. .form-group label {
  33. font-weight: 600;
  34. }
  35. .checkbox-inline, .radio-inline {
  36. font-weight: 400!important;
  37. }
  38. .rowlabel {
  39. font-weight: 300!important;
  40. }
  41. .music_play_hide {
  42. display:none;
  43. }
  44. </style>
  45. <div id="activity_container">
  46. <form id="activity_form">
  47. <div class="activity_center">
  48. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  49. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
  50. $this->_tpl_vars = $_smarty_tpl_vars;
  51. unset($_smarty_tpl_vars);
  52. ?>
  53. <input name="events_id" type="hidden" value="<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  54. ">
  55. <div class="panel panel-default">
  56. <div class="panel-heading"><h3 class="panel-title" id="panel-title">表单设置</h3></div>
  57. <div class="panel-body">
  58. <table class="table">
  59. <thead>
  60. <tr>
  61. <th>名称</th>
  62. <th>类型</th>
  63. <th>是否必填</th>
  64. </tr>
  65. <?php $_from = $this->_tpl_vars['events_Data']['events']['forms']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  66. foreach ($_from as $this->_tpl_vars['form']):
  67. ?>
  68. <tr>
  69. <td><?php echo $this->_tpl_vars['form']['name']; ?>
  70. </td>
  71. <td><?php if ($this->_tpl_vars['form']['type'] == 'text'): ?>单行文本<?php endif; ?>
  72. <?php if ($this->_tpl_vars['form']['type'] == 'textarea'): ?>多行文本<?php endif; ?>
  73. <?php if ($this->_tpl_vars['form']['type'] == 'select'): ?>下拉菜单<?php endif; ?></td>
  74. <td><?php if ($this->_tpl_vars['form']['required'] == 1): ?>必填<?php else: ?> 选填<?php endif; ?></td>
  75. </tr>
  76. <?php endforeach; endif; unset($_from); ?>
  77. </thead>
  78. </table>
  79. </div>
  80. <div style="text-align:right; margin-right: 20px;margin-bottom: 10px;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  81. &typ=input">点击编辑</a></div>
  82. </div>
  83. <div class="panel panel-default">
  84. <div class="panel-heading"><h3 class="panel-title" id="panel-title">奖品设置</h3></div>
  85. <div class="panel-body">
  86. <table class="table">
  87. <thead>
  88. <tr>
  89. <th>序号</th>
  90. <th>奖品名称</th>
  91. <th>图片</th>
  92. <th>数量</th>
  93. <th>操作</th>
  94. </tr>
  95. <?php $_from = $this->_tpl_vars['events_Data']['events']['survery_prize']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['survery'] = array('total' => count($_from), 'iteration' => 0);
  96. if ($this->_foreach['survery']['total'] > 0):
  97. foreach ($_from as $this->_tpl_vars['index'] => $this->_tpl_vars['survery_prize']):
  98. $this->_foreach['survery']['iteration']++;
  99. ?>
  100. <tr>
  101. <td><?php echo $this->_foreach['survery']['iteration']; ?>
  102. </td>
  103. <td><?php echo $this->_tpl_vars['survery_prize']['name']; ?>
  104. </td>
  105. <td><img src="<?php echo $this->_tpl_vars['survery_prize']['img_url']; ?>
  106. " class="img-thumbnail" style="width:50px;"></td>
  107. <td><?php echo $this->_tpl_vars['survery_prize']['num']; ?>
  108. <?php echo $this->_tpl_vars['survery_prize']['unit_name']; ?>
  109. </td>
  110. <td><a class="del_survery_prize" survery_prize_id='<?php echo $this->_tpl_vars['index']; ?>
  111. ' href="javascript:;">删除</a></td>
  112. </tr>
  113. <?php endforeach; endif; unset($_from); ?>
  114. </thead>
  115. </table>
  116. </div>
  117. <div style="text-align:right; margin-right: 20px;margin-bottom: 10px;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  118. &typ=prize"><i class="fa fa-plus"></i>添加奖品</a></div>
  119. </div>
  120. <div class="panel panel-default">
  121. <div class="panel-heading"><h3 class="panel-title" id="panel-title">问题设置</h3></div>
  122. <div class="panel-body">
  123. <div class="form-group">
  124. <?php $_from = $this->_tpl_vars['events_Data']['events']['survery_question']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  125. foreach ($_from as $this->_tpl_vars['index'] => $this->_tpl_vars['survery_question']):
  126. ?>
  127. <?php if ($this->_tpl_vars['survery_question']['type'] == 'img'): ?>
  128. <div class="panel panel-default" style="padding: 10px;">
  129. <div style="margin: 10px;">问题: &nbsp; &nbsp; &nbsp; <?php echo $this->_tpl_vars['survery_question']['question']; ?>
  130. </div>
  131. <div style="margin: 10px;">类型: &nbsp; &nbsp; &nbsp; 图片</div>
  132. <div style="clear:both;"></div>
  133. <table class="table">
  134. <tr>
  135. <?php $_from = $this->_tpl_vars['survery_question']['answer']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  136. foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['answer']):
  137. ?>
  138. <td style="text-align:center;">
  139. <img id="img_url_tag" src="<?php echo $this->_tpl_vars['answer']['img_url']; ?>
  140. " style="width:100px;" class="img-thumbnail"><br>
  141. <div style="text-align:center;">选择:<?php echo $this->_tpl_vars['answer']['answer']; ?>
  142. </div>
  143. </td>
  144. <?php endforeach; endif; unset($_from); ?>
  145. </tr>
  146. </table>
  147. <div style="margin: 10px;">操作: &nbsp; &nbsp; &nbsp; <a survery_question_id="<?php echo $this->_tpl_vars['index']; ?>
  148. " href="javascript:;" class="del_survery_question">点击删除</a></div>
  149. </div>
  150. <?php endif; ?>
  151. <?php if ($this->_tpl_vars['survery_question']['type'] == 'txt'): ?>
  152. <div class="panel panel-default" style="padding: 10px;">
  153. <div style="margin: 10px;">问题: &nbsp; &nbsp; &nbsp; <?php echo $this->_tpl_vars['survery_question']['question']; ?>
  154. </div>
  155. <div style="margin: 10px;">类型: &nbsp; &nbsp; &nbsp; 文字</div>
  156. <div style="clear:both;"></div>
  157. <?php $_from = $this->_tpl_vars['survery_question']['answer']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  158. foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['answer']):
  159. ?>
  160. <div style="text-align:left;margin:10px;"><?php echo $this->_tpl_vars['answer']['answer']; ?>
  161. </div>
  162. <?php endforeach; endif; unset($_from); ?>
  163. <div style="margin: 10px;">操作: &nbsp; &nbsp; &nbsp; <a survery_question_id="<?php echo $this->_tpl_vars['index']; ?>
  164. " href="javascript:;" class="del_survery_question">点击删除</a></div>
  165. </div>
  166. <?php endif; ?>
  167. <?php endforeach; endif; unset($_from); ?>
  168. </div>
  169. </div>
  170. <div style="text-align:right; margin-right: 20px;margin-bottom: 10px;"><a href="?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  171. &typ=question"><i class="fa fa-plus"></i>添加一个问题</a></div>
  172. </div>
  173. </div>
  174. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  175. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
  176. $this->_tpl_vars = $_smarty_tpl_vars;
  177. unset($_smarty_tpl_vars);
  178. ?>
  179. <div style="clear:both;"></div>
  180. </form>
  181. </div>
  182. <script>
  183. KISSY.use('node, io, event, jquery', function (S, Node, IO, Event, jQuery) {
  184. var $ = S.all;
  185. $(".del_survery_question").on('click', function () {
  186. var survery_question_id = $(this).attr('survery_question_id');
  187. var events_id = <?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  188. ;
  189. var formData = {'survery_question_id':survery_question_id,'events_id':events_id};
  190. new IO({
  191. type: "post"
  192. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqDelSurveyQuestion'
  193. , data: formData
  194. , success: function (data) {
  195. if (data.ok) { //ok
  196. var url = data.msg;
  197. location.href = VG.conf.root_domain + '?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  198. ';
  199. } else {
  200. alert('操作失败,原因:'+data.msg);
  201. }
  202. return false;
  203. }
  204. , error: function (NULL, textStatus) {
  205. alert("请求服务器失败,原因:"+textStatus);
  206. }
  207. , dataType: "json"
  208. });
  209. });
  210. $(".del_survery_prize").on('click', function () {
  211. var survery_prize_id = $(this).attr('survery_prize_id');
  212. var events_id = <?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  213. ;
  214. var formData = {'survery_prize_id':survery_prize_id,'events_id':events_id};
  215. new IO({
  216. type: "post"
  217. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetInteractive&a=ReqDelSurveyPrize'
  218. , data: formData
  219. , success: function (data) {
  220. if (data.ok) { //ok
  221. var url = data.msg;
  222. location.href = VG.conf.root_domain + '?c=Admin_Activity_SetInteractive&a=PageShow&events_id=<?php echo $this->_tpl_vars['events_Data']['events']['id']; ?>
  223. ';
  224. } else {
  225. alert('操作失败,原因:'+data.msg);
  226. }
  227. return false;
  228. }
  229. , error: function (NULL, textStatus) {
  230. alert("请求服务器失败,原因:"+textStatus);
  231. }
  232. , dataType: "json"
  233. });
  234. });
  235. });
  236. </script>
  237. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  238. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  239. $this->_tpl_vars = $_smarty_tpl_vars;
  240. unset($_smarty_tpl_vars);
  241. ?>