<div id="appcontent"> </div>
<p><script>fetch("https://wijayapayment.co.id/dev/hargaaktivasi.php").then((res) => res.text()).then((res) => {let template = document.createElement("div");template.innerHTML = res;return [...template.querySelectorAll("table")].map((table) => {let rows = [...table.rows].map((row) => [...row.cells].map((cell) => cell.innerText.replace(/\n/g, "").trim()));let caption = rows.slice(0, 1)[0][0];let columns = rows.slice(1, 2)[0].reduce((prev, curr) => {prev = [...prev, { text: curr, name: curr }];return prev;}, []);let data = rows.slice(2).filter((c) => c.length);return {caption,columns,data: data.map((doc) => {return doc.reduce((prev, curr, index) => {prev[columns[index].text] = curr;return prev;}, {});}),};});}).then((data) => {data.forEach((doc) => {let card = document.createElement("div");card.classList.add("app-content");let cardHeader = document.createElement("div");cardHeader.classList.add("app-content-header");cardHeader.textContent = doc.caption;card.appendChild(cardHeader);let cardBody = document.createElement("div");cardBody.classList.add("app-content-body");card.appendChild(cardBody);let cardList = document.createElement("div");cardList.classList.add("app-content-list");cardBody.appendChild(cardList);doc.data.forEach((item) => {let cardRow = document.createElement("div");cardRow.classList.add("app-content-list-row");cardList.appendChild(cardRow);let cardImage = document.createElement("img");cardImage.classList.add("app-content-list-image");cardImage.title = item.Status;cardImage.src = `https://ui-avatars.com/api/?background=${item.Status == "open"?"009688":"FFA000"}&color=fff&name=${item.Status}`;cardRow.appendChild(cardImage);let cardText = document.createElement("div");cardText.classList.add("app-content-list-text");cardRow.appendChild(cardText);let cardText1 = document.createElement("div");cardText1.classList.add("app-content-list-text-1");cardText1.innerText = item.Kode;cardText.appendChild(cardText1);let cardText2 = document.createElement("div");cardText2.classList.add("app-content-list-text-2");cardText2.innerText = item.Keterangan;cardText.appendChild(cardText2);let cardText3 = document.createElement("div");cardText3.classList.add("app-content-list-text-3");cardText3.innerText = item.Harga;cardText.appendChild(cardText3);});appcontent.appendChild(card);});});</script></p>