From 8b561a2ccec9f0cddbf39bddce681d792e189639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Wed, 22 Jul 2009 20:44:14 +0200 Subject: [PATCH] voteInspector: Show number of test results per user --- include/vote.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/vote.php b/include/vote.php index 692c2ab..53ad01c 100644 --- a/include/vote.php +++ b/include/vote.php @@ -288,6 +288,7 @@ class voteInspector $oTableRow->AddTextCell('Created'); $oTableRow->AddTextCell('Votes'); $oTableRow->AddTextCell('Privileges'); + $oTableRow->AddTextCell('# of test results'); $oTable->AddRow($oTableRow); for($i = 0; $oRow = mysql_fetch_object($hResult); $i++) @@ -314,6 +315,15 @@ class voteInspector } $oTableRow->AddTextCell($sPrivs); + + $hSubResult = query_parameters("SELECT COUNT(testingId) AS count FROM testResults WHERE submitterId = '?' AND state != 'deleted'", $oVoter->iUserId); + + if($hSubResult && ($oSubRow = mysql_fetch_object($hSubResult))) + $sSubmitted = $oSubRow->count; + else + $sSubmitted = 'DB failure'; + + $oTableRow->AddTextCell($sSubmitted); $oTable->AddRow($oTableRow); }