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 58
| if (!empty($_GET['d'])) {
$query = mysql_query('SELECT * FROM galeries WHERE id="' . $_GET['d'] . '"');
if ($galeries = mysql_fetch_assoc($query)) {
echo('
<form action="" method="post" enctype="multipart/formdata">
<table>
<tr>
<td>Numéro : </td>
<td><input type="text" name="id" value="' . $galeries['id'] . '" size="3" /></td>
</tr>
<tr>
<td>Description : </td>
<td><textarea name="description" cols="30" rows="5">' . $galeries['description'] . '</textarea></td>
</tr>
<tr>
<td></td>
<td>
<input type="hidden" name="blanc" "value="blanc" />
<input type="submit" value="Modifier" />
</td>
</tr>
</table>
</form>
');
$query2 = mysql_query('SELECT * FROM galeries');
while ($galeries2 = mysql_fetch_assoc($query2)) {
if ($_POST['id'] == $galeries2['id']) {
$nouveau = $galeries2['id']+1;
mysql_query('UPDATE galeries set id="' . $nouveau . '" WHERE id="' . $galeries2['id'] . '"');
/* QUE FAIRE A CETTE ENDROIT POUR MODIFIER TOUTE LES ID */
}
else {
if (!empty($_POST['blanc']) && !empty($_POST['id'])) {
$description = $_POST['description'];
$id = $_POST['id'];
mysql_query('UPDATE galeries set description="' . $description . '", id="' . $id . '" WHERE id="' . $_GET['d'] . '"');
echo redirection('galeries_edit.php');
}
}
}
}
}
else {
$query = mysql_query('SELECT * FROM galeries ORDER BY id ASC');
while ($galeries = mysql_fetch_assoc($query)) {
$dimensions = getimagesize($site_chemin_admin . 'fichiers/img/galeries/' . $galeries['image_nom']);
echo('
<div style="float:left; padding:10px; width:100px; height:100px;">
<a href="#" ');
echo galerie_popup ($site_chemin_absolu, $galeries, $dimensions);
echo('>
<img src="' . $site_chemin_absolu . 'fichiers/img/galeries/small/' . $galeries['image_nom'] . '" alt="' . $galeries['image_nom'] . '" />
</a>
<a href="galeries_ordonner.php?d=' . $galeries['id'] . '">MODIFIER</a>
</div>
');
}
} |
Partager