ittech/w12/views/lookup-tables.twig
2023-03-26 16:58:46 +07:00

51 lines
No EOL
1.5 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "template.twig" %}
{% block title %}Просмотр таблиц{% endblock %}
{% block head %}
{{ parent() }}
<style>
</style>
{% endblock %}
{% block content %}
{% if table %}
<b>{{user.login}}</b>, вы смотрите таблицу <i>{{table}}</i>. <a href="/lookupTables">Отмена</a>
{% else %}
<b>{{user.login}}</b>, вы смотрите таблицы. <a href="/">На главную</a>
{% endif %}
<hr>
{% if table %}
<table border width="100%">
<thead>
<tr>
{% for item in tableData.header %}
<th>
<a href="/lookupTables?table={{table}}&sort=ASC&col={{item.column_name}}">[ASC]</a>
{{item.column_name}}
<a href="/lookupTables?table={{table}}&sort=DESC&col={{item.column_name}}">[DESC]</a>
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in tableData.data %}
<tr>
{% for col in row %}
<td>{{col}}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<form action="/lookupTables" method="get">
<select name="table">
{% for table in tables %}
<option value="{{table}}">{{table}}</option>
{% endfor %}
</select>
<input type="submit" value="Перейти">
</form>
{% endif %}
{% endblock %}