{"id":8395,"date":"2024-09-05T11:01:40","date_gmt":"2024-09-05T08:01:40","guid":{"rendered":"https:\/\/digitalrise.art\/?page_id=8395"},"modified":"2024-09-05T13:40:46","modified_gmt":"2024-09-05T10:40:46","slug":"elementor-8395","status":"publish","type":"page","link":"https:\/\/digitalrise.art\/?page_id=8395","title":{"rendered":"CRM"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"8395\" class=\"elementor elementor-8395\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-bcc495a e-con-full e-flex e-con e-parent\" data-id=\"bcc495a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5f4c522 elementor-widget elementor-widget-html\" data-id=\"5f4c522\" 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, maximum-scale=1.0, user-scalable=no\">\r\n    <title>\u05de\u05e2\u05e8\u05db\u05ea CRM \u05de\u05e7\u05d9\u05e4\u05d4 \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9\u05d9\u05dd<\/title>\r\n    <link href='https:\/\/cdn.jsdelivr.net\/npm\/fullcalendar@5.10.2\/main.min.css' rel='stylesheet' \/>\r\n    <script src='https:\/\/cdn.jsdelivr.net\/npm\/fullcalendar@5.10.2\/main.min.js'><\/script>\r\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\r\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/@hebcal\/core\"><\/script>\r\n    <style>\r\n        * {\r\n            box-sizing: border-box;\r\n        }\r\n        \r\n        body {\r\n            font-family: Arial, sans-serif;\r\n            margin: 0;\r\n            padding: 0;\r\n            background-color: #f0f0f0;\r\n            font-size: 16px;\r\n            line-height: 1.5;\r\n        }\r\n        .container {\r\n            max-width: 1200px;\r\n            margin: 0 auto;\r\n            padding: 20px;\r\n        }\r\n        h1, h2 {\r\n            color: #333;\r\n        }\r\n        .dashboard {\r\n            display: flex;\r\n            flex-wrap: wrap;\r\n            justify-content: space-between;\r\n            margin-bottom: 20px;\r\n        }\r\n        .dashboard-item {\r\n            background-color: #fff;\r\n            border-radius: 5px;\r\n            box-shadow: 0 2px 5px rgba(0,0,0,0.1);\r\n            padding: 20px;\r\n            flex: 1;\r\n            margin: 10px;\r\n            min-width: 200px;\r\n        }\r\n        .tabs {\r\n            display: flex;\r\n            margin-bottom: 20px;\r\n        }\r\n        .tab {\r\n            padding: 10px 20px;\r\n            background-color: #ddd;\r\n            border: none;\r\n            cursor: pointer;\r\n            transition: background-color 0.3s;\r\n        }\r\n        .tab.active {\r\n            background-color: #fff;\r\n            color: #000;\r\n        }\r\n        .tab-content {\r\n            display: none;\r\n            background-color: #fff;\r\n            padding: 20px;\r\n            border-radius: 5px;\r\n            box-shadow: 0 2px 5px rgba(0,0,0,0.1);\r\n        }\r\n        .tab-content.active {\r\n            display: block;\r\n        }\r\n        .table-responsive {\r\n            overflow-x: auto;\r\n        }\r\n        table {\r\n            width: 100%;\r\n            border-collapse: collapse;\r\n        }\r\n        th, td {\r\n            padding: 10px;\r\n            border: 1px solid #ddd;\r\n            text-align: right;\r\n        }\r\n        th {\r\n            background-color: #f2f2f2;\r\n        }\r\n        .modal {\r\n            display: none;\r\n            position: fixed;\r\n            z-index: 1;\r\n            left: 0;\r\n            top: 0;\r\n            width: 100%;\r\n            height: 100%;\r\n            overflow: auto;\r\n            background-color: rgba(0,0,0,0.4);\r\n        }\r\n        .modal-content {\r\n            background-color: #fefefe;\r\n            margin: 15% auto;\r\n            padding: 20px;\r\n            border: 1px solid #888;\r\n            width: 80%;\r\n            max-width: 600px;\r\n            max-height: 80vh;\r\n            overflow-y: auto;\r\n        }\r\n        .close {\r\n            color: #aaa;\r\n            float: left;\r\n            font-size: 28px;\r\n            font-weight: bold;\r\n            cursor: pointer;\r\n        }\r\n        form {\r\n            display: flex;\r\n            flex-direction: column;\r\n        }\r\n        form input, form select {\r\n            margin-bottom: 10px;\r\n            padding: 5px;\r\n        }\r\n        #calendar {\r\n            height: 600px;\r\n        }\r\n        .fc-event-title {\r\n            white-space: normal;\r\n        }\r\n        button {\r\n            background-color: #4CAF50;\r\n            color: white;\r\n            padding: 10px 15px;\r\n            border: none;\r\n            border-radius: 4px;\r\n            cursor: pointer;\r\n            margin: 5px;\r\n            font-size: 16px;\r\n        }\r\n        button:hover {\r\n            background-color: #45a049;\r\n        }\r\n        input, select, button {\r\n            font-size: 16px;\r\n        }\r\n        \r\n        @media screen and (max-width: 768px) {\r\n            .container {\r\n                padding: 10px;\r\n            }\r\n            .dashboard {\r\n                flex-direction: column;\r\n            }\r\n            .dashboard-item {\r\n                margin: 5px 0;\r\n                width: 100%;\r\n            }\r\n            .tabs {\r\n                flex-direction: column;\r\n            }\r\n            .tab {\r\n                width: 100%;\r\n                text-align: center;\r\n            }\r\n            table {\r\n                font-size: 14px;\r\n            }\r\n            th, td {\r\n                padding: 5px;\r\n            }\r\n            .modal-content {\r\n                width: 95%;\r\n                margin: 5% auto;\r\n            }\r\n            form input, form select {\r\n                width: 100%;\r\n            }\r\n            #calendar {\r\n                height: 400px;\r\n            }\r\n        }\r\n    <\/style>\r\n<\/head>\r\n<body>\r\n    <div class=\"container\">\r\n        <h1>\u05d3\u05e9\u05d1\u05d5\u05e8\u05d3 CRM \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9\u05d9\u05dd<\/h1>\r\n        \r\n        <div class=\"dashboard\">\r\n            <div class=\"dashboard-item\">\r\n                <h3>\u05e1\u05da \u05d4\u05db\u05dc \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea<\/h3>\r\n                <p id=\"totalClients\">0<\/p>\r\n            <\/div>\r\n            <div class=\"dashboard-item\">\r\n                <h3>\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd<\/h3>\r\n                <p id=\"activeClients\">0<\/p>\r\n            <\/div>\r\n            <div class=\"dashboard-item\">\r\n                <h3>\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd<\/h3>\r\n                <p id=\"inactiveClients\">0<\/p>\r\n            <\/div>\r\n            <div class=\"dashboard-item\">\r\n                <h3>\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\u05d9\u05dd<\/h3>\r\n                <p id=\"potentialClients\">0<\/p>\r\n            <\/div>\r\n            <div class=\"dashboard-item\">\r\n                <h3>\u05e1\u05da \u05d4\u05db\u05dc \u05d4\u05db\u05e0\u05e1\u05d5\u05ea<\/h3>\r\n                <p id=\"totalIncome\">\u20aa0<\/p>\r\n            <\/div>\r\n            <div class=\"dashboard-item\">\r\n                <canvas id=\"clientStatusChart\"><\/canvas>\r\n            <\/div>\r\n            <div class=\"dashboard-item\">\r\n                <canvas id=\"incomeChart\"><\/canvas>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div class=\"tabs\">\r\n            <button class=\"tab active\" onclick=\"openTab(event, 'clientsTab')\">\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea<\/button>\r\n            <button class=\"tab\" onclick=\"openTab(event, 'appointmentsTab')\">\u05e4\u05d2\u05d9\u05e9\u05d5\u05ea<\/button>\r\n            <button class=\"tab\" onclick=\"openTab(event, 'incomeTab')\">\u05d4\u05db\u05e0\u05e1\u05d5\u05ea<\/button>\r\n            <button class=\"tab\" onclick=\"openTab(event, 'servicesTab')\">\u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd<\/button>\r\n        <\/div>\r\n\r\n        <div id=\"clientsTab\" class=\"tab-content active\">\r\n            <h2>\u05e8\u05e9\u05d9\u05de\u05ea \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea<\/h2>\r\n            <button onclick=\"showClientModal()\">\u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05d7\u05d3\u05e9<\/button>\r\n            <div class=\"table-responsive\">\r\n                <table id=\"clientsTable\">\r\n                    <thead>\r\n                        <tr>\r\n                            <th>\u05e9\u05dd<\/th>\r\n                            <th>\u05d0\u05d9\u05de\u05d9\u05d9\u05dc<\/th>\r\n                            <th>\u05d8\u05dc\u05e4\u05d5\u05df<\/th>\r\n                            <th>\u05e1\u05d8\u05d8\u05d5\u05e1<\/th>\r\n                            <th>\u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd<\/th>\r\n                            <th>\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea<\/th>\r\n                        <\/tr>\r\n                    <\/thead>\r\n                    <tbody id=\"clientsList\"><\/tbody>\r\n                <\/table>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div id=\"appointmentsTab\" class=\"tab-content\">\r\n            <h2>\u05d9\u05d5\u05de\u05df \u05e4\u05d2\u05d9\u05e9\u05d5\u05ea<\/h2>\r\n            <button onclick=\"showAppointmentModal()\">\u05e7\u05d1\u05e2 \u05e4\u05d2\u05d9\u05e9\u05d4 \u05d7\u05d3\u05e9\u05d4<\/button>\r\n            <div id=\"calendar\"><\/div>\r\n        <\/div>\r\n\r\n        <div id=\"incomeTab\" class=\"tab-content\">\r\n            <h2>\u05d4\u05db\u05e0\u05e1\u05d5\u05ea<\/h2>\r\n            <button onclick=\"showIncomeModal()\">\u05d4\u05d5\u05e1\u05e3 \u05d4\u05db\u05e0\u05e1\u05d4 \u05d7\u05d3\u05e9\u05d4<\/button>\r\n            <div class=\"table-responsive\">\r\n                <table id=\"incomeTable\">\r\n                    <thead>\r\n                        <tr>\r\n                            <th>\u05dc\u05e7\u05d5\u05d7<\/th>\r\n                            <th>\u05e1\u05db\u05d5\u05dd<\/th>\r\n                            <th>\u05ea\u05d0\u05e8\u05d9\u05da<\/th>\r\n                            <th>\u05e9\u05d9\u05e8\u05d5\u05ea<\/th>\r\n                            <th>\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea<\/th>\r\n                        <\/tr>\r\n                    <\/thead>\r\n                    <tbody id=\"incomeList\"><\/tbody>\r\n                <\/table>\r\n            <\/div>\r\n            <canvas id=\"incomeByClientChart\"><\/canvas>\r\n        <\/div>\r\n\r\n        <div id=\"servicesTab\" class=\"tab-content\">\r\n            <h2>\u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd<\/h2>\r\n            <button onclick=\"showServiceModal()\">\u05d4\u05d5\u05e1\u05e3 \u05e9\u05d9\u05e8\u05d5\u05ea \u05d7\u05d3\u05e9<\/button>\r\n            <div class=\"table-responsive\">\r\n                <table id=\"servicesTable\">\r\n                    <thead>\r\n                        <tr>\r\n                            <th>\u05e9\u05dd \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea<\/th>\r\n                            <th>\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd<\/th>\r\n                            <th>\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd<\/th>\r\n                            <th>\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\u05d9\u05dd<\/th>\r\n                            <th>\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea<\/th>\r\n                        <\/tr>\r\n                    <\/thead>\r\n                    <tbody id=\"servicesList\"><\/tbody>\r\n                <\/table>\r\n            <\/div>\r\n            <canvas id=\"servicesChart\"><\/canvas>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"clientModal\" class=\"modal\">\r\n        <div class=\"modal-content\">\r\n            <span class=\"close\">&times;<\/span>\r\n            <h2 id=\"clientModalTitle\">\u05e4\u05e8\u05d8\u05d9 \u05dc\u05e7\u05d5\u05d7<\/h2>\r\n            <div id=\"clientDetails\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"appointmentModal\" class=\"modal\">\r\n        <div class=\"modal-content\">\r\n            <span class=\"close\">&times;<\/span>\r\n            <h2 id=\"appointmentModalTitle\">\u05e7\u05d1\u05d9\u05e2\u05ea \u05e4\u05d2\u05d9\u05e9\u05d4<\/h2>\r\n            <div id=\"appointmentDetails\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"incomeModal\" class=\"modal\">\r\n        <div class=\"modal-content\">\r\n            <span class=\"close\">&times;<\/span>\r\n            <h2 id=\"incomeModalTitle\">\u05d4\u05db\u05e0\u05e1\u05d4<\/h2>\r\n            <div id=\"incomeDetails\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"serviceModal\" class=\"modal\">\r\n        <div class=\"modal-content\">\r\n            <span class=\"close\">&times;<\/span>\r\n            <h2 id=\"serviceModalTitle\">\u05e9\u05d9\u05e8\u05d5\u05ea<\/h2>\r\n            <div id=\"serviceDetails\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d5\u05ea \u05dc\u05e9\u05de\u05d9\u05e8\u05d4 \u05d5\u05d8\u05e2\u05d9\u05e0\u05d4 \u05e9\u05dc \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05de-localStorage\r\n        function saveData(key, data) {\r\n            localStorage.setItem(key, JSON.stringify(data));\r\n        }\r\n\r\n        function loadData(key) {\r\n            const data = localStorage.getItem(key);\r\n            return data ? JSON.parse(data) : null;\r\n        }\r\n\r\n        \/\/ \u05d8\u05e2\u05d9\u05e0\u05ea \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05d1\u05e2\u05ea \u05d0\u05ea\u05d7\u05d5\u05dc \u05d4\u05d0\u05e4\u05dc\u05d9\u05e7\u05e6\u05d9\u05d4\r\n        let clients = loadData('clients') || [\r\n            { id: 1, name: \"\u05d9\u05e9\u05e8\u05d0\u05dc \u05d9\u05e9\u05e8\u05d0\u05dc\u05d9\", email: \"israel@example.com\", phone: \"050-1234567\", status: \"\u05e4\u05e2\u05d9\u05dc\", birthDate: \"1980-01-01\", income: 50000, services: [\"\u05d9\u05d9\u05e2\u05d5\u05e5 \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9\"] },\r\n            { id: 2, name: \"\u05e9\u05e8\u05d4 \u05db\u05d4\u05df\", email: \"sarah@example.com\", phone: \"052-7654321\", status: \"\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\", birthDate: \"1985-05-15\", income: 30000, services: [\"\u05ea\u05db\u05e0\u05d5\u05df \u05e4\u05e8\u05d9\u05e9\u05d4\"] },\r\n            { id: 3, name: \"\u05d3\u05d5\u05d3 \u05dc\u05d5\u05d9\", email: \"david@example.com\", phone: \"054-1112233\", status: \"\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\", birthDate: \"1990-12-31\", income: 0, services: [] }\r\n        ];\r\n\r\n        let appointments = loadData('appointments') || [\r\n            { id: 1, title: '\u05e4\u05d2\u05d9\u05e9\u05d4 \u05e2\u05dd \u05d9\u05e9\u05e8\u05d0\u05dc \u05d9\u05e9\u05e8\u05d0\u05dc\u05d9', start: '2024-09-10T10:00:00', end: '2024-09-10T11:00:00', clientId: 1 },\r\n            { id: 2, title: '\u05e4\u05d2\u05d9\u05e9\u05d4 \u05e2\u05dd \u05e9\u05e8\u05d4 \u05db\u05d4\u05df', start: '2024-09-15T14:00:00', end: '2024-09-15T15:00:00', clientId: 2 }\r\n        ];\r\n\r\n        let incomes = loadData('incomes') || [\r\n            { id: 1, clientId: 1, amount: 5000, date: '2024-09-01', service: '\u05d9\u05d9\u05e2\u05d5\u05e5 \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9' },\r\n            { id: 2, clientId: 2, amount: 3000, date: '2024-09-05', service: '\u05ea\u05db\u05e0\u05d5\u05df \u05e4\u05e8\u05d9\u05e9\u05d4' },\r\n            { id: 3, clientId: 1, amount: 2000, date: '2024-09-10', service: '\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4\u05e9\u05e7\u05e2\u05d5\u05ea' }\r\n        ];\r\n\r\n        let services = loadData('services') || [\r\n            { id: 1, name: '\u05d9\u05d9\u05e2\u05d5\u05e5 \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9', activeClients: 2, inactiveClients: 1, potentialClients: 0 },\r\n            { id: 2, name: '\u05ea\u05db\u05e0\u05d5\u05df \u05e4\u05e8\u05d9\u05e9\u05d4', activeClients: 1, inactiveClients: 1, potentialClients: 1 },\r\n            { id: 3, name: '\u05e0\u05d9\u05d4\u05d5\u05dc \u05d4\u05e9\u05e7\u05e2\u05d5\u05ea', activeClients: 1, inactiveClients: 0, potentialClients: 1 }\r\n        ];\r\n\r\n        let calendar;\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e8\u05d9\u05e0\u05d3\u05d5\u05e8 \u05e8\u05e9\u05d9\u05de\u05ea \u05d4\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea\r\n        function renderClientList() {\r\n            const clientsList = document.getElementById('clientsList');\r\n            clientsList.innerHTML = '';\r\n            clients.forEach(client => {\r\n                const row = document.createElement('tr');\r\n                row.innerHTML = `\r\n                    <td>${client.name}<\/td>\r\n                    <td>${client.email}<\/td>\r\n                    <td>${client.phone}<\/td>\r\n                    <td>${client.status}<\/td>\r\n                    <td>${client.services.join(', ')}<\/td>\r\n                    <td>\r\n                        <button onclick=\"showClientModal(${client.id})\">\u05e2\u05e8\u05d5\u05da<\/button>\r\n                        <button onclick=\"deleteClient(${client.id})\">\u05de\u05d7\u05e7<\/button>\r\n                    <\/td>\r\n                `;\r\n                clientsList.appendChild(row);\r\n            });\r\n            updateDashboard();\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05e6\u05d2\u05ea \u05de\u05d5\u05d3\u05dc \u05d4\u05d5\u05e1\u05e4\u05ea\/\u05e2\u05e8\u05d9\u05db\u05ea \u05dc\u05e7\u05d5\u05d7\r\n        function showClientModal(clientId = null) {\r\n            const modal = document.getElementById('clientModal');\r\n            const clientDetails = document.getElementById('clientDetails');\r\n            const isEdit = clientId !== null;\r\n            const client = isEdit ? clients.find(c => c.id === clientId) : null;\r\n            \r\n            document.getElementById('clientModalTitle').textContent = isEdit ? '\u05e2\u05e8\u05d9\u05db\u05ea \u05dc\u05e7\u05d5\u05d7' : '\u05d4\u05d5\u05e1\u05e4\u05ea \u05dc\u05e7\u05d5\u05d7 \u05d7\u05d3\u05e9';\r\n            \r\n            clientDetails.innerHTML = `\r\n                <form id=\"clientForm\">\r\n                    ${isEdit ? `<input type=\"hidden\" name=\"id\" value=\"${client.id}\">` : ''}\r\n                    <input type=\"text\" name=\"name\" placeholder=\"\u05e9\u05dd\" required ${isEdit ? `value=\"${client.name}\"` : ''}>\r\n                    <input type=\"email\" name=\"email\" placeholder=\"\u05d0\u05d9\u05de\u05d9\u05d9\u05dc\" required ${isEdit ? `value=\"${client.email}\"` : ''}>\r\n                    <input type=\"tel\" name=\"phone\" placeholder=\"\u05d8\u05dc\u05e4\u05d5\u05df\" required ${isEdit ? `value=\"${client.phone}\"` : ''}>\r\n                    <select name=\"status\" required>\r\n                        <option value=\"\u05e4\u05e2\u05d9\u05dc\" ${isEdit && client.status === '\u05e4\u05e2\u05d9\u05dc' ? 'selected' : ''}>\u05e4\u05e2\u05d9\u05dc<\/option>\r\n                        <option value=\"\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\" ${isEdit && client.status === '\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc' ? 'selected' : ''}>\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc<\/option>\r\n                        <option value=\"\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\" ${isEdit && client.status === '\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9' ? 'selected' : ''}>\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9<\/option>\r\n                    <\/select>\r\n                    <input type=\"date\" name=\"birthDate\" required ${isEdit ? `value=\"${client.birthDate}\"` : ''}>\r\n                    <input type=\"number\" name=\"income\" placeholder=\"\u05d4\u05db\u05e0\u05e1\u05d4\" required ${isEdit ? `value=\"${client.income}\"` : ''}>\r\n                    <div>\r\n                        <label>\u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd:<\/label>\r\n                        ${services.map(service => `\r\n                            <label>\r\n                                <input type=\"checkbox\" name=\"services\" value=\"${service.name}\" \r\n                                ${isEdit && client.services.includes(service.name) ? 'checked' : ''}>\r\n                                ${service.name}\r\n                            <\/label>\r\n                        `).join('')}\r\n                    <\/div>\r\n                    <button type=\"submit\">${isEdit ? '\u05e2\u05d3\u05db\u05df' : '\u05d4\u05d5\u05e1\u05e3'} \u05dc\u05e7\u05d5\u05d7<\/button>\r\n                <\/form>\r\n            `;\r\n            \r\n            modal.style.display = 'block';\r\n            document.getElementById('clientForm').onsubmit = isEdit ? updateClient : addClient;\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05d5\u05e1\u05e4\u05ea \u05dc\u05e7\u05d5\u05d7 \u05d7\u05d3\u05e9\r\n        function addClient(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const newClient = {\r\n                id: clients.length > 0 ? Math.max(...clients.map(c => c.id)) + 1 : 1,\r\n                name: form.name.value,\r\n                email: form.email.value,\r\n                phone: form.phone.value,\r\n                status: form.status.value,\r\n                birthDate: form.birthDate.value,\r\n                income: parseInt(form.income.value),\r\n                services: Array.from(form.services).filter(s => s.checked).map(s => s.value)\r\n            };\r\n            clients.push(newClient);\r\n            saveData('clients', clients);\r\n            renderClientList();\r\n            document.getElementById('clientModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05dc\u05e7\u05d5\u05d7 \u05e7\u05d9\u05d9\u05dd\r\n        function updateClient(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const updatedClient = {\r\n                id: parseInt(form.id.value),\r\n                name: form.name.value,\r\n                email: form.email.value,\r\n                phone: form.phone.value,\r\n                status: form.status.value,\r\n                birthDate: form.birthDate.value,\r\n                income: parseInt(form.income.value),\r\n                services: Array.from(form.services).filter(s => s.checked).map(s => s.value)\r\n            };\r\n            const index = clients.findIndex(c => c.id === updatedClient.id);\r\n            clients[index] = updatedClient;\r\n            saveData('clients', clients);\r\n            renderClientList();\r\n            document.getElementById('clientModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05de\u05d7\u05d9\u05e7\u05ea \u05dc\u05e7\u05d5\u05d7\r\n        function deleteClient(clientId) {\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                clients = clients.filter(c => c.id !== clientId);\r\n                saveData('clients', clients);\r\n                renderClientList();\r\n            }\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05e6\u05d2\u05ea \u05de\u05d5\u05d3\u05dc \u05d4\u05d5\u05e1\u05e4\u05ea\/\u05e2\u05e8\u05d9\u05db\u05ea \u05e4\u05d2\u05d9\u05e9\u05d4\r\n        function showAppointmentModal(appointmentId = null, date = null) {\r\n            const modal = document.getElementById('appointmentModal');\r\n            const appointmentDetails = document.getElementById('appointmentDetails');\r\n            const isEdit = appointmentId !== null;\r\n            let appointment = null;\r\n\r\n            if (isEdit) {\r\n                appointment = appointments.find(a => a.id == appointmentId);\r\n            }\r\n            \r\n            document.getElementById('appointmentModalTitle').textContent = isEdit ? '\u05e2\u05e8\u05d9\u05db\u05ea \u05e4\u05d2\u05d9\u05e9\u05d4' : '\u05e7\u05d1\u05d9\u05e2\u05ea \u05e4\u05d2\u05d9\u05e9\u05d4 \u05d7\u05d3\u05e9\u05d4';\r\n            \r\n            appointmentDetails.innerHTML = `\r\n                <form id=\"appointmentForm\">\r\n                    ${isEdit ? `<input type=\"hidden\" name=\"id\" value=\"${appointment.id}\">` : ''}\r\n                    <input type=\"text\" name=\"title\" placeholder=\"\u05db\u05d5\u05ea\u05e8\u05ea \u05d4\u05e4\u05d2\u05d9\u05e9\u05d4\" required ${isEdit ? `value=\"${appointment.title}\"` : ''}>\r\n                    <select name=\"clientId\" required>\r\n                        <option value=\"\">\u05d1\u05d7\u05e8 \u05dc\u05e7\u05d5\u05d7<\/option>\r\n                        ${clients.map(client => `<option value=\"${client.id}\" ${isEdit && client.id == appointment.clientId ? 'selected' : ''}>${client.name}<\/option>`).join('')}\r\n                    <\/select>\r\n                    <input type=\"datetime-local\" name=\"start\" required ${isEdit ? `value=\"${appointment.start.slice(0, 16)}\"` : date ? `value=\"${date}T09:00\"` : ''}>\r\n                    <input type=\"datetime-local\" name=\"end\" required ${isEdit ? `value=\"${appointment.end.slice(0, 16)}\"` : date ? `value=\"${date}T10:00\"` : ''}>\r\n                    <button type=\"submit\">${isEdit ? '\u05e2\u05d3\u05db\u05df' : '\u05e7\u05d1\u05e2'} \u05e4\u05d2\u05d9\u05e9\u05d4<\/button>\r\n                    ${isEdit ? '<button type=\"button\" onclick=\"deleteAppointment(' + appointment.id + ')\">\u05de\u05d7\u05e7 \u05e4\u05d2\u05d9\u05e9\u05d4<\/button>' : ''}\r\n                <\/form>\r\n            `;\r\n            \r\n            modal.style.display = 'block';\r\n            document.getElementById('appointmentForm').onsubmit = isEdit ? updateAppointment : addAppointment;\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05d5\u05e1\u05e4\u05ea \u05e4\u05d2\u05d9\u05e9\u05d4 \u05d7\u05d3\u05e9\u05d4\r\n        function addAppointment(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const newAppointment = {\r\n                id: appointments.length > 0 ? Math.max(...appointments.map(a => a.id)) + 1 : 1,\r\n                title: form.title.value,\r\n                clientId: parseInt(form.clientId.value),\r\n                start: form.start.value,\r\n                end: form.end.value\r\n            };\r\n            appointments.push(newAppointment);\r\n            saveData('appointments', appointments);\r\n            calendar.addEvent(newAppointment);\r\n            document.getElementById('appointmentModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05e4\u05d2\u05d9\u05e9\u05d4 \u05e7\u05d9\u05d9\u05de\u05ea\r\n        function updateAppointment(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const updatedAppointment = {\r\n                id: parseInt(form.id.value),\r\n                title: form.title.value,\r\n                clientId: parseInt(form.clientId.value),\r\n                start: form.start.value,\r\n                end: form.end.value\r\n            };\r\n            const index = appointments.findIndex(a => a.id === updatedAppointment.id);\r\n            appointments[index] = updatedAppointment;\r\n            saveData('appointments', appointments);\r\n            \r\n            \/\/ \u05e2\u05d3\u05db\u05d5\u05df \u05d4\u05d0\u05d9\u05e8\u05d5\u05e2 \u05d1\u05dc\u05d5\u05d7 \u05d4\u05e9\u05e0\u05d4\r\n            const event = calendar.getEventById(updatedAppointment.id);\r\n            if (event) {\r\n                event.remove();\r\n            }\r\n            calendar.addEvent(updatedAppointment);\r\n            \r\n            document.getElementById('appointmentModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05de\u05d7\u05d9\u05e7\u05ea \u05e4\u05d2\u05d9\u05e9\u05d4\r\n        function deleteAppointment(appointmentId) {\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 \u05e4\u05d2\u05d9\u05e9\u05d4 \u05d6\u05d5?')) {\r\n                appointments = appointments.filter(a => a.id !== appointmentId);\r\n                saveData('appointments', appointments);\r\n                \r\n                \/\/ \u05d4\u05e1\u05e8\u05ea \u05d4\u05d0\u05d9\u05e8\u05d5\u05e2 \u05de\u05dc\u05d5\u05d7 \u05d4\u05e9\u05e0\u05d4\r\n                const event = calendar.getEventById(appointmentId);\r\n                if (event) {\r\n                    event.remove();\r\n                }\r\n                \r\n                document.getElementById('appointmentModal').style.display = 'none';\r\n            }\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05e6\u05d2\u05ea \u05de\u05d5\u05d3\u05dc \u05d4\u05d5\u05e1\u05e4\u05ea\/\u05e2\u05e8\u05d9\u05db\u05ea \u05d4\u05db\u05e0\u05e1\u05d4\r\n        function showIncomeModal(incomeId = null) {\r\n            const modal = document.getElementById('incomeModal');\r\n            const incomeDetails = document.getElementById('incomeDetails');\r\n            const isEdit = incomeId !== null;\r\n            const income = isEdit ? incomes.find(i => i.id === incomeId) : null;\r\n            \r\n            document.getElementById('incomeModalTitle').textContent = isEdit ? '\u05e2\u05e8\u05d9\u05db\u05ea \u05d4\u05db\u05e0\u05e1\u05d4' : '\u05d4\u05d5\u05e1\u05e4\u05ea \u05d4\u05db\u05e0\u05e1\u05d4 \u05d7\u05d3\u05e9\u05d4';\r\n            \r\n            incomeDetails.innerHTML = `\r\n                <form id=\"incomeForm\">\r\n                    ${isEdit ? `<input type=\"hidden\" name=\"id\" value=\"${income.id}\">` : ''}\r\n                    <select name=\"clientId\" required>\r\n                        <option value=\"\">\u05d1\u05d7\u05e8 \u05dc\u05e7\u05d5\u05d7<\/option>\r\n                        ${clients.map(client => `<option value=\"${client.id}\" ${isEdit && client.id === income.clientId ? 'selected' : ''}>${client.name}<\/option>`).join('')}\r\n                    <\/select>\r\n                    <input type=\"number\" name=\"amount\" placeholder=\"\u05e1\u05db\u05d5\u05dd\" required ${isEdit ? `value=\"${income.amount}\"` : ''}>\r\n                    <input type=\"date\" name=\"date\" required ${isEdit ? `value=\"${income.date}\"` : ''}>\r\n                    <select name=\"service\" required>\r\n                        <option value=\"\">\u05d1\u05d7\u05e8 \u05e9\u05d9\u05e8\u05d5\u05ea<\/option>\r\n                        ${services.map(service => `<option value=\"${service.name}\" ${isEdit && service.name === income.service ? 'selected' : ''}>${service.name}<\/option>`).join('')}\r\n                    <\/select>\r\n                    <button type=\"submit\">${isEdit ? '\u05e2\u05d3\u05db\u05df' : '\u05d4\u05d5\u05e1\u05e3'} \u05d4\u05db\u05e0\u05e1\u05d4<\/button>\r\n                <\/form>\r\n            `;\r\n            \r\n            modal.style.display = 'block';\r\n            document.getElementById('incomeForm').onsubmit = isEdit ? updateIncome : addIncome;\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05d5\u05e1\u05e4\u05ea \u05d4\u05db\u05e0\u05e1\u05d4 \u05d7\u05d3\u05e9\u05d4\r\n        function addIncome(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const newIncome = {\r\n                id: incomes.length > 0 ? Math.max(...incomes.map(i => i.id)) + 1 : 1,\r\n                clientId: parseInt(form.clientId.value),\r\n                amount: parseFloat(form.amount.value),\r\n                date: form.date.value,\r\n                service: form.service.value\r\n            };\r\n            incomes.push(newIncome);\r\n            saveData('incomes', incomes);\r\n            renderIncomeList();\r\n            document.getElementById('incomeModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05d4\u05db\u05e0\u05e1\u05d4 \u05e7\u05d9\u05d9\u05de\u05ea\r\n        function updateIncome(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const updatedIncome = {\r\n                id: parseInt(form.id.value),\r\n                clientId: parseInt(form.clientId.value),\r\n                amount: parseFloat(form.amount.value),\r\n                date: form.date.value,\r\n                service: form.service.value\r\n            };\r\n            const index = incomes.findIndex(i => i.id === updatedIncome.id);\r\n            incomes[index] = updatedIncome;\r\n            saveData('incomes', incomes);\r\n            renderIncomeList();\r\n            document.getElementById('incomeModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05e6\u05d2\u05ea \u05de\u05d5\u05d3\u05dc \u05d4\u05d5\u05e1\u05e4\u05ea\/\u05e2\u05e8\u05d9\u05db\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea\r\n        function showServiceModal(serviceId = null) {\r\n            const modal = document.getElementById('serviceModal');\r\n            const serviceDetails = document.getElementById('serviceDetails');\r\n            const isEdit = serviceId !== null;\r\n            const service = isEdit ? services.find(s => s.id === serviceId) : null;\r\n            \r\n            document.getElementById('serviceModalTitle').textContent = isEdit ? '\u05e2\u05e8\u05d9\u05db\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea' : '\u05d4\u05d5\u05e1\u05e4\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea \u05d7\u05d3\u05e9';\r\n            \r\n            serviceDetails.innerHTML = `\r\n                <form id=\"serviceForm\">\r\n                    ${isEdit ? `<input type=\"hidden\" name=\"id\" value=\"${service.id}\">` : ''}\r\n                    <input type=\"text\" name=\"name\" placeholder=\"\u05e9\u05dd \u05d4\u05e9\u05d9\u05e8\u05d5\u05ea\" required ${isEdit ? `value=\"${service.name}\"` : ''}>\r\n                    <input type=\"number\" name=\"activeClients\" placeholder=\"\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd\" required ${isEdit ? `value=\"${service.activeClients}\"` : ''}>\r\n                    <input type=\"number\" name=\"inactiveClients\" placeholder=\"\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd\" required ${isEdit ? `value=\"${service.inactiveClients}\"` : ''}>\r\n                    <input type=\"number\" name=\"potentialClients\" placeholder=\"\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\u05d9\u05dd\" required ${isEdit ? `value=\"${service.potentialClients}\"` : ''}>\r\n                    <button type=\"submit\">${isEdit ? '\u05e2\u05d3\u05db\u05df' : '\u05d4\u05d5\u05e1\u05e3'} \u05e9\u05d9\u05e8\u05d5\u05ea<\/button>\r\n                <\/form>\r\n            `;\r\n            \r\n            modal.style.display = 'block';\r\n            document.getElementById('serviceForm').onsubmit = isEdit ? updateService : addService;\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d4\u05d5\u05e1\u05e4\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea \u05d7\u05d3\u05e9\r\n        function addService(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const newService = {\r\n                id: services.length > 0 ? Math.max(...services.map(s => s.id)) + 1 : 1,\r\n                name: form.name.value,\r\n                activeClients: parseInt(form.activeClients.value),\r\n                inactiveClients: parseInt(form.inactiveClients.value),\r\n                potentialClients: parseInt(form.potentialClients.value)\r\n            };\r\n            services.push(newService);\r\n            saveData('services', services);\r\n            renderServicesList();\r\n            document.getElementById('serviceModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05e9\u05d9\u05e8\u05d5\u05ea \u05e7\u05d9\u05d9\u05dd\r\n        function updateService(e) {\r\n            e.preventDefault();\r\n            const form = e.target;\r\n            const updatedService = {\r\n                id: parseInt(form.id.value),\r\n                name: form.name.value,\r\n                activeClients: parseInt(form.activeClients.value),\r\n                inactiveClients: parseInt(form.inactiveClients.value),\r\n                potentialClients: parseInt(form.potentialClients.value)\r\n            };\r\n            const index = services.findIndex(s => s.id === updatedService.id);\r\n            services[index] = updatedService;\r\n            saveData('services', services);\r\n            renderServicesList();\r\n            document.getElementById('serviceModal').style.display = 'none';\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05d4\u05d3\u05e9\u05d1\u05d5\u05e8\u05d3\r\n        function updateDashboard() {\r\n            document.getElementById('totalClients').textContent = clients.length;\r\n            document.getElementById('activeClients').textContent = clients.filter(c => c.status === '\u05e4\u05e2\u05d9\u05dc').length;\r\n            document.getElementById('inactiveClients').textContent = clients.filter(c => c.status === '\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc').length;\r\n            document.getElementById('potentialClients').textContent = clients.filter(c => c.status === '\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9').length;\r\n            \r\n            const totalIncome = incomes.reduce((sum, income) => sum + income.amount, 0);\r\n            document.getElementById('totalIncome').textContent = `\u20aa${totalIncome}`;\r\n\r\n            updateClientStatusChart();\r\n            updateIncomeChart();\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05d2\u05e8\u05e3 \u05e1\u05d8\u05d8\u05d5\u05e1 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea\r\n        function updateClientStatusChart() {\r\n            const ctx = document.getElementById('clientStatusChart').getContext('2d');\r\n            new Chart(ctx, {\r\n                type: 'pie',\r\n                data: {\r\n                    labels: ['\u05e4\u05e2\u05d9\u05dc', '\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc', '\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9'],\r\n                    datasets: [{\r\n                        data: [\r\n                            clients.filter(c => c.status === '\u05e4\u05e2\u05d9\u05dc').length,\r\n                            clients.filter(c => c.status === '\u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc').length,\r\n                            clients.filter(c => c.status === '\u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9').length\r\n                        ],\r\n                        backgroundColor: ['#36a2eb', '#ff6384', '#ffce56']\r\n                    }]\r\n                },\r\n                options: {\r\n                    responsive: true,\r\n                    title: {\r\n                        display: true,\r\n                        text: '\u05e1\u05d8\u05d8\u05d5\u05e1 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea'\r\n                    }\r\n                }\r\n            });\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05d2\u05e8\u05e3 \u05d4\u05db\u05e0\u05e1\u05d5\u05ea\r\n        function updateIncomeChart() {\r\n            const ctx = document.getElementById('incomeChart').getContext('2d');\r\n            const monthlyIncome = Array(12).fill(0);\r\n            incomes.forEach(income => {\r\n                const month = new Date(income.date).getMonth();\r\n                monthlyIncome[month] += income.amount;\r\n            });\r\n            new Chart(ctx, {\r\n                type: 'bar',\r\n                data: {\r\n                    labels: ['\u05d9\u05e0\u05d5\u05d0\u05e8', '\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8', '\u05de\u05e8\u05e5', '\u05d0\u05e4\u05e8\u05d9\u05dc', '\u05de\u05d0\u05d9', '\u05d9\u05d5\u05e0\u05d9', '\u05d9\u05d5\u05dc\u05d9', '\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8', '\u05e1\u05e4\u05d8\u05de\u05d1\u05e8', '\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8', '\u05e0\u05d5\u05d1\u05de\u05d1\u05e8', '\u05d3\u05e6\u05de\u05d1\u05e8'],\r\n                    datasets: [{\r\n                        label: '\u05d4\u05db\u05e0\u05e1\u05d4 \u05d7\u05d5\u05d3\u05e9\u05d9\u05ea',\r\n                        data: monthlyIncome,\r\n                        backgroundColor: '#36a2eb'\r\n                    }]\r\n                },\r\n                options: {\r\n                    responsive: true,\r\n                    title: {\r\n                        display: true,\r\n                        text: '\u05d4\u05db\u05e0\u05e1\u05d4 \u05d7\u05d5\u05d3\u05e9\u05d9\u05ea'\r\n                    },\r\n                    scales: {\r\n                        y: {\r\n                            beginAtZero: true\r\n                        }\r\n                    }\r\n                }\r\n            });\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e8\u05d9\u05e0\u05d3\u05d5\u05e8 \u05e8\u05e9\u05d9\u05de\u05ea \u05d4\u05db\u05e0\u05e1\u05d5\u05ea\r\n        function renderIncomeList() {\r\n            const incomeList = document.getElementById('incomeList');\r\n            incomeList.innerHTML = '';\r\n            incomes.forEach(income => {\r\n                const client = clients.find(c => c.id === income.clientId);\r\n                const row = document.createElement('tr');\r\n                row.innerHTML = `\r\n                    <td>${client ? client.name : '\u05dc\u05e7\u05d5\u05d7 \u05dc\u05d0 \u05d9\u05d3\u05d5\u05e2'}<\/td>\r\n                    <td>\u20aa${income.amount}<\/td>\r\n                    <td>${income.date}<\/td>\r\n                    <td>${income.service}<\/td>\r\n                    <td>\r\n                        <button onclick=\"showIncomeModal(${income.id})\">\u05e2\u05e8\u05d5\u05da<\/button>\r\n                        <button onclick=\"deleteIncome(${income.id})\">\u05de\u05d7\u05e7<\/button>\r\n                    <\/td>\r\n                `;\r\n                incomeList.appendChild(row);\r\n            });\r\n            updateIncomeByClientChart();\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05de\u05d7\u05d9\u05e7\u05ea \u05d4\u05db\u05e0\u05e1\u05d4\r\n        function deleteIncome(incomeId) {\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 \u05d4\u05db\u05e0\u05e1\u05d4 \u05d6\u05d5?')) {\r\n                incomes = incomes.filter(i => i.id !== incomeId);\r\n                saveData('incomes', incomes);\r\n                renderIncomeList();\r\n            }\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05d2\u05e8\u05e3 \u05d4\u05db\u05e0\u05e1\u05d5\u05ea \u05dc\u05e4\u05d9 \u05dc\u05e7\u05d5\u05d7\r\n        function updateIncomeByClientChart() {\r\n            const ctx = document.getElementById('incomeByClientChart').getContext('2d');\r\n            const incomeByClient = {};\r\n            incomes.forEach(income => {\r\n                const client = clients.find(c => c.id === income.clientId);\r\n                if (client) {\r\n                    incomeByClient[client.name] = (incomeByClient[client.name] || 0) + income.amount;\r\n                }\r\n            });\r\n            new Chart(ctx, {\r\n                type: 'pie',\r\n                data: {\r\n                    labels: Object.keys(incomeByClient),\r\n                    datasets: [{\r\n                        data: Object.values(incomeByClient),\r\n                        backgroundColor: ['#36a2eb', '#ff6384', '#ffce56', '#4bc0c0', '#9966ff']\r\n                    }]\r\n                },\r\n                options: {\r\n                    responsive: true,\r\n                    title: {\r\n                        display: true,\r\n                        text: '\u05d4\u05db\u05e0\u05e1\u05d4 \u05dc\u05e4\u05d9 \u05dc\u05e7\u05d5\u05d7'\r\n                    }\r\n                }\r\n            });\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e8\u05d9\u05e0\u05d3\u05d5\u05e8 \u05e8\u05e9\u05d9\u05de\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd\r\n        function renderServicesList() {\r\n            const servicesList = document.getElementById('servicesList');\r\n            servicesList.innerHTML = '';\r\n            services.forEach(service => {\r\n                const row = document.createElement('tr');\r\n                row.innerHTML = `\r\n                    <td>${service.name}<\/td>\r\n                    <td>${service.activeClients}<\/td>\r\n                    <td>${service.inactiveClients}<\/td>\r\n                    <td>${service.potentialClients}<\/td>\r\n                    <td>\r\n                        <button onclick=\"showServiceModal(${service.id})\">\u05e2\u05e8\u05d5\u05da<\/button>\r\n                        <button onclick=\"deleteService(${service.id})\">\u05de\u05d7\u05e7<\/button>\r\n                    <\/td>\r\n                `;\r\n                servicesList.appendChild(row);\r\n            });\r\n            updateServicesChart();\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05de\u05d7\u05d9\u05e7\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea\r\n        function deleteService(serviceId) {\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 \u05e9\u05d9\u05e8\u05d5\u05ea \u05d6\u05d4?')) {\r\n                services = services.filter(s => s.id !== serviceId);\r\n                saveData('services', services);\r\n                renderServicesList();\r\n            }\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e2\u05d3\u05db\u05d5\u05df \u05d2\u05e8\u05e3 \u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd\r\n        function updateServicesChart() {\r\n            const ctx = document.getElementById('servicesChart').getContext('2d');\r\n            new Chart(ctx, {\r\n                type: 'bar',\r\n                data: {\r\n                    labels: services.map(s => s.name),\r\n                    datasets: [\r\n                        {\r\n                            label: '\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd',\r\n                            data: services.map(s => s.activeClients),\r\n                            backgroundColor: '#36a2eb'\r\n                        },\r\n                        {\r\n                            label: '\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd',\r\n                            data: services.map(s => s.inactiveClients),\r\n                            backgroundColor: '#ff6384'\r\n                        },\r\n                        {\r\n                            label: '\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\u05d9\u05dd',\r\n                            data: services.map(s => s.potentialClients),\r\n                            backgroundColor: '#ffce56'\r\n                        }\r\n                    ]\r\n                },\r\n                options: {\r\n                    responsive: true,\r\n                    title: {\r\n                        display: true,\r\n                        text: '\u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05dc\u05e4\u05d9 \u05e9\u05d9\u05e8\u05d5\u05ea'\r\n                    },\r\n                    scales: {\r\n                        y: {\r\n                            beginAtZero: true\r\n                        }\r\n                    }\r\n                }\r\n            });\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05d0\u05ea\u05d7\u05d5\u05dc \u05dc\u05d5\u05d7 \u05d4\u05e9\u05e0\u05d4\r\n        function initCalendar() {\r\n            const calendarEl = document.getElementById('calendar');\r\n            calendar = new FullCalendar.Calendar(calendarEl, {\r\n                initialView: window.innerWidth < 768 ? 'listWeek' : 'dayGridMonth',\r\n                headerToolbar: {\r\n                    left: 'prev,next today',\r\n                    center: 'title',\r\n                    right: window.innerWidth < 768 ? 'listWeek,dayGridMonth' : 'dayGridMonth,timeGridWeek,timeGridDay'\r\n                },\r\n                events: appointments,\r\n                eventClick: function(info) {\r\n                    showAppointmentModal(info.event.id);\r\n                },\r\n                dateClick: function(info) {\r\n                    showAppointmentModal(null, info.dateStr);\r\n                },\r\n                eventContent: function(arg) {\r\n                    return {\r\n                        html: `<b>${arg.timeText}<\/b><br>${arg.event.title}`\r\n                    };\r\n                }\r\n            });\r\n            calendar.render();\r\n\r\n            \/\/ \u05d4\u05d5\u05e1\u05e4\u05ea \u05d7\u05d2\u05d9\u05dd \u05d9\u05d4\u05d5\u05d3\u05d9\u05d9\u05dd\r\n            const hebrewEvents = [];\r\n            const year = new Date().getFullYear();\r\n            const events = window.Hebcal.calendar({\r\n                year: year,\r\n                isHebrewYear: false,\r\n                candlelighting: false,\r\n                location: window.Hebcal.Location.lookup('Jerusalem'),\r\n                sedrot: false,\r\n                omer: false\r\n            });\r\n\r\n            events.forEach(ev => {\r\n                if (ev.getFlags().includes(window.Hebcal.flags.ROSH_CHODESH) || ev.getDesc().includes('\u05d7\u05e0\u05d5\u05db\u05d4') || ev.getFlags().includes(window.Hebcal.flags.YOM_TOV_ENDS)) {\r\n                    return; \/\/ \u05d3\u05d9\u05dc\u05d5\u05d2 \u05e2\u05dc \u05e8\u05d0\u05e9\u05d9 \u05d7\u05d5\u05d3\u05e9\u05d9\u05dd, \u05d7\u05e0\u05d5\u05db\u05d4 \u05d5\u05e1\u05d9\u05d5\u05dd \u05d7\u05d2\r\n                }\r\n                hebrewEvents.push({\r\n                    title: ev.render('he'),\r\n                    start: ev.getDate().toISOString().split('T')[0],\r\n                    allDay: true,\r\n                    backgroundColor: 'lightgray',\r\n                    borderColor: 'gray',\r\n                    textColor: 'black'\r\n                });\r\n            });\r\n\r\n            calendar.addEventSource(hebrewEvents);\r\n        }\r\n\r\n        \/\/ \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05dc\u05e4\u05ea\u05d9\u05d7\u05ea \u05dc\u05e9\u05d5\u05e0\u05d9\u05ea\r\n        function openTab(evt, tabName) {\r\n            const tabContents = document.getElementsByClassName(\"tab-content\");\r\n            for (let i = 0; i < tabContents.length; i++) {\r\n                tabContents[i].style.display = \"none\";\r\n            }\r\n            const tabs = document.getElementsByClassName(\"tab\");\r\n            for (let i = 0; i < tabs.length; i++) {\r\n                tabs[i].className = tabs[i].className.replace(\" active\", \"\");\r\n            }\r\n            document.getElementById(tabName).style.display = \"block\";\r\n            evt.currentTarget.className += \" active\";\r\n        }\r\n\r\n        \/\/ \u05e1\u05d2\u05d9\u05e8\u05ea \u05de\u05d5\u05d3\u05dc \u05d1\u05dc\u05d7\u05d9\u05e6\u05d4 \u05e2\u05dc X\r\n        document.querySelectorAll('.close').forEach(closeBtn => {\r\n            closeBtn.onclick = function() {\r\n                this.closest('.modal').style.display = 'none';\r\n            }\r\n        });\r\n\r\n        \/\/ \u05e1\u05d2\u05d9\u05e8\u05ea \u05de\u05d5\u05d3\u05dc \u05d1\u05dc\u05d7\u05d9\u05e6\u05d4 \u05de\u05d7\u05d5\u05e5 \u05dc\u05de\u05d5\u05d3\u05dc\r\n        window.onclick = function(event) {\r\n            if (event.target.className === 'modal') {\r\n                event.target.style.display = 'none';\r\n            }\r\n        }\r\n\r\n        \/\/ \u05e2\u05d3\u05db\u05d5\u05df \u05ea\u05e6\u05d5\u05d2\u05ea \u05dc\u05d5\u05d7 \u05d4\u05e9\u05e0\u05d4 \u05d1\u05e2\u05ea \u05e9\u05d9\u05e0\u05d5\u05d9 \u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05e1\u05da\r\n        window.addEventListener('resize', function() {\r\n            if (calendar) {\r\n                if (window.innerWidth < 768) {\r\n                    calendar.changeView('listWeek');\r\n                } else {\r\n                    calendar.changeView('dayGridMonth');\r\n                }\r\n            }\r\n        });\r\n\r\n        \/\/ \u05d0\u05ea\u05d7\u05d5\u05dc \u05d4\u05d0\u05e4\u05dc\u05d9\u05e7\u05e6\u05d9\u05d4\r\n        renderClientList();\r\n        renderIncomeList();\r\n        renderServicesList();\r\n        initCalendar();\r\n    <\/script>\r\n<\/body>\r\n<\/html>\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>\u05de\u05e2\u05e8\u05db\u05ea CRM \u05de\u05e7\u05d9\u05e4\u05d4 \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9\u05d9\u05dd \u05d3\u05e9\u05d1\u05d5\u05e8\u05d3 CRM \u05dc\u05e0\u05d9\u05d4\u05d5\u05dc \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d9\u05e0\u05e0\u05e1\u05d9\u05d9\u05dd \u05e1\u05da \u05d4\u05db\u05dc \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea 0 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd 0 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05dc\u05d0 \u05e4\u05e2\u05d9\u05dc\u05d9\u05dd 0 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d5\u05d8\u05e0\u05e6\u05d9\u05d0\u05dc\u05d9\u05d9\u05dd 0 \u05e1\u05da \u05d4\u05db\u05dc \u05d4\u05db\u05e0\u05e1\u05d5\u05ea \u20aa0 \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05e4\u05d2\u05d9\u05e9\u05d5\u05ea \u05d4\u05db\u05e0\u05e1\u05d5\u05ea \u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd \u05e8\u05e9\u05d9\u05de\u05ea \u05dc\u05e7\u05d5\u05d7\u05d5\u05ea \u05d4\u05d5\u05e1\u05e3 \u05dc\u05e7\u05d5\u05d7 \u05d7\u05d3\u05e9 \u05e9\u05dd \u05d0\u05d9\u05de\u05d9\u05d9\u05dc \u05d8\u05dc\u05e4\u05d5\u05df \u05e1\u05d8\u05d8\u05d5\u05e1 \u05e9\u05d9\u05e8\u05d5\u05ea\u05d9\u05dd \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d9\u05d5\u05de\u05df \u05e4\u05d2\u05d9\u05e9\u05d5\u05ea \u05e7\u05d1\u05e2 \u05e4\u05d2\u05d9\u05e9\u05d4 \u05d7\u05d3\u05e9\u05d4 \u05d4\u05db\u05e0\u05e1\u05d5\u05ea \u05d4\u05d5\u05e1\u05e3 \u05d4\u05db\u05e0\u05e1\u05d4 \u05d7\u05d3\u05e9\u05d4 \u05dc\u05e7\u05d5\u05d7 \u05e1\u05db\u05d5\u05dd [&hellip;]<\/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-8395","page","type-page","status-publish","hentry"],"ams_acf":[],"_links":{"self":[{"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages\/8395","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=8395"}],"version-history":[{"count":18,"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages\/8395\/revisions"}],"predecessor-version":[{"id":8429,"href":"https:\/\/digitalrise.art\/index.php?rest_route=\/wp\/v2\/pages\/8395\/revisions\/8429"}],"wp:attachment":[{"href":"https:\/\/digitalrise.art\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}