<?php
include_once "header.php";
?>
<!-- Main -->
<div id="main-wrapper">
    <div class="container">
        <div class="row 200%">
            <div class="4u 12u(medium)">
                <?php
                include_once "sidebar.php";
                ?>
            </div>
            <div class="8u 12u(medium) important(medium)">
                <div id="content">

                    <!-- Content -->
                    <article class="restaurant">
                        <?php
                        $db = new Db();
                        $id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
                        $rows = $db->select("SELECT * FROM `poi` WHERE `Id`=" . $id);
                        ?>
                        <?php
                        if ($rows) {
                            if ($rows[0]['imageURL'] == "") {
                                $thumbnailURL = Init::HOMEURL . "images/imageNotAvailable.jpg";
                            } else {
                                $thumbnailURL = Init::IMAGEURL . $rows[0]['imageURL'];
                            }
                            ?>
                            <h2><?php echo $rows[0]["Name"]; ?></h2>
                           <div class="12u">
                                <div class="6u">

                                    <img class="placeImage" src="<?php echo $thumbnailURL; ?>" alt="<?php echo $rows[0]['Name']; ?>">

                                    <?php
                                    if ($rows[0]['Recommended']) {

                                        echo "<img src='" . Init::HOMEURL . "images/medal.png' alt='Recommended' class='recommended'>";
                                    }
                                    ?>
                                </div>
                                <div class="6u">
                                    <p>
                                        <?php echo preg_replace("/\r|\n/", "<br>", $rows[0]["Description"]); ?>
                                    </p>
                                </div>
                            </div>


                            <iframe width="100%" height="300" src="https://maps.google.com/maps?width=100%&amp;height=300&amp;hl=en&amp;coord=<?php echo $rows[0]["Latitude"]; ?>,<?php echo $rows[0]["Longtitude"]; ?>&amp;q=+()&amp;ie=UTF8&amp;t=&amp;z=14&amp;iwloc=B&amp;output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>

                    </div>
                <?php } else { ?>
                    <h2>Not found</h2>
                    Restaurant was not found!
                <?php } ?>



                </article>

            </div>
        </div>
    </div>
</div>
</div>
<?php
include_once "footer.php";
?>