<?php

    include ('../connect-bdd/connexion_bdd.php');
    $id = $_GET['id'];


    $reponse = $bdd->query('SELECT * FROM `admin` WHERE id =\'' . $id .'\'');

    while ($donnees = $reponse->fetch()){
        $pouvoir = $donnees['admin'];
        $pseudo = $donnees['login'];
        $couleur =  $donnees['couleur'];
        $admin = $donnees['admin'];
        $nom = $donnees['nom'];
        $prenom = $donnees['prenom'];
        $avatar = $donnees['avatar'];
        $societe = $donnees['societe'];
        $email = $donnees['email'];
        $tel = $donnees['tel'];

        $nom_groupe_admin = $donnees['nom_groupe'];
    }
    $reponse->closeCursor();


/*    En validant le portail-login, $page_en_cours == accueil    */
    $page_en_cours = $_GET['pageVisitee'];

    /*    Cas de la Page Compte    */
    if (isset($_GET['ongletVisite'])){
        $onglet_cpts_en_cours = $_GET['ongletVisite'];
    }
    else{
        $onglet_cpts_en_cours = "monCompte";
    }
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <!-- Meta Viewport pour un comportement optimisé Mobile (touch & zoom) -->
        <!--<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">-->
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <meta name="description" content="Espace Admin Client Studio-Acts">

        <!-- CSS Global -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
        <link rel="stylesheet" type="text/css" href="../../css/global/loader.css">
        <link rel="stylesheet" type="text/css" href="../../css/global/global.css">
        <link rel="stylesheet" type="text/css" href="../../css/global/layout-admin.css">
        <link rel="stylesheet" type="text/css" href="../../css/global/header.css">
        <link rel="stylesheet" type="text/css" href="../../css/global/sidebars.css">
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">

        <link rel="stylesheet" href="../../js/outils/pop-up/css/animate.css">
        <link rel="stylesheet" href="../../js/outils/pop-up/css/replete-modal.css">

        <!-- CSS Pages-->
        <!-- On appel la feuille de style de la page en cours de Visite-->
        <?php

        if ($page_en_cours === "accueil"){
            echo '<link rel="stylesheet" type="text/css" href="../../css/pages/accueil.css">';
        } elseif ($page_en_cours === "contacts"){
            echo '<link rel="stylesheet" type="text/css" href="../../css/pages/contacts.css">';
        } elseif ($page_en_cours === "newsletter"){
            echo '<link rel="stylesheet" type="text/css" href="../../css/pages/newsletter.css">';
        } elseif ($page_en_cours === "modif-site"){
            echo '<link rel="stylesheet" type="text/css" href="../../css/pages/modif-site.css">';
        } elseif ($page_en_cours === "comptes"){
            echo '<link rel="stylesheet" type="text/css" href="../../css/pages/comptes/comptes.css">';

            if ($onglet_cpts_en_cours === "monCompte"){
                echo '<link rel="stylesheet" type="text/css" href="../../css/pages/comptes/monCompte.css">';
            }
            elseif ($onglet_cpts_en_cours === "comptesUtilisateurs"){
                echo '<link rel="stylesheet" type="text/css" href="../../css/pages/comptes/comptesUtilisateurs.css">';
            }
            elseif ($onglet_cpts_en_cours === "creerUnCompte"){
                echo '<link rel="stylesheet" type="text/css" href="../../css/pages/comptes/creerUnCompte.css">';
            }
        };

        ?>

        <!-- Horloge -->
        <script type="text/javascript" src="../../js/outils/horloge.js"></script>


        <title>SmartAdmin 6.0</title>
    </head>


    <body>
<!-----------------------
|      Utilitaires      |
------------------------>
    <!-- Start Loader -->
    <?php require 'loader.php'; ?>
    <!-- End Loader -->



    <!-- Boîte à couleurs-->
    <div id="maCouleur"
         data-ma-couleur="<?php echo htmlspecialchars($couleur); ?>"
         data-mon-id="<?php echo $id; ?>"
         style="display: none">
    </div>



<!-----------------------
|      Layout Page      |
------------------------>
    <!-- Start Header -->
    <?php require 'header.php';?>
    <!-- End Header -->



    <!-- Start Sidebars -->
    <?php require 'sidebars.php';?>
    <!-- End Sidebars -->



    <!--/ div qui ferme la sidebar en Mobile -->
    <div id="menu-close">
        <a href="javascript:void(0)"></a>
    </div>



    <!-- Start Page Visitée -->
    <div class="main">
        <!-- On passe à div.main la page appelée dans l'url  -->

        <?php
            if ($page_en_cours == "accueil"){
                require '../../pages/accueil/accueil.php';
            } elseif ($page_en_cours == "contacts"){
                require '../../pages/contacts/contacts.php';
            } elseif ($page_en_cours == "newsletter"){
                require '../../pages/newsletter/newsletter.php';
            } elseif ($page_en_cours == "modif-site"){
                require '../../pages/modif-site/modif-site.php';
            } elseif ($page_en_cours == "comptes"){
                require '../../pages/comptes/comptes.php';
            }
        ; ?>

    </div>
    <!-- End Page Visitée -->



<!-----------------------
|       Javascript      |
------------------------>
        <!-- JS Bootstrap -->

        <!--<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>-->
        <script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

        <!-- JS Greensock -->
        <script src="../../js/outils/TweenMax.min.js"></script>

        <!-- JS Theme Couleur -->
        <script src="../../js/theme.js"></script>
        <?php
            if ($page_en_cours === "comptes" & $onglet_cpts_en_cours === "monCompte"){
                echo '<script src="../../js/maj-theme.js"></script>';
        /* JS Widget Avatars */
                echo '<script src="../../js/gestion-avatars.js"></script>';
        /* JS Gestion Inputs Coordonnées + Sécurité */
                echo '<script src="../../js/gestion-inputs-mon-compte.js"></script>';
            }
        ?>

        <!-- JS Layout + Sidebars -->
        <script src="../../js/layout-admin.js"></script>
        <script src="../../js/sidebars.js"></script>

        <!-- JS Affichage des Modals  -->
        <script src="../../js/outils/pop-up/js/replete-modal.js"></script>

        <!-- JS Gérer l'id dans l'Ajax de Recherche de Contacts  -->
        <?php
        if ($page_en_cours === "contacts" & $onglet_cpts_en_cours === "monCompte"){
            require '../../pages/contacts/input-search-contacts.php';
        }
        ?>
        <!-- JS Loading Page -->
        <script src="../../js/loader.js"></script>


    </body>
</html
