summaryrefslogtreecommitdiff
path: root/includes/pages/admin_active.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-28 20:11:09 +0200
committermsquare <msquare@notrademark.de>2017-07-28 20:11:09 +0200
commitf82e5456d22af7e39a22a9a64e74072cf01e0a31 (patch)
treec024194bd11621e1956a659a0ec91ee7c747b40c /includes/pages/admin_active.php
parent69a1ee2bfefb43a802dea8cf0f833cbe0a00369c (diff)
dried code by introducing selectOne for select queries with only one result line expected
Diffstat (limited to 'includes/pages/admin_active.php')
-rw-r--r--includes/pages/admin_active.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index 2e06f90d..be1217ff 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -210,19 +210,17 @@ function admin_active()
$shirt_statistics = [];
foreach (array_keys($tshirt_sizes) as $size) {
if (!empty($size)) {
- $sc = DB::select(
+ $sc = DB::selectOne(
'SELECT count(*) FROM `User` WHERE `Size`=? AND `Gekommen`=1',
[$size]
);
$sc = array_shift($sc);
- $sc = array_shift($sc);
- $gc = DB::select(
+ $gc = DB::selectOne(
'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1',
[$size]
);
$gc = array_shift($gc);
- $gc = array_shift($gc);
$shirt_statistics[] = [
'size' => $size,
@@ -232,8 +230,7 @@ function admin_active()
}
}
- $uc = DB::select('SELECT count(*) FROM `User` WHERE `Tshirt`=1');
- $uc = array_shift($uc);
+ $uc = DB::selectOne('SELECT count(*) FROM `User` WHERE `Tshirt`=1');
$uc = array_shift($uc);
$shirt_statistics[] = [