From 8220c4ca4dada94f806c7a78a098a4ccf827e1b7 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sun, 3 Nov 2013 09:06:20 +0100 Subject: [PATCH] stat-day.php bug fixed and some log added --- web/Obj/dbase_pgsql.phh | 1 - web/brisk.css | 2 +- web/briskin5/stat-day.php | 6 +++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index 6c127b5..ba8fc60 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -334,7 +334,6 @@ class BriskDB for ($u = 0 ; $u < $usr_n ; $u++) { $usr_obj = pg_fetch_object($usr_pg, $u); - fprintf(STDERR, "GOGORO [%s]\n", print_r($usr_obj, TRUE)); $users[$u] = array(); foreach($fields as $field) { $users[$u][$field] = $usr_obj->$field; diff --git a/web/brisk.css b/web/brisk.css index 82fbe90..fa59bbd 100644 --- a/web/brisk.css +++ b/web/brisk.css @@ -22,7 +22,7 @@ */ body { - background-image: url('img/snowy.jpg'); + background-image: url('img/happysunbg.jpg'); background-color: #fafafa; background-repeat: no-repeat; background-position: center center; diff --git a/web/briskin5/stat-day.php b/web/briskin5/stat-day.php index be148cf..72408e4 100644 --- a/web/briskin5/stat-day.php +++ b/web/briskin5/stat-day.php @@ -305,10 +305,11 @@ function main_pgsql($from, $to) $gam_sql = sprintf("SELECT g.* FROM %sbin5_tournaments as t, %sbin5_matches AS m, %sbin5_games AS g WHERE t.code = m.tcode AND m.code = g.mcode AND m.code = %d ORDER BY g.tstamp;", $G_dbpfx, $G_dbpfx, $G_dbpfx, $tmt_obj->code); if (($gam_pg = pg_query($bdb->dbconn->db(), $gam_sql)) == FALSE ) { + log_crit("stat-day: gam_sql failed"); break; } - for ($u = 0 ; $u < $usr_n ; $u++) { + for ($u = 0 ; $u < count($users) ; $u++) { if ($u == 0) { fprintf($fpexp, "

Codice: %d (%s - %s), Tavolo: %s

\n", $tmt_obj->code, $users[$u]['first'], $users[$u]['last'], $users[$u]['tidx']); fprintf($fpexp, "\n"); @@ -321,6 +322,7 @@ function main_pgsql($from, $to) // points of the match for each user if (($pts_pg[$u] = pg_query($bdb->dbconn->db(), $pts_sql)) == FALSE) { + log_crit("stat-day: pts_sql failed"); break; } if ($u == 0) { @@ -328,11 +330,13 @@ function main_pgsql($from, $to) } else { if ($num_games != pg_numrows($pts_pg[$u])) { + log_crit("stat-day: num_games != pg_numrows"); break; } } } if ($u != BIN5_PLAYERS_N) { + log_crit("stat-day: u != BIN5_PLAYERS_N"); break; } -- 2.17.1