<?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>

    </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 bg-white h100" style="min-height: 160px;">
        <div class="mlr20 mt30">
            <img style="vertical-align: middle;margin-top: -5px;" src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/income.png" alt="收入明细">
            <span class="color0 size16 bold ml10">收入管理</span>
        </div>
        <ul class="stat border stat_total mlr20 mtb30" >
            <li class="inline-block border-r" style="width: 33%;">
                <span class="ml30 color0 inline-block mtb20 size18 bold">累计订阅</span>
                <span class="color2 ml40 size16 bold"><?php echo $stat['subscription'];?><span class="color92"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?></span></span>
            </li>
            <li class="inline-block border-r" style="width: 33%;">
                <span class="ml30 color0 inline-block mtb20 size18 bold">累计打赏</span>
                <span class="color2 ml40 size16 bold"><?php echo $stat['reward'];?><span class="color92"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?></span></span>
            </li>
            <li class="inline-block" style="width: 32%;">
                <span class="ml30 color0 inline-block mtb20 size18 bold">累计<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.ticket_caption");?></span>
                <span class="color2 ml40 size16 bold"><?php echo $stat['ticket'];?><span class="color92">张</span></span>
            </li>
        </ul>
    </div>
    <div class="right mt20" style="min-height: 545px;height: 545px;">
        <style>
            .body ul.label li{
                float: left;
                width: 130px;
                height: 50px;
                line-height: 50px;
                text-align: center;
                background: #E5E5E5;
                margin-top: 4px;
            }
            .body ul.label li.active{
                background-color: #fff;
                color: #323237;
                border-top: 4px solid #f55;
                margin-top: 0;
            }
        </style>
        <ul class="label" style="height: 54px;">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",['type'=>'subscription'],"");?>"><li class="<?php echo $type=='subscription'?'active':'';?>">订阅明细</li></a>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",['type'=>'reward'],"");?>"><li class="<?php echo $type=='reward'?'active':'';?>">打赏明细</li></a>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",['type'=>'ticket'],"");?>"><li class="<?php echo $type=='ticket'?'active':'';?>">月票明细</li></a>
        </ul>
        <div class="bg-white pt20" style="height: 470px;">
            <style>
                table {
                    width: 100%;
                    text-align: center;
                    color: #323237;
                }

                table th {
                    height: 40px;
                    background-color: #F5F5F7;
                    text-align: center;
                    font-weight: 700;
                }

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

                table td {
                    height: 35px;
                }

                table tbody tr {
                    border: 1px solid #E9E9E9;
                }
            </style>
            <?php $paginate=\Kuxin\Block::show('pagination', ['page'=>$page,'limit'=>$pagesize,'count'=>$count,'maxpage'=>50,'section'=>3]);?>
            <table class="mlr20" style="width: 950px;">
                <thead>
                <tr>
                    <th>昵称</th>
                    <th>时间</th>
                    <th><?php echo $type=='ticket'?'数量':'金额';?></th>
                    <th>书籍</th>
                    <?php if($type == 'subscription'):?>
                    <th>章节</th>
                    <?php endif;?>
                </tr>
                </thead>
                <tbody>
                <?php if(is_array($records)): foreach($records as $key =>$loop):?>
                <tr>
                    <td><?php echo $loop['user']['nickname']?:$loop['user']['name'];?></td>
                    <td><?php echo \Kuxin\View::date($loop['create_time'],'Y-m-d');?></td>
                    <?php if($type == 'subscription'):?>
                    <td><span class="color2"><?php echo $loop['money_log']['num'];?></span><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?></td>
                    <?php else:?>
                    <td><span class="color2"><?php echo $loop['num'];?></span><?php echo $type=='ticket'?'张':\Kuxin\Helper\Arr::getValue($_kxcms_config, "user.money_caption");?></td>
                    <?php endif;?>
                    <td><?php echo $loop['novel']['name'];?></td>
                    <?php if($type == 'subscription'):?>
                    <td><?php echo $loop['chapter']['name'];?></td>
                    <?php endif;?>
                </tr>
                <?php endforeach; endif;?>
                </tbody>
            </table>
            <?php if($paginate['total']>1):?>
            <div class="pt-pages mtb10 text-center">
                <div class="pt10 color5">
                    <?php if($paginate['prev']):?>
                    <a class="inline-block ptb5 plr10" href="<?php echo \Kuxin\Helper\Url::build("author.income.record",['type'=>$type,'page'=>$paginate['prev']],"");?>"><span><</span></a>
                    <?php else:?>
                    <span class="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("author.income.record",['type'=>$type,'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['next']):?>
                    <a class="inline-block ptb5 plr10" href="<?php echo \Kuxin\Helper\Url::build("author.income.record",['type'=>$type,'page'=>$paginate['next']],"");?>"><span>></span></a>
                    <?php else:?>
                    <span class="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>