<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Groups</title>
</head>
<body>
<section>
    <table>
        {% if groups is defined %}
        {% for row in groups %}
            {% if selectedGroup is defined and selectedGroup == row.id %}
            <tr style="background-color:red;">
                {% else %}
            <tr>
                {% endif %}
                <td>ID</td>
                <td>Num</td>
                <td>Year</td>
                <td>Sector</td>
            </tr>
            <tr>
                <td>{{row.id}}</td>
                <td>{{row.num}}</td>
                <td>{{row.year}}</td>
                <td>{{row.sector}}</td>
                <td><a href="index.php?action=showGroupDetails&selectedGroup={{row.id}}">
                    <input class="btn-black" type="button" value="Show"/>
                </a></td>
            </tr>
        {% endfor %}
        {% endif %}
    </table>
</section>
{% if selectedGroup is defined %}
<section>
    <table>
        <tr>
            <td>ID</td>
            <td>Nickname</td>
            <td>Name</td>
            <td>Surname</td>
            <td>Mail</td>
            <td>Group</td>
            <td>Role</td>
            <td>Extra Time</td>
        </tr>
        {% if users is defined %}
        {% for row in users %}
        <tr>
            <td>{{row.id}}</td>
            <td>{{row.nickname}}</td>
            <td>{{row.name}}</td>
            <td>{{row.surname}}</td>
            <td>{{row.email}}</td>
            <td>{{row.group}}</td>
            <td>{{row.role}}</td>
            <td>{{row.extraTime}}</td>
            <td><a href="index.php?action=removeUserFromGroup&id={{row.id}}">
                <input class="btn-black" type="button" value="Delete from group"/>
            </a></td>
        </tr>
        {% endfor %}
        {% endif %}
    </table>
</section>
{% endif %}
</body>
</html>