diff --git a/handlers/__pycache__/projectors.cpython-314.pyc b/handlers/__pycache__/projectors.cpython-314.pyc index a5f945a..e2b90d5 100644 Binary files a/handlers/__pycache__/projectors.cpython-314.pyc and b/handlers/__pycache__/projectors.cpython-314.pyc differ diff --git a/handlers/projectors.py b/handlers/projectors.py index a8da0fe..e1dfad9 100644 --- a/handlers/projectors.py +++ b/handlers/projectors.py @@ -41,6 +41,26 @@ def projectors_list(*, get_conn, projector_kit_types): """ ) rows = cur.fetchall() + total_items = len(rows) + kits_count = 0 + projectors_count = 0 + tv_count = 0 + boards_count = 0 + interactive_display_count = 0 + for row in rows: + kit_type = (row[2] or "").strip().lower() + if kit_type == "kit": + kits_count += 1 + projectors_count += 1 + boards_count += 1 + elif kit_type == "projector": + projectors_count += 1 + elif kit_type == "board": + boards_count += 1 + elif kit_type == "tv": + tv_count += 1 + elif kit_type == "display": + interactive_display_count += 1 cur.execute("SELECT id, name FROM cabinets ORDER BY name") cabinets = cur.fetchall() cur.execute( @@ -69,6 +89,12 @@ def projectors_list(*, get_conn, projector_kit_types): kit_types=projector_kit_types, kit_type_labels=dict(projector_kit_types), projector_brands=projector_brands, + total_items=total_items, + kits_count=kits_count, + projectors_count=projectors_count, + tv_count=tv_count, + boards_count=boards_count, + interactive_display_count=interactive_display_count, ) diff --git a/templates/network.html b/templates/network.html index 669bad9..fa1d8f2 100644 --- a/templates/network.html +++ b/templates/network.html @@ -4,8 +4,8 @@
@@ -259,6 +266,15 @@ {% endfor %} +
+ Всего: {{ total_items }} | + Проекторов: {{ projectors_count }} | + Комплектов: {{ kits_count }} | + Телевизоров: {{ tv_count }} | + Досок: {{ boards_count }} | + Интерактивных экранов: {{ interactive_display_count }} +
+ {% if session.get('role') in ('admin','storekeeper') %}