<!DOCTYPE html>
<html lang="en">
<head>
    <title>Admin</title>
    <!-- Required meta tags -->
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />

    <!-- CSS -->
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU"
      crossorigin="anonymous"
    />
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col">
                <a class="btn btn-primary m-3" href="index.php?action=goToSeeOrdre" role="button">Retour</a>
                <h1>Ordre des énigmes</h1>
            </div>
        </div>
        <div class="row">
            <div class="col">
            <form action="index.php?action=modifOrdre" method="POST">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th scope="col">Enigme</th>
                            <th scope="col">Ordre</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                            foreach ($lesEnigmes as $enigme) {
                                echo "<tr>";
                                echo "<td>".$enigme->getNom()."</td>";
                                echo '<td><input type="number" name="ordre'. $enigme->getIdEnigme() .'" value="'. $enigme->getOrdre() .'"></td>';
                                echo "</tr>";
                            }
                        ?>
                    </tbody>
                </table>
                <button class="btn btn-primary m-3" type="submit">
                    Modifier
                </button>
            </form>
            </div>
        </div>
    </div>
</body>