From 98efe7019869fb05f2dd77dbda5238451626fd99 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Mon, 25 Nov 2024 13:20:36 +0700 Subject: [PATCH] dashboard done --- app/Controllers/Dashboard.php | 5 +- app/Views/dashboard.html | 251 - app/Views/dashboard.php | 232 +- app/Views/dashboard_modals.html | 601 - app/Views/dashboard_table.html | 111 - app/Views/dashboard_viewAccess.php | 39 +- app/Views/layouts/main.php | 6 +- app/Views/layouts/topbar.html | 23 - public/assets/datatables/datatables.min.css | 17363 +---------------- public/assets/datatables/datatables.min.js | 295 +- public/assets/js/bootstrap.bundle.min.js.map | 1 + 11 files changed, 130 insertions(+), 18797 deletions(-) delete mode 100644 app/Views/dashboard.html delete mode 100644 app/Views/dashboard_modals.html delete mode 100644 app/Views/dashboard_table.html delete mode 100644 app/Views/layouts/topbar.html create mode 100644 public/assets/js/bootstrap.bundle.min.js.map diff --git a/app/Controllers/Dashboard.php b/app/Controllers/Dashboard.php index 32c2ffa..b9c499b 100644 --- a/app/Controllers/Dashboard.php +++ b/app/Controllers/Dashboard.php @@ -40,8 +40,9 @@ when not exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESS when exists (select 1 FROM cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER ) then case when exists (select 1 from SP_TUBES st where st.SP_ACCESSNUMBER=sr.SP_ACCESSNUMBER and st.TUBESTATUS=4 ) then 'PartRecv' - when exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'PartColl' - else 'Coll' + when not exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=0 ) then 'Coll' + when exists (select 1 from cmod.dbo.CM_TUBES T where T.ACCESSNUMBER=sr.SP_ACCESSNUMBER and T.COLLSTATUS=1 ) then 'PartColl' + else 'Pend' end else 'Pend' end STATS diff --git a/app/Views/dashboard.html b/app/Views/dashboard.html deleted file mode 100644 index d278492..0000000 --- a/app/Views/dashboard.html +++ /dev/null @@ -1,251 +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 1f0ae98..6e3e41a 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -2,87 +2,7 @@ section('content') ?> -
-
-
-
-
-

345

-
-
-

Pending

-
-
-
-
-
-
-

333

-
-
-

Part. Collect

-
-
-
-
-
-
-

542

-
-
-

Collected

-
-
-
-
-
-
-

436

-
-
-

Part. Rcv.

-
-
-
-
-
-
-

567

-
-
-

Received

-
-
-
-
-
-
-

321

-
-
-

Inprocess

-
-
-
-
-
-
-

432

-
-
-

Part. Val.

-
-
-
-
-
-
-

321

-
-
-

Validated

