<?php defined('KX_ROOT') || exit('Permission denied');?><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>章节列表 - 原创专区 - <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></title>
    <link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/css/style.css"/>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico"/>
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width"/>
    <meta name="applicable-device" content="pc">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <link rel="canonical" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "pcurl");?><?php echo $_SERVER['REQUEST_URI'];?>"/>
    <style>
        .labels {
            height: 51px;
        }

        .labels li {
            padding: 15px 40px;
            background-color: #e5e5e5;
            color: #929297;
            display: inline-block;
            float: left;
        }

        .labels li:hover,
        .labels li.active {
            background-color: #fff;
            color: #323237;
        }

        .container {
            padding: 20px;
        }

        .container table {
            width: 100%;
            text-align: center;
            color: #323237;

        }

        .container table th {
            height: 48px;
            background-color: #F5F5F5;
            text-align: center;
            font-weight: 700;
        }

        .container table thead tr {
            border: 1px solid #F5F5F5;
        }

        .container table td {
            height: 48px;
        }

        .container table tbody tr {
            border: 1px solid #E9E9E9;
        }
    </style>
</head>
<body>
<div class="header">
    <div>
        <a href="/">
            <div class="logo"><span>原创专区</span></div>
        </a>
    </div>
</div>
<div class="body">
    <div class="left bg-white">
    <style>
        .icon {
            width: 20px;
            height: 20px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 10px;
        }

        .icon-home {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-home.png");
        }

        li.active .icon-home {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-home-active.png");
        }

        .icon-novel {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-novel.png");
        }

        li.active .icon-novel {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-novel-active.png");
        }

        .icon-stat {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-stat.png");
        }

        li.active .icon-stat {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-stat-active.png");
        }

        .icon-money {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-money.png");
        }

        li.active .icon-money {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-money-active.png");
        }

        .icon-userinfo {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-userinfo.png");
        }

        li.active .icon-userinfo {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-userinfo-active.png");
        }
        .add_novel:before{
            content: '+';
            width: 20px;
            height: 20px;
            display: inline-block;
            left: 60px;
            position: relative;
            margin-left: -20px;
            font-weight: 700;
        }
        .add_novel a{
            color: #929292 !important;
        }
    </style>
    <ul class="nav">
        <li class="<?php echo $pagesign == 'home'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.index",[],"");?>">
                <i class="icon icon-home"></i>专区首页
            </a>
        </li>
        <li class="<?php echo in_array($pagesign, ['novel','chapter'])?'active':'';?>">
            <?php if(in_array($pagesign, ['novel','chapter'])):?>
            <a href="javascript:void(0);">
                <i class="icon icon-novel"></i>作品管理
            </a>
            <ul class="sub-nav">
                <?php if(is_array($novels)): foreach($novels as $key =>$loop):?>
                <li class="<?php echo $_GET['novelid']==$loop['id']?'active':'';?>" style="width: 165px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                    <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.index",['novelid'=>$loop['id']],"");?>" title="<?php echo $loop['name'];?>"><?php echo $loop['name'];?></a>
                </li>
                <?php endforeach; endif;?>
                <li class="add_novel"><a href="<?php echo \Kuxin\Helper\Url::build("author.novel.add",[],"");?>">创建作品</a></li>
            </ul>
            <?php else:?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.novel.index",[],"");?>">
                <i class="icon icon-novel"></i>作品管理
            </a>
            <?php endif;?>
        </li>
        <li class="<?php echo $pagesign == 'stat'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.stat.index",[],"");?>">
                <i class="icon icon-stat"></i>数据统计
            </a>
        </li>
        <li class="<?php echo in_array($pagesign, ['incomeindex','incomerecord','incomemanage','incomeguarantee'])?'active':'';?>">
            <?php if(in_array($pagesign, ['incomeindex','incomerecord','incomemanage','incomeguarantee'])):?>
            <a href="javascript:void(0);">
                <i class="icon icon-money"></i>稿酬收入
            </a>
            <ul class="sub-nav">
                <li class="<?php echo $pagesign=='incomerecord'?'active':'';?>"><a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",[],"");?>">收入明细</a></li>
                <li class="<?php echo in_array($pagesign, ['incomemanage','incomeguarantee'])?'active':'';?>"><a href="<?php echo \Kuxin\Helper\Url::build("author.income.manage",[],"");?>">提现管理</a></li>
            </ul>
            <?php else:?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",[],"");?>">
                <i class="icon icon-money"></i>稿酬收入
            </a>
            <?php endif;?>
        </li>
        <li class="<?php echo $pagesign == 'authorinfo'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.info",[],"");?>">
                <i class="icon icon-userinfo"></i>作家资料
            </a>
        </li>
    </ul>
