%%D3^D3A^D3AA40DB%%edit.html.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php /* Smarty version 2.6.17, created on 2018-05-27 10:02:07
  2. compiled from admin/focus/edit.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. <form id="add_platform_form">
  52. <input name="id" type="hidden" value="<?php echo $this->_tpl_vars['focusData']['id']; ?>
  53. ">
  54. <div class="col-md-5" style="padding-left: 30px;">
  55. <div class="form-group">
  56. <label class="control-label">编辑推荐信息</label>
  57. </div>
  58. <div class="form-group">
  59. <label class="control-label rowlabel">选择平台</label>
  60. <select name="platform_id" id="platform_id">
  61. <?php $_from = $this->_tpl_vars['platformList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  62. foreach ($_from as $this->_tpl_vars['item']):
  63. ?>
  64. <option value="<?php echo $this->_tpl_vars['item']['id']; ?>
  65. " <?php if ($this->_tpl_vars['item']['id'] == $this->_tpl_vars['focusData']['platform_id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['item']['name']; ?>
  66. </option>
  67. </tr>
  68. <?php endforeach; endif; unset($_from); ?>
  69. </select>
  70. </div>
  71. <div class="form-group">
  72. <label class="control-label rowlabel">推荐名称</label>
  73. <input name="name" type="text" class="form-control" value="<?php echo $this->_tpl_vars['focusData']['name']; ?>
  74. ">
  75. </div>
  76. <div class="form-group">
  77. <label class="control-label rowlabel">推荐排序-数字越大越靠前</label>
  78. <input name="index" type="text" class="form-control" value="<?php echo $this->_tpl_vars['focusData']['index']; ?>
  79. ">
  80. </div>
  81. <div class="form-group">
  82. <label class="control-label rowlabel">推荐链接</label>
  83. <input name="link" type="text" class="form-control" value="<?php echo $this->_tpl_vars['focusData']['link']; ?>
  84. ">
  85. </div>
  86. <div class="form-group">
  87. <label class="control-label rowlabel">推荐图片</label>
  88. <div>
  89. <img id="icon_image_tag" src="<?php echo $this->_tpl_vars['focusData']['pic']; ?>
  90. " style="width:30px;" class="img-thumbnail">
  91. <input id="icon_image_input" name='pic' type="hidden" value="<?php echo $this->_tpl_vars['focusData']['pic']; ?>
  92. ">
  93. <input id="icon_image_upload" type="button" value="选中图片" >
  94. <span class="note">图片大小:高度为128px</span>
  95. </div>
  96. </div>
  97. <div>
  98. <a id="add_platform_btn" href="javascript:;" class="button button-primary button-small">修改分类</a>
  99. </div>
  100. </div>
  101. </form>
  102. <script>
  103. KISSY.use('node, io', function (S, Node, IO) {
  104. var $ = S.all;
  105. $("#add_platform_btn").on('click', function () {
  106. var name = $("input[name=name]").val();
  107. if (!name) {
  108. alert('请填写名称');
  109. return false;
  110. }
  111. var index = $("input[name=index]").val();
  112. if (!index) {
  113. alert('请填写排序');
  114. return false;
  115. }
  116. var platform_id = $("select[name=platform_id]").val();
  117. if (!platform_id) {
  118. alert('请选择平台');
  119. return false;
  120. }
  121. var link = $("input[name=link]").val();
  122. if (!link) {
  123. alert('请填写链接');
  124. return false;
  125. }
  126. var pic = $("input[name=pic]").val();
  127. if (!pic) {
  128. alert('请选择推荐图片');
  129. return false;
  130. }
  131. var data = IO.serialize("#add_platform_form");
  132. new IO({
  133. type: "post"
  134. , url: VG.conf.root_domain + '/?c=Admin_Focus_index&a=PageList&a=ReqUp'
  135. , data: data
  136. , success: function (data) {
  137. if (data.ok) { //ok
  138. var url = data.msg;
  139. location.href = VG.conf.root_domain + '/?c=Admin_Focus_index&a=PageList';
  140. } else {
  141. alert('操作失败,原因:'+data.msg);
  142. }
  143. return false;
  144. }
  145. , error: function (NULL, textStatus) {
  146. alert("请求服务器失败,原因:"+textStatus);
  147. }
  148. , dataType: "json"
  149. });
  150. });
  151. });
  152. //icon image
  153. KindEditor.ready(function(K) {
  154. var uploadbutton = K.uploadbutton({
  155. button : K('#icon_image_upload')[0],
  156. fieldName : 'imgFile',
  157. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  158. afterUpload : function(data) {
  159. if (data.error === 0) {
  160. var url = K.formatUrl(data.url, 'absolute');
  161. K('#icon_image_input').val(data.url);
  162. K('#icon_image_tag').attr('src', data.url);
  163. } else {
  164. alert(data.message);
  165. }
  166. },
  167. afterError : function(str) {
  168. alert('自定义错误信息: ' + str);
  169. }
  170. });
  171. uploadbutton.fileBox.change(function(e) {
  172. uploadbutton.submit();
  173. });
  174. });
  175. </script>
  176. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  177. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  178. $this->_tpl_vars = $_smarty_tpl_vars;
  179. unset($_smarty_tpl_vars);
  180. ?>