-
-
+
@@ -123,8 +43,35 @@ function index() { url: url, method: 'GET', success: function(response) { - // counter jaka yang ngerjakan + /* + // counter + */ + $("#stats").html(""); + var stats = ['Pend', 'PartColl', 'Coll', 'PartRecv', 'Recv', 'Inc', 'PartVal', 'Comp']; + var statcolor = ['text-orange', 'text-peach', 'text-pink', 'text-soft-blue', 'text-blue', 'text-grey', 'text-soft-green', 'text-green']; + var staticon = ['bi-clock-history','bi-tv', 'bi-collection', 'bi-file-medical', 'bi-journal-medical', 'bi-calendar3-week', 'bi-check2', 'bi-clipboard-check']; + var stattext = ['Pending', 'Part Collected', 'Collected', 'Part Received', 'Received', 'Incomplete', 'Part Validated', 'Validated']; + var count = response['count']; + var statcontent = ''; + stats.forEach ( (item, index) => { + //console.log(item + ' ' + index); + if(!count[item]) { count[item] = 0; } + statcontent += '
' + + '
' + + '
' + + '
' + + '

'+count[item]+'

' + + '
' + + '
' + + '

'+ stattext[index] +'

' + + '
' + + '
'; + }); + $("#stats").html(statcontent); + + /* // table + */ $("#table-body").html(""); var data = response['data']; for (var i = 0; i < data.length; i++) { @@ -134,38 +81,83 @@ function index() { patname = data[i].NAME; hon = data[i].HOSTORDERNUMBER; tests = data[i].TESTS; - stats = data[i].STATS; - if(stats == 'Pend') { - statsTD = "Pending"; + stat = data[i].STATS; + if(stat == 'Pend') { + bgcolor = 'bg-orange'; + datafilter = "data-filterrow='0'"; + stattext = 'Pending'; + } else if(stat == 'PartColl') { + bgcolor = 'bg-peach'; datafilter = "data-filterrow='1'"; - } else if(stats == 'PartColl') { - statsTD = "Partial Collected"; + stattext = 'Part Collected'; + } else if(stat == 'Coll') { + bgcolor = 'bg-pink'; datafilter = "data-filterrow='2'"; - } else if(stats == 'Coll') { - statsTD = "Collected"; - datafilter = "data-filterrow='3'"; - } else if(stats == 'PartRecv') { - statsTD = "Partial Received"; + stattext = 'Collected'; + } else if(stat == 'PartRecv') { + bgcolor = 'bg-soft-blue'; + datafilter = "data-filterrow='2'"; + stattext = 'Part Received'; + } else if(stat == 'Recv') { + bgcolor = 'bg-blue'; datafilter = "data-filterrow='4'"; - } else if(stats == 'Recv') { - statsTD = "Received"; + stattext = 'Received'; + } else if(stat == 'Inc') { + bgcolor = 'bg-grey'; datafilter = "data-filterrow='5'"; - } else if(stats == 'Inc') { - statsTD = "Incomplete"; + stattext = 'Incomplete'; + } else if(stat == 'PartVal') { + bgcolor = 'bg-soft-green'; datafilter = "data-filterrow='6'"; - } else if(stats == 'PartVal') { - statsTD = "Partial Validated"; + stattext = 'Part Validated'; + } else if(stat == 'Comp') { + bgcolor = 'bg-green'; datafilter = "data-filterrow='7'"; - } else if(stats == 'Comp') { - statsTD = "Validated"; - datafilter = "data-filterrow='8'"; + stattext = 'Validated'; } let datarow = '' + '' + colldate + ' ' + patnumber + ' ' + accessnumber + ' ' + patname + ' ' + hon + ' ' + tests + '' + - statsTD + ''; + ""+stattext+"" + ''; $("#table-body").append(datarow); } $('#myTable').DataTable(); + + // datatable filter + const filterButton = document.querySelectorAll("[data-filtertype]"); + const table = document.querySelector("#myTable"); + const tr = table.getElementsByTagName("tr"); + + let activeButton = null; + + filterButton.forEach((button) => { + button.addEventListener("click", () => { + const selectedButton = button.getAttribute("data-filtertype"); + console.log(selectedButton); + + if (activeButton === button) { + button.classList.remove("active", "border", "border-primary", "border-5"); + activeButton = null; + for (let i = 1; i < tr.length; i++) { + tr[i].style.display = ""; + } + } else { + filterButton.forEach((btn) => btn.classList.remove("active", "border", "border-info", "border-3")); + button.classList.add("active", "border", "border-info", "border-3"); + activeButton = button; + + for (let i = 1; i < tr.length; i++) { + const filterValue = tr[i].getAttribute("data-filterrow"); + + if (filterValue === selectedButton) { + tr[i].style.display = ""; + } else { + tr[i].style.display = "none"; + } + } + } + + }); + }); }, error: function(response) { console.log(response.responseJSON); } }); @@ -177,41 +169,5 @@ function viewAccess(access) { $('#modal').modal('show'); }); } - -const filterButton = document.querySelectorAll("[data-filtertype]"); -const table = document.querySelector("#myTable"); -const tr = table.getElementsByTagName("tr"); - -let activeButton = null; - -filterButton.forEach((button) => { - button.addEventListener("click", () => { - const selectedButton = button.getAttribute("data-filtertype"); - console.log(selectedButton); - - if (activeButton === button) { - button.classList.remove("active", "border", "border-primary", "border-5"); - activeButton = null; - for (let i = 1; i < tr.length; i++) { - tr[i].style.display = ""; - } - } else { - filterButton.forEach((btn) => btn.classList.remove("active", "border", "border-info", "border-3")); - button.classList.add("active", "border", "border-info", "border-3"); - activeButton = button; - - for (let i = 1; i < tr.length; i++) { - const filterValue = tr[i].getAttribute("data-filterrow"); - - if (filterValue === selectedButton) { - tr[i].style.display = ""; - } else { - tr[i].style.display = "none"; - } - } - } - - }); - }); endSection() ?> \ No newline at end of file diff --git a/app/Views/dashboard_modals.html b/app/Views/dashboard_modals.html deleted file mode 100644 index 9260c53..0000000 --- a/app/Views/dashboard_modals.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/Views/dashboard_table.html b/app/Views/dashboard_table.html deleted file mode 100644 index 71c60f9..0000000 --- a/app/Views/dashboard_table.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
\ No newline at end of file diff --git a/app/Views/dashboard_viewAccess.php b/app/Views/dashboard_viewAccess.php index 7543714..052a8c9 100644 --- a/app/Views/dashboard_viewAccess.php +++ b/app/Views/dashboard_viewAccess.php @@ -5,25 +5,16 @@ $patnumber = $row['PATNUMBER']; $host = $row['HOSTORDERNUMBER']; $name = $row['NAME']; ?> - -