1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
$<div>
$<?php
$if (!isset($_POST['envoyer'])) {
$chargeModifSofts = mysql_query('SELECT * FROM `boissons` WHERE `famille_boisson` = "softs"');
while ($afficheModifSofts = mysql_fetch_array($chargeModifSofts)) {
?>
<form method="post" action="#">
<input type="hidden" name="IDForm" value="<?php echo $afficheModifSofts['ID']; ?>" />
<table style="margin: 10px; width: auto;">
<tr>
<td style="padding: 5px; text-align: right;">
Nom du Soft :
</td>
<td style="padding: 5px;">
<input type="text" name="nomSoft" value="<?php echo $afficheModifSofts['nom_boisson']; ?>" />
</td>
</tr>
<tr>
<td style="padding: 5px; text-align: right;">
Contenance du Soft :
</td>
<td style="padding: 5px;">
<input type="text" name="contenanceSoft" value="<?php echo $afficheModifSofts['contenance_boisson01']; ?>" />
</td>
</tr>
<tr>
<td style="padding: 5px; text-align: right;">
Prix du Soft :
</td>
<td style="padding: 5px;">
<input type="text" name="prixSoft" value="<?php echo $afficheModifSofts['prix_boisson01']; ?>" />
</td>
</tr>
<tr>
<td style="padding: 5px;" colspan="2">
<input type="submit" name="envoyer" value="Modifier" style="background-color: #510003; border: 1px solid #ffffff; color: #ffffff;" />
</td>
</tr>
</table>
</form>
<?php
}
}
else {
if (isset($_POST['envoyer'])) {
$nomSoft = mysql_real_escape_string(htmlentities($_POST['nomSoft']));
$contenanceSoft = mysql_real_escape_string(htmlentities($_POST['contenanceSoft']));
$prixSoft = mysql_real_escape_string(htmlentities($_POST['prixSoft']));
$IDForm = mysql_real_escape_string(htmlentities($_POST['IDForm']));
$updateModifSofts = mysql_query("UPDATE `boissons` SET `nom_boisson` = '$nomSoft', `contenance_boisson01` = '$contenanceSoft', `prix_boisson01` = '$prixSoft' WHERE `ID` = '$IDForm'") or die (mysql_error());
echo 'Tout Bon !';
echo $nomSoft, $contenanceSoft, $prixSoft;
}
}
?>
</div> |
Partager