<?php

/**
 * @author Pratik Dev <webmaster.pratik@gmail.com>
 */
require_once __DIR__ . '/config/init.php';
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title><?php echo APP_NAME; ?> - Dashboard</title>
    <link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/assets/images/favicon-16x16.png">
    <link rel="manifest" href="/manifest.json">
    <!-- Custom fonts for this template-->
    <link href="<?php echo $AdminURL; ?>/assets/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
    <!-- Custom styles for this template-->
    <link href="<?php echo $AdminURL; ?>/assets/css/sb-admin-2.min.css" rel="stylesheet">
    <link href="<?php echo $AdminURL; ?>/assets/vendor/bootstrap-switch/css/bootstrap4/bootstrap-switch.min.css" rel="stylesheet">
    <link href="<?php echo $AdminURL; ?>/assets/vendor/bootstrap-sweetalert-master/dist/sweetalert.css" rel="stylesheet">
    <link href="<?php echo $AdminURL; ?>/assets/vendor/DataTables/datatables.min.css" rel="stylesheet">
    <link href="<?php echo $AdminURL; ?>/assets/vendor/bootstrap-tagsinput-latest/jquery.tagsinput.min.css" rel="stylesheet">
    <link href="<?php echo $AdminURL; ?>/assets/vendor/summernote-0.8.18-dist/summernote-bs4.min.css" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo $AdminURL; ?>/assets/css/jquery-ui.min.css">
    <link rel="stylesheet" href="<?php echo $AdminURL; ?>/assets/vendor/select2/css/select2.min.css">
    <link rel="stylesheet" href="<?php echo $AdminURL; ?>/assets/css/select2.min.css">

</head>

<body id="page-top" class="sidebar-toggled">

    <!-- Page Wrapper -->
    <div id="wrapper">

        <!-- Sidebar -->
        <ul class="navbar-nav bg-gradient-dark sidebar sidebar-dark accordion toggled" id="accordionSidebar">

            <!-- Sidebar - Brand -->
            <a class="sidebar-brand d-flex align-items-center justify-content-center" href="<?php echo $AdminURL; ?>">
                <div class="sidebar-brand-icon rotate-n-15">
                    <i class="fas fa-tachometer-alt"></i>
                </div>
                <div class="sidebar-brand-text mx-3">Dashboard</div>
            </a>

            <!-- Divider -->
            <hr class="sidebar-divider my-0">

            <!-- Divider -->
            <hr class="sidebar-divider">

            <!-- Heading -->
            <div class="sidebar-heading">
                Application
            </div>

            <!-- Nav Item - Utilities Collapse Menu -->
            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/category/index.php'; ?>">
                    <i class="fas fa-fw fa-sitemap"></i>
                    <span>Categories</span></a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/files/index.php'; ?>">
                    <i class="fas fa-list"></i>
                    <span>Files</span></a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/artist/index.php'; ?>">
                    <i class="fas fa-fw fa-user"></i>
                    <span>Artists</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/user/index.php'; ?>">
                    <i class="fas fa-fw fa-users"></i>
                    <span>Users</span></a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/reports/index.php'; ?>">
                    <i class="fas fa-fw fa-flag"></i>
                    <span>Reports</span></a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/notification/index.php'; ?>">
                    <i class="fas fa-fw fa-bell"></i>
                    <span>Notify</span></a>
            </li>
            <!-- Divider -->
            <hr class="sidebar-divider">
            <!-- Heading -->
            <div class="sidebar-heading">
                Settings
            </div>

            <!-- Nav Item - Charts -->

            <li class="nav-item">
                <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#adsmanage" aria-expanded="true" aria-controls="adsmanage">
                    <i class="fas fa-fw fa-arrow-circle-right"></i>
                    <span>Ads Mangement</span>
                </a>
                <div id="adsmanage" class="collapse" aria-labelledby="adsmanage" data-parent="#accordionSidebar">
                    <div class="bg-white py-2 collapse-inner rounded">
                        <a class="collapse-item" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/ads/index.php'; ?>"><i class="fas fa-fw fa-arrow-circle-right"></i> Ads Changer</a>
                        <a class="collapse-item" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/ads/ads.php'; ?>"><i class="fas fa-fw fa-cog"></i> Ads Code Editor</a>
                    </div>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/setting/headcode.php'; ?>">
                    <i class="fas fa-fw fa-arrow-circle-right"></i>
                    <span>Google Verfication / Analtics</span></a>
            </li>

            <!-- Nav Item - Tables -->
            <li class="nav-item">
                <a class="nav-link" href="<?php echo APP_URL . '/' . ADMIN_DIR . '/setting/index.php'; ?>">
                    <i class="fas fa-fw fa-cog"></i>
                    <span>Settings</span></a>
            </li>

            <!-- Divider -->
            <hr class="sidebar-divider d-none d-md-block">

            <!-- Sidebar Toggler (Sidebar) -->
            <div class="text-center d-none d-md-inline">
                <button class="rounded-circle border-0" id="sidebarToggle"></button>
            </div>

            <div id="sidebar-card">
            </div>
        </ul>
        <!-- End of Sidebar -->
        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                    <!-- Sidebar Toggle (Topbar) -->
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>

                    <div class="d-none d-sm-inline-block mr-auto ml-md-3 my-2 my-md-0 mw-100">
                        <i class="fas fa-eye fa-sm fa-fw text-gray-400"></i> <a target="_blank" href="<?php echo APP_URL; ?>">View Front</a>
                    </div>
                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">

                        <li class="nav-item dropdown no-arrow mx-1">
                            <a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                <i class="fas fa-bell fa-fw"></i>
                                <!-- Counter - Alerts -->
                                <span class="badge badge-danger badge-counter"><?php echo ($totalalerts = count($notification)) . '+' ? $totalalerts : ''; ?></span>
                            </a>
                            <?php if ($notification) : ?>
                                <!-- Dropdown - Alerts -->
                                <div class="dropdown-list dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="alertsDropdown">
                                    <h6 class="dropdown-header">
                                        Alerts Center
                                    </h6>
                                    <?php foreach ($notification as $alert) : ?>
                                        <a class="dropdown-item d-flex align-items-center" href="#">
                                            <div class="mr-3">
                                                <div class="icon-circle bg-warning">
                                                    <i class="fas fa-exclamation-triangle text-white"></i>
                                                </div>
                                            </div>
                                            <div>
                                                <div class="small text-gray-500"><?php echo $alert['date']; ?></div>
                                                <span class="font-weight-bold"><?php echo $alert['text']; ?></span>
                                            </div>
                                        </a>
                                    <?php endforeach ?>
                                </div>
                            <?php unset($notification);
                            endif; ?>
                        </li>
                        <li class="nav-item m-auto">
                            <?php echo 'v' . $AppVersion . '.0'; ?>
                        </li>
                        <div class="topbar-divider d-none d-sm-block"></div>

                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo $_SESSION['username']; ?></span>
                                <img class="img-profile rounded-circle" src="<?php echo $AdminURL; ?>/assets/img/undraw_profile.svg">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown">
                                <a class="dropdown-item" href="<?php echo $AdminURL; ?>/user/profile.php">
                                    <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Profile
                                </a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Logout
                                </a>
                            </div>
                        </li>
                    </ul>

                </nav>
                <!-- End of Topbar -->