prepare('SELECT sf.title, CONCAT(sf.file_name) as fname, GROUP_CONCAT(f.path) as fpaths FROM source_file sf LEFT JOIN files f ON sf.id = f.source_file_id WHERE sf.id = ? GROUP BY sf.id'); $st->execute([$id]); $row = $st->fetch(); if ($row) { if ($row['fpaths']) { foreach (explode(',', $row['fpaths']) as $path) { if (file_exists($path)) unlink($path); } } db()->prepare('DELETE FROM source_file WHERE id = ?')->execute([$id]); flash('success', "Entrée « " . htmlspecialchars($row['title']) . " » supprimée."); } header('Location: /'); exit; } $rows = db()->query( 'SELECT sf.id, sf.title, sf.sender, sf.date_processing, a.username, GROUP_CONCAT(f.id, ":", f.file_name, ":", f.path ORDER BY f.id SEPARATOR "|") as files FROM source_file sf LEFT JOIN accounts a ON sf.account_id = a.id LEFT JOIN files f ON sf.id = f.source_file_id GROUP BY sf.id ORDER BY sf.date_processing DESC' )->fetchAll(); html_head('Courriers'); html_navbar('mail'); ?>
Courriers traités
entrée(s)
Aucun courrier traité pour l'instant.
Date Compte Sujet Expéditeur Pièces jointes Action
— Aucune pièce jointe