-
-
No records found
+
+
+
+
+
+
+
+ Showing to
+ of
+ entries
+
+
+
+
+
+
-
+
include('superuser/dialog_sample'); ?>
include('superuser/dialog_unval'); ?>
include('superuser/dialog_preview'); ?>
-
-
+
+
= $this->endSection(); ?>
= $this->section('script') ?>
-
-= $this->endSection(); ?>
+ /*
+ preview dialog
+ */
+ isDialogPreviewOpen: false,
+ reviewed: false,
+ previewItem: null,
+ openPreviewDialog(accessnumber, type, item) {
+ this.previewAccessnumber = accessnumber;
+ this.previewItem = item;
+ this.previewType = type;
+ this.isDialogPreviewOpen = true;
+ this.reviewed = false;
+ },
+ closePreviewDialog() {
+ this.isDialogPreviewOpen = false;
+ this.previewItem = null;
+ },
+ setPreviewType(type) {
+ this.previewType = type;
+ },
+ getPreviewUrl() {
+ let base = 'http://glenlis/spooler_db/main_dev.php';
+ let url = `${base}?acc=${this.previewAccessnumber}`;
+ if (this.previewType === 'ind') url += '&lang=ID';
+ if (this.previewType === 'eng') url += '&lang=EN';
+ if (this.previewType === 'pdf') url += '&output=pdf';
+
+ // Keep fallback for local dev if needed, but the above is the expected logic
+ // return "http://localhost/application.html";
+ return url;
+ },
+ validate(accessnumber, userid) {
+ fetch(`${BASEURL}/api/requests/validate/${accessnumber}`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ userid: `${userid}` })
+ }).then(response => {
+ this.closePreviewDialog();
+ this.fetchList();
+ console.log('Validate clicked for', this.previewAccessnumber, 'by user', userid);
+ });
+ },
+
+ /*
+ unvalidate dialog
+ */
+ isDialogUnvalOpen: false,
+ unvalReason: '',
+ unvalAccessnumber: null,
+ openUnvalDialog(accessnumber) {
+ this.unvalReason = '';
+ this.isDialogUnvalOpen = true;
+ this.unvalAccessnumber = accessnumber;
+ },
+ unvalidate(accessnumber, userid) {
+ if (!confirm(`Unvalidate request ${accessnumber}?`)) { return; }
+ fetch(`${BASEURL}/api/requests/validate/${accessnumber}`, {
+ method: "DELETE",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ userid: `${userid}`, comment: this.unvalReason.trim() })
+ }).then(response => {
+ this.closeUnvalDialog();
+ this.fetchList();
+ console.log(`Unvalidate clicked for ${accessnumber}, by user ${userid}`);
+ });
+ },
+ closeUnvalDialog() {
+ this.isDialogUnvalOpen = false;
+ },
+ }));
+ });
+
+ Alpine.start();
+
+= $this->endSection(); ?>
\ No newline at end of file
diff --git a/app/Views/superuser/main.php b/app/Views/superuser/main.php
index 6878b10..71e229e 100644
--- a/app/Views/superuser/main.php
+++ b/app/Views/superuser/main.php
@@ -1,5 +1,6 @@
+
@@ -14,49 +15,83 @@
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-size: 0.71rem;
}
+
.navbar {
padding: 0.2rem 1rem;
min-height: 0rem;
}
- .card-body {
+
+ .card-body {
font-size: 0.71rem !important;
- }
+ }
-
-