} } else { /*** verification securite ***/ if ($op == 'admin') { verif_admin_tournois($s_joueur, $s_tournois, $grade['a'], $grade['b'], $grade['t']); } echo "<SCRIPT>\r\n\t\tfunction oneOrNoCheckboxGroup (checkbox) {\r\n\t\t\tvar checkboxGroup = checkbox.form[checkbox.name];\r\n\t\t\tfor (var c = 0; c < checkboxGroup.length; c++)\r\n\t\t\t\tif (checkboxGroup[c] != checkbox)\r\n\t\t\t\t\tcheckboxGroup[c].checked = false;\r\n\t\t}\r\n\t</SCRIPT>"; /*** informations sur un match ***/ if (!empty($id)) { $match = match($id); if (!$match) { fermer_fenetre(); } /** recup du type de tournois **/ $modeequipe_tournois = modeequipe_tournois($match->tournois); $modescore_tournois = modescore_tournois($match->tournois); $modefichier_tournois = modefichier_tournois($match->tournois); $modecommentaire_tournois = modecommentaire_tournois($match->tournois); $avatar_ok = 0; if ($modeequipe_tournois == 'E') { $show = "show_equipe"; $nom_participant = "tag_equipe"; $champX = "tag"; if ($config['avatar'] == 'E' || $config['avatar'] == 'A') { $avatar_ok = 1; $equipe1 = equipe($match->equipe1); $img1 = $equipe1->avatar_img; $equipe2 = equipe($match->equipe2); $img2 = $equipe2->avatar_img; } } else {
$res = $db->exec(); while ($match = $db->fetch($res)) { /*** select de toute les manches ***/ $db->select("id"); $db->from("{$dbprefix}manches"); $db->where("matchi = {$match->id}"); $res2 = $db->exec(); while ($manche = $db->fetch($res2)) { // suppression de la manche dans m4 if (modescore_tournois($id) == 'M4') { $dbm4->delete("m4_match"); $dbm4->where("numero = {$manche->id}"); $dbm4->exec(); } // suppression de la manche dans AB if (modescore_tournois($id) == 'AB') { $dbm4->delete("adb_match_tbl"); $dbm4->where("match_id = {$manche->id}"); $dbm4->exec(); } // suppression de la manche dans phptournois $db->delete("{$dbprefix}manches"); $db->where("id = {$manche->id}"); $db->exec(); } } $db->delete("{$dbprefix}participe"); $db->where("tournois = {$id}"); $db->exec(); $db->delete("{$dbprefix}administre"); $db->where("tournois = {$id}");
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>'; }