<?php  if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } function renderLabelGenerator(int $orderId): string { $order=Database::fetchOne("SELECT id,order_ref,shipping_name,city,province,postal_code FROM orders WHERE id=:id",[":id"=>$orderId]); if(!$order) return ""; return "<div class=\"label-gen\"><h3>Generate Label: #".UI::e($order["order_ref"])."</h3><p>".UI::e($order["city"]??"-").", ".UI::e($order["province"]??"-")." ".UI::e($order["postal_code"]??"-")."</p><button class=\"btn btn-primary\" data-action=\"generateLabel\" data-id=\"{$orderId}\">Generate Canada Post Label</button></div>"; } 