<?PHP 
require_once('core.php');
if(!isset($_SESSION['id']))
{
header("Location: index.php");
exit();
}
$menu = "home";
$page = "compte";
?>
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title><?PHP echo htmlentities(trim($cms['nom_hotel'])); ?> - Home</title>
        
        <link rel="import" href="https://www.polymer-project.org/0.5/components/paper-ripple/paper-ripple.html">
        <link type="text/css" href="web/css/material.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="web/css/nav.css">
        <script src="web/js/jquery.js"></script>
        <script type="text/javascript" src="web/js/smoothscroll.js"></script>
    </head>    
    <body>
    <?PHP require_once('template/header/template_header.php'); ?>
        <div class="container_24">
        <?PHP require_once('template/header/template_nav.php'); ?>
            <div class="grid_15">
                <div id="contentBox" style="background:url(web/img/me/<?PHP echo htmlentities(trim($cms['themes'])); ?>.png) center center;height:140px;padding:0;">
                    <div class="overlay">
                        <div style="background-image:url(https://www.habbo.de/habbo-imaging/avatarimage?figure=<?PHP echo htmlspecialchars(htmlentities(trim($U['look']))); ?>&direction=2&head_direction=3&action=wav&size=l&gesture=sml);" class="profile-header__avatar__image"></div>
                        <div class="profile-header__avatar__position">
                            <span style="font-size:25px;">Bienvenue <?PHP echo htmlentities(trim($U['username'])); ?> !</span>
                            <div class="motto"><b>Motto:</b> <?PHP echo htmlentities(trim($U['motto'])); ?></div>
                            <div class="lastLogin"><b>Dernière connexion:</b> <?PHP echo date('d.m.Y à h:i', htmlentities(trim($U['last_online']))); ?></div>
                            <div class="creditsAvailable">
                                <div class="credits">
                                    <div class="creditsIcon"></div>
                                    <?PHP echo htmlentities(trim($U['credits'])); ?>
                                </div>
                                <div class="duckets">
                                    <div class="ducketsIcon"></div>
                                    <?PHP echo htmlentities(trim($U['activity_points'])); ?>
                                </div>
                                <div class="diamonds">
                                    <div class="diamondsIcon"></div>
                                    <?PHP echo htmlentities(trim($U['vip_points'])); ?>
                                </div>
                            </div>
                        </div>
                        <a href="hotel" target="_blank" class="button raised green" id="profileCheckIn">
                            <div class="center" fit>ENTRER</div>
                            <paper-ripple fit></paper-ripple>
                        </a>
                    </div>
                </div>
                
                <link type="text/css" href="web/css/newsslider.css" rel="stylesheet">
                <script type="text/javascript" src="web/js/promo.js"></script>
                <div class="news" style="margin-bottom:10px">
                    <div id="promo-box">
                        <div id="promo-bullets"></div>
                        <?PHP 
                        $SelectArticles = $bdd->prepare('SELECT * FROM pluscms_articles ORDER BY id DESC LIMIT 5');
                        $SelectArticles->execute();
                        while ($A = $SelectArticles->fetch()) { ?>
                        <div class="promo-container" style="background-image:url(<?PHP echo htmlspecialchars(htmlentities(trim($A['image']))); ?>);">
                            <div class="promo-content-container">
                                <div class="promo-content">
                                    <div class="title"><?PHP echo htmlspecialchars_decode($A['titre']); ?></div>
                                    <div class="body"><?PHP echo htmlspecialchars_decode($A['soustitre']); ?></div>
                                </div>
                            </div>
                            <div class="promo-link-container">
                                <a href="articles?id=<?PHP echo htmlspecialchars(htmlentities(trim($A['id']))); ?>" class="button raised green" id="newsButton">
                                    <div class="center" fit>Lire l'article &raquo;</div>
                                    <paper-ripple fit></paper-ripple>
                                </a>
                            </div>
                        </div>
                        <?PHP } ?>
                    </div>
                </div>
            </div>
            <div class="grid_9">
                <iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2FHabbo%2F&tabs=timeline&width=350&height=350&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId" width="350" height="350" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
            </div>
            <div class="grid_24">
                <div id="contentBox">
                    <div class="title red">
                        <?PHP echo htmlentities(trim($cms['nom_hotel'])); ?> est propulsé par PlusCMS par Dodone.
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>