</div>
    <div class="right">
        <div class="labels">
            <ul>
                <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.index",['novelid'=>$_GET['novelid'],'type'=>'draft'],"");?>"><li class="<?php echo $type=='draft'?'active':'';?>">草稿箱</li></a>
                <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.index",['novelid'=>$_GET['novelid'],'type'=>'published'],"");?>"><li class="<?php echo $type=='published'?'active':'';?>">已发布</li></a>
                <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.index",['novelid'=>$_GET['novelid'],'type'=>'recycle'],"");?>"><li class="<?php echo $type=='recycle'?'active':'';?>">回收站</li></a>
                <a href="<?php echo \Kuxin\Helper\Url::build("author.novel.index",['novelid'=>$_GET['novelid']],"");?>"><li>作品设置</li></a>
            </ul>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.add",['novelid'=>$_GET['novelid']],"");?>" class="fr color1 bg-red plr20 ptb10">
                <img class="pr10 vertical-middle" style="height: 16px;width:16px;"
                     src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-edit.png" alt="新建章节">新建章节
            </a>
            <?php if($type == 'recycle'):?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.clear",['novelid'=>$_GET['novelid']],"");?>" class="fr color0 bg-white plr20 ptb10 mr10">
                <img class="pr10 vertical-middle" style="height: 16px;width:16px;"
                     src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-del.png" alt="全部清空">全部清空
            </a>
            <?php endif;?>
        </div>
        <div class="container bg-white">
            <table>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>章节</th>
                    <th>名称</th>
                    <th>字数</th>
                    <th>类型</th>
                    <th>时间</th>
                    <?php if($type == 'draft'):?>
                    <th>状态</th>
                    <?php endif;?>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php if(empty($records)):?>
                <tr><td colspan="<?php echo $type == 'draft'?7:8;?>">这里似乎什么都没有~</td></tr>
                <?php endif;?>
                <?php if(is_array($records)): foreach($records as $key =>$loop):?>
                <tr>
                    <td><?php echo $loop['id'];?></td>
                    <td><?php echo $loop['status'] == 1 || $type == 'published' ?$loop['order_id']:'';?></td>
                    <td><?php echo $loop['name'];?></td>
                    <td><?php echo \Kuxin\Helper\Json::decode($loop['note'])['words'];?></td>
                    <td><?php echo [-1=>'状态异常',-2=>'公众章节',-3=>'收费章节'][$loop['type']];?></td>
                    <td><?php echo \Kuxin\View::date($loop['time'],"Y-m-d H:i");?></td>
                    <?php if($type == 'draft'):?>
                    <td><?php echo \Kuxin\View::default($loop['status'],'草稿','发布待审核');?></td>
                    <?php endif;?>
                    <td>
                        <?php if(is_array($actions) && (array()!=$actions)): $i=array(); $i['loop']=array_slice($actions,0,null,true); $i['total']=count($actions); $i['count']=count($i['loop']); $i['cols']=1; $i['add']=$i['count']%1?1-$i['count']%1:0; $i['order']=0; $i['row']=1;$i['col']=0;foreach(array_pad($i['loop'],$i['add'],array()) as $i['index']=>$i['list']): $action=$i['list']; $i['order']++; $i['col']++; if($i['col']==1): $i['col']=0; $i['row']++; endif; $i['first']=$i['order']==1; $i['last']=$i['order']==$i['count']; $i['extra']=$i['order']>$i['count'];?>
                        <?php if($loop['status'] != 1 || $loop['status'] == 1 && $loop['id'] == 'del'):?>
                        <a href="<?php echo \Kuxin\Helper\Url::build('author.chapter.'.$i['index'],['novelid'=>$loop['novel_id'],'chapterid'=>$loop['id'],'type'=>$type]);?>"><?php echo $action;?></a>
                        <?php endif;?>
                        <?php endforeach; endif;?>
                    </td>
                </tr>
                <?php endforeach; endif;?>
                </tbody>
            </table>
            <?php $paginate=\Kuxin\Block::show('pagination', ['page'=>$page,'limit'=>$pagesize,'count'=>$count,'maxpage'=>50,'section'=>3]);?>
            <?php if($paginate['total']>1):?>
            <div class="pt-pages mtb10 text-center">
                <div class="inline-block">
                    <?php if($paginate['current'] > 1):?>
                    <a class="inline-block ptb5 plr10"
                       href="<?php echo \Kuxin\Helper\Url::build("",['type'=>$_GET['type'],'novelid'=>$_GET['novelid'],'page'=>$paginate['prev']],"");?>"><span><</span></a>
                    <?php else:?>
                    <span class="inline-block ptb5 plr10 disable"><</span>
                    <?php endif;?>
                    <?php if(is_array($paginate['items'])): foreach($paginate['items'] as $key =>$loop):?>
                    <a class="inline-block ptb5 plr10"
                       href="<?php echo \Kuxin\Helper\Url::build("",['type'=>$_GET['type'],'novelid'=>$_GET['novelid'],'page'=>$loop['num']],"");?>">
                        <span class="<?php echo \Kuxin\View::default($loop['status'],'','color2');?>"><?php echo $loop['num'];?></span>
                    </a>
                    <?php endforeach; endif;?>
                    <?php if($paginate['current'] < $paginate['total']):?>
                    <a class="inline-block ptb5 plr10"
                       href="<?php echo \Kuxin\Helper\Url::build("",['type'=>$_GET['type'],'novelid'=>$_GET['novelid'],'page'=>$paginate['next']],"");?>"><span>></span></a>
                    <?php else:?>
                    <span class="inline-block ptb5 plr10 disable">></span>
                    <?php endif;?>
                </div>
            </div>
            <?php endif;?>
        </div>
    </div>
</div>
<div class="footer text-center">
    <?php $list=\Kuxin\Block::show('page.list', []);?>
    <span class="aboutlink">
        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
        <a href="<?php echo \Kuxin\Helper\Url::build("page.detail",['pageid'=>$loop['id'],'key'=>$loop['key']],"");?>" title="<?php echo $loop['name'];?>"> <?php echo $loop['name'];?> </a>
        <?php endforeach; endif;?>
    </span>
    <span class="inline-block ml40">Copyright © 2009 - 2019 <a href="<?php echo $pt['config']['siteurl'];?>" target="_blank"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></a>. All Rights Reserved . 版权所有<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></span>
</div>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/jquery-3.3.1.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/layer/layer.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/common.js"></script>
</body>
</html>