'success']); } else { echo json_encode(['status' => 'error', 'message' => 'Invalid data']); } //// if it's a GET request, it's read/load from cache //} elseif ($loadcache === true) { // // // check if cached data exists in session // if (isset($_SESSION["agent{$agent}_cache"])) { // // return the cached data in JSON format // echo json_encode(['status' => 'success', 'data' => $_SESSION["agent{$agent}_cache"]]); // } else { // // if no cached data exists // echo json_encode(['status' => 'error', 'message' => 'No cached data found']); // } // no form submitted, show the templates } else { $agentDetails = $agentObject->getAgentDetails($platform_id); include '../app/templates/agent-list.php'; } ?>