{"id":8430,"date":"2024-09-08T14:36:54","date_gmt":"2024-09-08T11:36:54","guid":{"rendered":"https:\/\/digitalrise.art\/?page_id=8430"},"modified":"2024-09-10T17:12:54","modified_gmt":"2024-09-10T14:12:54","slug":"elementor-8430","status":"publish","type":"page","link":"https:\/\/digitalrise.art\/?page_id=8430","title":{"rendered":"Elementor #8430"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"8430\" class=\"elementor elementor-8430\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ec27e86 e-con-full e-flex e-con e-parent\" data-id=\"ec27e86\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-30e4077 elementor-widget elementor-widget-spacer\" data-id=\"30e4077\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1c9e93e e-con-full e-flex e-con e-parent\" data-id=\"1c9e93e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4c46c5c elementor-widget elementor-widget-html\" data-id=\"4c46c5c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<!DOCTYPE html>\r\n<html lang=\"he\" dir=\"rtl\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>\u05d8\u05d1\u05dc\u05ea \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea DR Digital<\/title>\r\n    <style>\r\n        body {\r\n            font-family: Arial, sans-serif;\r\n            line-height: 1.6;\r\n            margin: 0;\r\n            padding: 20px;\r\n            background-color: #f4f4f4;\r\n            direction: rtl;\r\n        }\r\n        h1 {\r\n            color: #333;\r\n            text-align: center;\r\n        }\r\n        table {\r\n            width: 100%;\r\n            border-collapse: collapse;\r\n            margin-top: 20px;\r\n            background-color: #fff;\r\n            box-shadow: 0 0 10px rgba(0,0,0,0.1);\r\n        }\r\n        th, td {\r\n            border: 1px solid #ddd;\r\n            padding: 12px;\r\n            text-align: right;\r\n        }\r\n        th {\r\n            background-color: #f2f2f2;\r\n            font-weight: bold;\r\n            color: #333;\r\n        }\r\n        tr:nth-child(even) {\r\n            background-color: #f9f9f9;\r\n        }\r\n        tr:hover {\r\n            background-color: #f5f5f5;\r\n        }\r\n        #status {\r\n            text-align: center;\r\n            margin-top: 20px;\r\n            font-weight: bold;\r\n            color: #333;\r\n        }\r\n        .success {\r\n            color: green;\r\n        }\r\n        button {\r\n            padding: 5px 10px;\r\n            margin: 5px;\r\n            cursor: pointer;\r\n        }\r\n        #addForm {\r\n            margin-top: 20px;\r\n            background-color: #fff;\r\n            padding: 20px;\r\n            border-radius: 5px;\r\n            box-shadow: 0 0 10px rgba(0,0,0,0.1);\r\n        }\r\n        #addForm input {\r\n            width: 100%;\r\n            padding: 8px;\r\n            margin-bottom: 10px;\r\n        }\r\n        #addForm button {\r\n            background-color: #4CAF50;\r\n            color: white;\r\n            border: none;\r\n            padding: 10px 20px;\r\n            cursor: pointer;\r\n        }\r\n        #addForm button:hover {\r\n            background-color: #45a049;\r\n        }\r\n\r\n        \/* \u05e2\u05d9\u05e6\u05d5\u05d1 \u05e8\u05e1\u05e4\u05d5\u05e0\u05e1\u05d9\u05d1\u05d9 \u05dc\u05e9\u05de\u05d9\u05e8\u05d4 \u05e2\u05dc \u05de\u05d1\u05e0\u05d4 \u05d8\u05d1\u05dc\u05d4 \u05d2\u05dd \u05d1\u05d8\u05dc\u05e4\u05d5\u05e0\u05d9\u05dd *\/\r\n        @media only screen and (max-width: 768px) {\r\n            table {\r\n                display: block;\r\n                overflow-x: auto;\r\n                white-space: nowrap;\r\n            }\r\n            tr {\r\n                display: table-row;\r\n            }\r\n        }\r\n    <\/style>\r\n<\/head>\r\n<body>\r\n    <h1>\u05d8\u05d1\u05dc\u05ea \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea DR Digital<\/h1>\r\n    <div id=\"status\"><\/div>\r\n    <button id=\"refreshButton\">\u05e8\u05e2\u05e0\u05df \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd<\/button>\r\n    <table id=\"customerTable\">\r\n        <thead>\r\n            <tr>\r\n                <th>\u05e9\u05dd \u05d4\u05dc\u05e7\u05d5\u05d7<\/th>\r\n                <th>\u05e2\u05e1\u05e7<\/th>\r\n                <th>\u05d8\u05dc\u05e4\u05d5\u05df<\/th>\r\n                <th>\u05de\u05d9\u05d9\u05dc<\/th>\r\n                <th>\u05d4\u05e9\u05d9\u05e8\u05d5\u05ea \u05d4\u05de\u05d1\u05d5\u05e7\u05e9<\/th>\r\n                <th>\u05d6\u05de\u05df \u05e0\u05d5\u05d7 \u05dc\u05d7\u05d6\u05e8\u05d4<\/th>\r\n                <th>\u05ea\u05d0\u05e8\u05d9\u05da \u05d9\u05e6\u05d9\u05e8\u05ea \u05e7\u05e9\u05e8<\/th>\r\n                <th>\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea<\/th>\r\n            <\/tr>\r\n        <\/thead>\r\n        <tbody>\r\n            <!-- \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05d9\u05d5\u05db\u05e0\u05e1\u05d5 \u05dc\u05db\u05d0\u05df \u05d1\u05d0\u05d5\u05e4\u05df \u05d3\u05d9\u05e0\u05de\u05d9 -->\r\n        <\/tbody>\r\n    <\/table>\r\n\r\n    <div id=\"addForm\">\r\n        <h2>\u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05d7\u05d3\u05e9<\/h2>\r\n        <input type=\"text\" id=\"name\" placeholder=\"\u05e9\u05dd \u05d4\u05dc\u05e7\u05d5\u05d7\">\r\n        <input type=\"text\" id=\"business\" placeholder=\"\u05e2\u05e1\u05e7\">\r\n        <input type=\"text\" id=\"phone\" placeholder=\"\u05d8\u05dc\u05e4\u05d5\u05df\">\r\n        <input type=\"email\" id=\"email\" placeholder=\"\u05de\u05d9\u05d9\u05dc\">\r\n        <input type=\"text\" id=\"service\" placeholder=\"\u05d4\u05e9\u05d9\u05e8\u05d5\u05ea \u05d4\u05de\u05d1\u05d5\u05e7\u05e9\">\r\n        <input type=\"text\" id=\"callback_time\" placeholder=\"\u05d6\u05de\u05df \u05e0\u05d5\u05d7 \u05dc\u05d7\u05d6\u05e8\u05d4\">\r\n        <button id=\"addCustomer\">\u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7<\/button>\r\n    <\/div>\r\n\r\n    <script>\r\n        let customers = [];\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05d5\u05e1\u05e4\u05ea \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05dc\u05d0\u05d7\u05e1\u05d5\u05df \u05d4\u05de\u05e7\u05d5\u05de\u05d9\r\n        function saveCustomersToLocalStorage() {\r\n            localStorage.setItem('customers', JSON.stringify(customers));\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d8\u05e2\u05d9\u05e0\u05ea \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05de\u05d0\u05d7\u05e1\u05d5\u05df \u05de\u05e7\u05d5\u05de\u05d9\r\n        function loadCustomersFromLocalStorage() {\r\n            const storedCustomers = localStorage.getItem('customers');\r\n            if (storedCustomers) {\r\n                customers = JSON.parse(storedCustomers);\r\n                renderTable();\r\n            }\r\n        }\r\n\r\n        function fetchCustomerData() {\r\n            const statusElement = document.getElementById('status');\r\n            statusElement.textContent = '\u05d8\u05d5\u05e2\u05df \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd...';\r\n            statusElement.className = '';\r\n\r\n            \/\/ \u05e0\u05e9\u05ea\u05de\u05e9 \u05d1\u05d0\u05d7\u05e1\u05d5\u05df \u05de\u05e7\u05d5\u05de\u05d9 \u05db\u05d3\u05d9 \u05dc\u05e9\u05de\u05d5\u05e8 \u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05dc\u05d0\u05d7\u05e8 \u05d8\u05e2\u05d9\u05e0\u05d4 \u05e8\u05d0\u05e9\u05d5\u05e0\u05d9\u05ea\r\n            if (!localStorage.getItem('customers')) {\r\n                fetch('https:\/\/digitalrise.art\/wp-json\/custom\/v1\/get-customers')\r\n                    .then(response => {\r\n                        if (!response.ok) {\r\n                            throw new Error('\u05dc\u05d0 \u05e0\u05d9\u05ea\u05df \u05dc\u05d8\u05e2\u05d5\u05df \u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd.');\r\n                        }\r\n                        return response.json();\r\n                    })\r\n                    .then(data => {\r\n                        customers = data;\r\n                        renderTable();\r\n                        saveCustomersToLocalStorage();\r\n                        statusElement.textContent = '\u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05e0\u05d8\u05e2\u05e0\u05d5 \u05d1\u05d4\u05e6\u05dc\u05d7\u05d4';\r\n                        statusElement.className = 'success';\r\n                    })\r\n                    .catch(error => {\r\n                        console.error('\u05e9\u05d2\u05d9\u05d0\u05d4 \u05d1\u05d8\u05e2\u05d9\u05e0\u05ea \u05e0\u05ea\u05d5\u05e0\u05d9 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea:', error);\r\n                        statusElement.textContent = '\u05dc\u05d0 \u05e0\u05d9\u05ea\u05df \u05dc\u05d8\u05e2\u05d5\u05df \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd, \u05d0\u05e0\u05d0 \u05e0\u05e1\u05d4 \u05e9\u05d5\u05d1 \u05de\u05d0\u05d5\u05d7\u05e8 \u05d9\u05d5\u05ea\u05e8.';\r\n                        statusElement.className = 'error';\r\n                    });\r\n            } else {\r\n                loadCustomersFromLocalStorage();\r\n                statusElement.textContent = '\u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05e0\u05d8\u05e2\u05e0\u05d5 \u05de\u05d4\u05d0\u05d7\u05e1\u05d5\u05df \u05d4\u05de\u05e7\u05d5\u05de\u05d9';\r\n                statusElement.className = 'success';\r\n            }\r\n        }\r\n\r\n        function renderTable() {\r\n            const tableBody = document.querySelector('#customerTable tbody');\r\n            tableBody.innerHTML = '';\r\n\r\n            if (customers.length > 0) {\r\n                customers.forEach((customer, index) => {\r\n                    const row = tableBody.insertRow();\r\n                    const fields = ['name', 'business', 'phone', 'email', 'service', 'callback_time', 'created_at'];\r\n                    fields.forEach(field => {\r\n                        const cell = row.insertCell();\r\n                        cell.textContent = customer[field] || '';\r\n                    });\r\n                    const actionsCell = row.insertCell();\r\n                    actionsCell.innerHTML = `\r\n                        <button onclick=\"editCustomer(${index})\">\u05e2\u05e8\u05d5\u05da<\/button>\r\n                        <button onclick=\"deleteCustomer(${index})\">\u05de\u05d7\u05e7<\/button>\r\n                    `;\r\n                });\r\n            } else {\r\n                const row = tableBody.insertRow();\r\n                const cell = row.insertCell();\r\n                cell.colSpan = 8;\r\n                cell.textContent = '\u05d0\u05d9\u05df \u05e0\u05ea\u05d5\u05e0\u05d9 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05d6\u05de\u05d9\u05e0\u05d9\u05dd \u05db\u05e8\u05d2\u05e2.';\r\n            }\r\n        }\r\n\r\n        function addCustomer() {\r\n            const newCustomer = {\r\n                name: document.getElementById('name').value,\r\n                business: document.getElementById('business').value,\r\n                phone: document.getElementById('phone').value,\r\n                email: document.getElementById('email').value,\r\n                service: document.getElementById('service').value,\r\n                callback_time: document.getElementById('callback_time').value,\r\n                created_at: new Date().toISOString().split('T')[0]\r\n            };\r\n\r\n            customers.push(newCustomer);\r\n            renderTable();\r\n            saveCustomersToLocalStorage();\r\n\r\n            \/\/ \u05e0\u05d9\u05e7\u05d5\u05d9 \u05d4\u05e9\u05d3\u05d5\u05ea\r\n            document.getElementById('name').value = '';\r\n            document.getElementById('business').value = '';\r\n            document.getElementById('phone').value = '';\r\n            document.getElementById('email').value = '';\r\n            document.getElementById('service').value = '';\r\n            document.getElementById('callback_time').value = '';\r\n        }\r\n\r\n        function editCustomer(index) {\r\n            const customer = customers[index];\r\n            document.getElementById('name').value = customer.name;\r\n            document.getElementById('business').value = customer.business;\r\n            document.getElementById('phone').value = customer.phone;\r\n            document.getElementById('email').value = customer.email;\r\n            document.getElementById('service').value = customer.service;\r\n            document.getElementById('callback_time').value = customer.callback_time;\r\n\r\n            const addButton = document.getElementById('addCustomer');\r\n            addButton.textContent = '\u05e2\u05d3\u05db\u05df \u05dc\u05e7\u05d5\u05d7';\r\n            addButton.onclick = function() {\r\n                updateCustomer(index);\r\n            };\r\n        }\r\n\r\n        function updateCustomer(index) {\r\n            const updatedCustomer = {\r\n                name: document.getElementById('name').value,\r\n                business: document.getElementById('business').value,\r\n                phone: document.getElementById('phone').value,\r\n                email: document.getElementById('email').value,\r\n                service: document.getElementById('service').value,\r\n                callback_time: document.getElementById('callback_time').value,\r\n                created_at: customers[index].created_at\r\n            };\r\n\r\n            customers[index] = updatedCustomer;\r\n            renderTable();\r\n            saveCustomersToLocalStorage();\r\n\r\n            const addButton = document.getElementById('addCustomer');\r\n            addButton.textContent = '\u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7';\r\n            addButton.onclick = addCustomer;\r\n\r\n            \/\/ \u05e0\u05d9\u05e7\u05d5\u05d9 \u05d4\u05e9\u05d3\u05d5\u05ea\r\n            document.getElementById('name').value = '';\r\n            document.getElementById('business').value = '';\r\n            document.getElementById('phone').value = '';\r\n            document.getElementById('email').value = '';\r\n            document.getElementById('service').value = '';\r\n            document.getElementById('callback_time').value = '';\r\n        }\r\n\r\n        function deleteCustomer(index) {\r\n            if (confirm('\u05d4\u05d0\u05dd \u05d0\u05ea\u05d4 \u05d1\u05d8\u05d5\u05d7 \u05e9\u05d1\u05e8\u05e6\u05d5\u05e0\u05da \u05dc\u05de\u05d7\u05d5\u05e7 \u05dc\u05e7\u05d5\u05d7 \u05d6\u05d4?')) {\r\n                customers.splice(index, 1);\r\n                renderTable();\r\n                saveCustomersToLocalStorage();\r\n            }\r\n        }\r\n\r\n        document.addEventListener('DOMContentLoaded', fetchCustomerData);\r\n        document.getElementById('refreshButton').addEventListener('click', fetchCustomerData);\r\n        document.getElementById('addCustomer').addEventListener('click', addCustomer);\r\n    <\/script>\r\n<\/body>\r\n<\/html>\r\n\t\t\t\t<\/div>\n\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>\u05d8\u05d1\u05dc\u05ea \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea DR Digital \u05d8\u05d1\u05dc\u05ea \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea DR Digital \u05e8\u05e2\u05e0\u05df \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05e9\u05dd \u05d4\u05dc\u05e7\u05d5\u05d7 \u05e2\u05e1\u05e7 \u05d8\u05dc\u05e4\u05d5\u05df \u05de\u05d9\u05d9\u05dc \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea \u05d4\u05de\u05d1\u05d5\u05e7\u05e9 \u05d6\u05de\u05df \u05e0\u05d5\u05d7 \u05dc\u05d7\u05d6\u05e8\u05d4 \u05ea\u05d0\u05e8\u05d9\u05da \u05d9\u05e6\u05d9\u05e8\u05ea \u05e7\u05e9\u05e8 \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05d7\u05d3\u05e9 \u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_canvas","meta":{"_eb_attr":"","content-type":"","site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"full-width-container","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-8430","page","type-page","status-publish","hentry"],"ams_acf":[],"_links":{"self":[{"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages\/8430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalrise.art\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8430"}],"version-history":[{"count":77,"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages\/8430\/revisions"}],"predecessor-version":[{"id":8514,"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages\/8430\/revisions\/8514"}],"wp:attachment":[{"href":"https:\/\/digitalrise.art\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}