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