<?php
include_once "config.php";

$sql = "SELECT * FROM galerija ORDER BY date DESC LIMIT 15";

$result = $connection->query($sql);

?>

<!DOCTYPE html>
<html lang="lv">
<head>
    <meta charset="UTF-8">
    <title>Galerija | Mirklis Elegances</title>
    <meta name="keywords" content="Galerija" />
    <meta name="description" content="Mirklis Elegances galerija." />
    <meta name="author" content="www.mirkliselegances.lv" />
    <meta name="robots" content="index, follow">
    <meta name="viewport" content="width=400, initial-scale=1.0">

    <link rel="stylesheet" href="assets/css/galerija.css">

    <link rel="stylesheet" href="https://unpkg.com/aos@2.3.1/dist/aos.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Karla&display=swap">


    <link rel="icon" type="image/png" href="assets/images/favicons/favicon-310x310.png" sizes="310x310" />
    <link rel="icon" type="image/png" href="assets/images/favicons/favicon-192x192.png" sizes="192x192" />
    <link rel="icon" type="image/png" href="assets/images/favicons/favicon-32x32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="assets/images/favicons/favicon-16x16.png" sizes="16x16" />

    <script src="jquery.js" type="text/javascript"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
                new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
        })(window,document,'script','dataLayer','GTM-PFZ3WDD');</script>
    <!-- End Google Tag Manager -->


    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PFZ3WDD"
                      height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
</head>
<body class="scroll4">

<?php
include_once "cookie.php";
?>

<header>
    <!-- Mirklis Elegances logo -->
    <div class="logo-center">
        <div class="logo-container">
            <img alt="Mirklis Elegances logo" class="logo" src="assets/images/logo1.png">
        </div>
    </div>
    <!-- Nav menu lines -->
    <input type="checkbox" id="nav-toggle" class="nav-toggle">
    <label for="nav-toggle" class="nav-toggle-label">
        <span></span>
    </label>
    <!-- Nav menu buttons -->
    <nav>
        <ul>
            <li><a href="index.php">Sākums</a></li>
            <li><a href="index.php#item1">Par Mums</a></li>
            <li><a href="index.php#item2">Kubls</a></li>
            <li><a href="index.php#item3">Cenrādis</a></li>
            <li><a href="index.php#item4">Papildaprīkojums</a></li>
            <li><a href="galerija.php">Galerija</a></li>
        </ul>
    </nav>
    <!-- Social buttons -->
    <div class="social-container">
        <a href="https://www.instagram.com/mirklis.elegances/" target="_blank" rel="noopener noreferrer"><embed alt="Instagram logo" width="35px" height="35px" src="assets/images/insta.png"></a>
        <a href="https://www.facebook.com/MirklisElegances" target="_blank" rel="noopener noreferrer"><embed alt="Facebook logo" width="35px" height="35px" src="assets/images/fb.png"></a>
        <a href="https://api.whatsapp.com/send?phone=37128070571" target="_blank" rel="noopener noreferrer"><embed alt="Whatsapp logo" width="35px" height="35px" src="assets/images/wpp.png"></a>
    </div>
</header>

<!-- Parallax image 1 -->
<div class="parallax image1" style="height:100%"></div>

<!-- First section -->
<div class="items-bg" id="item1">
    <div class="items">
        <div class="textdiv1">
            <h1 class="title">Galerija</h1>
        </div>
        <div id="gallery-container">
            <?php

            if ($result->num_rows > 0) {
                while ($row = $result->fetch_assoc()) {
                    echo "
                    <div class='gallery-item'>
                        <img class='thumbnail2' src='assets/images/".$row["img"]."'>
                    </div>
                    ";
                }
            }
            ?>
        </div>
    </div>
</div>

<footer>
    <div class="footer-vert">
        <div class="footer-text">
            <span>Cēsis</span>
            <span>|</span>
            <span><a href="tel:+37128070571">(+371) 28070571</a></span>
            <span>|</span>
            <span><a href="mailto: mirklis.elegances@gmail.com">mirklis.elegances@gmail.com</a></span>
        </div>
        <br id="footer-split">
        <div class="credits">
            <span>Designed by Rihards Lācis</span>
            <a rel="noreferrer" target="_blank" href="https://github.com/SolidShock"><img alt="Github logo" src="assets/images/github_logo.png"></a>
            <a rel="noreferrer" target="_blank" href="https://www.linkedin.com/in/rihards-l%C4%81cis-56047021a/"><img alt="LinkedIn logo" src="assets/images/linkedin_logo.png"></a>
        </div>
    </div>
</footer>