<!DOCTYPE html>
<html>
<head>

    {% set page_title = 'Database Summary Reports' %}
    <title>{{ page_title }}</title>

    {% set bloom_mod = 'admin' %}

    <link rel="stylesheet" type="text/css" href="{{ style.skin_css }}"  >
    <link rel="stylesheet" type="text/css" href="/static/legacy/style.css">
    <script src="/static/legacy/action_buttons.js"></script>
</head>
<body>
    {% include 'legacy/bloom_header.html' %}

    <h1>Database Stats</h1>
    <ul>
        <small>for all the pgadmn goodness, run the pgadmn install script</small>
        
        <ul><hr>
        <b>Total Number of Rows: {{ nrows }}</b> 

    <h2>Database Summary Reports</h2>

    {% for report in reports %}
        <h3>{{ report[0].Report }}</h3>
        <table>
            <thead>
                <tr>
                    {% for key in report[0].keys() %}
                        {% if key != 'Report' %}
                            <th>{{ key.replace('_', ' ') }}</th>
                        {% endif %}
                    {% endfor %}
                </tr>
            </thead>
            <tbody>
                {% for row in report %}
                    <tr>
                        {% for key, value in row.items() %}
                            {% if key != 'Report' %}
                                <td>{{ value }}</td>
                            {% endif %}
                        {% endfor %}
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% endfor %}
</body>
</html>
