J'ai créer un tableau statique, puis j'y ai ajouté 2 colonnes qui permettent la saisie de données (avec des listes déroulantes).
Maintenant j'ai donc un formulaire tableau
Code : Tout sélectionner
<form action="a_facturer.php">
<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_facture($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>
<p style="text-align: center;"><input name="modi" type="submit" class="button" value="Enregistrer les modifications"></p>
</form>Je renvoie les données sur la même page et les traite de cette façon:
Code : Tout sélectionner
<?
if(isset($_REQUEST["modi"]))
{
//echo "test";
var_dump($_REQUEST["NUM_FACT"],$_REQUEST["NUM_FACT2"]);
$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());
}
?>Ensuite je voudrais mettre à jour le champ pour un numéro de dossier (ce que j'ai mis dans la requête), mais le $_REQUEST["NUM_DOS"] n'est pas défini non plus
Merci de m'aider