0) { flash("$submitted change".($submitted>1?'s':'')." submitted for admin review.", 'success'); } else { flash('No changes detected.', 'info'); } go("/business.php?slug=$slug"); } if ($act === 'review' && authed()) { $rating = max(1, min(5, (int)p('rating', 5))); $title = ps('rtitle'); $body = ps('rbody'); $ex = qval("SELECT id FROM reviews WHERE business_id=? AND user_id=?", [$b['id'], uid()]); if ($ex) { qrun("UPDATE reviews SET rating=?,title=?,body=?,created_at=datetime('now') WHERE id=?", [$rating, $title, $body, $ex]); } else { qrun("INSERT INTO reviews(business_id,user_id,rating,title,body)VALUES(?,?,?,?,?)", [$b['id'], uid(), $rating, $title, $body]); } flash('Review saved!', 'success'); go("/business.php?slug=$slug"); } if ($act === 'post_alert' && owns($b['id'])) { $t = ps('atitle'); $body = ps('abody'); $type = p('atype', 'info'); if ($t && $body) { qrun("INSERT INTO alerts(business_id,type,title,body)VALUES(?,?,?,?)", [$b['id'], $type, $t, $body]); flash('Alert posted!', 'success'); } go("/business.php?slug=$slug"); } if ($act === 'del_alert' && owns($b['id'])) { qrun("DELETE FROM alerts WHERE id=? AND business_id=?", [(int)p('aid'), $b['id']]); go("/business.php?slug=$slug"); } if ($act === 'del_review' && isAdmin()) { qrun("DELETE FROM reviews WHERE id=?", [(int)p('rid')]); flash('Review deleted.', 'success'); go("/business.php?slug=$slug"); } if ($act === 'report' && authed()) { $rtype = p('rtype', 'correction'); $rmsg = ps('rmsg'); if ($rmsg) { qrun("INSERT INTO reports(business_id,user_id,type,message)VALUES(?,?,?,?)", [$b['id'], uid(), $rtype, $rmsg]); flash('Report submitted. Thank you!', 'success'); } go("/business.php?slug=$slug"); } } /* ── Page data ─────────────────────────────────────────── */ $pageTitle = e($b['name']).' β€” Keyser, WV'; $activeNav = 'dir'; $reviews = qall(" SELECT r.*, u.username FROM reviews r JOIN users u ON u.id = r.user_id WHERE r.business_id = ? AND r.is_approved = 1 ORDER BY r.created_at DESC ", [$b['id']]); $sects = qall("SELECT * FROM menu_sections WHERE business_id=? ORDER BY sort_order", [$b['id']]); $mitems = []; foreach ($sects as $s) { $mitems[$s['id']] = qall( "SELECT * FROM menu_items WHERE section_id=? AND is_available=1 ORDER BY sort_order", [$s['id']] ); } $alerts = qall("SELECT * FROM alerts WHERE business_id=? AND is_active=1 ORDER BY created_at DESC", [$b['id']]); $myrev = authed() ? qone("SELECT * FROM reviews WHERE business_id=? AND user_id=?", [$b['id'], uid()]) : null; $hours = parseHours($b['hours']); $isOwner = owns($b['id']); $isNonAdminOwner = $isOwner && !isAdmin(); $cat = (string)($b['cat'] ?? 'Uncategorized'); $catIcon = (string)($b['cat_icon'] ?? '🏒'); $days = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']; // Pending edit requests for this business (shown to owner) $pendingEdits = ($isOwner && !isAdmin()) ? qall("SELECT * FROM business_edit_requests WHERE business_id=? AND user_id=? AND status='pending' ORDER BY created_at DESC", [$b['id'], uid()]) : []; $pendingByField = []; foreach ($pendingEdits as $pe) $pendingByField[$pe['field']] = $pe; include __DIR__.'/includes/header.php'; ?>

( review) β˜… FEATURED
πŸ“’ BUSINESS UPDATES
πŸ“’ POST BUSINESS ALERT
✏️ SUGGEST LISTING CHANGES β€” Changes require admin approval before going live
⏳ Pending review: ''.e(ucfirst($pe['field'])).'', $pendingEdits)) ?> β€” an admin will review these changes shortly.
Currently pending: "80?'…':'' ?>"
Leave blank to omit a day from the hours display.
Setting to Inactive will hide this listing from the public directory until an admin approves and it goes live.
ABOUT

🍽️ MENU
✏️ Manage Menu
+ Add Menu

⭐ REVIEWS ()

Login to Write a Review

No reviews yet β€” be the first!


🚩 REPORT A LISTING ISSUE

🚩 Log in to report a listing issue.

BUSINESS INFO
πŸ“
πŸ“ž
βœ‰οΈ
🌐 β†—
🏷️
πŸ• HOURS OF OPERATION
$time): ?>
πŸ“ LOCATION

Open in Google Maps β†—
βš™οΈ OWNER CONTROLS
🍽️ Manage Menu ✏️ Edit Listing (Admin) πŸ“‹ Review Owner Edits
⏳ change1?'s':''?> awaiting admin review