Exemplo n.º 1
0
    switch ($q) {
        case "Ajouter":
            $champs = $champsSecretaire;
            $nb_champs = sizeof($champs["{$table}"]);
            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++;
                }
                Ajouter("{$table_utilisee}", $valeurs);
                ?>
				
				<script language="Javascript">
				window.location="<?php 
                echo "" . $_SERVER["PHP_SELF"] . "?table={$table}&msg=1";
                ?>
";
				</script>
				<?php 
            } else {
                echo "\r\n\t\t\t\t<form action=\"" . $_SERVER["PHP_SELF"] . "?table={$table}&q=Ajouter&sq=Valider\" method=\"post\">\r\n\t\t\t\t<table class=\"adminTable\" style=\"width:350px\" cellspacing=1>\r\n\t\t\t\t<tr><td>Ajout d'un nouvel utilisateur</td></tr>";
                $i = 0;
                while ($i < $nb_champs) {
                    $nom_champ = $champs["{$table}"]["{$i}"];
                    $nom_champ_maj = strtoupper($nom_champ);
Exemplo n.º 2
0
    $table_liste = "idoc_liste_" . "{$liste}" . "";
    switch ($q) {
        case "Ajouter":
            $nb_champs = sizeof($champs["{$liste}"]);
            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++;
                }
                Ajouter("{$table_liste}", $valeurs);
                ?>
				
				<script language="Javascript">
				window.location="<?php 
                echo "" . $_SERVER["PHP_SELF"] . "?liste={$liste}&msg=1";
                ?>
";
				</script>
				<?php 
            } else {
                echo "\r\n\t\t\t\t<form action=\"" . $_SERVER["PHP_SELF"] . "?liste={$liste}&q=Ajouter&sq=Valider\" method=\"post\">\r\n\t\t\t\t<table border=\"0\" cellspacing=\"1\" class=\"adminTable\" style=\"width:350px;\">\r\n\t\t\t\t\t<tr><td>Ajout d'une entrée dans la liste \"{$liste}\"</td></tr>";
                $i = 0;
                while ($i < $nb_champs) {
                    $nom_champ = $champs["{$liste}"]["{$i}"];
                    $nom_champ_maj = strtoupper($nom_champ);