$G_base = "../";
-$mlang_stat_day = array( 'normal match'=> array( 'it' => 'Partite normali',
- 'en' => 'Normal matches' ),
+// SYNC WITH bin5_tournaments table
+$mlang_stat_day = array(
+ 'old rules: with draw'=> array( 'it' => 'Partite vecchie (con il pareggio)',
+ 'en' => 'Old matches (with draw)' ),
+
+ 'new rules: without draw' => array( 'it' => 'Partite nuove (senza pareggio)',
+ 'en' => 'New matches (without draw)'),
+
'special match' => array( 'it' => 'Partite speciali',
'en' => 'Special matches'),
break;
}
- if (pg_query($bdb->dbconn->db(), "BEGIN") == FALSE) {
- log_crit("stat-day: begin failed");
- break;
- }
+ //if ($bdb->transaction("BEGIN") == FALSE) {
+ // log_crit("stat-day: begin failed");
+ // break;
+ //}
// retrieve list of active tournaments
$trn_sql = sprintf("SELECT * FROM %sbin5_tournaments WHERE active = 1;", $G_dbpfx);
SELECT p.pts AS pts
FROM %sbin5_games AS g, %sbin5_points AS p
WHERE g.code = p.gcode AND g.mcode = %d AND p.ucode = %d
- ORDER BY g.code",
+ ORDER BY g.tstamp",
$G_dbpfx, $G_dbpfx,
$tmt_obj->code, $users[$u]['code']);
fprintf($fpexp, "<%s class='%s'>%d</%s>",
($tmt_obj->minus_one_is_old == -1 ? "td" : "th"),
- $cla_nam, pow(2,$gam_obj->mult) * $pts,
+ $cla_nam,
+ pow(2,$gam_obj->mult) * $pts,
($tmt_obj->minus_one_is_old == -1 ? "td" : "th"));
}
if ($tmt_obj->minus_one_is_old != -1) {
+ // FIXME
+ $rules_name = "Rules_old_rules";
fprintf($fpexp, "<td>%s</td><td>%s</td>", $users[$gam_obj->mazzo]['login'],
- xcape( game_description($gam_obj->act, 'plain', $gam_obj->mult,
+ xcape( ${rules_name}::game_description($gam_obj->act, 'plain', $gam_obj->mult,
$gam_obj->asta_win,
($gam_obj->asta_win != -1 ?
$users[$gam_obj->asta_win]['login'] : ""),
$gam_obj->friend,
($gam_obj->friend != -1 ?
$users[$gam_obj->friend]['login'] : ""),
- $gam_obj->pnt, $gam_obj->asta_pnt) )
+ $gam_obj->pnt, $gam_obj->asta_pnt, $gam_obj->tourn_pts) )
);
}
fprintf($fpexp, "</tr>\n");
}
}
if ($t < $trn_n) {
- log_crit("stat-day: t < trn_n");
+ log_crit(sprintf("stat-day: t < trn_n (%d, %d)", $t, $trn_n));
break;
}
+ // if ($bdb->transaction("COMMIT") == FALSE) {
+ // break;
+ // }
$ret = (TRUE);
} while (0);
- if ($ret == FALSE) {
- pg_query($bdb->dbconn->db(), "ROLLBACK");
- }
+ // if ($ret == FALSE) {
+ // $bdb->transaction("ROLLBACK");
+ // }
if ($fpexp != FALSE) {
fclose($fpexp);
}