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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| <?php
if (isset($_POST['auteur']) AND isset($_POST['page']) AND isset($_POST['contenu']) AND isset($_POST['categorie_id']))
{
$auteur = addslashes($_POST['auteur']);
$page = addslashes($_POST['page']);
$contenu = addslashes($_POST['contenu']);
$categorie_id = addslashes($_POST['categorie_id']);
if ($_POST['id_news'] == 0)
{
mysql_query("INSERT INTO citation VALUES('',
'" . $auteur . "',
'" . $page . "',
'" . $contenu . "',
'" . $categorie_id . "',
'" . time() . "')");
}
else
{
$_POST['id_citation'] = addslashes($_POST['id_citation']);
mysql_query("UPDATE citation SET
auteur='" . $auteur . "',
page='" . $page . "',
contenu='" . $contenu . "'
WHERE id='" . $_POST['id_citation'] . "'");
}
}
if (isset($_GET['supprimer_citation']))
{
$_GET['supprimer_citation'] = addslashes($_GET['supprimer_citation']);
mysql_query('DELETE FROM citation WHERE id=\'' . $_GET['supprimer_citation'] . '\'');
}
$retour = mysql_query("SELECT * FROM citation WHERE id ORDER BY id DESC");
while ($donnees = mysql_fetch_array($retour))
{
// Affichage de la news
?>
<div align="center">
<table style=" border: 1px solid #bababa; width: 720px;">
<tr>
<td width="120" style="border-bottom: 1px dashed #bababa;border-right: 1px dashed #bababa;">
<div align="left">Modifier</div></td><td width="600" style="border-bottom: 1px dashed #bababa; background-color: #191919;">
<?php echo '<a href="ajouter_citation.php?modifier_citation=' . $donnees['id'] . '">'; ?>Modifier</a></td></tr>
<tr>
<td width="120" style="border-bottom: 1px dashed #bababa;border-right: 1px dashed #bababa;">
<div align="left">Supprimer</div></td><td width="600" style="border-bottom: 1px dashed #bababa; background-color: #191919;">
<?php echo '<a href="liste_articles.php?supprimer_citation=' . $donnees['id'] . '">'; ?>Supprimer</a></td></tr>
<tr>
<td width="120" style="border-bottom: 1px dashed #bababa;border-right: 1px dashed #bababa;">
<div align="left">Titre</div></td><td width="600" style="border-bottom: 1px dashed #bababa;">
<?php echo stripslashes($donnees['page']); ?></td></tr>
<tr>
<td width="120" style="border-bottom: 1px dashed #bababa;border-right: 1px dashed #bababa;">
<div align="left">Contenu</div></td><td width="600" style="border-bottom: 1px dashed #bababa;">
<?php echo stripslashes($donnees['contenu']); echo substr($contenu, 0, 50).'...'; ?></td></tr>
<tr>
<td width="120" style="border-bottom: 1px dashed #bababa;border-right: 1px dashed #bababa;">
<div align="left">Catégorie</div></td><td width="600" style="border-bottom: 1px dashed #bababa;">
CITATION</td></tr>
</table>
<br>
<hr class="style_two" width="600" />
<br>
</div>
<?php } ?> |
Partager