MAI/LabWork01/templates/main_page.html

59 lines
2.1 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Список магазинов</title>
<style>
.head {
background: #fc3;
border: 2px solid black;
padding: 20px;
}
</style>
</head>
<body>
<div>
<form action='http://127.0.0.1:5000/showDiapason' method=get>
<input type=text size=20 name=firstRow>
<input type=text size=20 name=secondRow>
<input type=text size=20 name=firstColumn>
<input type=text size=20 name=secondColumn>
2023-09-14 22:10:09 +04:00
<input type=submit value='Вывод диапазона'>
</form>
</div>
<div>
<table>
<tr>
{% if firstColumn == 1 %}
<th class="head">Площадь магазина, кв. м, double</th>
{% endif %}
{% if firstColumn <= 2 and secondColumn >= 2 %}
<th class="head">Кол-во продукции, шт, int</th>
{% endif %}
{% if firstColumn <= 3 and secondColumn >= 3 %}
<th class="head">Кол-во посетителей в день, чел., int</th>
{% endif %}
{% if secondColumn == 4 %}
<th class="head">Кол-во проданных товаров, шт., int</th>
{% endif %}
</tr>
{% for elem in context %}
<tr>
{% if firstColumn == 1 %}
<td>{{ elem.store_area }}</td>
{% endif %}
{% if firstColumn <= 2 and secondColumn >= 2 %}
<td>{{ elem.items_available }}</td>
{% endif %}
{% if firstColumn <= 3 and secondColumn >= 3 %}
<td>{{ elem.daily_customer_count }}</td>
{% endif %}
{% if secondColumn == 4 %}
<td>{{ elem.store_sales }}</td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
</body>
</html>