X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2Fbriskin5%2Fstat-day.php;h=0359bfe3d800292ef8a4145f97ad244258cbe72a;hb=328de26963e512cc34c999baf67f449020a62bfd;hp=11289ccca44490926982152f1894f3142f3dc3d9;hpb=ef7ec88c07a56a9ef3a24c63a7e64ddfcdc830ad;p=brisk.git diff --git a/web/briskin5/stat-day.php b/web/briskin5/stat-day.php index 11289cc..0359bfe 100644 --- a/web/briskin5/stat-day.php +++ b/web/briskin5/stat-day.php @@ -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, "