<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } RBAC::enforce('view.faq'); require_once __DIR__ . '/../modules/store/faq_data.php'; ?><?php if ($faqMsg === 'created'): ?> <div class="toast toast-create">+ FAQ added and encrypted.</div><?php elseif ($faqMsg === 'updated'): ?> <div class="toast toast-modify">FAQ updated and re-encrypted.</div><?php elseif ($faqMsg === 'deleted'): ?> <div class="toast toast-del">FAQ removed.</div><?php elseif ($faqMsg === 'toggled'): ?> <div class="toast toast-modify">FAQ visibility toggled.</div><?php elseif ($faqMsg === 'missing'): ?> <div class="toast toast-del">Question and answer are required.</div><?php endif; ?> <div class="faq-header"> <div class="faq-filters"> <a href="?view=faq&faq_filter=all" class="faq-filter<?= $faqFilter === 'all' ? ' active' : '' ?>">All <span class="faq-count"><?= count($faqs) ?></span></a> <a href="?view=faq&faq_filter=universal" class="faq-filter<?= $faqFilter === 'universal' ? ' active' : '' ?>">Universal</a><?php foreach ($faqStores as $s): ?> <a href="?view=faq&faq_filter=store_<?= $s['id'] ?>" class="faq-filter<?= $faqFilter === 'store_' . $s['id'] ? ' active' : '' ?>" style="border-left:3px solid<?= htmlspecialchars($s['color']) ?>"><?= htmlspecialchars($s['display']) ?></a><?php endforeach; ?> </div> <span class="faq-enc">ALL FIELDS ENCRYPTED</span> </div> <?php require_once __DIR__ . '/../modules/store/faq_form.php'; ?> <?php require_once __DIR__ . '/../modules/store/faq_list.php'; ?> <script nonce="<?= $cspNonce ?? '' ?>"> (function(){ document.querySelectorAll('[data-confirm]').forEach(function(f){ f.addEventListener('submit',function(e){if(!confirm(f.dataset.confirm))e.preventDefault();}); }); })(); </script>