@@ -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";
- }
- }
- }
-
- });
- });
= $this->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 @@
-
-
-
- | Order |
- MR |
- Patient |
- Request |
- Hosp |
- Loc |
- Doc |
- Test |
- Status |
-
-
-
-
- | 2024-10-12 23:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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:37 |
- AJI909S |
- Zakiya Miksha |
- 1232233112 |
- 2211212121 |
- R09 |
- 312 |
- Complete 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'];
?>
-
-