<?php
session_start();
if (!isset($_SESSION['eggzie_iboPlayer'])) {
    header('Location: login.php');
    exit();
}

error_reporting(E_ALL);
ini_set("display_errors",1);
ini_set("display_startup_errors", 1);
$admin_name = $_SESSION['admin_name'];

$IIIIIIIlI1lI = $_SESSION['id'];
$IIIIIIIlI1ll = new SQLite3('./a/.eggziepanels.db');
$adb = new SQLite3('./api/.adb.db');
$IIIIIIIlI1l1 = $IIIIIIIlI1ll->query('SELECT * FROM USERS WHERE id=\'1\'')->fetchArray();
$IIIIIIIlI11l = $IIIIIIIlI1l1['NAME'];
$IIIIIIIlI111 = $IIIIIIIlI1l1['LOGO'];

$IIIIIIIllIII = file_get_contents('./includes/eggzie.json');
$IIIIIIIllIIl = json_decode($IIIIIIIllIII, true);
$IIIIIIIllII1 = $IIIIIIIllIIl['info']['aa'];

// Carregar gerenciador de logo
require_once 'LogoManager.php';
$logoManager = new LogoManager('admin', 'admin');
$panel_logo = $logoManager->getLogo();
?>

<!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="">
    <meta name="google" content="notranslate">
    <title>IBO MASTER</title>
    <link rel="shortcut icon" href="favicon1.ico" type="image/x-icon">
    <link rel="icon" href="favicon1.ico" type="image/x-icon">
    
    <link href="css/sb-admin-2.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/jquery.datetimepicker.min.css"/>
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
    <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
    <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">
</head>
<body id="page-top">
    
    <div id="wrapper">
        <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
            <a class="sidebar-brand d-flex align-items-center justify-content-center" href="users.php">
                <div class="sidebar-brand-icon">
                    <img class="img-profile" width="120px" src="<?php echo $panel_logo; ?>">
                </div>
            </a>
            
            <!-- Nav Item - DNS Management -->
            <li class="nav-item">
                <a class="nav-link" href="dns_manager.php">
                    <i class="fas fa-fw fa-database"></i>
                    <span>Gerenciar DNSs</span>
                </a>
            </li>
            
            <hr class="sidebar-divider my-0">
            
            <li class="nav-item">
                <a class="nav-link" href="users.php">
                    <i class="fas fa-fw fa-user-plus"></i>
                    <span>Usuários</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="revenda.php">
                    <i class="fas fa-fw fa-user-plus"></i>
                    <span>Revenda</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="sub_revenda.php">
                    <i class="fas fa-fw fa-user-plus"></i>
                    <span>Sub Revenda</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="note.php">
                    <i class="fas fa-fw fa-inbox"></i>
                    <span>Notificação</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="qrcode.php">
                    <i class="fas fa-fw fa-qrcode"></i>
                    <span>QR Code e Texto</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="revenda_mensagem.php">
                    <i class="fas fa-fw fa-exclamation-triangle"></i>
                    <span>Alerta para Revendas</span>
                </a>
            </li>
            
            <li class="nav-item">
                <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePages" aria-expanded="true" aria-controls="collapsePages">
                    <i class="fa fa-cogs"></i>
                    <span>Config de Widget</span>
                </a>
                <div id="collapsePages" class="collapse" aria-labelledby="headingPages" data-parent="#accordionSidebar">
                    <div class="bg-white py-2 collapse-inner rounded">
                        <h6 class="collapse-header">Configuração de fundo:</h6>
                        <a class="collapse-item" href="UI_Setting.php"><i class="fa fa-home fa-fw" aria-hidden="true"></i></i><span> Widgets</span></a>
                        <a class="collapse-item" href="ads.php"><i class="fa fa-file-image-o"></i><span> Publicidades</span></a>
                        <a class="collapse-item" href="intro.php"><i class="fa fa-television"></i><span> Canal</span></a>
                        <a class="collapse-item" href="Sport.php"><i class="fa fa-futbol-o"></i><span> Esportes</span></a>
                    </div>
                </div>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="Image.php">
                    <i class="fa fa-picture-o"></i>
                    <span>Imagens de fundo</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="logo.php">
                    <i class="fa fa-fw fa-camera"></i>
                    <span>Alterar logotipo</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="layouts.php">
                    <i class="fa fa-hospital-o"></i>
                    <span>Temas</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="update.php">
                    <i class="fas fa-fw fa fa-refresh"></i>
                    <span>Atualização Apk</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="snoop.php">
                    <i class="fas fa-fw fa-eye"></i>
                    <span>Registros</span>
                </a>
            </li>
            
            <!-- Nav Item - Profile -->
            <li class="nav-item">
                <a class="nav-link" href="profile.php">
                    <i class="fas fa-fw fa-user"></i>
                    <span>Perfil</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>
        </ul>
        
        <div id="content-wrapper" class="d-flex flex-column">
            <div id="content">
                <nav class="navbar navbar-expand navbar-light topbar mb-4 static-top shadow">
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>
                    <div>
                        <h5 class="m-0 text-primary">Usuário<br><?php echo $IIIIIIIlI11l; ?></h5>
                    </div>
                    <ul class="navbar-nav ml-auto">
                        <div class="topbar-divider d-none d-sm-block"></div>
                        <li class="nav-item dropdown no-arrow mx-1">
                            <a class="nav-link dropdown-toggle" href="login.php">
                                <span class="badge badge-danger">Sair</span>
                                <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-red-400"></i>
                            </a>
                        </li>
                    </ul>
                </nav>