root / admin / admin.php @ 1057b016312d37a6c9384b452003596d95d6212e
Historique | Voir | Annoter | Télécharger (19,28 ko)
1 | <?php
|
---|---|
2 | /*
|
3 | * admin.php - Administration des compétitions |
4 | * Copyright (C) 2008 Romuald DELAVERGNE <delavergne@free.fr> |
5 | * |
6 | * This source code is licensed under the GNU General Public License, |
7 | * Version 2. See the file COPYING for more details. |
8 | */ |
9 | |
10 | require_once 'zip.lib.php'; |
11 | require_once 'unzip.lib.php'; |
12 | |
13 | if (basename(dirname($_SERVER['PHP_SELF'])) == "admin") |
14 | require_once '../functions.php'; |
15 | else
|
16 | require_once 'functions.php'; |
17 | |
18 | function hiddenVars() { ?> |
19 | <input type="hidden" name="typeCompetition" value="<?=$_POST['typeCompetition']?>" /> |
20 | <input type="hidden" name="saison" value="<?=$_POST['saison']?>" /> |
21 | <input type="hidden" name="div1" value="<?=$_POST['div1']?>" /> |
22 | <input type="hidden" name="div2" value="<?=$_POST['div2']?>" /> |
23 | <input type="hidden" name="poule" value="<?=$_POST['poule']?>" /> |
24 | <input type="hidden" name="phase" value="<?=$_POST['phase']?>" /> |
25 | <?php }
|
26 | |
27 | function retour($button, $message = "") { ?>
|
28 | <form method="post" action="index.php"> |
29 | <?php if ($message != "") echo "\t\t\t$message"; ?> |
30 | <?php hiddenVars() ?> |
31 | <input type="submit" value="<?=$button?>" /> |
32 | </form>
|
33 | <?php }
|
34 | |
35 | /* |
36 | echo "<pre>\n";
|
37 | print_r($_POST); |
38 | echo "</pre>\n";
|
39 | */ |
40 | |
41 | // Données reçues par l'index ou cette page |
42 | $championnat = $_POST['championnat']; |
43 | if ($_POST['validation_championnat'] == "ajouter") $championnat = "validation_ajouter"; |
44 | if ($_POST['validation_championnat'] == "modifier") $championnat = "validation_modifier"; |
45 | if ($_POST['validation_penalites'] == "valider") $championnat = "validation_penalites"; |
46 | if ($_POST['validation_ajustements'] == "valider") $championnat = "validation_ajustements"; |
47 | if ($_POST['validation_forfaits'] == "valider") $championnat = "validation_forfaits"; |
48 | |
49 | if (isset($_POST['rencontre-ajouter'])) { |
50 | $rencontre = "ajouter"; |
51 | } else { |
52 | $vars = preg_grep("/^rencontre-/", array_keys($_POST)); |
53 | if ($vars) { |
54 | $rencontre = $_POST[current($vars)]; |
55 | $rencontreId = current($vars); |
56 | } |
57 | } |
58 | { |
59 | $vars = preg_grep("/^adjust-/", array_keys($_POST)); |
60 | if ($vars) { |
61 | $championnat = "validation_ajustement"; |
62 | switch ($_POST[current($vars)]) { |
63 | case '↑':
|
64 | $action = "up"; |
65 | break; |
66 | case '↓':
|
67 | $action = "down"; |
68 | break; |
69 | default: |
70 | $action = "unknown"; |
71 | break; |
72 | } |
73 | list($prefix, $equipe) = explode("-", current($vars)); |
74 | } |
75 | } |
76 | if ($_POST['validation_rencontre'] == "ajouter") $rencontre = "validation_ajouter"; |
77 | if ($_POST['validation_rencontre'] == "modifier") $rencontre = "validation_modifier"; |
78 | |
79 | $equipes = get_magic_quotes_gpc() ? stripslashes($_POST['equipes']) : $_POST['equipes']; |
80 | $journees = get_magic_quotes_gpc() ? stripslashes($_POST['journees']) : $_POST['journees']; |
81 | $journee = get_magic_quotes_gpc() ? stripslashes($_POST['journee']) : $_POST['journee']; |
82 | $domicile = get_magic_quotes_gpc() ? stripslashes($_POST['domicile']) : $_POST['domicile']; |
83 | $visiteur = get_magic_quotes_gpc() ? stripslashes($_POST['visiteur']) : $_POST['visiteur']; |
84 | $ptsDom = get_magic_quotes_gpc() ? stripslashes($_POST['ptsDom']) : $_POST['ptsDom']; |
85 | $ptsVis = get_magic_quotes_gpc() ? stripslashes($_POST['ptsVis']) : $_POST['ptsVis']; |
86 | $scoreDom = get_magic_quotes_gpc() ? stripslashes($_POST['scoreDom']) : $_POST['scoreDom']; |
87 | $scoreVis = get_magic_quotes_gpc() ? stripslashes($_POST['scoreVis']) : $_POST['scoreVis']; |
88 | $fftDom = get_magic_quotes_gpc() ? stripslashes($_POST['fftDom']) : $_POST['fftDom']; |
89 | $fftVis = get_magic_quotes_gpc() ? stripslashes($_POST['fftVis']) : $_POST['fftVis']; |
90 | |
91 | $message = ""; |
92 | |
93 | if ($_POST['saison'] && $_POST['div1']) { |
94 | $path = (IamAdmin()) ? "../datas" : "datas"; |
95 | $path .= "/".$_POST['saison']."/".$_POST['div1']; |
96 | if ($_POST['div2'] != "") $path .= $SEP_DIV.$_POST['div2']; |
97 | if ($_POST['poule'] != "" || $_POST['phase'] != "") $path .= "/"; |
98 | if ($_POST['poule'] != "") $path .= $_POST['poule']; |
99 | if ($_POST['phase'] != "") $path .= $SEP_DIV.$_POST['phase']; |
100 | } |
101 | |
102 | if ($_POST['exporter'] == "exporter") { |
103 | $zip = new zipfile(); |
104 | backup($zip, "../datas", "datas"); |
105 | $archive = $zip->file();
|
106 | header("Content-Type: application/x-zip"); |
107 | header("Content-Disposition: inline; filename=datas-".date("Y-m-d").".zip"); |
108 | echo $archive; |
109 | exit; |
110 | } elseif ($_POST['validation_importer'] == "importer") { |
111 | if ($_FILES['zipfile']['error'] == 0) { |
112 | $dest = ".."; |
113 | $zip = new SimpleUnzip($_FILES['zipfile']['tmp_name']); |
114 | if ($zip) { |
115 | $needToImport = array(); |
116 | $alreadyExist = array(); |
117 | foreach ($zip->Entries as $extr) {
|
118 | if (!file_exists($dest."/".$extr->Path)) {
|
119 | mkdirRecursive($dest."/".$extr->Path);
|
120 | $needToImport[] = $extr->Path;
|
121 | } else { |
122 | if (!in_array($extr->Path, $needToImport)) {
|
123 | if (!in_array($extr->Path, $alreadyExist)) {
|
124 | $message .= "<p>Le championnat ".$extr->Path." n'a pas été importé car il existe déjà !</p>"; |
125 | $alreadyExist[] = $extr->Path;
|
126 | } |
127 | } |
128 | } |
129 | if (in_array($extr->Path, $needToImport)) {
|
130 | $fh = fopen($dest."/".$extr->Path."/".$extr->Name, 'w'); |
131 | fwrite($fh, $extr->Data);
|
132 | fclose($fh); |
133 | } |
134 | } |
135 | $message .= "Données importées"; |
136 | } else { |
137 | $message = $_POST['zipfile'].": fichier invalide !"; |
138 | } |
139 | } else { |
140 | $message = "Erreur lors du chargement du fichier '".$_FILES['zipfile']['name']."' !"; |
141 | } |
142 | } elseif ($_POST['supprimer-tout'] == "tout supprimer") { |
143 | $message = "pas implémenté."; |
144 | } |
145 | |
146 | if ($path) { |
147 | //echo "<p>path=$path.</p>\n"; |
148 | switch ($championnat) { |
149 | case "pénalités": |
150 | $Pen = getPenalites($path); |
151 | $equipes = getEquipes($path); |
152 | break; |
153 | case "ajustements": |
154 | $Adjust = getAjustements($path); |
155 | $equipes = getEquipes($path); |
156 | break; |
157 | case "forfait général": |
158 | $ForfaitsG = getForfaitsG($path); |
159 | $equipes = getEquipes($path); |
160 | break; |
161 | case "modifier": |
162 | if (file_exists("$path/equipes")) { |
163 | $equipes = file_get_contents("$path/equipes"); |
164 | } |
165 | if (file_exists("$path/journees")) { |
166 | $journees = file_get_contents("$path/journees"); |
167 | } |
168 | break; |
169 | case "validation_ajouter": |
170 | if (!file_exists($path)) { |
171 | mkdirRecursive($path); |
172 | my_file_put_contents("$path/equipes", $equipes); |
173 | my_file_put_contents("$path/journees", $journees); |
174 | $message = "La compétition a été ajoutée."; |
175 | } else { |
176 | $message = "La compétition existe déjà !"; |
177 | } |
178 | break; |
179 | case "validation_modifier": |
180 | my_file_put_contents("$path/equipes", $equipes); |
181 | my_file_put_contents("$path/journees", $journees); |
182 | $message = "La compétition a été mise à jour."; |
183 | break; |
184 | case "validation_penalites": |
185 | $vars = preg_grep("/^pen_/", array_keys($_POST)); |
186 | if ($vars) { |
187 | $penalites = ""; |
188 | foreach ($vars as $var) { |
189 | if ($_POST[$var] > 0) {
|
190 | list($prefix, $equipe) = explode("_", $var); |
191 | $penalites .= $equipe.":".$_POST[$var]."\n"; |
192 | } |
193 | } |
194 | $file = "$path/penalites"; |
195 | if ($penalites) { |
196 | my_file_put_contents($file, $penalites); |
197 | } else { |
198 | if (file_exists($file)) unlink($file); |
199 | } |
200 | $message = "Les pénalités ont été mises à jour."; |
201 | } |
202 | break; |
203 | case "validation_ajustements": |
204 | $vars = preg_grep("/^adjust_/", array_keys($_POST)); |
205 | if ($vars) { |
206 | $ajustements = ""; |
207 | foreach ($vars as $var) { |
208 | if ($_POST[$var] != 0) { |
209 | if (abs($_POST[$var]) <= 9) {
|
210 | list($prefix, $equipe) = explode("_", $var); |
211 | $ajustements .= $equipe.":".$_POST[$var]."\n"; |
212 | } else { |
213 | $message = "Ajustement trop important (".$_POST[$var].")."; |
214 | break 2; |
215 | } |
216 | } |
217 | } |
218 | $file = "$path/ajustements"; |
219 | if ($ajustements) { |
220 | my_file_put_contents($file, $ajustements); |
221 | } else { |
222 | if (file_exists($file)) unlink($file); |
223 | } |
224 | $message = "Les ajustements ont été mis à jour."; |
225 | } |
226 | break; |
227 | case "validation_forfaits": |
228 | $file = "$path/forfaits"; |
229 | $message = "Les forfaits généraux ont été mis à jour."; |
230 | $vars = preg_grep("/^forfaitG_/", array_keys($_POST)); |
231 | if ($vars) { |
232 | $forfaits = ""; |
233 | foreach ($vars as $var) { |
234 | if ($_POST[$var] == "on") { |
235 | list($prefix, $equipe) = explode("_", $var); |
236 | $forfaits .= $equipe.":".$_POST[$var]."\n"; |
237 | } |
238 | } |
239 | my_file_put_contents($file, $forfaits); |
240 | } else { |
241 | if (file_exists($file)) unlink($file); |
242 | } |
243 | break; |
244 | case "validation_ajustement": |
245 | $Adjust = getAjustements($path); |
246 | $equipes = getEquipes($path); |
247 | switch ($action) { |
248 | case "up": |
249 | $Adjust[$equipe]++; |
250 | $message = "L'équipe ".$equipes[$equipe]." a été remontée d'une position."; |
251 | break; |
252 | case "down": |
253 | $Adjust[$equipe] = $Adjust[$equipe] - 1; /* $var-- don't works with empty value */ |
254 | $message = "L'équipe ".$equipes[$equipe]." a été redescendue d'une position."; |
255 | break; |
256 | default: |
257 | break 2; |
258 | } |
259 | $ajustements = ""; |
260 | foreach ($Adjust as $n => $val) {
|
261 | if ($val != 0) { |
262 | if (abs($val) <= 9) {
|
263 | $ajustements .= "$n:$val\n"; |
264 | } else { |
265 | $message = "Ajustement trop important ($val)."; |
266 | break 2; |
267 | } |
268 | } |
269 | } |
270 | $file = "$path/ajustements"; |
271 | if ($ajustements) { |
272 | my_file_put_contents($file, $ajustements); |
273 | } else { |
274 | if (file_exists($file)) unlink($file); |
275 | } |
276 | break; |
277 | case "supprimer": |
278 | // Suppression de tous les fichiers du répertoire |
279 | if ($dir = opendir($path)) { |
280 | while (($file = readdir($dir)) !== FALSE) { |
281 | if (is_file("$path/$file")) unlink("$path/$file"); |
282 | } |
283 | closedir($dir); |
284 | } |
285 | // Suppression du maximum de répertoires |
286 | while (isEmptyDir($path) && basename($path) != "datas") { |
287 | monRmdir($path); |
288 | $path = dirname($path); |
289 | } |
290 | $message = "Le championnat a été supprimé."; |
291 | break; |
292 | } |
293 | switch ($rencontre) { |
294 | case "ajouter": |
295 | $equipes = getEquipes($path); |
296 | $journees = getJournees($path); |
297 | break; |
298 | case "modifier": |
299 | $equipes = getEquipes($path); |
300 | $journees = getJournees($path); |
301 | list($prefix, $journee, $domicile, $visiteur) = explode("-", $rencontreId); |
302 | $file = "$path/match-".$journee."-".$domicile."-".$visiteur; |
303 | if (file_exists($file)) { |
304 | $resu = file_get_contents($file); |
305 | list($ptsDom, $ptsVis, $scoreDom, $scoreVis, $fftDom, $fftVis) = explode(":", $resu); |
306 | } |
307 | break; |
308 | case "validation_ajouter": |
309 | if ($journee == "" || $domicile == "" || $visiteur == "") { |
310 | $message = "Vous devez saisir le numéro de la journée, l'équipe qui reçoit et qui se déplace !"; |
311 | } else { |
312 | $file = "$path/match-".$journee."-".$domicile."-".$visiteur; |
313 | if (!file_exists($file)) { |
314 | my_file_put_contents($file, $ptsDom.":".$ptsVis.":".$scoreDom.":".$scoreVis.":".$fftDom.":".$fftVis); |
315 | $message = "La nouvelle rencontre a été ajoutée."; |
316 | } else { |
317 | $message = "La rencontre existe déjà !"; |
318 | } |
319 | } |
320 | break; |
321 | case "validation_modifier": |
322 | $file = "$path/match-".$journee."-".$domicile."-".$visiteur; |
323 | my_file_put_contents($file, $ptsDom.":".$ptsVis.":".$scoreDom.":".$scoreVis.":".$fftDom.":".$fftVis); |
324 | $message = "La rencontre a été mise à jour."; |
325 | break; |
326 | case "supprimer": |
327 | list($prefix, $journee, $domicile, $visiteur) = explode("-", $rencontreId); |
328 | $file = "match-".$journee."-".$domicile."-".$visiteur; |
329 | if (file_exists("$path/$file")) { |
330 | unlink("$path/$file"); |
331 | $message = "La rencontre a été supprimée."; |
332 | } |
333 | break; |
334 | } |
335 | } |
336 | ?>
|
337 | <html>
|
338 | <head>
|
339 | <title>Administration</title> |
340 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
341 | <meta http-equiv="Content-language" content="fr" /> |
342 | <meta name="copyright" content="Tous droits réservés - All Rights Reserved" /> |
343 | <meta name="author" content="Romuald DELAVERGNE"> |
344 | </head>
|
345 | <html>
|
346 | <body>
|
347 | <?php if ($championnat == "ajouter" || $championnat == "modifier" ) { ?> |
348 | <form name="admin" method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
349 | <table border="0"> |
350 | <tr>
|
351 | <td>Saison</td> |
352 | <td>
|
353 | : |
354 | <?php if ($championnat == "ajouter") { ?> |
355 | <input type="text" name="saison" size="5" value="" /> |
356 | <?php } else { ?> |
357 | <input type="hidden" name="saison" value="<?=$_POST['saison']?>" /> |
358 | <?=$_POST['saison']."/".($_POST['saison']+1)."\n"?> |
359 | <?php } ?> |
360 | </td>
|
361 | </tr>
|
362 | <?php if ($_POST['typeCompetition'] != "") { ?> |
363 | <input type="hidden" name="div1" value="<?=$_POST['typeCompetition']?>" /> |
364 | <tr>
|
365 | <td><?=$_POST['typeCompetition'] == "C" ? "Coupe" : "Tournoi"?></td> |
366 | <td>
|
367 | : |
368 | <?php if ($championnat == "ajouter") { ?> |
369 | <input type="text" name="div2" value="" /> |
370 | <?php } else { ?> |
371 | <input type="hidden" name="div2" value="<?=$_POST['div2']?>" /> |
372 | <?=$_POST['div2']."\n"?> |
373 | <?php } ?> |
374 | </td>
|
375 | </tr>
|
376 | <?php } else { ?> |
377 | <tr>
|
378 | <td>Division</td> |
379 | <td>
|
380 | : |
381 | <?php if ($championnat == "ajouter") { ?> |
382 | <select name="div1"> |
383 | <option value=""></option> |
384 | <?php
|
385 | foreach ($DIVISION as $n => $d) { |
386 | echo "\t\t\t\t\t\t<option value=\"$n\">$d</option>\n"; |
387 | } |
388 | ?>
|
389 | </select>
|
390 | <input type="text" name="div2" size="3" value="" /> |
391 | <?php } else { ?> |
392 | <input type="hidden" name="div1" value="<?=$_POST['div1']?>" /> |
393 | <input type="hidden" name="div2" value="<?=$_POST['div2']?>" /> |
394 | <?=$_POST['div1'].$_POST['div2']."\n"?> |
395 | <?php } ?> |
396 | </td>
|
397 | </tr>
|
398 | <?php } ?> |
399 | <?php if ($championnat == "ajouter" || $_POST['poule']) { ?> |
400 | <tr>
|
401 | <td><?=($_POST['typeCompetition'] != "") ? "Poule/Tableau" : "Poule"?></td> |
402 | <td>
|
403 | : |
404 | <?php if ($championnat == "ajouter") { ?> |
405 | <input type="text" name="poule" value="" /> |
406 | <?php } else { ?> |
407 | <input type="hidden" name="poule" value="<?=$_POST['poule']?>" /> |
408 | <?=$_POST['poule']."\n"?> |
409 | <?php } ?> |
410 | </td>
|
411 | </tr>
|
412 | <?php } ?> |
413 | <?php if (($championnat == "ajouter" || $_POST['phase']) && $_POST['typeCompetition'] == "") { ?> |
414 | <tr>
|
415 | <td>Phase</td> |
416 | <td>
|
417 | : |
418 | <?php if ($championnat == "ajouter") { ?> |
419 | <select name="phase"> |
420 | <option value=""></option> |
421 | <option value="1">1</option> |
422 | <option value="2">2</option> |
423 | </select>
|
424 | <?php } else { ?> |
425 | <input type="hidden" name="phase" value="<?=$_POST['phase']?>" /> |
426 | <?=$_POST['phase']."\n"?> |
427 | <?php } ?> |
428 | </td>
|
429 | </tr>
|
430 | <?php } ?> |
431 | <tr>
|
432 | <td colspan="2"> |
433 | <br /> |
434 | Liste des <?=$_POST['typeCompetition'] == "T" ? "joueurs" : "équipes"?> : |
435 | </td>
|
436 | </tr>
|
437 | <tr>
|
438 | <td colspan="2"> |
439 | <textarea name="equipes" cols="30" rows="10"><?=$equipes?></textarea> |
440 | </td>
|
441 | </tr>
|
442 | <tr>
|
443 | <td colspan="2"> |
444 | <br /> |
445 | Liste des <?=$_POST['typeCompetition'] == "T" ? "tours" : "journées"?> : |
446 | </td>
|
447 | </tr>
|
448 | <tr>
|
449 | <td colspan="2"> |
450 | <textarea name="journees" cols="30" rows="10"><?=$journees?></textarea> |
451 | </td>
|
452 | </tr>
|
453 | </table>
|
454 | <?php if ($championnat == "ajouter") { ?> |
455 | <input type="submit" name="validation_championnat" value="ajouter" /> |
456 | <?php } ?> |
457 | <?php if ($championnat == "modifier" ) { ?> |
458 | <input type="submit" name="validation_championnat" value="modifier" /> |
459 | <?php } ?> |
460 | </form>
|
461 | <?php retour("annuler"); ?> |
462 | <?php } else if ($championnat == "pénalités") { ?> |
463 | <form method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
464 | <table>
|
465 | <?php foreach ($equipes as $n => $e) { ?> |
466 | <tr>
|
467 | <td><?=$e?></td> |
468 | <td>:<input type="text" name="pen_<?=$n?>" size="3" value="<?=($Pen[$n] ? $Pen[$n] : "0")?>" /></td> |
469 | </tr>
|
470 | <?php } ?> |
471 | </table>
|
472 | <?php hiddenVars() ?> |
473 | <input type="submit" name="validation_penalites" value="valider" /> |
474 | </form>
|
475 | <?php retour("annuler"); ?> |
476 | <?php } else if ($championnat == "ajustements") { ?> |
477 | <form method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
478 | <table>
|
479 | <?php foreach ($equipes as $n => $e) { ?> |
480 | <tr>
|
481 | <td><?=$e?></td> |
482 | <td>:<input type="text" name="adjust_<?=$n?>" size="3" value="<?=($Adjust[$n] ? $Adjust[$n] : "0")?>" /></td> |
483 | </tr>
|
484 | <?php } ?> |
485 | </table>
|
486 | <?php hiddenVars() ?> |
487 | <input type="submit" name="validation_ajustements" value="valider" /> |
488 | </form>
|
489 | <?php retour("annuler"); ?> |
490 | <?php } else if ($championnat == "forfait général") { ?> |
491 | <form method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
492 | <table>
|
493 | <?php foreach ($equipes as $n => $e) { ?> |
494 | <tr>
|
495 | <td><?=$e?></td> |
496 | <td>:<input type="checkbox" name="forfaitG_<?=$n?>"<?=($ForfaitsG[$n] == "on" ? " checked" : "")?> /></td> |
497 | </tr>
|
498 | <?php } ?> |
499 | </table>
|
500 | <?php hiddenVars() ?> |
501 | <input type="submit" name="validation_forfaits" value="valider" /> |
502 | </form>
|
503 | <?php retour("annuler"); ?> |
504 | <?php } else if ($rencontre == "ajouter" || $rencontre == "modifier") { ?> |
505 | <form method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
506 | <table border="0"> |
507 | <tr>
|
508 | <td colspan="4"> |
509 | <?php if ($rencontre == "ajouter") { ?> |
510 | <?=$_POST['typeCompetition'] == "" ? "Journée" : "Tour"?> : |
511 | <select name="journee"> |
512 | <option value=""></option> |
513 | <?php
|
514 | foreach ($journees as $n => $j) { |
515 | echo "\t\t\t\t\t\t<option value=\"$n\">$j</option>\n"; |
516 | } |
517 | ?>
|
518 | </select>
|
519 | <?php } else { ?> |
520 | <?=$journees[$journee]."\n"?> |
521 | <input type="hidden" name="journee" value="<?=$journee?>" /> |
522 | <?php } ?> |
523 | </td>
|
524 | </tr>
|
525 | <tr>
|
526 | <td>
|
527 | <?php if ($rencontre == "ajouter") { ?> |
528 | <?=$_POST['typeCompetition'] == "T" ? "Joueur 1" : "Équipe à domicile"?> : |
529 | <select name="domicile"> |
530 | <option value=""></option> |
531 | <?php
|
532 | foreach ($equipes as $n => $e) { |
533 | echo "\t\t\t\t\t\t<option value=\"$n\">$e</option>\n"; |
534 | } |
535 | ?>
|
536 | </select>
|
537 | <?php } else { ?> |
538 | <input type="hidden" name="domicile" value="<?=$domicile?>" /> |
539 | <?=$equipes[$domicile]."\n"?> |
540 | <?php } ?> |
541 | </td>
|
542 | <td> points : <input type="text" name="ptsDom" size="3" value="<?=$ptsDom?>" /></td> |
543 | <td> score : <input type="text" name="scoreDom" size="3" value="<?=$scoreDom?>" /></td> |
544 | <td>
|
545 | <label for="fftDom">forfait :</label> |
546 | <input type="checkbox" id="fftDom" name="fftDom"<?=$fftDom ? " checked" : ""?> /> |
547 | </td>
|
548 | </tr>
|
549 | <tr>
|
550 | <td>
|
551 | <?php if ($rencontre == "ajouter") { ?> |
552 | <?=$_POST['typeCompetition'] == "T" ? "Joueur 2" : "Équipe à l'extérieure"?> : |
553 | <select name="visiteur"> |
554 | <option value=""></option> |
555 | <?php
|
556 | foreach ($equipes as $n => $e) { |
557 | echo "\t\t\t\t\t\t<option value=\"$n\">$e</option>\n"; |
558 | } |
559 | ?>
|
560 | </select>
|
561 | <?php } else { ?> |
562 | <input type="hidden" name="visiteur" value="<?=$visiteur?>" /> |
563 | <?=$equipes[$visiteur]."\n"?> |
564 | <?php } ?> |
565 | </td>
|
566 | <td> points : <input type="text" name="ptsVis" size="3" value="<?=$ptsVis?>" /></td> |
567 | <td> score : <input type="text" name="scoreVis" size="3" value="<?=$scoreVis?>" /></td> |
568 | <td>
|
569 | <label for="fftVis">forfait :</label> |
570 | <input type="checkbox" id="fftVis" name="fftVis"<?=$fftVis ? " checked" : ""?> /> |
571 | </td>
|
572 | </tr>
|
573 | </table>
|
574 | <?php hiddenVars() ?> |
575 | <?php if ($rencontre == "ajouter") { ?> |
576 | <input type="submit" name="validation_rencontre" value="ajouter" /> |
577 | <?php } ?> |
578 | <?php if ($rencontre == "modifier") { ?> |
579 | <input type="submit" name="validation_rencontre" value="modifier" /> |
580 | <?php } ?> |
581 | </form>
|
582 | <?php retour("annuler"); ?> |
583 | <?php } else if ($_POST['importer'] == "importer") { ?> |
584 | <form method="post" enctype="multipart/form-data"> |
585 | <?php hiddenVars() ?> |
586 | <input type="file" name="zipfile" value="" /> |
587 | <input type="submit" name="validation_importer" value="importer" /> |
588 | </form>
|
589 | <?php retour("annuler"); ?> |
590 | <?php
|
591 | } else { |
592 | retour("continuer", $message); |
593 | } |
594 | ?>
|
595 | </body>
|
596 | </html>
|