+
- function renewToken(sessionToken, email, password, userId) {
- // Add your logic here to renew the login token
- login(email, password, sessionToken, function() {
- // Callback function after renewing the token, e.g., show the modal
- showTheModal(userId);
- });
- }
+
+
+ ' . $page . '';
+ }
+ ?>
+
- function login(username, password, sessionToken, callback) {
- fetch("https:///api/v1/login", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- "X-Api-Key": "{{apiKey}}"
- },
- body: JSON.stringify({
- username: username,
- password: password
- })
- })
- .then(response => {
- if (response.ok) {
- return response.json();
- } else {
- throw new Error("Unable to login");
- }
- })
- .then(data => {
- // Update the session token on the server side
- fetch("update-token-session.php", {
- method: "POST",
- headers: {
- "Content-Type": "application/json"
- },
- body: JSON.stringify({
- token: data.token
- })
- })
- .then(response => response.json())
- .then(result => {
- if (result.status === 'success') {
- // Update the session token in the client-side variable
- sessionToken = data.token;
- console.log("New Token:", sessionToken);
- callback();
- } else {
- throw new Error("Unable to update session token");
- }
- });
- })
- .catch(error => {
- console.error("Error:", error.message);
- });
- }
-
- function showTheModal(userId) {
- // Add your logic here to show the modal
- // You may need to trigger it manually if using Bootstrap modal
- $('#modalContact-' + userId).modal('show');
- }
-
-
-
-
-
-
- ' . $page . '';
- }
- ?>
-
diff --git a/admin/vendor-profile.php b/admin/vendor-profile.php
index eba6656..c764e21 100644
--- a/admin/vendor-profile.php
+++ b/admin/vendor-profile.php
@@ -236,45 +236,50 @@ if (is_array($vendorOrderss)) {
-
+