From 2855b2f8f0e24ab7766cf3632d203e3f16edc391 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Tue, 12 Nov 2024 15:33:56 +0700 Subject: [PATCH] backup dashboard html, add modal, add tubes table --- app/Config/Routes.php | 3 +- app/Controllers/Dashboard.php | 40 +++ app/Controllers/Home.php | 10 - app/Views/dashboard.html | 251 ++++++++++++++++++ app/Views/dashboard.php | 209 +++++---------- ...board_modals.php => dashboard_modals.html} | 0 ...shboard_table.php => dashboard_table.html} | 0 app/Views/dashboard_viewAccess.php | 71 +++++ app/Views/layouts/sidebar.html | 69 +++++ app/Views/layouts/topbar.html | 23 ++ app/Views/layouts/topbar.php | 4 +- cmod-td.sql | 18 +- 12 files changed, 534 insertions(+), 164 deletions(-) create mode 100644 app/Controllers/Dashboard.php delete mode 100644 app/Controllers/Home.php create mode 100644 app/Views/dashboard.html rename app/Views/{dashboard_modals.php => dashboard_modals.html} (100%) rename app/Views/{dashboard_table.php => dashboard_table.html} (100%) create mode 100644 app/Views/dashboard_viewAccess.php create mode 100644 app/Views/layouts/sidebar.html create mode 100644 app/Views/layouts/topbar.html diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 15abe2d..ed5a78a 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -5,7 +5,8 @@ use CodeIgniter\Router\RouteCollection; /** * @var RouteCollection $routes */ -$routes->get('/', 'Home::index'); +$routes->get('/', 'Dashboard::index'); +$routes->get('/dashboard/viewAccess/(:any)', 'Dashboard::viewAccess/$1'); // Auth $routes->get('/auth/logout', 'Auth::logout'); $routes->get('/auth/loginTD', 'Auth::loginTD'); diff --git a/app/Controllers/Dashboard.php b/app/Controllers/Dashboard.php new file mode 100644 index 0000000..8dac413 --- /dev/null +++ b/app/Controllers/Dashboard.php @@ -0,0 +1,40 @@ + 'Q' + ) as T + for xml path('')),1,1,'') + from SP_REQUESTS sr + left join PATIENTS p on p.PATID=sr.PATID + where sr.COLLECTIONDATE between '2024-10-02 00:00' and '2024-10-03 23:59'"; + $query = $db->query($sql); + $results = $query->getResultArray(); + $data['data'] = $results; + + return view('dashboard', $data); + } + + public function viewAccess($accessnumber): string { + $db = \Config\Database::connect(); + $sql = "select p.PATNUMBER, p.NAME, sr.HOSTORDERNUMBER, tu.SAMPLETYPE, ds.SHORTTEXT, tu.TUBESTATUS, ct.COLLSTATUS from SP_TUBES tu + left join SP_REQUESTS sr on tu.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER + left join PATIENTS p on p.PATID=sr.PATID + left join DICT_SAMPLES_TYPES ds on ds.SAMPCODE= tu.SAMPLETYPE + left join cmod.dbo.CM_TUBES ct on ct.SAMPLETYPE=tu.SAMPLETYPE + where tu.SP_ACCESSNUMBER='$accessnumber'"; + $query = $db->query($sql); + $results = $query->getResultArray(); + $data['data'] = $results; + $data['accessnumber'] = $accessnumber; + return view('dashboard_viewAccess', $data); + } +} diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php deleted file mode 100644 index c30f9c1..0000000 --- a/app/Controllers/Home.php +++ /dev/null @@ -1,10 +0,0 @@ -extend('layouts/main.php') ?> + +section('content') ?> + + +
+
+
+
+
+
+
+
+

345

+
+
+
+

Pending

+
+
+
+
+
+
+
+
+
+

333

+
+
+
+

Part. Collect

+
+
+
+
+
+
+
+
+
+

542

+
+
+
+

Collected

+
+
+
+
+
+
+
+
+
+

436

+
+
+
+

Part. Rcv.

