<?PHP 
require_once('core.php');
if(!isset($_SESSION['id']))
{
header("Location: index.php");
exit();
}
$menu = "couple";
$page = "lescouples";
$erreur = false;
?>
<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title><?PHP echo htmlentities(trim($cms['nom_hotel'])); ?> - Couple</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'); ?>
        <?PHP if (isset($message) && $erreur == true) { ?>
                <div class="grid_24">
            <div id="erreur">
                <div class="title red">
                    <?PHP echo htmlentities(trim($message)); ?>
                </div>
            </div>
        </div>
        <?PHP } elseif (isset($message) && $erreur == false) { ?>
        <div class="grid_24">
            <div id="good">
                <div class="title red">
                    <?PHP echo htmlentities(trim($message)); ?>
                </div>
            </div>
        </div>
        <?PHP } ?>
            <?PHP
            $SelectDemandeToi = $bdd->prepare('SELECT * FROM pluscms_couples');
            $SelectDemandeToi->execute();
            while ($c = $SelectDemandeToi->fetch()) {
            $SelectPseudo = $bdd->prepare('SELECT * FROM users WHERE id = ? LIMIT 1');
            $SelectPseudo->execute(array($c['membres_1_id']));
            $SelectPseudo2 = $bdd->prepare('SELECT * FROM users WHERE id = ? LIMIT 1');
            $SelectPseudo2->execute(array($c['membres_2_id']));
            $D = $SelectPseudo->fetch();
            $D2 = $SelectPseudo2->fetch();
            ?>
            <div class="grid_8">
                <div id="contentBox" class="activity" style="overflow: hidden;">
                    <div class="head">
                        <div class="badgeImage couple"></div>
                        <?PHP echo htmlspecialchars(trim($D['username'])); ?> & <?PHP echo htmlspecialchars(trim($D2['username'])); ?>
                        <br>
                        <span class="date">Unis depuis le <?PHP echo date('d.m.Y à H:i', intval($c['date'])); ?></span>
                    </div>
                    <div class="text" style="background: url(web/img/couple/heart-icon.png) no-repeat center center;height: 200px;text-align: center;">
                    <img style="margin-top: 35px;" src="https://www.habbo.de/habbo-imaging/avatarimage?figure=<?PHP echo htmlspecialchars(trim($D['look'])); ?>&direction=2&head_direction=2&action=wlk&size=m&gesture=sml">
                    <img style="margin-top: 35px;" src="https://www.habbo.de/habbo-imaging/avatarimage?figure=<?PHP echo htmlspecialchars(trim($U['look'])); ?>&direction=4&head_direction=4&action=wlk&size=m&gesture=sml">
                    </div>
                    <div class="text" style="text-align: center;">
                    
                </div>
                </div>
            </div>
            <?PHP } ?>
            <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>