diff --git a/cp/app/Controllers/FinancialsController.php b/cp/app/Controllers/FinancialsController.php index b81db2c..d830daa 100644 --- a/cp/app/Controllers/FinancialsController.php +++ b/cp/app/Controllers/FinancialsController.php @@ -12,19 +12,24 @@ class FinancialsController extends Controller { return view($response,'admin/financials/transactions.twig'); } - + public function overview(Request $request, Response $response) { return view($response,'admin/financials/overview.twig'); } - + public function pricing(Request $request, Response $response) { return view($response,'admin/financials/pricing.twig'); } - + public function deposit(Request $request, Response $response) { - return view($response,'admin/financials/deposit.twig'); + $db = $this->container->get('db'); + $registrars = $db->select("SELECT id, clid, name FROM registrar"); + + return view($response,'admin/financials/deposit.twig', [ + 'registrars' => $registrars + ]); } } \ No newline at end of file diff --git a/cp/resources/views/admin/financials/deposit.twig b/cp/resources/views/admin/financials/deposit.twig index cfa74d8..4dcd629 100644 --- a/cp/resources/views/admin/financials/deposit.twig +++ b/cp/resources/views/admin/financials/deposit.twig @@ -1,6 +1,6 @@ {% extends "layouts/app.twig" %} -{% block title %}{{ __('Price Management') }}{% endblock %} +{% block title %}{{ __('Registrar Deposit') }}{% endblock %} {% block content %}
@@ -14,28 +14,9 @@ Overview

- {{ __('Price Management') }} + {{ __('Registrar Deposit') }}

- -
-
- - - New view - - - - - - Create new report - - - - - -
-
@@ -44,88 +25,82 @@
-
-

Registrar Deposit

+
+
+
+ + +
-
-
- - -
- - +
+
Current Funds for
+

$0.00

+
+ +
+ + +
+ +
+ + +
- - -
-
Current Funds for
-

$0.00

+ + + + + // Mock API call to add deposit + fetch("https://api.example.com/addDeposit", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify({ registrarId: registrarSelect.value, amount: amount }) + }) + .then(response => response.json()) + .then(data => { + // Update the displayed funds after deposit + document.getElementById('currentFunds').textContent = data.newFunds.toFixed(2); + }) + .catch(error => { + console.error('There was an error with the request:', error); + }); + }); +
diff --git a/cp/resources/views/admin/registrars/index.twig b/cp/resources/views/admin/registrars/index.twig index 7ac37c7..95588da 100644 --- a/cp/resources/views/admin/registrars/index.twig +++ b/cp/resources/views/admin/registrars/index.twig @@ -28,7 +28,7 @@ - Create new report + Create new registrar @@ -59,9 +59,9 @@
-
-
-
+
+
+