simplify t-shirt statistics

This commit is contained in:
msquare 2017-12-30 13:40:24 +01:00
parent 0314ba19e3
commit b3ca550ed0
1 changed files with 0 additions and 9 deletions

View File

@ -245,12 +245,6 @@ function admin_active()
$shirt_statistics = []; $shirt_statistics = [];
foreach (array_keys($tshirt_sizes) as $size) { foreach (array_keys($tshirt_sizes) as $size) {
if (!empty($size)) { if (!empty($size)) {
$sc = DB::selectOne(
'SELECT count(*) FROM `User` WHERE `Size`=? AND `Gekommen`=1',
[$size]
);
$sc = array_shift($sc);
$gc = DB::selectOne( $gc = DB::selectOne(
'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1', 'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1',
[$size] [$size]
@ -259,7 +253,6 @@ function admin_active()
$shirt_statistics[] = [ $shirt_statistics[] = [
'size' => $size, 'size' => $size,
'needed' => (int)$sc,
'given' => (int)$gc 'given' => (int)$gc
]; ];
} }
@ -270,7 +263,6 @@ function admin_active()
$shirt_statistics[] = [ $shirt_statistics[] = [
'size' => '<b>' . _('Sum') . '</b>', 'size' => '<b>' . _('Sum') . '</b>',
'needed' => '<b>' . User_arrived_count() . '</b>',
'given' => '<b>' . (int)$shirtCount . '</b>' 'given' => '<b>' . (int)$shirtCount . '</b>'
]; ];
@ -298,7 +290,6 @@ function admin_active()
'<h2>' . _('Shirt statistics') . '</h2>', '<h2>' . _('Shirt statistics') . '</h2>',
table([ table([
'size' => _('Size'), 'size' => _('Size'),
'needed' => _('Needed shirts'),
'given' => _('Given shirts') 'given' => _('Given shirts')
], $shirt_statistics) ], $shirt_statistics)
]); ]);