<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <style>
*{
                box-sizing: border-box;
                color:darkblue
            }
            form {
                width: 500px;
                margin: auto;
                position: relative;
                top: 100px;
                background-color: rgb(213, 146, 133);
                padding-left: 10px;
                padding-top: 10px;
            }
            table, td, th {
                padding: 10px;
            }
            tr:nth-child(even) {background-color: #f2f2f2;}
        </style>
    </head>
    <body>
    <form action="zad3.php" method="GET">    
        <label for="rok">Unesite naziv predmeta:</label><br>
        <input type="text" name="rok" id="rok"><br><br>
        <label for="godina">Unesite godinu roka:</label><br>
        <input type="text" name="godina" id="godina"><br>
        <br>
        <input type="submit" value="Prikazi">
    
    <?php
    $rok = $_GET['rok'];
    $godina = $_GET['godina'];
    $conn = new mysqli("localhost", "root", "daradara", "StudentskaBaza");
    $upit = "SELECT ispit.oznaka_roka, MAX(ispit.ocena) as o FROM ispit JOIN predmet on ispit.id_predmeta = predmet.id_predmeta WHERE ispit.godina_roka = 2015 AND predmet.naziv = 'Analiza 1' GROUP BY ispit.oznaka_roka;";
    $rezultat = $conn->query($upit);
    if($rezultat->num_rows==0)
        die("nema rezultata");

    echo "<table>";
    echo "<tr><th>Najveca ocena</th><th>Oznaka roka</th></tr>";
    while($red = $rezultat->fetch_assoc()){
        echo "<tr><td>".$red['o']."</td><td>".$red['oznaka_roka']."</td>";
    }
    echo "</table>";
    ?>
    </form>
    </body>
</html>