From 16b0c781c5f222b6f46c7cb39ccc4fe42b305f00 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Tue, 28 Jan 2025 11:00:05 +0700 Subject: [PATCH] add recent messages view --- app/Controllers/Pages.php | 8 +- app/Views/recent_messages.php | 40 ++++ app/Views/welcome_message.php | 331 ---------------------------------- 3 files changed, 47 insertions(+), 332 deletions(-) create mode 100644 app/Views/recent_messages.php delete mode 100644 app/Views/welcome_message.php diff --git a/app/Controllers/Pages.php b/app/Controllers/Pages.php index 4e09683..eb71cbb 100644 --- a/app/Controllers/Pages.php +++ b/app/Controllers/Pages.php @@ -5,7 +5,13 @@ namespace App\Controllers; class Pages extends BaseController { public function home() { - echo "this site is made for Technidata integration with Transmedic"; + $db = \Config\Database::connect(); + $sql = "select top 10 * from cmod.dbo.CM_TM_LOGS order by LOGDATE desc"; + $query = $db->query($sql); + $results = $query->getResultArray(); + $data['messages'] = $results; + + return view('recent_messages', $data); } } diff --git a/app/Views/recent_messages.php b/app/Views/recent_messages.php new file mode 100644 index 0000000..e2cff5b --- /dev/null +++ b/app/Views/recent_messages.php @@ -0,0 +1,40 @@ + + +
+ + + +".htmlspecialchars($prettyjson).""; + } + } + } + ?> + + \ No newline at end of file diff --git a/app/Views/welcome_message.php b/app/Views/welcome_message.php deleted file mode 100644 index c18eca3..0000000 --- a/app/Views/welcome_message.php +++ /dev/null @@ -1,331 +0,0 @@ - - - - -
The page you are looking at is being generated dynamically by CodeIgniter.
- -If you would like to edit this page you will find it located at:
- -app/Views/welcome_message.php
-
- The corresponding controller for this page can be found at:
- -app/Controllers/Home.php
-
-The User Guide contains an introduction, tutorial, a number of "how to" - guides, and then reference documentation for the components that make up - the framework. Check the User Guide !
- -CodeIgniter is a community-developed open source project, with several - venues for the community members to gather and exchange ideas. View all - the threads on CodeIgniter's forum, or chat on Slack !
- -CodeIgniter is a community driven project and accepts contributions - of code and documentation from the community. Why not - - join us ?
- -