diff --git a/app/templates/agent-list.php b/app/templates/agent-list.php
index fe763b8..74197cc 100644
--- a/app/templates/agent-list.php
+++ b/app/templates/agent-list.php
@@ -6,7 +6,10 @@
agent id= htmlspecialchars($agent['id']) ?>: type = htmlspecialchars($agent['agent_type_id']) ?>, url = htmlspecialchars($agent['url']) ?>
-
+
+
+ Result:
+ click a button to fetch data from the agent.
diff --git a/app/templates/page-header.php b/app/templates/page-header.php
index 6a7cab8..028210a 100644
--- a/app/templates/page-header.php
+++ b/app/templates/page-header.php
@@ -23,6 +23,9 @@
}
})();
+
+
+
Jilo Web
diff --git a/public_html/static/agents.js b/public_html/static/agents.js
new file mode 100644
index 0000000..c8a57f8
--- /dev/null
+++ b/public_html/static/agents.js
@@ -0,0 +1,20 @@
+function fetchData(force = false) {
+ // Show loading text
+ document.getElementById("result").innerHTML = "Loading...";
+
+ // Create an AJAX request
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", "index.php?page=agents", true);
+ xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4 && xhr.status === 200) {
+ // Parse and display the result
+ let result = JSON.parse(xhr.responseText);
+ document.getElementById("result").innerHTML = JSON.stringify(result, null, 2);
+ }
+ };
+
+ // Send the AJAX request, with force flag
+ xhr.send("action=fetch&force=" + (force ? 'true' : 'false'));
+}