<?php
include 'sections/head.php'
?>

<!-- ======================================================================
                                        START HEADER
    ======================================================================= -->
<?php
include 'sections/header.php';
?>

<!-- ======================================================================
                                        END HEADER
======================================================================= -->


<?php
if (isset($_GET['tid'])) {
    $tid = $_GET['tid'];
}
if (isset($_GET['ttid'])) {
    $ttid = $_GET['ttid'];
    $found_topic = Topics::find_by_id($ttid);
    $found_type_topic = Type_topic::find_by_id($found_topic->topic_typetopic_id);
    $found_user_info = User_info::find_by_id($found_topic->topic_author);
}

?>
<div class="page-title-area">
    <div class="container">
        <div class="page-title-content">

            <h2><?php echo $found_type_topic->type_topic_desc ?></h2>
            <ul>
                <li><a href="index.php">Accueil</a></li>
                <li><?php echo $found_type_topic->type_topic_desc ?></li>
            </ul>
        </div>
    </div>
</div>
<?php if(isset($_GET['msg']) && $_GET['msg'] == 'success'){ ?>
<div class="d-flex justify-content-center" style="color:#fff; background-color:#016147; font-size:20px; padding:5px;">Votre commentaire a été envoyé avec succès!</div>
<?php } ?>
</br></br>
<?php
$found_photos = explode(",", $found_topic->topic_image_path);
?>

<!-- =====================================================================
                                             START PUBLIC OR PRIVATE CONTENT
====================================================================== -->
<?php

if ($found_topic->topic_statut == 1 && !isset($_GET['msg'])) {
    include 'sections/private_content.php';
} else {

    include 'sections/public_content.php';
}
?>
<!-- =====================================================================
                                             END PUBLIC OR PRIVATE CONTENT
====================================================================== -->


<!-- =====================================================================
                                             START FOOTER
====================================================================== -->
<?php include 'sections/footer.php';?>
<!-- =====================================================================
                                             END FOOTER
====================================================================== -->