root / admin / admin.php @ 4e7797f7365583f6db77d93a32c266b0c30fb783
Historique | Voir | Annoter | Télécharger (11,57 ko)
1 | eaf58ac6 | Romuald | <?php
|
---|---|---|---|
2 | eaf58ac6 | Romuald | /*
|
3 | eaf58ac6 | Romuald | * admin.php - Administration du championnat |
4 | eaf58ac6 | Romuald | * Copyright (C) 2008 Romuald DELAVERGNE <delavergne@free.fr> |
5 | eaf58ac6 | Romuald | * |
6 | eaf58ac6 | Romuald | * This source code is licensed under the GNU General Public License, |
7 | eaf58ac6 | Romuald | * Version 2. See the file COPYING for more details. |
8 | eaf58ac6 | Romuald | */ |
9 | eaf58ac6 | Romuald | |
10 | eaf58ac6 | Romuald | require_once 'zip.lib.php'; |
11 | eaf58ac6 | Romuald | |
12 | eaf58ac6 | Romuald | if (basename(dirname($_SERVER['PHP_SELF'])) == "admin") |
13 | eaf58ac6 | Romuald | require_once '../functions.php'; |
14 | eaf58ac6 | Romuald | else
|
15 | eaf58ac6 | Romuald | require_once 'functions.php'; |
16 | eaf58ac6 | Romuald | |
17 | 4e7797f7 | Romuald | function hiddenVars() { ?> |
18 | 4e7797f7 | Romuald | <input type="hidden" name="saison" value="<?=$_POST['saison']?>" /> |
19 | 4e7797f7 | Romuald | <input type="hidden" name="div1" value="<?=$_POST['div1']?>" /> |
20 | 4e7797f7 | Romuald | <input type="hidden" name="div2" value="<?=$_POST['div2']?>" /> |
21 | 4e7797f7 | Romuald | <input type="hidden" name="poule" value="<?=$_POST['poule']?>" /> |
22 | 4e7797f7 | Romuald | <input type="hidden" name="phase" value="<?=$_POST['phase']?>" /> |
23 | 4e7797f7 | Romuald | <?php }
|
24 | 4e7797f7 | Romuald | |
25 | 4e7797f7 | Romuald | function retour($button, $message = "") { ?>
|
26 | 4e7797f7 | Romuald | <form method="post" action="index.php"> |
27 | 4e7797f7 | Romuald | <?php if ($message != "") echo "\t\t\t$message"; ?> |
28 | 4e7797f7 | Romuald | <?php hiddenVars() ?> |
29 | 4e7797f7 | Romuald | <input type="submit" value="<?=$button?>" /> |
30 | 4e7797f7 | Romuald | </form>
|
31 | 4e7797f7 | Romuald | <?php }
|
32 | eaf58ac6 | Romuald | /* |
33 | eaf58ac6 | Romuald | echo "<pre>\n";
|
34 | eaf58ac6 | Romuald | print_r($_POST); |
35 | eaf58ac6 | Romuald | echo "</pre>\n";
|
36 | eaf58ac6 | Romuald | */ |
37 | eaf58ac6 | Romuald | |
38 | eaf58ac6 | Romuald | // Données reçues par l'index ou cette page |
39 | eaf58ac6 | Romuald | $championnat = $_POST['championnat']; |
40 | eaf58ac6 | Romuald | if ($championnat == "ajouter un championnat") $championnat = "ajouter"; |
41 | eaf58ac6 | Romuald | if ($_POST['validation_championnat'] == "ajouter") $championnat = "validation_ajouter"; |
42 | eaf58ac6 | Romuald | if ($_POST['validation_championnat'] == "modifier") $championnat = "validation_modifier"; |
43 | eaf58ac6 | Romuald | |
44 | eaf58ac6 | Romuald | if (isset($_POST['rencontre-ajouter'])) { |
45 | eaf58ac6 | Romuald | $rencontre = "ajouter"; |
46 | eaf58ac6 | Romuald | } else { |
47 | eaf58ac6 | Romuald | $vars = preg_grep("/^rencontre-/", array_keys($_POST)); |
48 | eaf58ac6 | Romuald | if ($vars) { |
49 | eaf58ac6 | Romuald | $rencontre = $_POST[current($vars)]; |
50 | eaf58ac6 | Romuald | $rencontreId = current($vars); |
51 | eaf58ac6 | Romuald | } |
52 | eaf58ac6 | Romuald | } |
53 | eaf58ac6 | Romuald | if ($_POST['validation_rencontre'] == "ajouter") $rencontre = "validation_ajouter"; |
54 | eaf58ac6 | Romuald | if ($_POST['validation_rencontre'] == "modifier") $rencontre = "validation_modifier"; |
55 | eaf58ac6 | Romuald | |
56 | eaf58ac6 | Romuald | $equipes = get_magic_quotes_gpc() ? stripslashes($_POST['equipes']) : $_POST['equipes']; |
57 | eaf58ac6 | Romuald | $journee = get_magic_quotes_gpc() ? stripslashes($_POST['journee']) : $_POST['journee']; |
58 | eaf58ac6 | Romuald | $domicile = get_magic_quotes_gpc() ? stripslashes($_POST['domicile']) : $_POST['domicile']; |
59 | eaf58ac6 | Romuald | $visiteur = get_magic_quotes_gpc() ? stripslashes($_POST['visiteur']) : $_POST['visiteur']; |
60 | eaf58ac6 | Romuald | $ptsDom = get_magic_quotes_gpc() ? stripslashes($_POST['ptsDom']) : $_POST['ptsDom']; |
61 | eaf58ac6 | Romuald | $ptsVis = get_magic_quotes_gpc() ? stripslashes($_POST['ptsVis']) : $_POST['ptsVis']; |
62 | eaf58ac6 | Romuald | $scoreDom = get_magic_quotes_gpc() ? stripslashes($_POST['scoreDom']) : $_POST['scoreDom']; |
63 | eaf58ac6 | Romuald | $scoreVis = get_magic_quotes_gpc() ? stripslashes($_POST['scoreVis']) : $_POST['scoreVis']; |
64 | eaf58ac6 | Romuald | |
65 | eaf58ac6 | Romuald | $message = ""; |
66 | eaf58ac6 | Romuald | |
67 | eaf58ac6 | Romuald | if ($_POST['saison'] && $_POST['div1']) { |
68 | eaf58ac6 | Romuald | $champPath = $_POST['saison']."/".$_POST['div1']; |
69 | eaf58ac6 | Romuald | if ($_POST['div2']) $champPath .= $SEP_DIV.$_POST['div2']; |
70 | eaf58ac6 | Romuald | if ($_POST['poule'] || $_POST['phase']) $champPath .= "/"; |
71 | eaf58ac6 | Romuald | if ($_POST['poule']) $champPath .= $_POST['poule']; |
72 | eaf58ac6 | Romuald | if ($_POST['phase']) $champPath .= $SEP_DIV.$_POST['phase']; |
73 | eaf58ac6 | Romuald | $path = ((IamAdmin()) ? "../datas" : "datas")."/$champPath"; |
74 | eaf58ac6 | Romuald | } else { |
75 | eaf58ac6 | Romuald | $message = "Données manquantes !";
|
76 | eaf58ac6 | Romuald | } |
77 | eaf58ac6 | Romuald | |
78 | eaf58ac6 | Romuald | if ($_POST['exporter-tout'] == "tout exporter") { |
79 | eaf58ac6 | Romuald | $zip = new zipfile(); |
80 | eaf58ac6 | Romuald | backup($zip, "../datas", "datas"); |
81 | eaf58ac6 | Romuald | $archive = $zip->file();
|
82 | eaf58ac6 | Romuald | header("Content-Type: application/x-zip"); |
83 | eaf58ac6 | Romuald | header("Content-Disposition: inline; filename=datas-".date("Y-m-d").".zip"); |
84 | eaf58ac6 | Romuald | echo $archive; |
85 | eaf58ac6 | Romuald | exit; |
86 | eaf58ac6 | Romuald | } elseif ($_POST['importer-tout'] == "tout importer") { |
87 | eaf58ac6 | Romuald | $message = "pas implémenté."; |
88 | eaf58ac6 | Romuald | } elseif ($_POST['supprimer-tout'] == "tout supprimer") { |
89 | eaf58ac6 | Romuald | $message = "pas implémenté."; |
90 | eaf58ac6 | Romuald | } |
91 | eaf58ac6 | Romuald | |
92 | eaf58ac6 | Romuald | if ($path) { |
93 | eaf58ac6 | Romuald | //echo "<p>path=$path.</p>\n"; |
94 | eaf58ac6 | Romuald | switch ($championnat) { |
95 | eaf58ac6 | Romuald | case "modifier": |
96 | eaf58ac6 | Romuald | if (file_exists("$path/equipes")) { |
97 | eaf58ac6 | Romuald | $equipes = file_get_contents("$path/equipes"); |
98 | eaf58ac6 | Romuald | } |
99 | eaf58ac6 | Romuald | break; |
100 | eaf58ac6 | Romuald | case "validation_ajouter": |
101 | eaf58ac6 | Romuald | if (!file_exists($path)) { |
102 | eaf58ac6 | Romuald | mkdirRecursive($path); |
103 | 4e8f0aee | Romuald | my_file_put_contents("$path/equipes", $equipes); |
104 | eaf58ac6 | Romuald | $message = "Le championnat a été ajouté."; |
105 | eaf58ac6 | Romuald | } else { |
106 | eaf58ac6 | Romuald | $message = "Le championnat existe déjà !"; |
107 | eaf58ac6 | Romuald | } |
108 | eaf58ac6 | Romuald | break; |
109 | eaf58ac6 | Romuald | case "validation_modifier": |
110 | 4e8f0aee | Romuald | my_file_put_contents("$path/equipes", $equipes); |
111 | eaf58ac6 | Romuald | $message = "Le championnat a été mis à jour."; |
112 | eaf58ac6 | Romuald | break; |
113 | eaf58ac6 | Romuald | case "supprimer": |
114 | eaf58ac6 | Romuald | // Suppression de tous les fichiers du répertoire |
115 | eaf58ac6 | Romuald | if ($dir = opendir($path)) { |
116 | eaf58ac6 | Romuald | while (($file = readdir($dir)) !== FALSE) { |
117 | eaf58ac6 | Romuald | if (is_file("$path/$file")) unlink("$path/$file"); |
118 | eaf58ac6 | Romuald | } |
119 | eaf58ac6 | Romuald | closedir($dir); |
120 | eaf58ac6 | Romuald | } |
121 | eaf58ac6 | Romuald | // Suppression du maximum de répertoires |
122 | eaf58ac6 | Romuald | while (isEmptyDir($path) && basename($path) != "datas") { |
123 | eaf58ac6 | Romuald | monRmdir($path); |
124 | eaf58ac6 | Romuald | $path = dirname($path); |
125 | eaf58ac6 | Romuald | } |
126 | eaf58ac6 | Romuald | $message = "Le championnat a été supprimé."; |
127 | eaf58ac6 | Romuald | break; |
128 | eaf58ac6 | Romuald | case "exporter": |
129 | eaf58ac6 | Romuald | $filename = $_POST['saison']."-".$_POST['div1']; |
130 | eaf58ac6 | Romuald | if ($_POST['div2']) $filename .= $_POST['div2']; |
131 | eaf58ac6 | Romuald | if ($_POST['poule'] || $_POST['phase']) $filename .= "-"; |
132 | eaf58ac6 | Romuald | if ($_POST['poule']) $filename .= $_POST['poule']; |
133 | eaf58ac6 | Romuald | if ($_POST['phase']) $filename .= $_POST['phase']; |
134 | eaf58ac6 | Romuald | $zip = new zipfile(); |
135 | eaf58ac6 | Romuald | backup($zip, $path, "datas/$champPath"); |
136 | eaf58ac6 | Romuald | $archive = $zip->file();
|
137 | eaf58ac6 | Romuald | header("Content-Type: application/x-zip"); |
138 | eaf58ac6 | Romuald | header("Content-Disposition: inline; filename=datas-$filename.zip"); |
139 | eaf58ac6 | Romuald | echo $archive; |
140 | eaf58ac6 | Romuald | exit; |
141 | eaf58ac6 | Romuald | break; |
142 | eaf58ac6 | Romuald | } |
143 | eaf58ac6 | Romuald | switch ($rencontre) { |
144 | eaf58ac6 | Romuald | case "ajouter": |
145 | eaf58ac6 | Romuald | $equipes = getEquipes($path); |
146 | eaf58ac6 | Romuald | break; |
147 | eaf58ac6 | Romuald | case "modifier": |
148 | eaf58ac6 | Romuald | $equipes = getEquipes($path); |
149 | eaf58ac6 | Romuald | list($prefix, $journee, $domicile, $visiteur) = explode("-", $rencontreId); |
150 | eaf58ac6 | Romuald | $file = "$path/match-".$journee."-".$domicile."-".$visiteur; |
151 | eaf58ac6 | Romuald | if (file_exists($file)) { |
152 | eaf58ac6 | Romuald | $resu = file_get_contents($file); |
153 | eaf58ac6 | Romuald | list($ptsDom, $ptsVis, $scoreDom, $scoreVis) = explode(":", $resu); |
154 | eaf58ac6 | Romuald | } |
155 | eaf58ac6 | Romuald | break; |
156 | eaf58ac6 | Romuald | case "validation_ajouter": |
157 | eaf58ac6 | Romuald | if ($journee == "" || $domicile == "" || $visiteur == "") { |
158 | eaf58ac6 | Romuald | $message = "Vous devez saisir le numéro de la journée, l'équipe qui reçoit et qui se déplace !"; |
159 | eaf58ac6 | Romuald | } else { |
160 | eaf58ac6 | Romuald | $file = "$path/match-".$journee."-".$domicile."-".$visiteur; |
161 | eaf58ac6 | Romuald | if (!file_exists($file)) { |
162 | 4e8f0aee | Romuald | my_file_put_contents($file, $ptsDom.":".$ptsVis.":".$scoreDom.":".$scoreVis); |
163 | eaf58ac6 | Romuald | $message = "La nouvelle rencontre a été ajoutée."; |
164 | eaf58ac6 | Romuald | } else { |
165 | eaf58ac6 | Romuald | $message = "La rencontre existe déjà !"; |
166 | eaf58ac6 | Romuald | } |
167 | eaf58ac6 | Romuald | } |
168 | eaf58ac6 | Romuald | break; |
169 | eaf58ac6 | Romuald | case "validation_modifier": |
170 | eaf58ac6 | Romuald | $file = "$path/match-".$journee."-".$domicile."-".$visiteur; |
171 | 4e8f0aee | Romuald | my_file_put_contents($file, $ptsDom.":".$ptsVis.":".$scoreDom.":".$scoreVis); |
172 | eaf58ac6 | Romuald | $message = "La rencontre a été mise à jour."; |
173 | eaf58ac6 | Romuald | break; |
174 | eaf58ac6 | Romuald | case "supprimer": |
175 | eaf58ac6 | Romuald | list($prefix, $journee, $domicile, $visiteur) = explode("-", $rencontreId); |
176 | eaf58ac6 | Romuald | $file = "match-".$journee."-".$domicile."-".$visiteur; |
177 | eaf58ac6 | Romuald | if (file_exists("$path/$file")) { |
178 | eaf58ac6 | Romuald | unlink("$path/$file"); |
179 | eaf58ac6 | Romuald | $message = "La rencontre a été supprimée."; |
180 | eaf58ac6 | Romuald | } |
181 | eaf58ac6 | Romuald | break; |
182 | eaf58ac6 | Romuald | } |
183 | eaf58ac6 | Romuald | } |
184 | eaf58ac6 | Romuald | ?>
|
185 | eaf58ac6 | Romuald | <html>
|
186 | eaf58ac6 | Romuald | <head>
|
187 | eaf58ac6 | Romuald | <title>Administration</title> |
188 | eaf58ac6 | Romuald | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
189 | eaf58ac6 | Romuald | <meta http-equiv="Content-language" content="fr" /> |
190 | eaf58ac6 | Romuald | <meta name="copyright" content="Tous droits réservés - All Rights Reserved" /> |
191 | eaf58ac6 | Romuald | <meta name="author" content="Romuald DELAVERGNE"> |
192 | eaf58ac6 | Romuald | </head>
|
193 | eaf58ac6 | Romuald | <html>
|
194 | eaf58ac6 | Romuald | <body>
|
195 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter" || $championnat == "modifier" ) { ?> |
196 | eaf58ac6 | Romuald | <form name="admin" method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
197 | eaf58ac6 | Romuald | <table border="0"> |
198 | eaf58ac6 | Romuald | <tr>
|
199 | eaf58ac6 | Romuald | <td>Saison</td> |
200 | eaf58ac6 | Romuald | <td>
|
201 | eaf58ac6 | Romuald | : |
202 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter") { ?> |
203 | eaf58ac6 | Romuald | <input type="text" name="saison" size="5" value="" /> |
204 | eaf58ac6 | Romuald | <?php } else { ?> |
205 | eaf58ac6 | Romuald | <input type="hidden" name="saison" value="<?=$_POST['saison']?>" /> |
206 | eaf58ac6 | Romuald | <?=$_POST['saison']."/".($_POST['saison']+1)."\n"?> |
207 | eaf58ac6 | Romuald | <?php } ?> |
208 | eaf58ac6 | Romuald | </td>
|
209 | eaf58ac6 | Romuald | </tr>
|
210 | eaf58ac6 | Romuald | <tr>
|
211 | eaf58ac6 | Romuald | <td>Division</td> |
212 | eaf58ac6 | Romuald | <td>
|
213 | eaf58ac6 | Romuald | : |
214 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter") { ?> |
215 | eaf58ac6 | Romuald | <select name="div1"> |
216 | eaf58ac6 | Romuald | <option value=""></option> |
217 | eaf58ac6 | Romuald | <?php
|
218 | eaf58ac6 | Romuald | foreach ($DIVISION as $n => $d) { |
219 | eaf58ac6 | Romuald | echo "\t\t\t\t\t\t<option value=\"$n\">$d</option>\n"; |
220 | eaf58ac6 | Romuald | } |
221 | eaf58ac6 | Romuald | ?>
|
222 | eaf58ac6 | Romuald | </select>
|
223 | eaf58ac6 | Romuald | <input type="text" name="div2" size="3" value="" /> |
224 | eaf58ac6 | Romuald | <?php } else { ?> |
225 | eaf58ac6 | Romuald | <input type="hidden" name="div1" value="<?=$_POST['div1']?>" /> |
226 | eaf58ac6 | Romuald | <input type="hidden" name="div2" value="<?=$_POST['div2']?>" /> |
227 | eaf58ac6 | Romuald | <?=$_POST['div1'].$_POST['div2']."\n"?> |
228 | eaf58ac6 | Romuald | <?php } ?> |
229 | eaf58ac6 | Romuald | </td>
|
230 | eaf58ac6 | Romuald | </tr>
|
231 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter" || $_POST['poule']) { ?> |
232 | eaf58ac6 | Romuald | <tr>
|
233 | eaf58ac6 | Romuald | <td>Poule</td> |
234 | eaf58ac6 | Romuald | <td>
|
235 | eaf58ac6 | Romuald | : |
236 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter") { ?> |
237 | eaf58ac6 | Romuald | <input type="text" name="poule" size="3" value="" /> |
238 | eaf58ac6 | Romuald | <?php } else { ?> |
239 | eaf58ac6 | Romuald | <input type="hidden" name="poule" value="<?=$_POST['poule']?>" /> |
240 | eaf58ac6 | Romuald | <?=$_POST['poule']."\n"?> |
241 | eaf58ac6 | Romuald | <?php } ?> |
242 | eaf58ac6 | Romuald | </td>
|
243 | eaf58ac6 | Romuald | </tr>
|
244 | eaf58ac6 | Romuald | <?php } ?> |
245 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter" || $_POST['phase']) { ?> |
246 | eaf58ac6 | Romuald | <tr>
|
247 | eaf58ac6 | Romuald | <td>Phase</td> |
248 | eaf58ac6 | Romuald | <td>
|
249 | eaf58ac6 | Romuald | : |
250 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter") { ?> |
251 | eaf58ac6 | Romuald | <select name="phase"> |
252 | eaf58ac6 | Romuald | <option value=""></option> |
253 | eaf58ac6 | Romuald | <option value="1">1</option> |
254 | eaf58ac6 | Romuald | <option value="2">2</option> |
255 | eaf58ac6 | Romuald | </select>
|
256 | eaf58ac6 | Romuald | <?php } else { ?> |
257 | eaf58ac6 | Romuald | <input type="hidden" name="phase" value="<?=$_POST['phase']?>" /> |
258 | eaf58ac6 | Romuald | <?=$_POST['phase']."\n"?> |
259 | eaf58ac6 | Romuald | <?php } ?> |
260 | eaf58ac6 | Romuald | </td>
|
261 | eaf58ac6 | Romuald | </tr>
|
262 | eaf58ac6 | Romuald | <?php } ?> |
263 | eaf58ac6 | Romuald | <tr>
|
264 | eaf58ac6 | Romuald | <td colspan="2"> |
265 | eaf58ac6 | Romuald | Liste des équipes :
|
266 | eaf58ac6 | Romuald | </td>
|
267 | eaf58ac6 | Romuald | </tr>
|
268 | eaf58ac6 | Romuald | <tr>
|
269 | eaf58ac6 | Romuald | <td colspan="2"> |
270 | eaf58ac6 | Romuald | <textarea name="equipes" cols="30" rows="10"><?=$equipes?></textarea> |
271 | eaf58ac6 | Romuald | </td>
|
272 | eaf58ac6 | Romuald | </tr>
|
273 | eaf58ac6 | Romuald | </table>
|
274 | eaf58ac6 | Romuald | <?php if ($championnat == "ajouter") { ?> |
275 | eaf58ac6 | Romuald | <input type="submit" name="validation_championnat" value="ajouter" /> |
276 | eaf58ac6 | Romuald | <?php } ?> |
277 | eaf58ac6 | Romuald | <?php if ($championnat == "modifier" ) { ?> |
278 | eaf58ac6 | Romuald | <input type="submit" name="validation_championnat" value="modifier" /> |
279 | eaf58ac6 | Romuald | <?php } ?> |
280 | eaf58ac6 | Romuald | </form>
|
281 | 4e7797f7 | Romuald | <?php retour("annuler"); ?> |
282 | eaf58ac6 | Romuald | <?php } else if ($rencontre == "ajouter" || $rencontre == "modifier") { ?> |
283 | eaf58ac6 | Romuald | <form name="admin" method="post" action="<?=$_SERVER['PHP_SELF']?>"> |
284 | eaf58ac6 | Romuald | <table border="0"> |
285 | eaf58ac6 | Romuald | <tr>
|
286 | eaf58ac6 | Romuald | <td colspan="3"> |
287 | eaf58ac6 | Romuald | Journée<?=($rencontre == "modifier") ? " $journee\n" : "\n"?> |
288 | eaf58ac6 | Romuald | <?php if ($rencontre == "ajouter") { ?> |
289 | eaf58ac6 | Romuald | <input type="text" name="journee" size="3" value="" /> |
290 | eaf58ac6 | Romuald | <?php } else { ?> |
291 | eaf58ac6 | Romuald | <input type="hidden" name="journee" value="<?=$journee?>" /> |
292 | eaf58ac6 | Romuald | <?php } ?> |
293 | eaf58ac6 | Romuald | </td>
|
294 | eaf58ac6 | Romuald | </tr>
|
295 | eaf58ac6 | Romuald | <tr>
|
296 | eaf58ac6 | Romuald | <td>
|
297 | eaf58ac6 | Romuald | <?php if ($rencontre == "ajouter") { ?> |
298 | eaf58ac6 | Romuald | Équipe à domicile : |
299 | eaf58ac6 | Romuald | <select name="domicile"> |
300 | eaf58ac6 | Romuald | <option value=""></option> |
301 | eaf58ac6 | Romuald | <?php
|
302 | eaf58ac6 | Romuald | foreach ($equipes as $n => $e) { |
303 | eaf58ac6 | Romuald | echo "\t\t\t\t\t\t<option value=\"$n\""; |
304 | eaf58ac6 | Romuald | if ($domicile && $n == $domicile) echo " selected"; |
305 | eaf58ac6 | Romuald | echo ">$e</option>\n"; |
306 | eaf58ac6 | Romuald | } |
307 | eaf58ac6 | Romuald | ?>
|
308 | eaf58ac6 | Romuald | </select>
|
309 | eaf58ac6 | Romuald | <?php } else { ?> |
310 | eaf58ac6 | Romuald | <input type="hidden" name="domicile" value="<?=$domicile?>" /> |
311 | eaf58ac6 | Romuald | <?=$equipes[$domicile]."\n"?> |
312 | eaf58ac6 | Romuald | <?php } ?> |
313 | eaf58ac6 | Romuald | </td>
|
314 | eaf58ac6 | Romuald | <td> points : <input type="text" name="ptsDom" size="3" value="<?=$ptsDom?>" /></td> |
315 | eaf58ac6 | Romuald | <td> score : <input type="text" name="scoreDom" size="3" value="<?=$scoreDom?>" /></td> |
316 | eaf58ac6 | Romuald | </tr>
|
317 | eaf58ac6 | Romuald | <tr>
|
318 | eaf58ac6 | Romuald | <td>
|
319 | eaf58ac6 | Romuald | <?php if ($rencontre == "ajouter") { ?> |
320 | eaf58ac6 | Romuald | Équipe à l'extérieure : |
321 | eaf58ac6 | Romuald | <select name="visiteur"> |
322 | eaf58ac6 | Romuald | <option value=""></option> |
323 | eaf58ac6 | Romuald | <?php
|
324 | eaf58ac6 | Romuald | foreach ($equipes as $n => $e) { |
325 | eaf58ac6 | Romuald | echo "\t\t\t\t\t\t<option value=\"$n\""; |
326 | eaf58ac6 | Romuald | if ($visiteur && $n == $visiteur) echo " selected"; |
327 | eaf58ac6 | Romuald | echo ">$e</option>\n"; |
328 | eaf58ac6 | Romuald | } |
329 | eaf58ac6 | Romuald | ?>
|
330 | eaf58ac6 | Romuald | </select>
|
331 | eaf58ac6 | Romuald | <?php } else { ?> |
332 | eaf58ac6 | Romuald | <input type="hidden" name="visiteur" value="<?=$visiteur?>" /> |
333 | eaf58ac6 | Romuald | <?=$equipes[$visiteur]."\n"?> |
334 | eaf58ac6 | Romuald | <?php } ?> |
335 | eaf58ac6 | Romuald | </td>
|
336 | eaf58ac6 | Romuald | <td> points : <input type="text" name="ptsVis" size="3" value="<?=$ptsVis?>" /></td> |
337 | eaf58ac6 | Romuald | <td> score : <input type="text" name="scoreVis" size="3" value="<?=$scoreVis?>" /></td> |
338 | eaf58ac6 | Romuald | </tr>
|
339 | eaf58ac6 | Romuald | </table>
|
340 | 4e7797f7 | Romuald | <?php hiddenVars() ?> |
341 | eaf58ac6 | Romuald | <?php if ($rencontre == "ajouter") { ?> |
342 | eaf58ac6 | Romuald | <input type="submit" name="validation_rencontre" value="ajouter" /> |
343 | eaf58ac6 | Romuald | <?php } ?> |
344 | eaf58ac6 | Romuald | <?php if ($rencontre == "modifier") { ?> |
345 | eaf58ac6 | Romuald | <input type="submit" name="validation_rencontre" value="modifier" /> |
346 | eaf58ac6 | Romuald | <?php } ?> |
347 | eaf58ac6 | Romuald | </form>
|
348 | 4e7797f7 | Romuald | <?php retour("annuler"); ?> |
349 | 4e7797f7 | Romuald | <?php
|
350 | 4e7797f7 | Romuald | } else { |
351 | 4e7797f7 | Romuald | retour("continuer", $message); |
352 | 4e7797f7 | Romuald | } |
353 | 4e7797f7 | Romuald | ?>
|
354 | eaf58ac6 | Romuald | </body>
|
355 | eaf58ac6 | Romuald | </html> |