<?php
use yii\helpers\Url;
?>
<style>
    #side-menu li {display: none;}
</style>

<nav class="navbar-default navbar-static-side" role="navigation">
    <div class="sidebar-collapse">
        <ul class="nav metismenu" id="side-menu">
            <li class="nav-header" style="display: block;">
                <div class="profile-element">
                    <h1 style="color:#FFF;">X-CRM</h1>
                </div>
                <div class="logo-element">
                    CRM
                </div>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/dashboard"]) ?>><i class="fa fa-tachometer"></i> <span class="nav-label">管理首页</span></a>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/member"]) ?>><i class="fa fa-user"></i> <span class="nav-label">用户管理</span></a>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/user"]) ?>><i class="fa fa-users"></i> <span class="nav-label">MT4账户管理</span></a>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/open"]) ?>><i class="fa fa-dot-circle-o"></i> <span class="nav-label">开户申请</span></a>
            </li>

            <li>
                <a href="#"><i class="fa fa-arrows-h"></i> <span class="nav-label">修改杠杆</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level collapse">
                    <li><a href=<?= Url::to(["/admin/modify-lever?type=0"]) ?>>待审核明细</a></li>
                    <li><a href=<?= Url::to(["/admin/modify-lever?type=1"]) ?>>审核不通过明细</a></li>
                    <li><a href=<?= Url::to(["/admin/modify-lever?type=2"]) ?>>已修改明细</a></li>
                </ul>
            </li>

            <li>
                <a href="#"><i class="fa fa-retweet"></i> <span class="nav-label">同名转账</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level collapse">
                    <li><a href=<?= Url::to(["/admin/transfer?type=0"]) ?>>待审核明细</a></li>
                    <li><a href=<?= Url::to(["/admin/transfer?type=1"]) ?>>审核不通过明细</a></li>
                    <li><a href=<?= Url::to(["/admin/transfer?type=2"]) ?>>已修改明细</a></li>
                </ul>
            </li>

            <li >
                <a href="#"><i class="fa fa-list-ul"></i> <span class="nav-label">交易管理</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level collapse">
                    <li><a href=<?= Url::to(["/admin/trades?type=deposit"]) ?>>入金</a></li>
                    <li><a href=<?= Url::to(["/admin/trades?type=withdraw"]) ?>>出金</a></li>
                    <li><a href=<?= Url::to(["/admin/trades?type=position"]) ?>>持仓</a></li>
                    <li><a href=<?= Url::to(["/admin/trades?type=history"]) ?>>历史</a></li>
                    <li><a href=<?= Url::to(["/admin/trades?type=pending"]) ?>>挂单</a></li>
                    <li><a href=<?= Url::to(["/admin/trades?type=credit"]) ?>>信用</a></li>
                </ul>
            </li>


            <li>
                <a href=<?= Url::to(["/admin/notice"]) ?>><i class="fa fa-bell-o"></i> <span class="nav-label">公告/帮助管理</span></a>
            </li>

            <li>
                <a href="#"><i class="fa fa-cny"></i> <span class="nav-label">入金管理</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level collapse">
                    <li><a href=<?= Url::to(["/admin/deposit?type=0"]) ?>>待入金明细</a></li>
                    <li><a href=<?= Url::to(["/admin/deposit?type=1"]) ?>>成功入金明细</a></li>
                    <li><a href=<?= Url::to(["/admin/deposit-config"]) ?>>入金配置</a></li>
                </ul>
            </li>

 
            <li>
                <a href="#"><i class="fa fa-dollar"></i> <span class="nav-label">出金管理</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level collapse">
                    <li><a href=<?= Url::to(["/admin/withdraw"]) ?>>全部</a></li>
                    <!--<li><a href=<?= Url::to(["/admin/withdraw?type=0"]) ?>>待审核明细</a></li>-->
                    <li><a href=<?= Url::to(["/admin/withdraw?type=6"]) ?>>待审核明细</a></li>
                    <li><a href=<?= Url::to(["/admin/withdraw?type=1"]) ?>>审核不通过明细</a></li>
                    <li><a href=<?= Url::to(["/admin/withdraw?type=2"]) ?>>已出金明细</a></li>
                    <li><a href=<?= Url::to(["/admin/withdraw?type=3"]) ?>>管理员撤消明细</a></li>
            
                </ul>
            </li>
            

            <li>
                <a href=<?= Url::to(["/admin/ib"]) ?>><i class="fa fa-sitemap"></i> <span class="nav-label">代理商管理</span></a>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/mail"]) ?>><i class="fa fa-send"></i> <span class="nav-label">邮件系统</span></a>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/admin"]) ?>><i class="fa fa-cog"></i> <span class="nav-label">管理员管理</span></a>
            </li>


            <li>
                <a href=<?= Url::to(["/admin/logs"]) ?>><i class="fa fa-keyboard-o"></i> <span class="nav-label">系统日志</span></a>
            </li>

            <li>
                <a href=<?= Url::to(["/admin/config"]) ?>><i class="fa fa-cogs"></i> <span class="nav-label">系统参数设置</span></a>
            </li>
            
            
        </ul>

    </div>
</nav>

<?php  $this->beginBlock('left_script'); ?>
<script>
var allow_urls = <?= json_encode(\Yii::$app->params['allow_urls']) ?>;

$('#side-menu a').each(function (i, n) {
    var href = $(this).attr('href');
    if (href && href.indexOf('?') != -1) {
        href = href.slice(0, href.indexOf('?'));
    }
    if ($.inArray(href, allow_urls) != -1 || href == '#') {
        $(this).parent().show();
    }
});

$('.nav-second-level').each(function (i, n) {
    var show = false;
    $(this).find('li').each(function (i2, n2) {
        if ($(this).css('display') !== 'none') {
            show = true;
            return false;
        }
    });
    if (!show) {
        $(this).parent().hide();
    }
});
</script>
<?php $this->endBlock(); ?>

