<?php
$CI = & get_instance();
$controller = $CI->router->fetch_class();
$action = $CI->router->fetch_method();



?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title><?php echo $titlePage;?></title>
    <link rel="shortcut icon" href="<?php echo base_url('images/favicon.png') ?>" sizes="24x24" type="image/png" />
    <meta name="description" content="overview &amp; stats"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="<?php echo base_url('public/assets/css/bootstrap.min.css') ?>"/>
    <link rel="stylesheet" href="<?php echo base_url('public/assets/font-awesome/4.2.0/css/font-awesome.min.css') ?>"/>
    <link rel="stylesheet" href="<?php echo base_url('public/assets/css/datepicker.min.css') ?>" />
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/css/daterangepicker.min.css' ?>" />
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/css/chosen.min.css' ?>"/>
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/css/jquery-ui.min.css' ?>"/>
		<!-- <link rel="stylesheet" href="assets/css/jquery-ui.min.css" /> -->
    <!-- text fonts -->
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/fonts/fonts.googleapis.com.css' ?>"/>
    <!-- ace styles -->
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/css/ace.min.css' ?>" class="ace-main-stylesheet" id="main-ace-style"/>
    <!-- DCV Style -->
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/css/dcv-css.css' ?>"/>
    <link rel="stylesheet" href="<?php echo base_url().'public/assets/css/pagination.css' ?>"/>
    <!-- inline styles related to this page -->

    <style> body { font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif; } </style>

    <!-- ace settings handler -->
    <script src="<?php echo base_url().'public/assets/js/ace-extra.min.js' ?>"></script>
    <!-- <script src="<?php echo base_url().'public/assets/js/jquery.1.11.1.min.js' ?>"></script> -->
    <script src="<?php echo base_url().'public/assets/js/jquery.2.1.1.min.js' ?>"></script>
    <script src="<?php echo base_url().'public/assets/js/bootstrap.min.js' ?>"></script>
    <script src="<?php echo base_url().'public/assets/js/jquery-ui.min.js' ?>"></script>
    <script src="<?php echo base_url().'public/assets/js/jquery.ui.touch-punch.min.js' ?>"></script>
    <script src="<?php echo base_url().'public/assets/js/chosen.jquery.min.js' ?>"></script>
    <script src="<?php echo base_url().'public/fckeditor/ckfinder/ckfinder.js' ?>"></script>

    <?php if ($controller == 'cmsRanking' && $action == 'listByDaily'): ?>
        <!-- Styles -->
        <style> #chartdiv { width: 100%; height: 500px; } </style>
        <!-- Resources -->
        <script src="https://www.amcharts.com/lib/4/core.js"></script>
        <script src="https://www.amcharts.com/lib/4/charts.js"></script>
        <script src="https://www.amcharts.com/lib/4/themes/animated.js"></script>
    <?php endif; ?>

</head>

<body class="no-skin">
<div id="navbar" class="navbar navbar-default">
    <!-- Giu cho menu tai khoan co dinh -->
    <script type="text/javascript">
        try { ace.settings.check('navbar', 'fixed') } catch (e) { }
    </script>
    <div class="navbar-container" id="navbar-container">
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only">Toggle sidebar</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>

        <div class="navbar-header pull-left">
            <a href="<?php echo base_url('backend/home/index') ?>" class="navbar-brand">
                <small>CMS for Administrator</small>
            </a>
        </div>
        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="<?php echo base_url('images/favicon.png')?>" alt="VMusicchart"/>
                        <span class="user-info">
                            <small>Xin chào,</small>
                            <?php if($CI->session->userdata('username')){
                                echo $CI->session->userdata('username');
                            }else{
                                redirect(base_url('backend/account/index'));
                            }?>
                        </span>
                        <i class="ace-icon fa fa-caret-down"></i>
                    </a>

                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li>
                            <a href="<?php echo base_url('backend/adminSetting/changePassword/'.$CI->session->userdata('id')); ?>">
                                <i class="ace-icon fa fa-cogs"></i>Đổi mật khẩu
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="<?php echo base_url('backend/adminSetting/userInfo/'.$CI->session->userdata('id')); ?>">
                                <i class="ace-icon fa fa-info"></i>Thông tin tài khoản
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="<?php echo base_url('backend/account/logout'); ?>" onclick="return confirm('Bạn có chắc chắn muốn thoát không?')">
                                <i class="ace-icon fa fa-power-off"></i>Thoát
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!-- /.navbar-container -->
</div>

