[php] Tableau de saisie
MenphiTimrid
Messages postés
2
Date d'inscription
Statut
Membre
Dernière intervention
-
MenphiTimrid Messages postés 2 Date d'inscription Statut Membre Dernière intervention -
MenphiTimrid Messages postés 2 Date d'inscription Statut Membre Dernière intervention -
Bonjour à tous,
J'ai créer un tableau dans lequel j'ai mis deux colonnes avec des listes déroulantes, j'aimerais pouvoir modifier ces informations et les enregistrer dans ma BDD. J'ai donc au final un formulaire dans lequel il y à un tableau!
Voici comment je traite la modification dans la BDD:
Avec mes tests d'affichage je me suis aperçu que c'était le numéro de dossier qui posait problème et n'était pas récupéré.
J'ai un numéro de dossier par ligne et je ne sais pas comment récupéré tout ça, la finalité serait de faire l'update pour tous les dossiers pour lesquels ont a modifier des éléments.
Merci pour votre aide!
J'ai créer un tableau dans lequel j'ai mis deux colonnes avec des listes déroulantes, j'aimerais pouvoir modifier ces informations et les enregistrer dans ma BDD. J'ai donc au final un formulaire dans lequel il y à un tableau!
<form action="a_facturer.php" method="post"> <table class="Tabledonnees"> <thead> <tr> <th>Numéro contrat</th> <th>Nom locataire</th> <th>Date mandat</th> <th>A la charge</th> <th>Statut matériel</th> <th>Statut mandat</th> <th>Type mandat</th> <th>Facture 1</th> <th>Montant 1</th> <th>Facture 2</th> <th>Montant 2</th> <th></th> </tr> </thead> <?php $altenative = $numligne = 0 ; $vide = "vrai"; $c_ligne = $c_ligne2="" ; while ($ligne = mysql_fetch_array($exec)) : ?> <tr valign=top> <!--<td><?php echo ($numCon = getNumCon($ligne["NUM_DOS"])) ?></td>--> <td> <a href="<?php echo 'detail_dossier.php?NUM_DOS='.$ligne["NUM_DOS"].'&onglet=6&NUM_CON='.$numCon ?>"> <?php echo $numCon ?> </a> </td> <td><?php echo $ligne["DEN_LOC"] ?></td> <td><?php echo datemysql2francais($ligne["DATE_DOS"]) ?></td> <td><?php echo $ligne["DEN_CLI"] ?></td> <td><?php echo htmlentities($ligne["LIB_STA"]) ?></td> <td><?php echo htmlentities($ligne["LIBE_STA_DOS"]) ?></td> <td><?php echo $ligne["LIB_TYP_MANDAT"] ?></td> <td><?php echo select_facture($ligne["NUM_FACT"]) //fonction qui fait une liste déroulante avec les factures?></td> <td><?php echo $ligne["MT_FACT"] ?></td> <td><?php echo select_facture2($ligne["NUM_FACT2"]) ?></td> <td><?php echo $ligne["MT_FACT2"] ?></td> <td> <a href="rapport_activite.php?NUM_DOS=<?php echo $ligne["NUM_DOS"] ?>" target="_blank"> <img src="img\b_print.png" border="0" width="16" height="16" alt="Rapport d'activité"> </a> </td> </tr> <?php endwhile; ?> </table> <input type="hidden" name="NUM_DOS" value=<?$ligne["NUM_DOS"]?> > <p style="text-align: center;"><input name="modi" type="submit" class="button" value="Enregistrer les modifications"></p> </form>
Voici comment je traite la modification dans la BDD:
<? if(isset($_REQUEST["modi"])) { //echo "test"; echo " facture 1 : '".$_REQUEST["NUM_FACT"]."' <br>"; echo " facture 2 : '".$_REQUEST["NUM_FACT2"]."' <br>"; echo "numéro de dossier : '".$_REQUEST["NUM_DOS"]."' "; $sqlUP="update locataire set NUM_FACT='".$_REQUEST["NUM_FACT"]."' , NUM_FACT2='".$_REQUEST["NUM_FACT2"]."' where NUM_DOS='".$_REQUEST["NUM_DOS"]."'"; $execUP=mysql_query($sqlUP) or die(mysql_error()); } ?>
Avec mes tests d'affichage je me suis aperçu que c'était le numéro de dossier qui posait problème et n'était pas récupéré.
J'ai un numéro de dossier par ligne et je ne sais pas comment récupéré tout ça, la finalité serait de faire l'update pour tous les dossiers pour lesquels ont a modifier des éléments.
Merci pour votre aide!
A voir également:
- [php] Tableau de saisie
- Tableau word - Guide
- Tableau ascii - Guide
- Saisie gestuelle iphone - Guide
- Trier un tableau excel - Guide
- Tableau croisé dynamique - Guide