Ejemplo n.º 1
0
 }
 $modescore_tournois = modescore_tournois($tournois);
 if ($modescore_tournois == 'M4') {
     $dbm4 = new database();
     $dbm4->debug($m4dbdebug);
     $dbm4->connect($m4dbhost, $m4dbuser, $m4dbpass, $m4dbname);
 } elseif ($modescore_tournois == 'AB') {
     $dbab = new database();
     $dbab->debug($abdbdebug);
     $dbab->connect($abdbhost, $abdbuser, $abdbpass, $abdbname);
 }
 /*** recup des matchs dans le tableau d'id a recup ***/
 foreach ($tab_matches as $id) {
     /*** test du status du match ***/
     if (status_match($id) == 'D') {
         $manche = manche_active($id);
         /*** si aucune manche de ce match est active ***/
         if ($manche) {
             /*** recuperation dans la base M4 ***/
             if ($modescore_tournois == 'M4') {
                 $dbm4->select("clan1, clan2, score1, score2, etape, rule, campa1, tie");
                 $dbm4->from("m4_match");
                 $dbm4->where("numero = {$manche->id} ");
                 $res1 = $dbm4->exec();
                 /*** si le match est dans M4 ***/
                 if ($dbm4->num_rows($res1) == 1) {
                     $matchm4 = $db->fetch($res1);
                     // si le match est commencé, on recup d'abord juste les scores
                     if ($matchm4->etape > 0) {
                         $match = match($id);
                         /*** mise a jour des scores dans la manche en cours ***/
Ejemplo n.º 2
0
function show_match_poule($id, $op = '')
{
    global $db, $dbprefix, $s_joueur, $strVS, $strScore, $strMap;
    global $strCache, $strActif, $strEnCours, $strValidation, $strConflit, $strTermine, $grade;
    $match = match($id);
    if (!$match) {
        return;
    }
    /*** verification securite ***/
    //if($op=='admin') verif_admin_tournois($s_joueur,$match->tournois);
    if ($op == 'admin') {
        verif_admin_tournois($s_joueur, $match->tournois, $grade['a'], $grade['b'], $grade['t']);
    }
    /*** récupération des infos ***/
    $seed1 = seed($match->equipe1, $match->tournois);
    $seed2 = seed($match->equipe2, $match->tournois);
    $modeequipe_tournois = modeequipe_tournois($match->tournois);
    $modescore_tournois = modescore_tournois($match->tournois);
    if ($modeequipe_tournois == 'E') {
        $show = "show_equipe";
    } else {
        $show = "show_joueur";
    }
    if ($op != 'admin' && $match->status == 'C') {
        $match = '';
    }
    if ($op) {
        $op_str = "&op={$op}";
    } else {
        $op_str = '';
    }
    if ($match->status == "C") {
        $title = $strCache;
    }
    if ($match->status == "A") {
        $title = $strActif;
    }
    if ($match->status == "D") {
        $title = $strEnCours;
    }
    if ($match->status == "V") {
        $title = $strValidation;
    }
    if ($match->status == "F") {
        $title = $strConflit;
    }
    if ($match->status == "T") {
        $title = $strTermine;
    }
    // info du match
    echo '<table cellspacing="0" cellpadding="0" border="0"><tr><td>';
    echo '<table cellspacing="0" cellpadding="0" border="0"><tr valign=center>';
    if ($op == 'admin') {
        echo "<td class=\"info\">{$match->status}</td>";
        $hauteur = 450;
    } elseif ($op == 'report') {
        $hauteur = 400;
    } else {
        $hauteur = 350;
    }
    echo "<td class=\"info\"><input type=\"radio\" name=\"match\" value=\"{$match->id}\" onclick=\"javascript:ouvrir_fenetre('?page=matchs_gestion{$op_str}&id={$match->id}&header=win','match',{$hauteur},500)\" style=\"border: 0px;background-color:transparent;\" title=\"{$title}\">";
    if ($op == 'admin' && ($match->status == 'C' || $match->status == 'A' || $match->status == 'D' && ($modescore_tournois == 'M4' || $modescore_tournois == 'AB'))) {
        echo "<td class=\"info\"><input type=\"checkbox\" name=\"tab_matches[]\" value=\"{$match->id}\" style=\"border: 0px;background-color:transparent;\"></td>";
    }
    echo '</tr>';
    echo '</table>';
    echo '</td>';
    // ekip 1
    echo '<td class="text" align="left" width="120">';
    if ($match->statusequipe == 'F1') {
        echo $show($match->equipe1, $op, 'F', $seed1);
    } elseif ($match->statusequipe == 'D1') {
        echo $show($match->equipe1, $op, 'D', $seed1);
    } else {
        echo $show($match->equipe1, $op, '', $seed1);
    }
    echo '</td>';
    echo show_score1($match->score1, $match->score2, $match->frags1, $match->frags2, $match->type, $match->status, $match->statusequipe, $match->modematchscore);
    echo '<td class="text" align="center" width="20">' . $strVS . '</td>';
    echo show_score2($match->score1, $match->score2, $match->frags1, $match->frags2, $match->type, $match->status, $match->statusequipe, $match->modematchscore);
    // ekip 2
    echo '<td class="text" align="right" width="120">';
    if ($match->statusequipe == 'F2') {
        echo $show($match->equipe2, $op, 'F', $seed2, 'right');
    } elseif ($match->statusequipe == 'D2') {
        echo $show($match->equipe2, $op, 'D', $seed2, 'right');
    } else {
        echo $show($match->equipe2, $op, '', $seed2, 'right');
    }
    echo '</td>';
    echo '</tr>';
    /** info du match **/
    if ($op != 'report' && ($match->status != 'T' && $match->status != 'F' && $match->status != 'V' || $op == 'admin')) {
        $map = '';
        /** manche **/
        if ($match->status == 'A') {
            $manches = manches($match->id);
            for ($i = 0; $i < count($manches); $i++) {
                if ($manches[$i]->map) {
                    $map .= $manches[$i]->map . ',';
                }
            }
            $map = substr($map, 0, -1);
        } elseif ($match->status == 'D') {
            $mancheactive = manche_active($match->id);
            if ($mancheactive->map) {
                $map = $mancheactive->map;
                if (nb_manches($match->id) > 1) {
                    $map .= ': ' . $mancheactive->score1 . '/' . $mancheactive->score2;
                }
            }
        }
        if ($map) {
            $map = "- {$map}";
        }
        /** date **/
        /*$date_now = time();
        		$date=strftime(DATESTRING, $match->date);
        		if(!$match->date) $date='';
        
        		if($match->date < $date_now && ($match->status=='C' || $match->status=='A'))
        			$date='<font color="red">'.$date.'</font>';
        
        		if($match->date && ($match->status=='C' || $match->status=='A')) $date="- $date";
        		else $date='';*/
        echo '<tr height="10">';
        echo '<td></td>';
        echo '<td class="info" colspan="5" nowrap ><img src="images/next.gif" border="0" align="absmiddle" alt="next"><small>' . $match->id . ' ' . $map . '</small></td>';
        echo '</tr>';
    }
    echo '</td></tr></table>';
}