add table of needed shirts to user active page

This commit is contained in:
Philip Häusler 2015-08-14 14:06:33 +02:00
parent 18e49ee06a
commit e8daa4d2ce
4 changed files with 56 additions and 29 deletions

View File

@ -146,13 +146,22 @@ function admin_active() {
$matched_users[] = $usr; $matched_users[] = $usr;
} }
$shirt_statistics = sql_select(" $given_shirt_statistics = sql_select("
SELECT `Size`, count(`Size`) AS `count` SELECT `Size`, count(`Size`) AS `count`
FROM `User` FROM `User`
WHERE `Tshirt`=1 WHERE `Tshirt`=1
GROUP BY `Size` GROUP BY `Size`
ORDER BY `count` DESC"); ORDER BY `Size` DESC");
$shirt_statistics[] = array( $given_shirt_statistics[] = array(
'Size' => '<b>' . _("Sum") . '</b>',
'count' => '<b>' . sql_select_single_cell("SELECT count(*) FROM `User` WHERE `Tshirt`=1") . '</b>'
);
$needed_shirt_statistics = sql_select("
SELECT `Size`, count(`Size`) AS `count`
FROM `User`
GROUP BY `Size`
ORDER BY `Size` DESC");
$needed_shirt_statistics[] = array(
'Size' => '<b>' . _("Sum") . '</b>', 'Size' => '<b>' . _("Sum") . '</b>',
'count' => '<b>' . sql_select_single_cell("SELECT count(*) FROM `User` WHERE `Tshirt`=1") . '</b>' 'count' => '<b>' . sql_select_single_cell("SELECT count(*) FROM `User` WHERE `Tshirt`=1") . '</b>'
); );
@ -178,11 +187,22 @@ function admin_active() {
'tshirt' => _("T-shirt?"), 'tshirt' => _("T-shirt?"),
'actions' => "" 'actions' => ""
), $matched_users), ), $matched_users),
div('row', [
div('col-md-6', [
'<h2>' . _("Needed shirts") . '</h2>' ,
table(array(
'Size' => _("Size"),
'count' => _("Count")
), $needed_shirt_statistics)
]),
div('col-md-6', [
'<h2>' . _("Given shirts") . '</h2>', '<h2>' . _("Given shirts") . '</h2>',
table(array( table(array(
'Size' => _("Size"), 'Size' => _("Size"),
'count' => _("Count") 'count' => _("Count")
), $shirt_statistics) ), $given_shirt_statistics)
])
])
)); ));
} }
?> ?>

View File

@ -268,7 +268,7 @@ function User_angeltypes_render($user_angeltypes) {
$class = 'text-warning'; $class = 'text-warning';
else else
$class = 'text-success'; $class = 'text-success';
$output[] = '<span class="' . $class . '">' . ($angeltype['coordinator'] ? '<span class="glyphicon glyphicon-certificate"></span> ' : '') . $angeltype['name'] . '</span>'; $output[] = '<span class="' . $class . '">' . ($angeltype['coordinator'] ? glyph('education') : '') . $angeltype['name'] . '</span>';
} }
return join('<br />', $output); return join('<br />', $output);
} }

View File

@ -1,8 +1,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Engelsystem 2.0\n" "Project-Id-Version: Engelsystem 2.0\n"
"POT-Creation-Date: 2015-08-14 12:31+0100\n" "POT-Creation-Date: 2015-08-14 14:06+0100\n"
"PO-Revision-Date: 2015-08-14 12:32+0100\n" "PO-Revision-Date: 2015-08-14 14:06+0100\n"
"Last-Translator: msquare <msquare@notrademark.de>\n" "Last-Translator: msquare <msquare@notrademark.de>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: de_DE\n" "Language: de_DE\n"
@ -557,21 +557,22 @@ msgid "remove t-shirt"
msgstr "entferne t-shirt" msgstr "entferne t-shirt"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:156 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:156
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:165
#: /Users/msquare/workspace/projects/engelsystem/includes/view/AngelTypes_view.php:139 #: /Users/msquare/workspace/projects/engelsystem/includes/view/AngelTypes_view.php:139
#: /Users/msquare/workspace/projects/engelsystem/includes/view/AngelTypes_view.php:146 #: /Users/msquare/workspace/projects/engelsystem/includes/view/AngelTypes_view.php:146
#: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:52 #: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:52
msgid "Sum" msgid "Sum"
msgstr "Summe" msgstr "Summe"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:162 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:171
msgid "Search angel:" msgid "Search angel:"
msgstr "Suche Engel:" msgstr "Suche Engel:"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:163 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:172
msgid "Show all shifts" msgid "Show all shifts"
msgstr "Alle Schichten anzeigen" msgstr "Alle Schichten anzeigen"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:164 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:173
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:86 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:86
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:87 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:87
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_free.php:71 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_free.php:71
@ -581,59 +582,65 @@ msgstr "Alle Schichten anzeigen"
msgid "Search" msgid "Search"
msgstr "Suche" msgstr "Suche"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:167 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:176
msgid "How much angels should be active?" msgid "How much angels should be active?"
msgstr "Wie viele Engel sollten aktiv sein?" msgstr "Wie viele Engel sollten aktiv sein?"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:168 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:177
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_shifts.php:239 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_shifts.php:239
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_shifts.php:322 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_shifts.php:322
msgid "Preview" msgid "Preview"
msgstr "Vorschau" msgstr "Vorschau"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:172 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:181
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:90 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:90
msgid "Nickname" msgid "Nickname"
msgstr "Nick" msgstr "Nick"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:173 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:182
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:183 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:194
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:201
#: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:78 #: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:78
msgid "Size" msgid "Size"
msgstr "Größe" msgstr "Größe"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:174 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:183
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/user_shifts.php:4 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/user_shifts.php:4
#: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:217 #: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:217
msgid "Shifts" msgid "Shifts"
msgstr "Schichten" msgstr "Schichten"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:175 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:184
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_shifts.php:311 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_shifts.php:311
msgid "Length" msgid "Length"
msgstr "Länge" msgstr "Länge"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:176 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:185
msgid "Active?" msgid "Active?"
msgstr "Aktiv?" msgstr "Aktiv?"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:177 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:186
#: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:76 #: /Users/msquare/workspace/projects/engelsystem/includes/view/User_view.php:76
msgid "Forced" msgid "Forced"
msgstr "Gezwungen" msgstr "Gezwungen"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:178 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:187
msgid "T-shirt?" msgid "T-shirt?"
msgstr "T-Shirt?" msgstr "T-Shirt?"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:181 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:192
msgid "Given shirts" msgid "Needed shirts"
msgstr "Ausgegebene T-Shirts" msgstr "Benötigte T-Shirts"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:184 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:195
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:202
msgid "Count" msgid "Count"
msgstr "Anzahl" msgstr "Anzahl"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_active.php:199
msgid "Given shirts"
msgstr "Ausgegebene T-Shirts"
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:4 #: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_arrive.php:4
msgid "Arrived angels" msgid "Arrived angels"
msgstr "Angekommene Engel" msgstr "Angekommene Engel"