X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2Fbriskin5%2Fstat-day.php;h=d96cb6c626dadada6e43d88911c631ea704fcac4;hb=302c97f7ac81dfcc6fc8d8d44359f4f432e4618a;hp=11289ccca44490926982152f1894f3142f3dc3d9;hpb=ef7ec88c07a56a9ef3a24c63a7e64ddfcdc830ad;p=brisk.git
diff --git a/web/briskin5/stat-day.php b/web/briskin5/stat-day.php
index 11289cc..d96cb6c 100644
--- a/web/briskin5/stat-day.php
+++ b/web/briskin5/stat-day.php
@@ -141,7 +141,7 @@ function main_file($curtime)
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
// echo $p." i) ".$i."
";
$username = $ar[9+($i*2)];
- if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) {
+ if (($item = $bdb->getitem_bylogin($username, $id)) == FALSE) {
echo "WARNING: the user [".$username."] NOT EXISTS!
";
continue;
}
@@ -267,11 +267,18 @@ function main_pgsql($from, $to)
$trn_n = pg_numrows($trn_pg);
printf("Number of tournaments: %d\n", $trn_n);
+ // loop on tournaments
for ($t = 0 ; $t < $trn_n ; $t++) {
// log_crit("stat-day: LOOP t");
$trn_obj = pg_fetch_object($trn_pg, $t);
- $tmt_sql = sprintf("SELECT m.code AS code, m.mazzo_next as minus_one_is_old FROM %sbin5_matches AS m, %sbin5_games AS g, %sbin5_tournaments as t WHERE t.code = m.tcode AND m.code = g.mcode AND t.code = %d AND g.tstamp >= '%s' AND g.tstamp < '%s' GROUP BY m.code, minus_one_is_old ORDER BY m.code, minus_one_is_old DESC;",
+ $tmt_sql = sprintf("
+SELECT m.code AS code, m.mazzo_next as minus_one_is_old
+ FROM %sbin5_matches AS m, %sbin5_games AS g, %sbin5_tournaments as t
+ WHERE t.code = m.tcode AND m.code = g.mcode
+ AND t.code = %d AND g.tstamp >= '%s' AND g.tstamp < '%s'
+ GROUP BY m.code, minus_one_is_old
+ ORDER BY m.code, minus_one_is_old DESC;",
$G_dbpfx, $G_dbpfx, $G_dbpfx, $trn_obj->code, $from, $to);
// if deletable old matches exists then ...
@@ -295,23 +302,29 @@ function main_pgsql($from, $to)
printf("[Tournament [%s]], number of matches: %d\n", $mlang_stat_day[$trn_obj->name][$G_lang], $tmt_n);
fprintf($fpexp, "