$champs = $champsSecretaire; } $nb_champs = sizeof($champs["{$table}"]); $id = $_GET["id"]; if ($sq == "Valider") { $valeurs = ""; $i = 0; while ($i < $nb_champs) { $nom_champ = $champs["{$table}"]["{$i}"]; if ($i != 0) { $valeurs .= " ,"; } $valeurs .= "{$nom_champ}=\"{$_POST[$nom_champ]}\""; $i++; } Modifier("{$table_utilisee}", $valeurs, "id=\"{$id}\""); ?> <script language="Javascript"> window.location="<?php echo "" . $_SERVER["PHP_SELF"] . "?table={$table}&msg=2"; ?> "; </script> <?php } else { $select = mysql_query("select * from {$table_utilisee} where id=\"{$id}\""); $res = mysql_fetch_array($select); echo "\r\n\t\t\t<form action=\"" . $_SERVER["PHP_SELF"] . "?table={$table}&q=Modifier&sq=Valider&id={$id}\" method=\"post\">\r\n\t\t\t<table border=\"0\" class=\"adminTable\" cellspacing=\"1\" style=\"width:350px\">\r\n\t\t\t\t<tr><td>Modification d'une entrée de la table \"{$table}\"</td></tr>"; $i = 0; while ($i < $nb_champs) {
break; case "Modifier": $nb_champs = sizeof($champs[$liste]); $id = $_GET["id"]; if ($sq == "Valider") { $valeurs = ""; $i = 0; while ($i < $nb_champs) { $nom_champ = $champs["{$liste}"]["{$i}"]; if ($i != 0) { $valeurs .= " ,"; } $valeurs .= "{$nom_champ}=\"" . $_POST["{$nom_champ}"] . "\""; $i++; } Modifier("{$table_liste}", $valeurs, "id=\"{$id}\""); ?> <script language="Javascript"> window.location="<?php echo "" . $_SERVER["PHP_SELF"] . "?liste={$liste}&msg=2"; ?> "; </script> <?php } else { $select = mysql_query("select * from {$table_liste} where id=\"{$id}\""); $res = mysql_fetch_array($select); echo "\r\n\t\t\t<form action=\"" . $_SERVER["PHP_SELF"] . "?liste={$liste}&q=Modifier&sq=Valider&id={$id}\" method=\"post\">\r\n\t\t\t<table border=\"0\" cellspacing=\"1\" class=\"adminTable\" style=\"width:350px;\">\r\n\t\t\t\t<tr><td>Modification d'une entrée de la liste \"{$liste}\"</td></tr>"; $i = 0; while ($i < $nb_champs) {