diff --git a/app/Views/admin/dashboard.php b/app/Views/admin/dashboard.php
index 9bfc6c8..b61089c 100644
--- a/app/Views/admin/dashboard.php
+++ b/app/Views/admin/dashboard.php
@@ -156,7 +156,7 @@ function index() {
stattext = 'Validated';
}
let datarow = "
" +
- "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + ' | ' + hon + ' | ' + tests + ' | ' +
+ "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + " Disalin" +" | " + hon + " Disalin | " + tests + ' | ' +
""+stattext+" | " +
" | " +'
';
$("#table-body").append(datarow);
@@ -218,5 +218,38 @@ function resultPdfAccess(access, event) {
let url = '=base_url();?>printResult/'+access;
window.open(url, '_blank');
}
+function copyToClipboard(element) {
+ let text = element.innerText.trim(); // Ambil teks dari elemen
+ text = text.replace("Teks sudah disalin", "").trim(); // Hilangkan teks notifikasi sebelumnya
+
+ if (navigator.clipboard) {
+ navigator.clipboard.writeText(text).then(() => {
+ showCopyMessage(element);
+ }).catch(err => {
+ console.error("Gagal menyalin teks: ", err);
+ });
+ } else {
+ // Alternatif jika Clipboard API tidak didukung
+ let tempInput = document.createElement("textarea");
+ tempInput.value = text;
+ document.body.appendChild(tempInput);
+ tempInput.select();
+ document.execCommand("copy");
+ document.body.removeChild(tempInput);
+
+ showCopyMessage(element);
+ }
+}
+function showCopyMessage(element) {
+ let message = element.querySelector(".copy-message");
+ if (message) {
+ message.style.display = "inline"; // Tampilkan teks notifikasi
+
+ // Sembunyikan kembali setelah 2 detik
+ setTimeout(() => {
+ message.style.display = "none";
+ }, 500);
+ }
+}
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/fo/dashboard.php b/app/Views/fo/dashboard.php
index 256bc30..74916b7 100644
--- a/app/Views/fo/dashboard.php
+++ b/app/Views/fo/dashboard.php
@@ -156,7 +156,7 @@ function index() {
stattext = 'Validated';
}
let datarow = "" +
- "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + ' | ' + hon + ' | ' + tests + ' | ' +
+ "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + " Disalin" +" | " + hon + " Disalin | " + tests + ' | ' +
""+stattext+" | " +
" | " +'
';
$("#table-body").append(datarow);
@@ -218,5 +218,38 @@ function resultPdfAccess(access, event) {
let url = '=base_url();?>printResult/'+access;
window.open(url, '_blank');
}
+function copyToClipboard(element) {
+ let text = element.innerText.trim(); // Ambil teks dari elemen
+ text = text.replace("Teks sudah disalin", "").trim(); // Hilangkan teks notifikasi sebelumnya
+
+ if (navigator.clipboard) {
+ navigator.clipboard.writeText(text).then(() => {
+ showCopyMessage(element);
+ }).catch(err => {
+ console.error("Gagal menyalin teks: ", err);
+ });
+ } else {
+ // Alternatif jika Clipboard API tidak didukung
+ let tempInput = document.createElement("textarea");
+ tempInput.value = text;
+ document.body.appendChild(tempInput);
+ tempInput.select();
+ document.execCommand("copy");
+ document.body.removeChild(tempInput);
+
+ showCopyMessage(element);
+ }
+}
+function showCopyMessage(element) {
+ let message = element.querySelector(".copy-message");
+ if (message) {
+ message.style.display = "inline"; // Tampilkan teks notifikasi
+
+ // Sembunyikan kembali setelah 2 detik
+ setTimeout(() => {
+ message.style.display = "none";
+ }, 500);
+ }
+}
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/sampling/dashboard.php b/app/Views/sampling/dashboard.php
index f26e616..f374a63 100644
--- a/app/Views/sampling/dashboard.php
+++ b/app/Views/sampling/dashboard.php
@@ -156,7 +156,7 @@ function index() {
stattext = 'Validated';
}
let datarow = "" +
- "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + ' | ' + hon + ' | ' + tests + ' | ' +
+ "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + " Disalin" +" | " + hon + " Disalin | " + tests + ' | ' +
""+stattext+" | " +
" | " +'
';
$("#table-body").append(datarow);
@@ -218,5 +218,38 @@ function resultPdfAccess(access, event) {
let url = '=base_url();?>printResult/'+access;
window.open(url, '_blank');
}
+function copyToClipboard(element) {
+ let text = element.innerText.trim(); // Ambil teks dari elemen
+ text = text.replace("Teks sudah disalin", "").trim(); // Hilangkan teks notifikasi sebelumnya
+
+ if (navigator.clipboard) {
+ navigator.clipboard.writeText(text).then(() => {
+ showCopyMessage(element);
+ }).catch(err => {
+ console.error("Gagal menyalin teks: ", err);
+ });
+ } else {
+ // Alternatif jika Clipboard API tidak didukung
+ let tempInput = document.createElement("textarea");
+ tempInput.value = text;
+ document.body.appendChild(tempInput);
+ tempInput.select();
+ document.execCommand("copy");
+ document.body.removeChild(tempInput);
+
+ showCopyMessage(element);
+ }
+}
+function showCopyMessage(element) {
+ let message = element.querySelector(".copy-message");
+ if (message) {
+ message.style.display = "inline"; // Tampilkan teks notifikasi
+
+ // Sembunyikan kembali setelah 2 detik
+ setTimeout(() => {
+ message.style.display = "none";
+ }, 500);
+ }
+}
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/user/dashboard.php b/app/Views/user/dashboard.php
index 2580f51..7478c5b 100644
--- a/app/Views/user/dashboard.php
+++ b/app/Views/user/dashboard.php
@@ -156,7 +156,7 @@ function index() {
stattext = 'Validated';
}
let datarow = "" +
- "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + ' | ' + hon + ' | ' + tests + ' | ' +
+ "" + colldate + ' '+ colltime +' | ' + patnumber + ' | ' + patname.trim() + " | " + accessnumber + " Disalin" +" | " + hon + " Disalin | " + tests + ' | ' +
""+stattext+" | " +
" | " +'
';
$("#table-body").append(datarow);
@@ -218,5 +218,38 @@ function resultPdfAccess(access, event) {
let url = '=base_url();?>printResult/'+access;
window.open(url, '_blank');
}
+function copyToClipboard(element) {
+ let text = element.innerText.trim(); // Ambil teks dari elemen
+ text = text.replace("Teks sudah disalin", "").trim(); // Hilangkan teks notifikasi sebelumnya
+
+ if (navigator.clipboard) {
+ navigator.clipboard.writeText(text).then(() => {
+ showCopyMessage(element);
+ }).catch(err => {
+ console.error("Gagal menyalin teks: ", err);
+ });
+ } else {
+ // Alternatif jika Clipboard API tidak didukung
+ let tempInput = document.createElement("textarea");
+ tempInput.value = text;
+ document.body.appendChild(tempInput);
+ tempInput.select();
+ document.execCommand("copy");
+ document.body.removeChild(tempInput);
+
+ showCopyMessage(element);
+ }
+}
+function showCopyMessage(element) {
+ let message = element.querySelector(".copy-message");
+ if (message) {
+ message.style.display = "inline"; // Tampilkan teks notifikasi
+
+ // Sembunyikan kembali setelah 2 detik
+ setTimeout(() => {
+ message.style.display = "none";
+ }, 500);
+ }
+}
= $this->endSection() ?>
\ No newline at end of file