From e8daa4d2ce91a5376b3770a8cd60385339b67a81 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 14 Aug 2015 14:06:33 +0200 Subject: add table of needed shirts to user active page --- includes/pages/admin_active.php | 38 +++++++++++++++++++++++++++++--------- includes/view/User_view.php | 2 +- 2 files changed, 30 insertions(+), 10 deletions(-) (limited to 'includes') diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index b79d1bd1..78796391 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -145,14 +145,23 @@ function admin_active() { $matched_users[] = $usr; } - - $shirt_statistics = sql_select(" + + $given_shirt_statistics = sql_select(" SELECT `Size`, count(`Size`) AS `count` FROM `User` WHERE `Tshirt`=1 GROUP BY `Size` - ORDER BY `count` DESC"); - $shirt_statistics[] = array( + ORDER BY `Size` DESC"); + $given_shirt_statistics[] = array( + 'Size' => '' . _("Sum") . '', + 'count' => '' . sql_select_single_cell("SELECT count(*) FROM `User` WHERE `Tshirt`=1") . '' + ); + $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' => '' . _("Sum") . '', 'count' => '' . sql_select_single_cell("SELECT count(*) FROM `User` WHERE `Tshirt`=1") . '' ); @@ -178,11 +187,22 @@ function admin_active() { 'tshirt' => _("T-shirt?"), 'actions' => "" ), $matched_users), - '

' . _("Given shirts") . '

', - table(array( - 'Size' => _("Size"), - 'count' => _("Count") - ), $shirt_statistics) + div('row', [ + div('col-md-6', [ + '

' . _("Needed shirts") . '

' , + table(array( + 'Size' => _("Size"), + 'count' => _("Count") + ), $needed_shirt_statistics) + ]), + div('col-md-6', [ + '

' . _("Given shirts") . '

', + table(array( + 'Size' => _("Size"), + 'count' => _("Count") + ), $given_shirt_statistics) + ]) + ]) )); } ?> diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 99a70ba9..3ab5f816 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -268,7 +268,7 @@ function User_angeltypes_render($user_angeltypes) { $class = 'text-warning'; else $class = 'text-success'; - $output[] = '' . ($angeltype['coordinator'] ? ' ' : '') . $angeltype['name'] . ''; + $output[] = '' . ($angeltype['coordinator'] ? glyph('education') : '') . $angeltype['name'] . ''; } return join('
', $output); } -- cgit v1.3.1