From 361ccb3a7e08f09b6eac2c131178ba7ea334a1ea Mon Sep 17 00:00:00 2001
From: Pinga <121483313+getpinga@users.noreply.github.com>
Date: Tue, 29 Aug 2023 11:08:35 +0300
Subject: [PATCH] Added logs page to the panel
---
cp/app/Controllers/LogsController.php | 18 ++++
cp/app/Models/RegistryTransaction.php | 25 ++++++
cp/phpunit.xml | 16 ----
cp/resources/views/admin/logs/index.twig | 109 +++++++++++++++++++++++
cp/resources/views/layouts/app.twig | 9 ++
cp/routes/web.php | 2 +
cp/tests/unit/SampleTest.php | 9 --
cp/tests/unit/UserTest.php | 17 ----
8 files changed, 163 insertions(+), 42 deletions(-)
create mode 100644 cp/app/Controllers/LogsController.php
create mode 100644 cp/app/Models/RegistryTransaction.php
delete mode 100644 cp/phpunit.xml
create mode 100644 cp/resources/views/admin/logs/index.twig
delete mode 100644 cp/tests/unit/SampleTest.php
delete mode 100644 cp/tests/unit/UserTest.php
diff --git a/cp/app/Controllers/LogsController.php b/cp/app/Controllers/LogsController.php
new file mode 100644
index 0000000..45e43a1
--- /dev/null
+++ b/cp/app/Controllers/LogsController.php
@@ -0,0 +1,18 @@
+container->get('db'));
+ $logs = $logModel->getAllRegistryTransaction();
+ return view($response,'admin/logs/index.twig', compact('logs'));
+ }
+}
\ No newline at end of file
diff --git a/cp/app/Models/RegistryTransaction.php b/cp/app/Models/RegistryTransaction.php
new file mode 100644
index 0000000..5a58c0a
--- /dev/null
+++ b/cp/app/Models/RegistryTransaction.php
@@ -0,0 +1,25 @@
+db = $db;
+ }
+
+ public function getAllRegistryTransaction()
+ {
+ return $this->db->select('SELECT * FROM registryTransaction.transaction_identifier ORDER BY cldate DESC');
+ }
+
+ public function getRegistryTransactionById($id)
+ {
+ return $this->db->select('SELECT * FROM registryTransaction.transaction_identifier WHERE id = ?', [$id])->fetch();
+ }
+}
\ No newline at end of file
diff --git a/cp/phpunit.xml b/cp/phpunit.xml
deleted file mode 100644
index c2a680a..0000000
--- a/cp/phpunit.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
+ | + | + | + | + | + | + | + | Actions | +
---|---|---|---|---|---|---|---|---|
{{ log.cldate }} | +{{ log.registrar_id }} | +{{ log.cmd }} | +{{ log.obj_id }} | +{{ log.code }} | +{{ log.msg }} | +{{ log.clmicrosecond }} | +{{ log.clTRID }} | ++ + + + + | +