Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.volley92.asso.fr
/
htdocs
/
admin174
/
connected
/
pages
/
/srv/data/web/vhosts/www.volley92.asso.fr/htdocs/admin174/connected/pages/opinion.php
<?php include('functions/avis.php'); ?> <h1>Livre d'Or</h1> <?= $confirmMessage ?> <table class="table table-striped"> <thead> <tr> <th class="col-xs-1">#</th> <th class="col-xs-2">Surnom</th> <th class="col-xs-1">Note</th> <th class="col-xs-6">Commentaire</th> <th class="col-xs-1">Date</th> <th class="col-xs-1">Action</th> </tr> </thead> <tbody> <?php $result = $db_client->prepare('SELECT * FROM avis ORDER BY id DESC'); $result->setFetchMode(PDO::FETCH_OBJ); $result->execute(); $commentaires = $result->fetchAll(); foreach($commentaires as $commentaire) { $note = ''; for($i = 0; $i < $commentaire->note; $i++) { $note .= '<span class="fa fa-star"></span>'; } echo '<tr>'; echo '<td>'.$commentaire->id.'</td>'; echo '<td>'.$commentaire->pseudonyme.'</td>'; echo '<td>'.$note.'</td>'; echo '<td>'.$commentaire->commentaire.'</td>'; echo '<td>'.date('d/m/Y',strtotime($commentaire->date)).'</td>'; echo '<td>'; if($commentaire->valide == 0) { echo '<a href="avis-active-'.$commentaire->id.'" class="btn btn-success" title="Valider ce commentaire"><span class="fa fa-check"></span></a> '; } else { echo '<a href="avis-pause-'.$commentaire->id.'" class="btn btn-warning" title="Retirer ce commentaire"><span class="fa fa-pause"></span></a> '; } echo '<a href="#" class="btn btn-danger modalConfirm" data-id="'.$commentaire->id.'" data-author="'.$commentaire->pseudonyme.'" data-date="'.date('d/m/Y',strtotime($commentaire->date)).'" data-action="delete" title="Supprimer ce commentaire" ><span class="fa fa-times"></span></a>'; echo '</td>'; echo '</tr>'; } ?> </tbody> </table> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4 class="modal-title" id="myModalLabel">Suppression d'un commentaire</h4> </div> <div class="modal-body"> <p class="alert alert-danger"><b>Attention !</b> Vous vous apprêtez à supprimer un commentaire.</p> <p>Êtes-vous sûr de vouloir supprimer le commentaire de <b id="comAuthor"></b> du <b id="comDate"></b> ?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button> <a href="" id="comId" class="btn btn-danger">Supprimer</a> </div> </div> </div> </div> <script> $(document).ready(function(){ $(".modalConfirm").click(function(){ $("#comAuthor").html($(this).data('author')); $("#comDate").html($(this).data('date')); $("#comId").attr('href', 'avis' + '-' + $(this).data('action') + '-' + $(this).data('id')); $('#myModal').modal('show'); }); }); </script>