<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:47:"D:\mijia/application/admin\view\link\index.html";i:1535907382;}*/ ?>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>H+ 后台主题UI框架 - 选项卡 &amp; 面板</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link href="/public/static/admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="/public/static/admin/css/animate.min.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/css/admin.css" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeIn">
        <div class="row">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="<?php if(input('tab',1) == 1): ?>active<?php endif; ?>"><a data-toggle="tab" href="#tab-1" aria-expanded="true">友情链接列表</a>
                        </li>
                        <li class="<?php if(input('tab',1) == 2): ?>active<?php endif; ?>"><a data-toggle="tab" href="#tab-2" aria-expanded="false">添加友情链接</a>
                        </li>
                        <li id="showtab" class="<?php if(input('tab',1) == 3): ?>active<?php endif; ?>" style="<?php if(input('tab',1)!=3): ?>display:none<?php endif; ?>"><a data-toggle="tab" href="#tab-3" aria-expanded="false">编辑友情链接<?php echo $info['name']; ?></a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane <?php if(input('tab',1) == 1): ?>active<?php endif; ?>">
                            <div class="panel-body">
                               <!--  <form method="post" class="form-horizontal" action="<?php echo url('deleteAll'); ?>" data-type="ajax"> -->
                                    <div class="table-responsive">
                                        <table id="dataTables-example" class="table table-striped">
                                            <thead>
                                                <tr>
                                                    <th></th>
                                                    <th>ID</th>
                                                    <th>排序</th>
                                                    <th>链接名称</th>
                                                    <th>链接url</th>
                                                    <th>链接LOGO</th>
                                                    <th>链接描述</th>
                                                    <th>操作</th>
                                                </tr>
                                            </thead>
                                        </table>
                                    </div>
                              <!--   </form> -->
                            </div>
                        </div>
                        <div id="tab-2" class="tab-pane <?php if(input('tab',1) == 2): ?>active<?php endif; ?>">
                            <div class="panel-body">
                           <form action="<?php echo url('add'); ?>" method="post" enctype="multipart/form-data"  class="form-horizontal">
                                
                            <div class="form-group">
                                <label class="col-sm-2 control-label">链接名称</label>

                                <div class="col-sm-6">
                                    <input type="text" name="linkname" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">链接url</label>

                                <div class="col-sm-6">
                                    <input type="text" name="linkurl" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                             <div class="form-group">
                                <label class="col-sm-2 control-label">链接LOGO</label>

                                <div class="col-sm-6">
                                    <input type="file" name="linkpic" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">链接描述</label>

                                <div class="col-sm-6">
                                    <textarea class="form-control" name="linkdesc" style="height: 100px;"></textarea>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">排序</label>

                                <div class="col-sm-3">
                                    <input type="text" name="sort" value="50" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                    <button class="btn btn-white" type="submit">取消</button>
                                </div>
                            </div>
                        </form>
                            </div>
                        </div>
                        <div id="tab-3" class="tab-pane <?php if(input('tab',1) == 3): ?>active<?php endif; ?>">
                            <div class="panel-body">
                                <form action="<?php echo url('edit'); ?>" method="post" enctype="multipart/form-data"  class="form-horizontal">

                            <input type="hidden" name="id" value="<?php echo $info['id']; ?>">

                            <div class="form-group">
                                <label class="col-sm-2 control-label">链接名称</label>

                                <div class="col-sm-6">
                                    <input type="text" name="linkname" value="<?php echo $info['linkname']; ?>" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">链接url</label>

                                <div class="col-sm-6">
                                    <input type="text" name="linkurl" value="<?php echo $info['linkurl']; ?>" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                             <div class="form-group">
                                <label class="col-sm-2 control-label">链接LOGO</label>

                                <div class="col-sm-6">
                                    <input type="file" name="linkpic" class="form-control" >
                                    <?php if($info['linkpic'] != ''): ?>
                                    <img src="/public/uploads/<?php echo $info['linkpic']; ?>" width="300">
                                    <?php else: ?>
                                    暂无缩略图
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                              <div class="form-group">
                                <label class="col-sm-2 control-label">链接描述</label>

                                <div class="col-sm-6">
                                    <textarea class="form-control" name="linkdesc" style="height: 100px;"><?php echo $info['linkdesc']; ?></textarea>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">排序</label>

                                <div class="col-sm-6">
                                    <input type="text" name="sort" value="<?php echo $info['sort']; ?>" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">保存内容</button>
                                    <button class="btn btn-white" type="submit">取消</button>
                                </div>
                            </div>
                        </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/public/static/admin/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="/public/static/admin/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="/public/static/admin/js/content.min.js?v=1.0.0"></script>
    <script src="/public/static/admin/js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function() {
            $("#dataTables-example").dataTable({
                "serverSide": true,
                "ajax": {
                    "url": "<?php echo url('getDataTables'); ?>",
                    "data": function(d) {
                        d.extra_search = "id|linkname";
                    }
                },
                "ordering": false, //禁用全局排序
                "order": [0, '`listorder` desc'],
                "lengthMenu": [5, 10, 20, 50, 100],
                // "dom": '<l <"#normalToos">f>t<ip>',
                "dom": "<'row'<'#normalToos.col-xs-4'><'col-xs-8'f>>" +
                    "<'row'<'col-xs-12't>>" +
                    "<'row'<'col-xs-6'li><'col-xs-6'p>>",
                "language": {
                    "zeroRecords": "没有检索到数据",
                    "lengthMenu": "每页 _MENU_ 条记录&nbsp;&nbsp;",
                    "search": "搜索 ",
                    "info": "共 _PAGES_ 页，_TOTAL_ 条记录，当前显示 _START_ 到 _END_ 条",
                    "paginate": {
                        "previous": "上一页",
                        "next": "下一页",
                    }
                },
                "columns": [{
                    render: function(data, type, row, meta) {
                        return '';
                    }
                }, {
                    data: "id"
                },{
                    data:"sort" 
                }, {
                    data: "linkname"
                }, {
                     data:"linkurl"
                },  {
                    data: "linkpic"
                }, {
                    data: "linkdesc"
                }, {
                    data:"operate"
                } ],
                "drawCallback": function() {
                    normal_init();
                },
                "initComplete": function() {
                    $("#normalToos").append("<div class='m-b-xs'>" +
                        "<div class='btn-group' id='exampleTableEventsToolbar' role='group'>" +
                        "<a class='btn btn-sm btn-outline btn-default' title='添加' href='<?php echo url('index',['tab'=>2]); ?>'>" +
                        "<i class='glyphicon glyphicon-plus' aria-hidden='true'></i>添加链接</a>" +
                        "</div></div>");
                }
            });

        });


    </script>
    
    <script src="/public/static/admin/js/plugins/layer/layer.min.js"></script>
    <script src="/public/static/admin/js/adva.js"></script>
</body>

</html>
