コード例 #1
0
ファイル: finales.php プロジェクト: HehLan/Intranet-5.0
                        $query->bind('id2', NULL);
                    } else {
                        $query->bind('id1', $id_enfant[$i][0], PDO::PARAM_INT);
                        $query->bind('id2', $id_enfant[$i][1], PDO::PARAM_INT);
                    }
                    if (!$query->execute()) {
                        global $glob_debug;
                        if ($glob_debug) {
                            echo 'ERREUR INSERT MATCH ';
                        }
                        exit;
                    }
                    $id_enfant[$i >> 1][$i % 2] = $database->getConnection()->lastInsertId();
                }
                if ($nbr_match > 1) {
                    $tournoi['heure_finale_start'] = ajouter_heures($tournoi['heure_finale_start'], $tournoi['duree_inter_match']);
                    $first = false;
                    $nbr_match = $nbr_match >> 1;
                }
                $sql = 'SELECT id_match,id_enfant1,id_enfant2 FROM matchs WHERE id_tournoi=:idt
			AND id_groupe IS NULL AND (id_enfant1 IS NOT NULL OR id_enfant2 IS NOT NULL)';
                $query = new Query($database, $sql);
                $query->bind('idt', $id_tournoi, PDO::PARAM_INT);
                if (!$query->execute()) {
                    global $glob_debug;
                    if ($glob_debug) {
                        echo 'ERREUR SELECT FINALES ';
                    }
                    exit;
                }
            }
コード例 #2
0
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[0]['id'], $equipes[1]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[2]['id'], $equipes[3]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[4]['id'], $equipes[5]['id']);
             $h_start = ajouter_heures($h_start, $tournoi['duree_inter_match']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[1]['id'], $equipes[2]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[4]['id'], $equipes[3]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[0]['id'], $equipes[5]['id']);
             $h_start = ajouter_heures($h_start, $tournoi['duree_inter_match']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[3]['id'], $equipes[5]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[1]['id'], $equipes[4]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[2]['id'], $equipes[0]['id']);
             $h_start = ajouter_heures($h_start, $tournoi['duree_inter_match']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[2]['id'], $equipes[5]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[0]['id'], $equipes[4]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[1]['id'], $equipes[3]['id']);
             $h_start = ajouter_heures($h_start, $tournoi['duree_inter_match']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[2]['id'], $equipes[4]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[1]['id'], $equipes[5]['id']);
             creer_match_equipe($database, $id_tournoi, $groupe['id_groupe'], $tournoi['nombreManche'], $tournoi['teamParMatch'], $h_start, $equipes[3]['id'], $equipes[0]['id']);
             break;
     }
 } else {
     $sql = 'DELETE FROM joueurs_groupes WHERE id_groupe=:idg';
     $query = new Query($database, $sql);
     $query->bind('idg', $groupe['id_groupe'], PDO::PARAM_INT);
     if (!$query->execute()) {
         global $glob_debug;
         if ($glob_debug) {
             echo 'ERREUR JOUEUR_GROUPE DELETE SQL';
         }
         exit;