From a829e187bd73a69851566e1bc1ad6ff5d04d1267 Mon Sep 17 00:00:00 2001
From: afnanramadhan <13521011@std.stei.itb.ac.id>
Date: Thu, 16 Nov 2023 03:36:43 +0700
Subject: [PATCH] feat: add exp from soap

---
 app/views/profile/index.php        | 4 ++--
 public/js/profile.js               | 9 +++++----
 server/controller/auth/Profile.php | 2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/app/views/profile/index.php b/app/views/profile/index.php
index 4fb77fb..3e0d830 100644
--- a/app/views/profile/index.php
+++ b/app/views/profile/index.php
@@ -56,8 +56,8 @@ echo "<script>console.log('$id, $fullName, $email, $phone')</script>";
                     <div class="levelcontainer">
                         <div class="level">
                             <p class="leveltext">Level</p>
-                            <div class="levelcircle">
-                                <p class="leveltext">2</p>
+                            <div class="levelcircle" id="levelcirle">
+                                <!-- <p class="leveltext" id>2</p> -->
                             </div>
                         </div>
                         <ul class="skills skills1">
diff --git a/public/js/profile.js b/public/js/profile.js
index 82502e4..632b737 100644
--- a/public/js/profile.js
+++ b/public/js/profile.js
@@ -89,13 +89,14 @@ function showExp(){
             // const jsonObject = JSON.parse(response);
             console.log(response);
             
-            const parentElement = document.getElementById("exp");
+            const parentElement = document.getElementById("levelcirle");
             let html = "";
+            const level = Math.floor(response/100)+1;
+            const exp = response%100;
+            document.querySelector('ul.skills li.sk-cms').style.setProperty('--per', exp);
 
             html += `
-            <div">
-                <h1>EXP : ${response}</h1>
-            </div>
+                <p class="leveltext" id>${level}</p>
             `;
             
             parentElement.innerHTML = html;        
diff --git a/server/controller/auth/Profile.php b/server/controller/auth/Profile.php
index a2e9891..6b6f9b2 100644
--- a/server/controller/auth/Profile.php
+++ b/server/controller/auth/Profile.php
@@ -118,7 +118,7 @@ if(isset($_GET['show'])){
     <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
         <Body>
             <getExpUser xmlns="http://Services.nutricraft.org/">
-                <arg0 xmlns="">1</arg0>
+                <arg0 xmlns="">3</arg0>
             </getExpUser>
         </Body>
     </Envelope>';
-- 
GitLab