{"id":73,"date":"2026-04-13T07:39:53","date_gmt":"2026-04-13T07:39:53","guid":{"rendered":"https:\/\/go.purchbay.com\/?page_id=73"},"modified":"2026-04-16T08:24:20","modified_gmt":"2026-04-16T08:24:20","slug":"master","status":"publish","type":"page","link":"https:\/\/go.purchbay.com\/index.php\/master\/","title":{"rendered":"."},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"73\" class=\"elementor elementor-73\">\n\t\t\t\t<div class=\"elementor-element elementor-element-aeabbc6 e-flex e-con-boxed e-con e-parent\" data-id=\"aeabbc6\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d732777 elementor-widget elementor-widget-heading\" data-id=\"d732777\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Master<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2da056f elementor-widget elementor-widget-heading\" data-id=\"2da056f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">ID: AX0003<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-629bed2 elementor-widget__width-inherit elementor-widget elementor-widget-html\" data-id=\"629bed2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div class=\"wp-balance-wrapper\">\n    <div class=\"balance-card\">\n        <small>Available Balance RS<\/small>\n        <div id=\"display-total\">100000<\/div>\n    <\/div>\n\n    <div class=\"input-group\">\n        <input type=\"number\" id=\"user-amount\" placeholder=\"Enter amount\" \/>\n        \n        <div class=\"actions\">\n            <button id=\"add-btn\" type=\"button\">Add (+)<\/button>\n            <button id=\"sub-btn\" type=\"button\">Minus (-)<\/button>\n        <\/div>\n    <\/div>\n\n    <div id=\"msg-box\"><\/div>\n    \n    <center><a href=\"javascript:void(0)\" id=\"reset-trigger\" style=\"color:#999; font-size:12px;\"><\/a><\/center>\n<\/div>\n\n<style>\n    .wp-balance-wrapper {\n        max-width: 380px;\n        margin: 20px auto;\n        padding: 20px;\n        background: #fff;\n        border: 1px solid #eee;\n        border-radius: 12px;\n        font-family: sans-serif;\n        box-shadow: 0 5px 15px rgba(0,0,0,0.05);\n    }\n    .balance-card {\n        background: #1a1a1a;\n        color: white;\n        padding: 20px;\n        border-radius: 8px;\n        text-align: center;\n        margin-bottom: 20px;\n    }\n    #display-total {\n        font-size: 2.5rem;\n        font-weight: bold;\n    }\n    .input-group input {\n        width: 100%;\n        padding: 12px;\n        margin-bottom: 10px;\n        border: 2px solid #ddd;\n        border-radius: 6px;\n        font-size: 16px;\n        box-sizing: border-box;\n    }\n    .actions { display: flex; gap: 10px; }\n    .actions button {\n        flex: 1;\n        padding: 12px;\n        border: none;\n        border-radius: 6px;\n        color: white;\n        font-weight: bold;\n        cursor: pointer;\n    }\n    #add-btn { background: #28a745; }\n    #sub-btn { background: #dc3545; }\n    \n    #msg-box {\n        margin-top: 15px;\n        padding: 10px;\n        border-radius: 6px;\n        display: none;\n        font-size: 14px;\n        font-weight: bold;\n        text-align: center;\n    }\n    .error-style { background: #f8d7da; color: #721c24; display: block !important; }\n<\/style>\n\n<script>\n(function() {\n    let currentBal = 100000;\n\n    const inputField = document.getElementById('user-amount');\n    const display = document.getElementById('display-total');\n    const msgBox = document.getElementById('msg-box');\n\n    \/\/ ADD FUNCTION\n    document.getElementById('add-btn').addEventListener('click', function() {\n        const val = parseFloat(inputField.value);\n        msgBox.className = \"\"; \n        msgBox.style.display = \"none\";\n\n        if (!isNaN(val) && val > 0) {\n            currentBal = currentBal + val;\n            updateUI();\n        }\n    });\n\n    \/\/ SUBTRACT FUNCTION\n    document.getElementById('sub-btn').addEventListener('click', function() {\n        const val = parseFloat(inputField.value);\n        msgBox.className = \"\";\n        msgBox.style.display = \"none\";\n\n        if (isNaN(val) || val <= 0) return;\n\n        if (val > currentBal) {\n            msgBox.innerText = \"Error: Cannot subtract \" + val + \". Your balance is only \" + currentBal;\n            msgBox.className = \"error-style\";\n        } else {\n            currentBal = currentBal - val;\n            updateUI();\n        }\n    });\n\n    function updateUI() {\n        display.innerText = currentBal.toLocaleString();\n        inputField.value = '';\n        inputField.focus();\n    }\n\n    document.getElementById('reset-trigger').onclick = function() {\n        currentBal = 0;\n        updateUI();\n        msgBox.style.display = \"none\";\n    };\n})();\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Master ID: AX0003 Available Balance RS 100000 Add (+) Minus (-)<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-73","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/pages\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":21,"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/pages\/73\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/pages\/73\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/go.purchbay.com\/index.php\/wp-json\/wp\/v2\/media?parent=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}