// css for pay with cief modal popup var head = document.getElementsByTagName('HEAD')[0]; var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/css/mdb.min.css'; head.appendChild(link); // end css for pay with cief modal popup // creating modal and appending to body const body = document.getElementsByTagName("body"); const modal = document.createElement("div"); modal.className = "modal fade right"; modal.tabIndex = "-1"; modal.id = "modal"; modal.ariaHidden = "false"; const modaldialog = document.createElement("div"); modaldialog.className = "modal-dialog modal-side modal-top-right modal-notify "; const modalcontent = document.createElement("div"); modalcontent.className = "modal-content"; const modalheader = document.createElement("div"); modalheader.className = "modal-header"; const closebtn = document.createElement("button"); closebtn.type = "button"; closebtn.className = "close"; closebtn.ariaLabel = "close"; closebtn.id = "close"; closebtn.onclick = function () { let d = document.getElementById('modal') d.style.display = "none" }; const span = document.createElement("span"); span.ariaHidden = "true"; span.className = "text-dark"; span.innerHTML = "×"; closebtn.appendChild(span); const modaltitle = document.createElement("h4"); modaltitle.className = "modal-title text-dark" modaltitle.textContent = "Pay With CIEF"; const ciflogo = document.createElement("img"); ciflogo.className = "image-fluid"; ciflogo.style = 'margin-top: 30px; width: 100%; height: 60%; max-height: 60px !important;'; ciflogo.src = "https://www.cief-malaysia.com/wp-content/uploads/2022/10/cropped-cief-dark-2.png"; const modalbody = document.createElement("div"); modalbody.className = "modal-body"; const bodyrow = document.createElement("div"); bodyrow.className = "row"; const col3 = document.createElement("div"); col3.className = "col-4 "; col3.appendChild(ciflogo); bodyrow.appendChild(col3); const col9 = document.createElement("div"); col9.className = "col-8"; const discription = document.createElement("p"); discription.textContent = " Following a spike in demand for Alipay pay-on-behalf payments and the subsequent freezing of a significant number of accounts, we have finally found a solution! "; const cardtext = document.createElement("p"); cardtext.className = "card-text"; cardtext.textContent = "blah blah blah"; col9.appendChild(discription); bodyrow.appendChild(col9); modalbody.appendChild(bodyrow); const modalfooter = document.createElement("div"); modalfooter.className = "modal-footer justify-content-center"; const paywithcief = document.createElement("button"); paywithcief.className = "btn btn-danger"; paywithcief.textContent = "pay with cief"; paywithcief.onclick = function (){extractdata()} const nothanks = document.createElement("button"); nothanks.className = "btn btn-outline-danger waves-effect"; nothanks.textContent = "No, thanks"; nothanks.onclick = function () { let d = document.getElementById('modal') d.style.display = "none" }; modalfooter.appendChild(paywithcief); modalfooter.appendChild(nothanks); modalheader.appendChild(modaltitle); modalheader.appendChild(closebtn); modalcontent.appendChild(modalheader); modalcontent.appendChild(modalbody); modalcontent.appendChild(modalfooter); modaldialog.appendChild(modalcontent); modal.appendChild(modaldialog); document.body.appendChild(modal); document.querySelector(".modal").classList.add("show"); document.querySelector(".modal").style.display = "block"; // end creating modal and appending to body // extract information and redirect function extractdata() { var table1 = document.getElementsByTagName('table')[0]; for (var i = 0; i < table1.tBodies.length; i++) { var rows = table1.tBodies[i].rows; for (var j = 0; j < rows.length; j++) { var cells = rows[j].cells; for (var k = 0; k < cells.length; k++) { if (k == 2) { console.log('product name:', cells[2].children[0].children[0].textContent); } if (k == 3) { console.log('product price:', cells[3].textContent); } } } }; redirect(); } function redirect () { setTimeout(billplzurl, 2000); } function billplzurl() { document.location.href = 'https://dev.exchange.cief-malaysia.com'; } //end extract information and redirect