fix tournament related sql queries and enhanced output of stat-day.php