diff --git a/cp/app/Controllers/SystemController.php b/cp/app/Controllers/SystemController.php index 1f6a50f..de4d8e0 100644 --- a/cp/app/Controllers/SystemController.php +++ b/cp/app/Controllers/SystemController.php @@ -2,15 +2,31 @@ namespace App\Controllers; -use App\Models\Tickets; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Container\ContainerInterface; class SystemController extends Controller { - public function settings(Request $request, Response $response) + public function registry(Request $request, Response $response) { - return view($response,'admin/system/settings.twig'); - } + if ($_SESSION["auth_roles"] != 0) { + return $response->withHeader('Location', '/dashboard')->withStatus(302); + } + + $db = $this->container->get('db'); + $tlds = $db->select("SELECT id, tld, idn_table, secure FROM domain_tld"); + + foreach ($tlds as $key => $tld) { + // Count the domains for each TLD + $domainCount = $db->select("SELECT COUNT(name) FROM domain WHERE tldid = ?", [$tld['id']]); + + // Add the domain count to the TLD array + $tlds[$key]['domain_count'] = $domainCount[0]['COUNT(name)']; + } + + return view($response,'admin/system/registry.twig', [ + 'tlds' => $tlds, + ]); + } } \ No newline at end of file diff --git a/cp/resources/views/admin/system/registry.twig b/cp/resources/views/admin/system/registry.twig new file mode 100644 index 0000000..f6b547c --- /dev/null +++ b/cp/resources/views/admin/system/registry.twig @@ -0,0 +1,184 @@ +{% extends "layouts/app.twig" %} + +{% block title %}{{ __('Registry Configuration') }}{% endblock %} + +{% block content %} +