wrtgdDaHm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?php /* Smarty version 2.6.17, created on 2018-05-17 17:16:13
  2. compiled from admin/Category/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. </tr>
  61. </thead>
  62. <tbody>
  63. <?php if (! $this->_tpl_vars['categoryData']): ?>
  64. <tr><td colspan="5" align="center">暂无信息</td></tr>
  65. <?php endif; ?>
  66. <?php $_from = $this->_tpl_vars['categoryData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  67. foreach ($_from as $this->_tpl_vars['item']):
  68. ?>
  69. <tr>
  70. <td><?php echo $this->_tpl_vars['item']['id']; ?>
  71. </td>
  72. <td><?php echo $this->_tpl_vars['item']['name']; ?>
  73. </td>
  74. <td><img src="<?php echo $this->_tpl_vars['item']['icon']; ?>
  75. " width="150" /></td>
  76. <td><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  77. /?c=Admin_Category_index&a=PageShow&id=<?php echo $this->_tpl_vars['item']['id']; ?>
  78. ">编辑</a></td>
  79. </tr>
  80. <?php endforeach; endif; unset($_from); ?>
  81. </tbody>
  82. </table>
  83. <div class="page"><?php echo $this->_tpl_vars['page_html']; ?>
  84. </div>
  85. </div>
  86. </div>
  87. <form id="add_category_form">
  88. <div class="col-md-5" style="padding-left: 30px;">
  89. <div class="form-group">
  90. <label class="control-label">添加新分类</label>
  91. </div>
  92. <div class="form-group">
  93. <label class="control-label rowlabel">分类名称</label>
  94. <input name="name" type="text" class="form-control" >
  95. </div>
  96. <div class="form-group">
  97. <label class="control-label rowlabel">分类图标</label>
  98. <div>
  99. <img id="icon_image_tag" src="http://placehold.it/36&text=36x36" style="width:30px;" class="img-thumbnail">
  100. <input id="icon_image_input" name='icon' type="hidden" value="">
  101. <input id="icon_image_upload" type="button" value="默认图片" >
  102. </div>
  103. </div>
  104. <div>
  105. <a id="add_category_btn" href="javascript:;" class="button button-primary button-small">添加新分类</a>
  106. </div>
  107. </div>
  108. </form>
  109. <script>
  110. KISSY.use('node, io', function (S, Node, IO) {
  111. var $ = S.all;
  112. $("#add_category_btn").on('click', function () {
  113. var name = $("input[name=name]").val();
  114. if (!name) {
  115. alert('请填写名称');
  116. return false;
  117. }
  118. var icon = $("input[name=icon]").val();
  119. if (!icon) {
  120. alert('请选择分类图标');
  121. return false;
  122. }
  123. var data = IO.serialize("#add_category_form");
  124. new IO({
  125. type: "post"
  126. , url: VG.conf.root_domain + '/?c=Admin_Category_index&a=PageList&a=ReqCreate'
  127. , data: data
  128. , success: function (data) {
  129. if (data.ok) { //ok
  130. var url = data.msg;
  131. location.href = VG.conf.url;
  132. } else {
  133. alert('操作失败,原因:'+data.msg);
  134. }
  135. return false;
  136. }
  137. , error: function (NULL, textStatus) {
  138. alert("请求服务器失败,原因:"+textStatus);
  139. }
  140. , dataType: "json"
  141. });
  142. });
  143. });
  144. //icon image
  145. KindEditor.ready(function(K) {
  146. var uploadbutton = K.uploadbutton({
  147. button : K('#icon_image_upload')[0],
  148. fieldName : 'imgFile',
  149. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  150. afterUpload : function(data) {
  151. if (data.error === 0) {
  152. var url = K.formatUrl(data.url, 'absolute');
  153. K('#icon_image_input').val(data.url);
  154. K('#icon_image_tag').attr('src', data.url);
  155. } else {
  156. alert(data.message);
  157. }
  158. },
  159. afterError : function(str) {
  160. alert('自定义错误信息: ' + str);
  161. }
  162. });
  163. uploadbutton.fileBox.change(function(e) {
  164. uploadbutton.submit();
  165. });
  166. });
  167. </script>
  168. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  169. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  170. $this->_tpl_vars = $_smarty_tpl_vars;
  171. unset($_smarty_tpl_vars);
  172. ?>