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