diff --git a/cp/app/Controllers/ContactsController.php b/cp/app/Controllers/ContactsController.php index cea84ff..bcc5707 100644 --- a/cp/app/Controllers/ContactsController.php +++ b/cp/app/Controllers/ContactsController.php @@ -6,6 +6,7 @@ use App\Models\Contact; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Container\ContainerInterface; +use League\ISO3166\ISO3166; class ContactsController extends Controller { @@ -16,7 +17,15 @@ class ContactsController extends Controller public function create(Request $request, Response $response) { - return view($response,'admin/contacts/create.twig'); + $iso3166 = new ISO3166(); + $db = $this->container->get('db'); + $countries = $iso3166->all(); + $registrars = $db->select("SELECT id, clid, name FROM registrar"); + + // Default view for GET requests or if POST data is not set + return view($response,'admin/contacts/create.twig', [ + 'registrars' => $registrars, + 'countries' => $countries, + ]); } - } \ No newline at end of file diff --git a/cp/composer.json b/cp/composer.json index 8230cd5..cd1c6ad 100644 --- a/cp/composer.json +++ b/cp/composer.json @@ -14,24 +14,26 @@ "require": { "php": "^8.1", "ext-pdo": "*", - "slim/slim": "4.11.0", + "slim/slim": "4.12.0", "slim/twig-view": "^3.3.0", - "monolog/monolog": "^3.3.1", + "monolog/monolog": "^3.4.0", "respect/validation": "^2.2.4", "slim/csrf": "^1.3", "slim/flash": "^0.4", "vlucas/phpdotenv": "^5.5", - "php-di/php-di": "^7.0.2", - "nyholm/psr7": "^1.5", - "nyholm/psr7-server": "^1.0", + "php-di/php-di": "^7.0.5", + "nyholm/psr7": "^1.8", + "nyholm/psr7-server": "^1.0.2", "pinga/auth": "^0.1.1", - "phpmailer/phpmailer": "^6.7.1", - "filp/whoops": "^2.14.6", - "imefisto/psr-swoole-native": "^1.1", + "phpmailer/phpmailer": "^6.8.1", + "filp/whoops": "^2.15.3", + "imefisto/psr-swoole-native": "^1.1.2", "chubbyphp/chubbyphp-static-file": "^1.2", - "lasserafn/php-initial-avatar-generator": "^4.2", + "lasserafn/php-initial-avatar-generator": "^4.3", "mevdschee/php-crud-api": "^2.14", - "gettext/gettext": "^5.7" + "gettext/gettext": "^5.7", + "punic/punic": "^3.8", + "league/iso3166": "^4.3" }, "autoload": { "psr-4": { diff --git a/cp/resources/views/admin/contacts/create.twig b/cp/resources/views/admin/contacts/create.twig index a263fcd..502094b 100644 --- a/cp/resources/views/admin/contacts/create.twig +++ b/cp/resources/views/admin/contacts/create.twig @@ -17,257 +17,258 @@ {{ __('Contacts') }} - -
-
- - - New view - - - - - - Create new report - - - - - -
-
-
+
- -
-
General & Internationalized Info
- - -
- - -
- - -
-
+ +
+
General & Internationalized Info
+ + +
+ + + +
+ + {% if registrars %} +
+ + +
+ {% endif %} - -
- - -
- - -
-
+ +
+ + + +
- -
- - -
-
- - -
-
- - -
+ +
+ + +
+
+ + +
+
+ + +
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
- -
-
Contact Details
+ +
+
Contact Details
- -
- - -
- - -
-
+ +
+ + + +
- -
- - -
- - -
-
+ +
+ + + +
- -
- - -
- - -
-
- - -
- - - Auto-generated authentication information for the contact. -
+ +
+ + + +
+ + +
+ + + Auto-generated authentication information for the contact. +
- -
- - -
+ +
+ + +
- -
-
- - -
- -
- -
-
- - -
-
- - -
-
- - -
-
+ +
+
+ + +
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
-
+
- - +
- -
+ +
@@ -297,7 +298,7 @@ document.addEventListener("DOMContentLoaded", function() { localizedSection.style.display = "none"; } }); - + // Generate authInfo for Contact const authInfoInput = document.getElementById('authInfo'); authInfoInput.value = generateAuthInfo();