<!DOCTYPE html>
<html lang="fr">

<!-- Head -->
<head>
    {% include 'head.html' %}
</head>
<!-- End of Head -->

<body id="page-top">

<!-- Page Wrapper -->
<div id="wrapper">

    <!-- Sidebar -->
    {% include 'sidebar.html' %}
    <!-- End of Sidebar -->

    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

        <!-- Main Content -->
        <div id="content">

            <!-- Topbar -->
            <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
                {% include 'topbar.html' %}
            </nav>
            <!-- End of Topbar -->

            <!-- Begin Page Content -->
            <div class="container-fluid">
                {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                {% for category, message in messages %}
                <div class="card bg-{{ category }} text-white shadow">
                    <div class="card-body">
                        {{ message }}
                    </div>
                </div>
                {% endfor %}
                {% endif %}
                {% endwith %}
                <h1>Ajouter un utilisateur</h1>
                <!-- Forms -->
                <form method="post" action="user_addbdd" class="user">
                    <div class="form-group row">
                        <label for="inputEmail3" class="col-sm-2 col-form-label">Nom</label>
                        <div class="col">
                            <input name="prenom" type="text" class="form-control" placeholder="Prénom">
                        </div>
                        <div class="col">
                            <input name="nom" type="text" class="form-control" placeholder="Nom de famille">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputEmail3" class="col-sm-2 col-form-label">Téléphone (ex : 0612563478)</label>
                        <div class="col-sm-10">
                            <input name="number" type="tel" pattern="[0-9]{10}" required class="form-control"
                                   id="inputEmail3" placeholder="Téléphone">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="inputPassword3" class="col-sm-2 col-form-label">Mot de passe</label>
                        <div class="col-sm-10">
                            <input name="password" type="password" class="form-control" id="inputPassword3"
                                   placeholder="Mot de passe">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleFormControlSelect1">Rank de l'utilisateur</label>
                        <select name="rank" class="form-control" id="exampleFormControlSelect1">
                            <option>Patient</option>
                            <option>Proche</option>
                            {% if admin_option==0 %}
                            <option>Personnel Médical</option>
                            <option>Administrateur</option>
                            {% endif %}
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">Enregistrer</button>
                </form>

            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- End of Main Content -->

        <!-- Footer -->
        {% include 'footer.html' %}
        <!-- End of Footer -->

    </div>
    <!-- End of Content Wrapper -->

</div>
<!-- End of Page Wrapper -->

<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
</a>

<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
     aria-hidden="true">
    {% include 'auth/logout_modal.html' %}
</div>

</body>

</html>
