%%27^27A^27A220D1%%list.html.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <?php /* Smarty version 2.6.17, created on 2018-05-29 15:18:16
  2. compiled from admin/focus/list.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. <script type="text/javascript" src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  24. /public/static/js/jquery-1.7.2.min.js"></script>
  25. <link rel="stylesheet" href="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  26. /public/static/js/jquery.minicolors.css" />
  27. <script type="text/javascript" src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  28. /public/static/js/jquery.minicolors.js"></script>
  29. <style>
  30. .set-nav {
  31. margin: 0 auto;
  32. }
  33. .set-nav-hr {
  34. background-color: #ddd;
  35. height: 1px;
  36. position: relative;
  37. }
  38. .form-group label {
  39. font-weight: 600;
  40. }
  41. .checkbox-inline, .radio-inline {
  42. font-weight: 400!important;
  43. }
  44. .rowlabel {
  45. font-weight: 300!important;
  46. }
  47. .music_play_hide {
  48. display:none;
  49. }
  50. </style>
  51. <div class="panel panel-default col-md-7">
  52. <div class="panel-body">
  53. <table class="table">
  54. <thead>
  55. <tr>
  56. <th>排序</th>
  57. <th>平台</th>
  58. <th>名称</th>
  59. <th>图片</th>
  60. <th>编辑</th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <?php if (! $this->_tpl_vars['focusData']): ?>
  65. <tr><td colspan="5" align="center">暂无信息</td></tr>
  66. <?php endif; ?>
  67. <?php $_from = $this->_tpl_vars['focusData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  68. foreach ($_from as $this->_tpl_vars['item']):
  69. ?>
  70. <tr>
  71. <td><?php echo $this->_tpl_vars['item']['index']; ?>
  72. </td>
  73. <td><?php echo $this->_tpl_vars['platformList'][$this->_tpl_vars['item']['platform_id']]['name']; ?>
  74. </td>
  75. <td><?php echo $this->_tpl_vars['item']['name']; ?>
  76. </td>
  77. <td><img src="<?php echo $this->_tpl_vars['item']['pic']; ?>
  78. " width="100" /><br /><?php echo $this->_tpl_vars['item']['link']; ?>
  79. </td>
  80. <td><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  81. /?c=Admin_Focus_index&a=PageShow&id=<?php echo $this->_tpl_vars['item']['id']; ?>
  82. ">编辑</a> <a href="javascript:;" class="deleteItem" data-id="<?php echo $this->_tpl_vars['item']['id']; ?>
  83. ">删除</a></td>
  84. </tr>
  85. <?php endforeach; endif; unset($_from); ?>
  86. </tbody>
  87. </table>
  88. <div class="page"><?php echo $this->_tpl_vars['page_html']; ?>
  89. </div>
  90. </div>
  91. </div>
  92. <form id="add_focus_form">
  93. <div class="col-md-5" style="padding-left: 30px;">
  94. <div class="form-group">
  95. <label class="control-label">添加一个相关推荐</label>
  96. </div>
  97. <div class="form-group">
  98. <label class="control-label rowlabel">选择平台</label>
  99. <select name="platform_id" id="platform_id">
  100. <?php $_from = $this->_tpl_vars['platformList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  101. foreach ($_from as $this->_tpl_vars['item']):
  102. ?>
  103. <option value="<?php echo $this->_tpl_vars['item']['id']; ?>
  104. "><?php echo $this->_tpl_vars['item']['name']; ?>
  105. </option>
  106. </tr>
  107. <?php endforeach; endif; unset($_from); ?>
  108. </select>
  109. </div>
  110. <div class="form-group">
  111. <label class="control-label rowlabel">推荐名称</label>
  112. <input name="name" type="text" class="form-control" >
  113. </div>
  114. <div class="form-group">
  115. <label class="control-label rowlabel">推荐排序-数字越大越靠前</label>
  116. <input name="index" type="text" class="form-control" value="1">
  117. </div>
  118. <div class="form-group">
  119. <label class="control-label rowlabel">推荐地址</label>
  120. <input name="link" type="text" class="form-control" >
  121. </div>
  122. <div class="form-group">
  123. <label class="control-label rowlabel">推荐图片</label>
  124. <div>
  125. <img id="icon_image_tag" src="http://placehold.it/36&text=36x36" style="width:30px;" class="img-thumbnail">
  126. <input id="icon_image_input" name='pic' type="hidden" value="">
  127. <input id="icon_image_upload" type="button" value="默认图片" >
  128. <span class="note">图片大小:高度为128px</span>
  129. </div>
  130. </div>
  131. <div>
  132. <a id="add_focus_btn" href="javascript:;" class="button button-primary button-small">添加</a>
  133. </div>
  134. </div>
  135. </form>
  136. <script>
  137. KISSY.use('node, io', function (S, Node, IO) {
  138. var $ = S.all;
  139. $(".deleteItem").on('click', function () {
  140. var id = $(this).attr('data-id');
  141. if (!id) {
  142. alert('无效id');
  143. return false;
  144. }
  145. if (!confirm('确定要删除这项数据?')) {
  146. return false;
  147. }
  148. new IO({
  149. type: "post"
  150. , url: VG.conf.root_domain + '/?c=Admin_Focus_index&a=Delete'
  151. , data: {'id':id}
  152. , success: function (data) {
  153. if (data.ok) { //ok
  154. alert('操作成功');
  155. location.reload();
  156. } else {
  157. alert('操作失败,原因:'+data.msg);
  158. }
  159. return false;
  160. }
  161. , error: function (NULL, textStatus) {
  162. alert("请求服务器失败,原因:"+textStatus);
  163. }
  164. , dataType: "json"
  165. });
  166. });
  167. $("#add_focus_btn").on('click', function () {
  168. var name = $("input[name=name]").val();
  169. if (!name) {
  170. alert('请填写名称');
  171. return false;
  172. }
  173. var index = $("input[name=index]").val();
  174. if (!index) {
  175. alert('请填写排序');
  176. return false;
  177. }
  178. var platform_id = $("select[name=platform_id]").val();
  179. if (!platform_id) {
  180. alert('请选择平台');
  181. return false;
  182. }
  183. var link = $("input[name=link]").val();
  184. if (!link) {
  185. alert('请填写链接');
  186. return false;
  187. }
  188. var pic = $("input[name=pic]").val();
  189. if (!pic) {
  190. alert('请选择推荐图片');
  191. return false;
  192. }
  193. var data = IO.serialize("#add_focus_form");
  194. new IO({
  195. type: "post"
  196. , url: VG.conf.root_domain + '/?c=Admin_Focus_index&a=PageList&a=ReqCreate'
  197. , data: data
  198. , success: function (data) {
  199. if (data.ok) { //ok
  200. var url = data.msg;
  201. location.href = VG.conf.url;
  202. } else {
  203. alert('操作失败,原因:'+data.msg);
  204. }
  205. return false;
  206. }
  207. , error: function (NULL, textStatus) {
  208. alert("请求服务器失败,原因:"+textStatus);
  209. }
  210. , dataType: "json"
  211. });
  212. });
  213. });
  214. //icon image
  215. KindEditor.ready(function(K) {
  216. var uploadbutton = K.uploadbutton({
  217. button : K('#icon_image_upload')[0],
  218. fieldName : 'imgFile',
  219. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  220. afterUpload : function(data) {
  221. if (data.error === 0) {
  222. var url = K.formatUrl(data.url, 'absolute');
  223. K('#icon_image_input').val(data.url);
  224. K('#icon_image_tag').attr('src', data.url);
  225. } else {
  226. alert(data.message);
  227. }
  228. },
  229. afterError : function(str) {
  230. alert('自定义错误信息: ' + str);
  231. }
  232. });
  233. uploadbutton.fileBox.change(function(e) {
  234. uploadbutton.submit();
  235. });
  236. });
  237. </script>
  238. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  239. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  240. $this->_tpl_vars = $_smarty_tpl_vars;
  241. unset($_smarty_tpl_vars);
  242. ?>