<!DOCTYPE html>
<html lang="pl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styl.css">
    <title>OPONY</title>
</head>
<body>
    <main>
        <aside>
            <?php
                $connect = mysqli_connect("localhost", "root", "", "opony");
                $query = "SELECT * FROM opony ORDER BY cena ASC LIMIT 10;";

                $result = mysqli_query($connect, $query);
            ?>
            <p><a href="https://opona.pl/">więcej ofert</a></p>
        </aside>
        <section class="section1">
            <img src="opona.png" alt="Opona">
            <h2>Opona dnia</h2>
            <?php
                $query = "SELECT producent, model, sezon, cena FROM opony WHERE nr_kat=9";
                $result = mysqli_query($connect, $query);

            ?>
        </section>
        <section class="section2">
            <h2>Najnowsze zamówienie</h2>
            <?php
                $query = "SELECT id_zam, ilosc, model, cena FROM zamowienie INNER JOIN opony ON zamowienie.id = opony.nr_kat ORDER BY RAND() LIMIT 1;";
                $result = mysqli_query($connect, $query);

                mysqli_close($connect);
            ?>
        </section>
    </main>
    <footer>
        <p>Stronę wykonał: Zong</p>
    </footer>
</body>
</html>