{% extends 'base.html' %}

{% block content %}

<h1>{{table_name}}</h1>

<li><a href="/addalim/{{table_name}}">add alim</a></li>
<li><a href="/details/{{table_name}}">consumption details</a></li>
<br>

<h2>tabel_alimentari</h2>
<table class="table" id="tabel_alimentari" border="1">
<!--    <script src="{{ url_for('static', filename='js/myfile.cs') }}"></script>-->
    <thead>
        <tr>
            {% for colName in tabel_alimentari[0] %}
                <th scope="col" onclick="sortTable(0)">{{colName}}</th>
            {% endfor %}
        </tr>
    </thead>

    {% for row in tabel_alimentari[1:] %}
    <tr>
        {% for col in row %}
            <td>{{col}}</td>
        {% endfor %}
    </tr>
    {% endfor %}
</table>

<br>
<h2>tabel_totals</h2>
<table class="table" id="tabel_totals" border="1">
    <thead>
        <tr>
            {% for colName in tabel_totals[0] %}
                <th scope="col" onclick="sortTable(0)">{{colName}}</th>
            {% endfor %}
        </tr>
    </thead>
    {% if tabel_totals is not none %}
        {% for row in tabel_totals[1:] %}
        <tr>
            {% for col in row %}
                <td>{{col}}</td>
            {% endfor %}
        </tr>
        {% endfor %}
    {% else %}
    {% endif %}
</table>
<br>

<br>
<h2>last_records</h2>
<table class="table" id="last_records" border="1">
<!--    <script src="{{ url_for('static', filename='js/myfile.cs') }}"></script>-->
    <thead>
        <tr>
            {% for colName in last_records[0] %}
                <th scope="col" onclick="sortTable(0)">{{colName}}</th>
            {% endfor %}
        </tr>
    </thead>

    {% for row in last_records[1:] %}
    <tr>
        {% for col in row %}
            <td>{{col}}</td>
        {% endfor %}
    </tr>
    {% endfor %}
</table>
<br>

{% endblock %}
