diff --git a/src/admin/gym/index.php b/src/admin/gym/index.php
index f1bad41720c670eedd2ec052e6f921cbc685e964..0572d0ac4396c8dee4bc0d559949b0fbe5dbc082 100644
--- a/src/admin/gym/index.php
+++ b/src/admin/gym/index.php
@@ -121,8 +121,8 @@ AuthMiddleware::getInstance()->secureRoute(true);
     <script src="/public/javascript/gym/trainer.js"></script>
     <script>
         // getGymTrainers(<?php echo $gym_id ?>);
-        // getGymApplication(<?php echo $gym_id ?>);
-        getTrainersByGymId(<?php echo $gym_id ?>);
+        getGymApplication(<?php echo $gym_id ?>);
+        // getTrainersByGymId(<?php echo $gym_id ?>);
     </script>
 </body>
 
diff --git a/src/public/javascript/gym/application.js b/src/public/javascript/gym/application.js
index 71b51be6d8f91b373385dac0471142372cf7e494..c930a01612bfc85c98ed5172e2e5968c0cd98ec7 100644
--- a/src/public/javascript/gym/application.js
+++ b/src/public/javascript/gym/application.js
@@ -4,23 +4,6 @@ function hidePopupRej() { document.querySelector(`#pop-up-reject`).style.display
 function showPopupRej() { document.querySelector(`#pop-up-reject`).style.display = "flex";}
 
 // dummy data
-// let trainer = {
-//   username: "johndoe",
-//   gym_id: 43,
-//   acceptance: 0,
-//   trainer_name: "John Doe",
-//   trainer_description: "Aku ingin bekerja",
-//   application_description: "Aku ingin bekerja di sebuah gym, aku memiliki semangat di gym 43 ini semoga bisa keterima. Sekian dan terima kasih atas perhatian dan kesan dan pesannya",
-// }
-// let trainer2 = {
-//   username: "johndoedfdf",
-//   gym_id: 43, 
-//   acceptance: 0,
-//   trainer_name: "John Doe",
-//   trainer_description: "Aku ingin bekerja",
-//   application_description: "Aku ingin bekerja",
-// }
-// let data = [trainer, trainer2];
 const response = `<?xml version="1.0"?>
 <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
     <S:Body>
@@ -98,43 +81,62 @@ function getApplication(username, gymId) {
   xhr.send(soapBody);
 }
 
-function acceptApplication(username, gymId) {
-  alert("ajax : accept with username: " + username + " and gym id: " + gymId);
+function acceptApplication(gymId, username) {
+  hidePopupAcc()
   const xhr = new XMLHttpRequest();
   xhr.onreadystatechange = function () {
-    if (this.readyState === 4) {
-      if (this.status === 200) {
-          alert("accept with username: " + username + " and gym id: " + gymId);
-        
-        } else {
-          const json = JSON.parse(this.responseText);
-          alert(json["error"]);
-        }
+      if (this.readyState === 4) {
+          if (this.status === 200) {
+              alert("accept with username: " + username + " and gym id: " + gymId + "\n" + "Email has been sent to the trainer");
+          } else {
+              const xml = this.responseXML;
+              console.log("error status : " + this.status + " error text : " + xml);
+          }
       }
-    };
-  
-    // xhr.open("GET", `/api/gym/rating?gym_id=${gymId}`, true);
-    // xhr.setRequestHeader("X-API-KEY", apikey);
-    xhr.send();
+  };
+
+  const soapBody = `<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
+                      <Body>
+                          <accept xmlns="http://service.gymtracker.com/">
+                              <username xmlns="">${username}</username>
+                              <gym_id xmlns="">${gymId}</gym_id>
+                          </accept>
+                      </Body>
+                  </Envelope>`;
+
+  xhr.open("POST", soapurl, true);
+  xhr.setRequestHeader("Content-Type", "text/xml");
+  xhr.setRequestHeader("Authorization", soapkey);
+  xhr.send(soapBody);
 }
 
-function rejectApplication(username, gymId) {
-  alert("ajax : reject with username: " + username + " and gym id: " + gymId);
+function rejectApplication(gymId, username) {
+  hidePopupRej()
   const xhr = new XMLHttpRequest();
   xhr.onreadystatechange = function () {
-    if (this.readyState === 4) {
-      if (this.status === 200) {
-          alert("reject with username: " + username + " and gym id: " + gymId);
-        
-        } else {
-          const json = JSON.parse(this.responseText);
-          alert(json["error"]);
-        }
+      if (this.readyState === 4) {
+          if (this.status === 200) {
+              alert("reject with username: " + username + " and gym id: " + gymId + "\n" + "Email has been sent to the trainer");
+          } else {
+              const xml = this.responseXML;
+              console.log("error status : " + this.status + " error text : " + xml);
+          }
       }
-    };
-    // xhr.open("GET", `/api/gym/rating?gym_id=${gymId}`, true);
-    // xhr.setRequestHeader("X-API-KEY", apikey);
-    xhr.send();
+  };
+
+  const soapBody = `<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
+                      <Body>
+                          <reject xmlns="http://service.gymtracker.com/">
+                              <username xmlns="">${username}</username>
+                              <gym_id xmlns="">${gymId}</gym_id>
+                          </reject>
+                      </Body>
+                  </Envelope>`;
+
+  xhr.open("POST", soapurl, true);
+  xhr.setRequestHeader("Content-Type", "text/xml");
+  xhr.setRequestHeader("Authorization", soapkey);
+  xhr.send(soapBody);
 }
 
 function modifyGymApplicationList(data) {