+
+
+
+
+
+
+
+
+
+

567

+
+
+
+

Received

+
+
+
+
+
+
+
+
+
+

321

+
+
+
+

Inprocess

+
+
+
+
+
+
+
+
+
+

432

+
+
+
+

Part. Val.

+
+
+
+
+
+
+
+
+
+

321

+
+
+
+

Validated

+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OrderMRPatientRequestHospLocDocTestStatus
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Pending
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Partial Collect
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Full Collect
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Partial Receive
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Full Receive
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Inprocess
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Partial Validation
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Complete Validation
+
+
+
+ +endSection() ?> + +section('script') ?> + +endSection() ?> \ No newline at end of file diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php index d278492..e71f42b 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -2,19 +2,16 @@ section('content') ?> +
- +
@@ -131,121 +101,62 @@ tr { cursor: pointer; } - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
OrderPatient Request HospLocDoc Test Status
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)
Pending
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Partial Collect
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Full Collect
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Partial Receive
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Full Receive
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Inprocess
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Partial Validation
2024-10-12 23:37AJI909SZakiya Miksha12322331122211212121R09312Complete Blood Count (CBC): Hemoglobin (Hb), Hematocrit (Hct), Red Blood Cells (RBC), White Blood Cells (WBC), Platelet Count, Mean Corpuscular Volume (MCV), Mean Corpuscular Hemoglobin (MCH), Mean Corpuscular Hemoglobin Concentration (MCHC)Complete Validation
- + + + endSection() ?> section('script') ?> endSection() ?> \ No newline at end of file diff --git a/app/Views/dashboard_modals.php b/app/Views/dashboard_modals.html similarity index 100% rename from app/Views/dashboard_modals.php rename to app/Views/dashboard_modals.html diff --git a/app/Views/dashboard_table.php b/app/Views/dashboard_table.html similarity index 100% rename from app/Views/dashboard_table.php rename to app/Views/dashboard_table.html diff --git a/app/Views/dashboard_viewAccess.php b/app/Views/dashboard_viewAccess.php new file mode 100644 index 0000000..504af3a --- /dev/null +++ b/app/Views/dashboard_viewAccess.php @@ -0,0 +1,71 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/Views/layouts/sidebar.html b/app/Views/layouts/sidebar.html new file mode 100644 index 0000000..01d0c70 --- /dev/null +++ b/app/Views/layouts/sidebar.html @@ -0,0 +1,69 @@ +
+ +
\ No newline at end of file diff --git a/app/Views/layouts/topbar.html b/app/Views/layouts/topbar.html new file mode 100644 index 0000000..c0287e9 --- /dev/null +++ b/app/Views/layouts/topbar.html @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/app/Views/layouts/topbar.php b/app/Views/layouts/topbar.php index c0287e9..dd776ff 100644 --- a/app/Views/layouts/topbar.php +++ b/app/Views/layouts/topbar.php @@ -12,8 +12,8 @@ diff --git a/cmod-td.sql b/cmod-td.sql index 765a68d..315887f 100644 --- a/cmod-td.sql +++ b/cmod-td.sql @@ -96,7 +96,21 @@ CREATE TABLE [dbo].[CM_USERS]( )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO -USE [master] +CREATE TABLE [dbo].[CM_TUBES]( + [TUBEID] [int] IDENTITY(1,1) NOT NULL, + [ACCESSNUMBER] [varchar](10) NULL, + [SAMPLETYPE] [varchar](10) NULL, + [COLLECTIONDATE] [datetime] NULL, + [COLL_USERID] [varchar](25) NULL, + [COLLSTATUS] [varchar](1) NOT NULL, + [CREATEDATE] [datetime] NULL, + CONSTRAINT [PK_TUBES] PRIMARY KEY CLUSTERED +( + [TUBEID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] GO -ALTER DATABASE [cmod] SET READ_WRITE + +ALTER TABLE [dbo].[CM_TUBES] ADD CONSTRAINT [DF_TUBES_STATUS] DEFAULT ((0)) FOR [COLLSTATUS] GO +