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