<?php include('partie1_admin.php');?>
<div id="coverer" align="center">
<h2><img src="img/fleche.gif" style="margin-bottom:-10px;" height="40" width="40">&nbsp;Contacts</h2>
<a href="liste_messages.php"><p class="bouton_design" style="display:inline-block; color:#fff;">Retour</p></a>
<?php 
if (isset($_GET['id']))
{ 
		include ('connexion_mysql.php');
	$retour = 'SELECT * FROM messages WHERE objet="'.$_GET['id'].'" ORDER BY id desc';
$res = $conn->query($retour);
while($donnees = mysqli_fetch_array($res))
{

	echo "<table align=\"center\"><tr align=\"center\"><td style=\"font-weight:bold; font-size:26px; color:orange; text-shadow:1px 1px 1px #000;\">".stripslashes($donnees['objet'])."</td></tr>";
	

echo"
<tr align=\"center\"><td>
<b>".$donnees['nom']." ".$donnees['prenom']."</b><br> 
<b>email : </b>".$donnees['mail']."<br><br><b>Pays : </b>".$donnees['pays']."<br> 
</td></tr>
<tr align=\"center\"><td><b>Message</b><br>
".$donnees['message']."<br><a href=\"liste_messages.php?supprimer_news=" .
$donnees['id'] . "\">Supprimer</a><hr style=\"color:orange;\"> 
</td></tr>
";
}
echo"</table>";

if (isset($_GET['supprimer_news'])) // Si l'on demande de supprimerune news.
{
// Alors on supprime la news correspondante.
// On protège la variable « id_news » pour éviter une faille SQL
$_GET['supprimer_news'] = addslashes($_GET['supprimer_news']);
mysql_query('DELETE FROM messages WHERE id=\'' .
$_GET['supprimer_news'] . '\'');
}

}	



?>
<?php include('partie3_admin.php'); ?>