} else { foreach ($_POST['delete_photos'] as $photo) { $unlink = unlink('.' . $photo); $unlink2 = unlink('../view/data/photos/mini/' . substr($photo, 26)); } header('Location:../espace_membre.php?upload=x&update=x&delete=true&news=0&photos=0&videos=0,coms=x&error=0'); } } else { if ($type == 'video') { if (empty($_POST['delete_videos'])) { header('Location:../espace_membre.php?upload=x&update=x&delete=x&news=0&photos=0&videos=0,coms=x&error=videos.delete.1'); } else { include 'requetes_videos.php'; $compteur_videos = 0; foreach ($_POST['delete_videos'] as $id) { $req_id_video = req_id_video($id); $req_id_video = $req_id_video->fetch(); $chemin = $req_id_video['chemin']; unlink('../' . $chemin); $req_delete_video = req_delete_video($id); $tab_result_videos[$compteur_videos] = $req_delete_video; $compteur_videos++; } if (!in_array('false', $tab_result_videos)) { /* true */ header('Location:../espace_membre.php?upload=x&update=x&delete=true&news=0&photos=0&videos=0,coms=x&error=0'); } else { /* false */ header('Location:../espace_membre.php?upload=x&update=x&delete=false&news=0&photos=0&videos=0,coms=x&error=0'); } }
include 'view/includes/header.php'; ?> <div class="column-group gutters"> <?php include 'model/requetes_videos.php'; $videos = req_videos(); $total_videos = $videos->rowCount(); if (empty($_GET['video'])) { $id_video = req_last_video(); } else { $id_video = $_GET['video']; } $last_videos = req_id_video($id_video); $last_videos = $last_videos->fetch(); ?> <div class="xlarge-70 large-70 medium-100 small-100 tiny-100"> <div> <div class="push-left"><h1><?php echo $last_videos['titre']; ?> </h1></div> <div class="push-right"><h1><small><?php echo $last_videos['date']; ?> </small></h1></div> </div>
<button type="submit" class="ink-button" style="width : 100%; margin-left : 0px; margin-top : 25px"> Modifier </button> </div> </form> <form class="ink-form" enctype="multipart/form-data" action="model/update.php?type=video" method="post"> <div class="control-group" style="<?php if ($_GET['videos'] == "0") { echo 'display : none'; } ?> "> <?php $id_video = $_GET['videos']; $update_video = req_id_video($id_video); $update_video = $update_video->fetch(); ?> <label>Titre</label> <div class="control"> <input type="text" name="titre_video" value="<?php echo $update_video['titre']; ?> " /> </div> <label>Date</label> <div class="control"> <input type="text" name="date_video" id="datepicker" value="<?php echo $update_video['date']; ?>