Exemple #1
0
function sync_team_ids($event)
{
    echo "\n\n****Syncing IDs****\n";
    $rankings = $event->ranking_list;
    foreach ($rankings as $ranking) {
        //pause(" ");
        update_id($ranking->team, $event->teams);
    }
    $games = $event->games;
    foreach ($games as $game) {
        update_id($game->team1, $event->teams);
        update_id($game->team2, $event->teams);
    }
}
     }
 }
 if ($firsttype != "text") {
     rename($targetdir . $firsttype . "/" . $first, $targetdir . $firsttype . "/" . "temp" . getextension($first));
     echo "<br>[process]:file renamed from {$first} to temp<br>";
 }
 $query = "DELETE from pairs WHERE id={$pairid}";
 $result = $conn->query($query);
 echo "<br>[process]:pair deleted from database<br>";
 if ($firsttype != "text") {
     udpate_database($first, $firsttype, $pairid);
 }
 if ($firsttype != $secondtype && $secondtype != "text") {
     udpate_database($second, $secondtype, $pairid);
 }
 update_id($pairid);
 echo "<br>[process]:first file type is {$firsttype}<br>";
 if ($firsttype != "text") {
     $c1name = getfilename($firsttype);
     $c1name = $c1name . "." . getextension($first);
     rename($targetdir . $firsttype . "/" . "temp" . getextension($first), $targetdir . $firsttype . "/" . $c1name);
     echo "<br>[process]:file renamed from temp to {$c1name}<br>";
 } else {
     $c1name = $first;
 }
 echo "<br>[process]:second file type is {$c2filetype}<br>";
 if ($c2filetype != "text") {
     $c2name = getfilename($c2filetype);
     if ($firsttype == $c2filetype) {
         $value = chop($c1name, getextension($first));
         $cnt = getsrno($value);