.
<?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;Galerie Vid&eacute;os</h2>
<a href="ajouter_videos.php"><p class="bouton_design" style="display:inline-block; color:#fff;">Ajouter</p></a>
<br />


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

<?php
if (isset($_POST['ajouter_video']))
{$date = $_POST['date'];
$id_video = $_POST['id_news'];


$video = addslashes($_POST['video']);

$inserta = "INSERT INTO videosplus (id,video,id_video,date) VALUES(NULL,'" . $video . "',
'" . $id_video . "','" . $date. "')";
$res = $conn->query($inserta);




}




if (isset($_GET['supprimer_videos'])) // 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_videos'] = addslashes($_GET['supprimer_videos']);
$dele = 'DELETE FROM videos WHERE id=\'' .
$_GET['supprimer_videos'] . '\'';
$res = $conn->query($dele);

$dele1 = 'DELETE FROM videosplus WHERE id_videos=\'' .
$_GET['supprimer_videos'] . '\'';
$res = $conn->query($dele1);
}


if(isset($_POST['modifier_videos']))
{

$description = addslashes($_POST['description']);
$date = addslashes($_POST['date']);

	
$_POST['id_news'] = addslashes($_POST['id_news']);
// C'est une modification, on met juste à jour le titre etle contenu.
$upda = "UPDATE videos SET date='" . $date . "',description='" . $description. "' WHERE id='" . $_POST['id_news'] . "'";
$res = $conn->query($upda);}

if (isset($_POST['modifier_video']))
{

$video = $_POST['video'];

$upda1 = "UPDATE videos SET video='" . $video . "' WHERE  id='" . $_POST['id_news'] . "'";
$res = $conn->query($upda1);



}



if (isset($_POST['modifier_videosplus']))
{

$video = $_POST['video'];

$upda2 = "UPDATE videosplus SET video='" . $video . "' WHERE  id='" . $_POST['id_news'] . "'";
$res = $conn->query($upda2);



}


if(isset($_POST['ajouter_videos']))
{
	$description= addslashes($_POST['description']);
	$date = addslashes($_POST['date']);



	
	
$video = $_POST['video'];


$inserta1 = "INSERT INTO videos (id,description,video,date) VALUES(NULL,'" . $description . "',
'" . $video . "','" . $date. "')";
$res = $conn->query($inserta1);



}
 ?>

<table style="margin-top:100px;"><tr>
<th>Video</th>
<th>Description</th>
<th>Supprimer</th>
<th>Date</th>
</tr>
<?php
$retour = 'SELECT * FROM videos ORDER BY id DESC';
$res = $conn->query($retour);
while ($donnees = mysqli_fetch_array($res)) // On fait une boucle
{$video = stripslashes($donnees['video']);?>
<tr align="center">
<td><?php echo '<a style="text-decoration:none; color:green; font-weight:bold;" href="modifier_videos.php?modifier_video=' .
$donnees['id'] . '">'; ?>
<iframe width="100" height="100" src="<?php echo $video; ?>" frameborder="0" allowfullscreen></iframe>
<br />

<img src="img/modif.png" style="width:25px;" title="modifier la vidéo" /></a><br /></td>
<td><?php echo ($donnees['description']); ?></td>
<td><?php echo '<a style="text-decoration:none; color:green; font-weight:bold;" href="liste_videos.php?supprimer_videos=' .
$donnees['id'] . '">'; ?>Supprimer</a></td>
<td><?php echo ($donnees['date']); ?></td>

</tr>
<?php
} // Fin de la boucle clients liste les news.
?>
</table>

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