* @license https://files.froxlor.org/misc/COPYING.txt GPLv2 */ const AREA = 'admin'; require __DIR__ . '/lib/init.php'; use Froxlor\Traffic\Traffic; use Froxlor\UI\Panel\UI; use Froxlor\UI\Request; use Froxlor\UI\Response; $range = Request::any('range', 'currentmonth'); if ($page == 'overview' || $page == 'customers') { try { $context = Traffic::getCustomerStats($userinfo, $range); } catch (Exception $e) { if ($e->getCode() === 405) { Response::dynamicError(lng('traffic.nocustomers')); } Response::dynamicError($e->getMessage()); } // pass metrics to the view UI::view('user/traffic.html.twig', $context); }