123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <?php /* Smarty version 2.6.17, created on 2018-05-29 15:18:16
- compiled from admin/focus/list.html */ ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
- <script type="text/javascript" src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
- /public/static/js/jquery-1.7.2.min.js"></script>
- <link rel="stylesheet" href="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
- /public/static/js/jquery.minicolors.css" />
- <script type="text/javascript" src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
- /public/static/js/jquery.minicolors.js"></script>
- <style>
- .set-nav {
- margin: 0 auto;
- }
- .set-nav-hr {
- background-color: #ddd;
- height: 1px;
- position: relative;
- }
- .form-group label {
- font-weight: 600;
- }
- .checkbox-inline, .radio-inline {
- font-weight: 400!important;
- }
- .rowlabel {
- font-weight: 300!important;
- }
- .music_play_hide {
- display:none;
- }
- </style>
- <div class="panel panel-default col-md-7">
- <div class="panel-body">
- <table class="table">
- <thead>
- <tr>
- <th>排序</th>
- <th>平台</th>
- <th>名称</th>
- <th>图片</th>
- <th>编辑</th>
- </tr>
- </thead>
- <tbody>
- <?php if (! $this->_tpl_vars['focusData']): ?>
- <tr><td colspan="5" align="center">暂无信息</td></tr>
- <?php endif; ?>
- <?php $_from = $this->_tpl_vars['focusData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
- foreach ($_from as $this->_tpl_vars['item']):
- ?>
- <tr>
- <td><?php echo $this->_tpl_vars['item']['index']; ?>
- </td>
- <td><?php echo $this->_tpl_vars['platformList'][$this->_tpl_vars['item']['platform_id']]['name']; ?>
- </td>
- <td><?php echo $this->_tpl_vars['item']['name']; ?>
- </td>
- <td><img src="<?php echo $this->_tpl_vars['item']['pic']; ?>
- " width="100" /><br /><?php echo $this->_tpl_vars['item']['link']; ?>
- </td>
- <td><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
- /?c=Admin_Focus_index&a=PageShow&id=<?php echo $this->_tpl_vars['item']['id']; ?>
- ">编辑</a> <a href="javascript:;" class="deleteItem" data-id="<?php echo $this->_tpl_vars['item']['id']; ?>
- ">删除</a></td>
- </tr>
- <?php endforeach; endif; unset($_from); ?>
- </tbody>
- </table>
- <div class="page"><?php echo $this->_tpl_vars['page_html']; ?>
- </div>
- </div>
- </div>
- <form id="add_focus_form">
- <div class="col-md-5" style="padding-left: 30px;">
- <div class="form-group">
- <label class="control-label">添加一个相关推荐</label>
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">选择平台</label>
- <select name="platform_id" id="platform_id">
- <?php $_from = $this->_tpl_vars['platformList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
- foreach ($_from as $this->_tpl_vars['item']):
- ?>
- <option value="<?php echo $this->_tpl_vars['item']['id']; ?>
- "><?php echo $this->_tpl_vars['item']['name']; ?>
- </option>
- </tr>
- <?php endforeach; endif; unset($_from); ?>
- </select>
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">推荐名称</label>
- <input name="name" type="text" class="form-control" >
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">推荐排序-数字越大越靠前</label>
- <input name="index" type="text" class="form-control" value="1">
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">推荐地址</label>
- <input name="link" type="text" class="form-control" >
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">推荐图片</label>
- <div>
- <img id="icon_image_tag" src="http://placehold.it/36&text=36x36" style="width:30px;" class="img-thumbnail">
- <input id="icon_image_input" name='pic' type="hidden" value="">
- <input id="icon_image_upload" type="button" value="默认图片" >
- <span class="note">图片大小:高度为128px</span>
- </div>
- </div>
- <div>
- <a id="add_focus_btn" href="javascript:;" class="button button-primary button-small">添加</a>
- </div>
- </div>
- </form>
- <script>
- KISSY.use('node, io', function (S, Node, IO) {
- var $ = S.all;
- $(".deleteItem").on('click', function () {
- var id = $(this).attr('data-id');
- if (!id) {
- alert('无效id');
- return false;
- }
-
- if (!confirm('确定要删除这项数据?')) {
- return false;
- }
-
- new IO({
- type: "post"
- , url: VG.conf.root_domain + '/?c=Admin_Focus_index&a=Delete'
- , data: {'id':id}
- , success: function (data) {
- if (data.ok) { //ok
- alert('操作成功');
- location.reload();
- } else {
- alert('操作失败,原因:'+data.msg);
- }
- return false;
- }
- , error: function (NULL, textStatus) {
- alert("请求服务器失败,原因:"+textStatus);
- }
- , dataType: "json"
- });
- });
-
- $("#add_focus_btn").on('click', function () {
- var name = $("input[name=name]").val();
- if (!name) {
- alert('请填写名称');
- return false;
- }
- var index = $("input[name=index]").val();
- if (!index) {
- alert('请填写排序');
- return false;
- }
- var platform_id = $("select[name=platform_id]").val();
- if (!platform_id) {
- alert('请选择平台');
- return false;
- }
- var link = $("input[name=link]").val();
- if (!link) {
- alert('请填写链接');
- return false;
- }
-
- var pic = $("input[name=pic]").val();
- if (!pic) {
- alert('请选择推荐图片');
- return false;
- }
- var data = IO.serialize("#add_focus_form");
-
- new IO({
- type: "post"
- , url: VG.conf.root_domain + '/?c=Admin_Focus_index&a=PageList&a=ReqCreate'
- , data: data
- , success: function (data) {
- if (data.ok) { //ok
- var url = data.msg;
- location.href = VG.conf.url;
- } else {
- alert('操作失败,原因:'+data.msg);
- }
- return false;
- }
- , error: function (NULL, textStatus) {
- alert("请求服务器失败,原因:"+textStatus);
- }
- , dataType: "json"
- });
- });
- });
- //icon image
- KindEditor.ready(function(K) {
- var uploadbutton = K.uploadbutton({
- button : K('#icon_image_upload')[0],
- fieldName : 'imgFile',
- url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
- afterUpload : function(data) {
- if (data.error === 0) {
- var url = K.formatUrl(data.url, 'absolute');
- K('#icon_image_input').val(data.url);
- K('#icon_image_tag').attr('src', data.url);
- } else {
- alert(data.message);
- }
- },
- afterError : function(str) {
- alert('自定义错误信息: ' + str);
- }
- });
- uploadbutton.fileBox.change(function(e) {
- uploadbutton.submit();
- });
- });
- </script>
- <?php $_smarty_tpl_vars = $this->_tpl_vars;
- $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
- $this->_tpl_vars = $_smarty_tpl_vars;
- unset($_smarty_tpl_vars);
- ?>
|