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

YiiAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <link href="<?= STATIC_URL ?>/ui/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/animate.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/style.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/plugins/select2/select2.min.css" rel="stylesheet">
    <style>
        #datatables tr.selected {
            background: #1ab394;
            color: #FFF;
        }

        .ibox-title {
            border-width: 1px 0 0;
        }

        @media (min-width: 1366px) {
            .container {
                width: 1170px;
            }
        }

        @media (min-width: 1440px) {
            .container {
                width: 1170px;
            }
        }

        @media (min-width: 1600px) {
            .container {
                width: 1170px;
            }
        }

        @media (min-width: 1920px) {
            .container {
                width: 1170px;
            }
        }
    </style>
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <?= isset($this->blocks['header_script']) ? trim($this->blocks['header_script']) : '' ?>
</head>
<body class="top-navigation">
<?php $this->beginBody() ?>
<div id="wrapper">
    <div id="page-wrapper" class="gray-bg">
        <div class="wrapper wrapper-content">
            <div class="container">
                <?= $content ?>
            </div>
        </div>
        <br>
        <div class="footer">
            <div class="container">
                <div class="pull-right">V2.0</div>
                <div><strong>Copyright</strong> &copy; <?= date('Y') ?></div>
            </div>
        </div>
    </div>
</div>
<?php $this->endBody() ?>
<!-- Mainly scripts -->
<script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/inspinia.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/pace/pace.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/validate/jquery.validate.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/validate/additional-methods.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/validate/messages.cn.js"></script>
<!-- iCheck -->
<script src="<?= STATIC_URL ?>/ui/js/plugins/iCheck/icheck.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/select2/select2.full.min.js"></script>
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });
        $('.data').datepicker({
            startView: 1,
            todayBtn: "linked",
            keyboardNavigation: true,
            forceParse: false,
            autoclose: true,
            format: "yyyy-mm-dd"
        });
        $(".select2").select2();
        $("#kefu").click(function () {
            window.open('http://crm2.qq.com/page/portalpage/wpa.php?uin=800800642&aty=1&a=0&curl=&ty=1', '_blank', 'width=760,height=430,top=0px,left=0px');
        });
        findNotReadCount();
    });
    function findNotReadCount() {
        $.ajax({
            type: "GET",
            url: "<?= Url::to(['/user/notice/find-not-read-count']) ?>",
            data: $('#form').serialize(),
            dataType: "text",
            beforeSend: function () {
            },
            success: function (data) {
                if (data != "0") {
                    $("#findNotReadCount").html(data + "未读");
                }
            },
            complete: function (XMLHttpRequest, textStatus) {
            },
            error: function () {
            }
        });
    }
</script>
<script>
    var url = location.href;
    if (url.indexOf("/dashboard") != -1) {
        $("#navdashboard").addClass("active");
    } else if (url.indexOf("/dw") != -1) {
        $("#navdw").addClass("active");
    } else if (url.indexOf("/lever") != -1) {
        $("#navlever").addClass("active");
    } else if (url.indexOf("/transfer") != -1) {
        $("#navtransfer").addClass("active");
    } else if (url.indexOf("/bankdeposit") != -1) {
        $("#navbankdeposit").addClass("active");
    } else if (url.indexOf("/notice") != -1) {
        $("#navnotice").addClass("active");
    } else if (url.indexOf("/nview") != -1) {
        $("#navnotice").addClass("active");
    } else if (url.indexOf("/help") != -1) {
        $("#navhelp").addClass("active");
    }
</script>
<script>
    // 对Date的扩展，将 Date 转化为指定格式的String
    // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符，
    // 年(y)可以用 1-4 个占位符，毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
    // 例子：
    // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
    // (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18
    Date.prototype.Format = function (fmt) { //author: meizz
        var o = {
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "h+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds(), //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds() //毫秒
        };
        if (/(y+)/.test(fmt))
            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    };
    function timeStamp2String(time) {
        time += new Date().getTimezoneOffset() * 60 * 1000;
        var datetime = new Date();
        datetime.setTime(parseInt(time));
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
        var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
        var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
        return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
    }
    function timeStamp2StringForEcharts(time) {
        time += new Date().getTimezoneOffset() * 60 * 1000;
        var datetime = new Date();
        datetime.setTime(parseInt(time));
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
        var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
        var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
        //return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second;
        return month + "/" + date + " " + hour + ":" + minute;
    }
    function timeStamp2StringMin(time) {
        time += new Date().getTimezoneOffset() * 60 * 1000;
        var datetime = new Date();
        datetime.setTime(parseInt(time));
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
        var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
        var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
        //return hour + ":" + minute + ":" + second;
        return hour + ":" + minute;
    }
</script>
<?= isset($this->blocks['left_menu_script']) ? trim($this->blocks['left_menu_script']) : '' ?>
<?= isset($this->blocks['footer_script']) ? trim($this->blocks['footer_script']) : '' ?>
</body>
</html>
<?php $this->endPage() ?>
