<?php
/* @var $this \yii\web\View */
/* @var $content string */
use yii\helpers\Html;
use yii\helpers\Url;

/** @var \backend\models\MemberIdentity $identity */
$identity = Yii::$app->getUser()->getIdentity(false);
$mt4User = $identity->getMt4user();
/** @var \backend\modules\user\controllers\BaseController $context */
$context = $this->context;
?>
<div class="ibox">
    <div class="ibox-content text-center">
        <div class="m-b-sm">
            <a href="<?= Url::to(['/user/info']) ?>">
                <img alt="image" class="img-circle" src="<?= STATIC_URL ?>/ui/img/logo.png" style="width:80px;">
            </a>
        </div>
        <h3><?= $identity->name ?></h3>
        <hr>
        <div class="row">
            <div class="col-xs-6 border-right">
                <div class="description-block">
                    <h4 class="description-header text-dan">$<?= $mt4User['EQUITY'] ? number_format($mt4User['EQUITY'], 2) : '0.00' ?></h4>
                    <span class="description-text">净值</span>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="description-block">
                    <h4 class="description-header">1:<?= $mt4User['LEVERAGE'] ?></h4>
                    <span class="description-text">杠杆</span>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="ibox float-e-margins">
    <div class="ibox-content mailbox-content">
        <div class="file-manager">
            <button aria-controls="navbar" aria-expanded="false" data-target="#navbar2" data-toggle="collapse" class="navbar-toggle collapsed pull-left" type="button">
                <i class="fa fa-list"></i>
            </button>
            <div class="clearfix"></div>
            <div class="navbar-collapse collapse" id="navbar2" style="padding:0px;">
                <div class="space-25"></div>
                <h5>名下账户</h5>
                <ul class="folder-list m-b-md" style="padding:0">
                    <?php foreach (explode(',', $identity->logins) as $login):?>
                    <li>
                        <a href="<?= Url::to(['/user/dashboard', 'login' => $login]) ?>"> <i class="fa <?= $login == $identity->getMain_login() ? 'fa-circle' : 'fa-circle-o' ?> "></i><?= $login ?> </a>
                    </li>
                    <?php endforeach;?>
                </ul>
                <h5>出入金</h5>
                <ul class="folder-list m-b-md" style="padding:0">
                    <li>
                        <a href="<?= Url::to(['/user/deposit']) ?>"> <i class="fa <?= $context->id == 'deposit' ? 'fa-circle' : 'fa-circle-o' ?>"></i> 入金报表 </a>
                    </li>
                    <li>
                        <a href="<?= Url::to(['/user/withdraw']) ?>"> <i class="fa <?= $context->id == 'withdraw' ? 'fa-circle' : 'fa-circle-o' ?>"></i> 出金报表</a>
                    </li>
                </ul>
                <h5>交易</h5>
                <ul class="folder-list m-b-md" style="padding:0">
                    <li>
                        <a href="<?= Url::to(['/user/position']) ?>"> <i class="fa <?= $context->id == 'position' ? 'fa-circle' : 'fa-circle-o' ?>"></i> 持仓报表 </a>
                    </li>
                    <li>
                        <a href="<?= Url::to(['/user/pending']) ?>"> <i class="fa <?= $context->id == 'pending' ? 'fa-circle' : 'fa-circle-o' ?>"></i> 挂单报表</a>
                    </li>
                    <li>
                        <a href="<?= Url::to(['/user/history']) ?>"> <i class="fa <?= $context->id == 'history' ? 'fa-circle' : 'fa-circle-o' ?>"></i> 历史报表</a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
</div>
