aboutsummaryrefslogtreecommitdiff
path: root/src/fcontest.php
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-08-29 11:27:40 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-08-29 11:27:40 +0000
commita8f4723c268d3bf0d42bd4a3a79d0d5d5dfd465d (patch)
treece07faec23d807b21b9d5e309b35d455f1b7c256 /src/fcontest.php
parent7191e76649dbb207db26b59271cb6e16cc427bc6 (diff)
downloadboca-a8f4723c268d3bf0d42bd4a3a79d0d5d5dfd465d.tar.gz
boca-a8f4723c268d3bf0d42bd4a3a79d0d5d5dfd465d.zip
bug fixes and speed up runs
Diffstat (limited to 'src/fcontest.php')
-rw-r--r--src/fcontest.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/fcontest.php b/src/fcontest.php
index 96576a6..045f28e 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
-//Last updated 26/jul/2017 by cassio@ime.usp.br
+//Last updated 29/aug/2017 by cassio@ime.usp.br
//
function DBDropContestTable() {
$c = DBConnect();
@@ -201,6 +201,24 @@ function DBFakeContest() {
"'t', '$pass', NULL, NULL, '', NULL, NULL)", "DBFakeContest(insert system user)");
DBExec($c, "commit work");
}
+function DBAllUserNames($contest,$site=-1) {
+ $sql = "select * from usertable where contestnumber=$contest ";
+ if($site > 0) $sql .= "and usersitenumber=$site ";
+ $c = DBConnect();
+ $r = DBExec ($c, $sql, "DBAllUserNames(get users)");
+ $n = DBnlines($r);
+ if ($n == 0) {
+ LOGError("Unable to find users in the database. SQL=(" . $sql . ")");
+ MSGError("Unable to find users in the database!");
+ }
+
+ $a = array();
+ for ($i=0;$i<$n;$i++) {
+ $tmp = DBRow($r,$i);
+ $a[$tmp['usersitenumber'] . '-' . $tmp['usernumber']] = $tmp['username'];
+ }
+ return $a;
+}
function DBAllUserInfo($contest,$site=-1) {
$sql = "select * from usertable where contestnumber=$contest ";
if($site > 0) $sql .= "and usersitenumber=$site ";