<?php  if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } RBAC::enforce('view.listings'); $listings=Database::fetchAll("SELECT id, sku, slug, price, sale_price, status_code, visibility_code, display_order, created_at FROM products WHERE status_code != 6099 ORDER BY display_order"); $rows=[]; foreach($listings as $l){ $price = safeDecryptPrice($l['price']); $salePrice = $l['sale_price'] ? safeDecryptPrice($l['sale_price']) : '—'; $rows[]=[(int)$l['id'], UI::e($l['sku']??''), UI::e($l['slug']), '$'.number_format((float)$price,2), ($salePrice==='—'?'—':'$'.number_format((float)$salePrice,2)), StatusCode::render((int)$l['status_code']), StatusCode::render((int)$l['visibility_code']), (int)$l['display_order'], UI::e($l['created_at']), "<a class='btn btn-sm' href='javascript:void(0)' data-action='edit-listing' data-id='{$l['id']}'><span>Edit</span></a>"]; } UI::table(['ID','SKU','Slug','Price','Sale','Status','Visibility','Order','Created','Actions'],$rows); 