Beispiel #1
0
<?php

require_once 'Connection.php';
require_once 'Ikts.class.php';
require_once 'Session.php';
Ikts::getGlobals();
$err_msg = "";
$round = Ikts::$curr_round - 1;
if (isset($_POST['submit'])) {
    $query = "select * from fixture where round='" . $round . "' ";
    $result = mysql_query($query) or die("Error in query: {$query}. " . mysql_error());
    while ($fixture = mysql_fetch_assoc($result)) {
        $fid = $fixture['fid'];
        $scoreA = $_POST[$fid . 'A'];
        $scoreB = $_POST[$fid . 'B'];
        Ikts::updateFixture($fid, $scoreA, $scoreB);
        $err_msg = "Fixtures successfully updated for round " . $round . "";
    }
}
if (isset($_POST['calc'])) {
    Ikts::updateGame($_POST['rd']);
    $err_msg = "GAME Updated for round " . $_POST['rd'] . ". Check Community Predictions and My Leagues.";
}
if (isset($_POST['surrogate'])) {
    $query = "select * from main where player='" . $_POST['friend'] . "' and round='" . Ikts::$curr_round . "' ";
    $result = mysql_query($query) or die("Error in query: {$query}. " . mysql_error());
    while ($main = mysql_fetch_assoc($result)) {
        $mid = $main['mid'];
        $fixture = $main['fixture'];
        $predA = $_POST[$fixture . 'A'];
        $predB = $_POST[$fixture . 'B'];