Autosave: 20260408-230208
This commit is contained in:
parent
2145a0438c
commit
0c4d8aefa9
@ -282,23 +282,6 @@ $webhooks = $stmt_webhooks->fetchAll();
|
||||
|
||||
$stmt_banners = $db->query('SELECT * FROM tbl_scbanners ORDER BY cl_scbanner_name ASC');
|
||||
$banners = $stmt_banners->fetchAll();
|
||||
|
||||
$stmt_recent = $db->query(
|
||||
'SELECT n.cl_scnotification_id,
|
||||
n.cl_scnotification_title,
|
||||
n.cl_scnotification_success,
|
||||
n.cl_scnotification_created_at,
|
||||
n.cl_scnotification_created_by,
|
||||
w.cl_scwebhook_name,
|
||||
b.cl_scbanner_name
|
||||
FROM tbl_scnotifications n
|
||||
JOIN tbl_scwebhooks w ON w.cl_scwebhook_id = n.cl_scnotification_webhook_id
|
||||
LEFT JOIN tbl_scbanners b ON b.cl_scbanner_id = n.cl_scnotification_banner_id
|
||||
ORDER BY n.cl_scnotification_id DESC
|
||||
LIMIT 8'
|
||||
);
|
||||
$recent_notifications = $stmt_recent->fetchAll();
|
||||
|
||||
function scnotification_old_value(array $old, string $key, string $default = ''): string
|
||||
{
|
||||
$value = $old[$key] ?? $default;
|
||||
@ -893,34 +876,6 @@ function scnotification_old_checked(array $old, string $key, bool $default = fal
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<section class="history-card">
|
||||
<h2>Historique récent</h2>
|
||||
<?php if (empty($recent_notifications)): ?>
|
||||
<div class="empty-state">Aucune notification n’a encore été envoyée.</div>
|
||||
<?php else: ?>
|
||||
<div class="history-list">
|
||||
<?php foreach ($recent_notifications as $item): ?>
|
||||
<div class="history-item">
|
||||
<div>
|
||||
<strong><?php echo htmlspecialchars($item['cl_scnotification_title'] !== '' ? $item['cl_scnotification_title'] : 'Notification sans titre', ENT_QUOTES, 'UTF-8'); ?></strong>
|
||||
<span class="status-pill <?php echo ((int) $item['cl_scnotification_success'] === 1) ? 'ok' : 'ko'; ?>">
|
||||
<?php echo ((int) $item['cl_scnotification_success'] === 1) ? 'Envoyée' : 'Erreur'; ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="history-meta">
|
||||
Webhook : <strong><?php echo htmlspecialchars($item['cl_scwebhook_name'], ENT_QUOTES, 'UTF-8'); ?></strong>
|
||||
<?php if (!empty($item['cl_scbanner_name'])): ?>
|
||||
| Bannière : <strong><?php echo htmlspecialchars($item['cl_scbanner_name'], ENT_QUOTES, 'UTF-8'); ?></strong>
|
||||
<?php endif; ?>
|
||||
| Par : <strong><?php echo htmlspecialchars($item['cl_scnotification_created_by'], ENT_QUOTES, 'UTF-8'); ?></strong>
|
||||
| Le : <strong><?php echo htmlspecialchars($item['cl_scnotification_created_at'], ENT_QUOTES, 'UTF-8'); ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user