<div class="main-container" id="main-container">
<div id="sidebar" class="sidebar responsive">
    <div class="sidebar-shortcuts" id="sidebar-shortcuts">
        <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
            <button class="btn btn-success"><i class="ace-icon fa fa-signal"></i></button>
            <button class="btn btn-info"><i class="ace-icon fa fa-pencil"></i></button>
            <button class="btn btn-warning"><i class="ace-icon fa fa-users"></i></button>
            <button class="btn btn-danger"><i class="ace-icon fa fa-cogs"></i></button>
        </div>

        <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
            <span class="btn btn-success"></span>
            <span class="btn btn-info"></span>
            <span class="btn btn-warning"></span>
            <span class="btn btn-danger"></span>
        </div>
    </div>
    <!-- /.sidebar-shortcuts -->
    <ul class="nav nav-list">
        <!-- Trang chu -->
        <li class="<?php if($controller && $controller == 'home') echo 'active'?>">
            <a href="<?php echo base_url('backend/home/index'); ?>">
                <i class="menu-icon fa fa-home"></i>
                <span class="menu-text"> Trang chủ </span>
            </a>
            <b class="arrow"></b>
        </li>

        <!-- Quan ly Thong ke -->
        <li class="<?php if($controller && $controller == 'cmsRanking') echo 'active open'?>">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-bar-chart-o"></i>
                <span class="menu-text">BXH</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="<?php if($action && (in_array($action, array('listByDaily')))) echo 'active'?>">
                    <a href="<?php echo base_url('backend/cmsRanking/listByDaily'); ?>">
                        <i class="menu-icon fa fa-caret-right"></i>BXH Ngày
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="<?php if($action && (in_array($action, array('listByWeekly')))) echo 'active'?>">
                    <a href="<?php echo base_url('backend/cmsRanking/listByWeekly'); ?>">
                        <i class="menu-icon fa fa-caret-right"></i>BXH Tuần
                    </a>
                    <b class="arrow"></b>
                </li>
                <li class="<?php if($action && (in_array($action, array('listByMonthly')))) echo 'active'?>">
                    <a href="<?php echo base_url('backend/cmsRanking/listByMonthly'); ?>">
                        <i class="menu-icon fa fa-caret-right"></i>BXH Tháng
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>

        <!-- Quan ly Bài hát -->
        <li class="<?php if($controller && $controller == 'cmsTrack') echo 'active open'?>">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-music" aria-hidden="true"></i>
                <span class="menu-text">Bài hát</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="<?php if($action && (in_array($action, array('listTrack','editTrack','showTrack')))) echo 'active'?>">
                    <a href="<?php echo base_url('backend/cmsTrack/listTrack'); ?>">
                        <i class="menu-icon fa fa-caret-right"></i>Danh sách
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>

        <!-- Quan ly Nghệ sĩ -->
        <li class="<?php if($controller && $controller == 'cmsArtist') echo 'active open'?>">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-users"></i>
                <span class="menu-text">Nghệ sĩ</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="<?php if($action && (in_array($action, array('listArtist','showArtist')))) echo 'active'?>">
                    <a href="<?php echo base_url('backend/cmsArtist/listArtist'); ?>">
                        <i class="menu-icon fa fa-caret-right"></i>Ca sĩ/Nhạc sĩ
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>

        <!-- Quan ly V Heartbeat Live -->
        <li class="<?php if($controller && $controller == 'cmsVheartbeatlive') echo 'active open'?>">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-video-camera"></i>
                <span class="menu-text">V Heartbeat Live</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="<?php if($action && (in_array($action, array('listVheartbeatlive','addVheartbeatlive','editVheartbeatlive')))) echo 'active'?>">
                    <a href="<?php echo base_url('backend/cmsVheartbeatlive/listVheartbeatlive'); ?>">
                        <i class="menu-icon fa fa-caret-right"></i>Danh sách mã nhúng
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>

        <!-- Quan ly tai nguyen -->
        <!--<li class="<?php /*if($controller && $controller == 'cmsResource') echo 'active open'*/?>">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-camera"></i>
                <span class="menu-text">QL Thư viện</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="<?php /*if($action && (in_array($action, array('listResource')))) echo 'active'*/?>">
                    <a href="<?php /*echo base_url('backend/cmsResource/listResource'); */?>">
                        <i class="menu-icon fa fa-caret-right"></i>Danh sách tài nguyên
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>-->

        <!-- Quan ly he thong -->
        <?php if($CI->session->userdata('group_id') == 2 && $CI->session->userdata('is_super') == 1): ?>
        <li class="<?php if($controller && $controller == 'cmsSetting') echo 'active open'?>">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa fa-cogs"></i>
                <span class="menu-text">Hệ thống</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                <li class="<?php if($action && (in_array($action, array('listGroup','addGroup','editGroup')))) echo 'active'?>">
                    <a href="<?php echo base_url().'backend/cmsSetting/listGroup'; ?>">
                        <i class="menu-icon fa fa-caret-right"></i>DS Nhóm quản trị
                    </a>
                    <b class="arrow"></b>
                </li>

                <li class="<?php if($action && (in_array($action, array('listUserAdmin','addUserAdmin','editUserAdmin','assignPermissionUserAdmin')))) echo 'active'?>">
                    <a href="<?php echo base_url().'backend/cmsSetting/listUserAdmin'; ?>">
                        <i class="menu-icon fa fa-caret-right"></i>DS Quản trị viên
                    </a>
                    <b class="arrow"></b>
                </li>

                <li class="<?php if($action && $action == 'logUser') echo 'active'?>">
                    <a href="<?php echo base_url().'backend/cmsSetting/logUser'; ?>">
                        <i class="menu-icon fa fa-caret-right"></i>Log nhập, xuất
                    </a>
                    <b class="arrow"></b>
                </li>

                <li class="<?php if($action && $action == 'logAction') echo 'active'?>">
                    <a href="<?php echo base_url().'backend/cmsSetting/logAction'; ?>">
                        <i class="menu-icon fa fa-caret-right"></i>Log hành động
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
        <?php endif; ?>
    </ul>
    <!-- /.nav-list -->

    <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
        <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
           data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>

    <script type="text/javascript">
        try {
            ace.settings.check('sidebar', 'collapsed')
        } catch (e) {
        }
    </script>
