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