prepare('DELETE FROM archive_records WHERE id = :id LIMIT 1'); $stmt->bindValue(':id', $id, PDO::PARAM_INT); $stmt->execute(); if (!empty($record['attachment_path']) && is_file(__DIR__ . '/' . $record['attachment_path'])) { @unlink(__DIR__ . '/' . $record['attachment_path']); } flash('success', 'Arsip berhasil dihapus.'); header('Location: index.php');