</div>

<div class="main-content">
    <div class="main-content-inner">
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try {
                    ace.settings.check('breadcrumbs', 'fixed')
                } catch (e) {
                }
            </script>
            <ul class="breadcrumb">
                <li><i class="ace-icon fa fa-home home-icon"></i>Home</li>
                <?php if(isset($functionName)): ?>
                <li class="active"><?php echo $functionName; ?></li>
                <?php endif; ?>
            </ul>
            <!-- /.breadcrumb -->
        </div>
        <div class="page-content">
            <!-- /.page-header -->
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <?php $CI->load->view($loadPage); ?>
                    <!-- PAGE CONTENT ENDS -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /.page-content -->
    </div>
</div>
<!-- /.main-content -->

<div class="footer">
    <div class="footer-inner">
        <div class="footer-content">
            <span class="bigger-50">&copy; 2020</span>
        </div>
    </div>
</div>

<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div>
<!-- /.main-container -->

<!-- daterange picker scripts -->
<script src="<?php echo base_url().'public/assets/js/jquery-ui.custom.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/chosen.jquery.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/fuelux.spinner.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/bootstrap-datepicker.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/bootstrap-timepicker.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/moment.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/daterangepicker.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/bootstrap-datetimepicker.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/bootstrap-colorpicker.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/jquery.knob.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/jquery.autosize.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/jquery.inputlimiter.1.3.1.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/jquery.maskedinput.min.js' ?>"></script>
<!-- /daterange picker scripts -->
<!-- Bootstrap Modals -->
<script src="<?php echo base_url().'public/assets/js/bootbox.min.js' ?>"></script>
<!-- /Bootstrap Modals -->
<script type="text/javascript" src="<?php echo base_url('public/fckeditor/ckeditor/ckeditor.js')?>"></script>
<!-- ace scripts -->
<script src="<?php echo base_url().'public/assets/js/ace-elements.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/ace.min.js' ?>"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('.date-picker').datepicker({
            autoclose: true,
            todayHighlight: true,
            format: 'dd/mm/yyyy',
            startDate: '30/03/2020',
            endDate: '<?php echo date('d/m/Y', time()-86400)?>'
        });

        $('input[name=date-range-picker]').daterangepicker({
            'applyClass' : 'btn-sm btn-success',
            'cancelClass' : 'btn-sm btn-default',
            locale: {
                applyLabel: 'Chọn',
                cancelLabel: 'Hủy'
            },
            format: 'DD/MM/YYYY',
            maxDate: '<?php echo date('d/m/Y')?>'
        });
    });
</script>

</body>
</html>
