<script type="application/ld+json">{ "@context": "https://schema.org", "@type": "WebSite", "name": "Bluetika.nz", "url": "https://bluetika.nz", "potentialAction": { "@type": "SearchAction", "target": "https://bluetika.nz/search?q={search_term_string}", "query-input": "required name=search_term_string" } }</script>
<main class="max-w-2xl mx-auto py-12 px-4"> <h1 class="text-3xl font-bold mb-2">Check Report Status</h1> <p class="text-gray-600 mb-8">Enter your report ID to check the status of your report. Your report ID was provided when you submitted your report.</p> <div class="bg-white rounded-xl border p-6"> <div class="space-y-4"> <div> <label class="block text-sm font-medium text-gray-700 mb-2">Report ID</label> <input type="text" id="report-id" placeholder="e.g., abc123-def456-ghi789" class="w-full border rounded-lg px-4 py-2"> <p class="text-xs text-gray-500 mt-1">Your report ID looks like: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</p> </div> <button onclick="checkStatus()" id="check-btn" class="w-full py-3 px-4 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 transition-colors"> Check Status </button> </div> </div> <div id="result" class="mt-6 hidden"></div> <div class="mt-8 bg-blue-50 border border-blue-200 rounded-lg p-4"> <h3 class="font-semibold text-blue-900 mb-2">📋 How to Find Your Report ID</h3> <p class="text-sm text-blue-700">When you submit a report, you'll receive a confirmation with your unique report ID. If you submitted a report while logged in, you can also find your report ID in:</p> <ul class="text-sm text-blue-700 mt-2 space-y-1 ml-4 list-disc"> <li>Your email confirmation (if you provided an email)</li> <li>Your dashboard → Reports section</li> <li>The confirmation message shown after submission</li> </ul> </div> </main> <script src="/js/main.js" defer></script> <script> async function checkStatus() { const reportId = document.getElementById('report-id').value.trim() if (!reportId) { alert('Please enter a report ID') return } const btn = document.getElementById('check-btn') btn.disabled = true btn.textContent = 'Checking...' const result = document.getElementById('result') result.classList.remove('hidden') result.innerHTML = '<div class="text-center py-8"><div class="text-2xl mb-2">⏳</div><p class="text-gray-600">Checking report status...</p></div>' try { const res = await fetch('/api/reports/status?id=' + encodeURIComponent(reportId)) const data = await res.json() if (data.ok) { const d = data.data const statusColors = { pending: { bg: 'bg-yellow-50', border: 'border-yellow-200', text: 'text-yellow-800', label: '⏳ Pending Review' }, investigating: { bg: 'bg-blue-50', border: 'border-blue-200', text: 'text-blue-800', label: '🔍 Under Investigation' }, resolved: { bg: 'bg-green-50', border: 'border-green-200', text: 'text-green-800', label: '✅ Resolved' }, dismissed: { bg: 'bg-gray-50', border: 'border-gray-200', text: 'text-gray-800', label: '❌ Dismissed' }, } const s = statusColors[d.status] || statusColors.pending result.innerHTML = '<div class="' + s.bg + ' border ' + s.border + ' rounded-xl p-6">' + '<div class="flex items-center justify-between mb-4">' + '<h2 class="text-xl font-bold ' + s.text + '">' + s.label + '</h2>' + '<span class="text-xs text-gray-500 font-mono">' + d.id + '</span>' + '</div>' + '<div class="grid grid-cols-2 gap-4 text-sm">' + '<div><span class="text-gray-500">Report Type:</span> <span class="font-medium capitalize">' + d.reportType.replace('_', ' ') + '</span></div>' + '<div><span class="text-gray-500">Reported:</span> ' + (d.reportedName || 'Unknown') + '</div>' + '<div><span class="text-gray-500">Submitted:</span> ' + new Date(d.submittedAt).toLocaleDateString('en-NZ', { year: 'numeric', month: 'long', day: 'numeric' }) + '</div>' + '<div><span class="text-gray-500">Last Updated:</span> ' + new Date(d.updatedAt).toLocaleDateString('en-NZ', { year: 'numeric', month: 'long', day: 'numeric' }) + '</div>' + '</div>' + (d.adminNotes ? '<div class="mt-4 p-3 bg-white border rounded-lg text-sm">' + '<span class="font-medium">Admin Notes:</span> ' + d.adminNotes + '</div>' : '') + '</div>' } else { result.innerHTML = '<div class="bg-red-50 border border-red-200 rounded-xl p-6">' + '<h2 class="text-lg font-bold text-red-800 mb-2">Report Not Found</h2>' + '<p class="text-sm text-red-700">' + (data.error?.message || 'No report found with that ID. Please check the ID and try again.') + '</p>' + '</div>' } } catch (err) { result.innerHTML = '<div class="bg-red-50 border border-red-200 rounded-xl p-6">' + '<h2 class="text-lg font-bold text-red-800 mb-2">Error</h2>' + '<p class="text-sm text-red-700">Failed to check report status. Please try again later.</p>' + '</div>' } finally { btn.disabled = false btn.textContent = 'Check Status' } } </script>