INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(2876, 464, '_elementor_data', '[{\"id\":\"16ea7a2f\",\"elType\":\"section\",\"settings\":{\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"72ac61a0\",\"elType\":\"column\",\"settings\":{\"_column_size\":100,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"2630643c\",\"elType\":\"widget\",\"settings\":{\"shortcode\":\"[gravityform id=\\\"4\\\" title=\\\"false\\\" description=\\\"false\\\" ajax=\\\"true\\\"]\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"shortcode\"}],\"isInner\":false}],\"isInner\":false},{\"id\":\"e61174d\",\"elType\":\"section\",\"settings\":{\"structure\":\"30\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"4165740\",\"elType\":\"column\",\"settings\":{\"_column_size\":33,\"_inline_size\":null,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"isInner\":false},{\"id\":\"81f2db3\",\"elType\":\"column\",\"settings\":{\"_column_size\":33,\"_inline_size\":null,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"isInner\":false},{\"id\":\"ce0b7f6\",\"elType\":\"column\",\"settings\":{\"_column_size\":33,\"_inline_size\":null,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"0aec4e7\",\"elType\":\"widget\",\"settings\":{\"text\":\"Anuluj\",\"link\":{\"url\":\"https:\\/\\/live-biegi.sport-timing.pl\\/panel\\/\",\"is_external\":\"\",\"nofollow\":\"\",\"custom_attributes\":\"\"},\"align\":\"center\",\"background_color\":\"#CE6161\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"button\"}],\"isInner\":false}],\"isInner\":false},{\"id\":\"4b62136\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"a0f0252\",\"elType\":\"widget\",\"settings\":{\"html\":\"    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\n    <style>\\n        table {\\n            width: 100%;\\n            border-collapse: collapse;\\n            margin-top: 20px;\\n        }\\n        th, td {\\n            border: 1px solid #ccc;\\n            padding: 8px;\\n            text-align: left;\\n        }\\n        th {\\n            background-color: #f4f4f4;\\n        }\\n        input[type=\\\"text\\\"], select {\\n            width: 100%;\\n            box-sizing: border-box;\\n        }\\n    <\\/style>\\n\\n<div class=\\\"container mt-5\\\">\\n    <h1 class=\\\"mb-4\\\">Enter Athlete Data<\\/h1>\\n\\n    <!-- Information Card -->\\n    <div id=\\\"statusCard\\\" class=\\\"card d-none\\\">\\n        <div class=\\\"card-body\\\">\\n            <h5 id=\\\"statusTitle\\\" class=\\\"card-title\\\"><\\/h5>\\n            <p id=\\\"statusMessage\\\" class=\\\"card-text\\\"><\\/p>\\n        <\\/div>\\n    <\\/div>\\n\\n    <!-- Form -->\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\n        <div class=\\\"mb-3\\\">\\n            <label for=\\\"csvFileInput\\\" class=\\\"form-label\\\">Upload CSV File<\\/label>\\n            <input type=\\\"file\\\" id=\\\"csvFileInput\\\" class=\\\"form-control\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\n        <\\/div>\\n\\n        <table class=\\\"table table-bordered\\\">\\n            <thead class=\\\"table-light\\\">\\n                <tr>\\n                    <th>BIP<\\/th>\\n                    <th>First Name<\\/th>\\n                    <th>Last Name<\\/th>\\n                    <th>Gender<\\/th>\\n                    <th>FIS Code<\\/th>\\n                    <th>Licence Code<\\/th>\\n                    <th>Licence Type<\\/th>\\n                    <th>Klub<\\/th>\\n                    <th>Country<\\/th>\\n                    <th>Date of Birth<\\/th>\\n                    <th>Category<\\/th>\\n                    <th>Actions<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <!-- Rows will be dynamically added -->\\n            <\\/tbody>\\n        <\\/table>\\n        <button type=\\\"button\\\" class=\\\"btn btn-primary mb-3\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\n        <button type=\\\"submit\\\" class=\\\"btn btn-success\\\">Submit<\\/button>\\n    <\\/form>\\n<\\/div>\\n\\n<script>\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\n\\n    \\/\\/ Show status card\\n    function showStatusCard(title, message, isSuccess) {\\n        const statusCard = document.getElementById(\\\"statusCard\\\");\\n        const statusTitle = document.getElementById(\\\"statusTitle\\\");\\n        const statusMessage = document.getElementById(\\\"statusMessage\\\");\\n\\n        statusCard.className = `card ${isSuccess ? \\\"bg-success\\\" : \\\"bg-danger\\\"} text-white`;\\n        statusTitle.textContent = title;\\n        statusMessage.textContent = message;\\n        statusCard.classList.remove(\\\"d-none\\\");\\n    }\\n\\n    \\/\\/ Function to validate unique BIP\\n    function isBipUnique(bip) {\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\n        const duplicateCount = bips.filter(existingBip => existingBip === bip).length;\\n        return duplicateCount <= 1; \\/\\/ A BIP is unique if it appears only once\\n    }\\n\\n    \\/\\/ Function to validate BIP and show a warning if duplicate\\n    function validateBip(input) {\\n        const bip = input.value.trim();\\n        if (!isBipUnique(bip)) {\\n            alert(\\\"BIP number must be unique!\\\");\\n            input.value = \\\"\\\";\\n        }\\n    }\\n\\n    \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\n    function formatDate(input) {\\n        const dateParts = input.split(\'\\/\');\\n        if (dateParts.length === 3) {\\n            const day = dateParts[0].padStart(2, \'0\');\\n            const month = dateParts[1].padStart(2, \'0\');\\n            const year = dateParts[2];\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\n                return `${day}\\/${month}\\/${year}`;\\n            }\\n        }\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\n        return \\\"\\\";\\n    }\\n\\n    \\/\\/ Function to add a new row\\n    function addRow(data = {}) {\\n        const table = document.querySelector(\\\"table tbody\\\");\\n        const newRow = document.createElement(\\\"tr\\\");\\n        newRow.innerHTML = `\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"validateBip(this)\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"gender\\\">\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"country\\\">\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\n            <td>\\n                <select name=\\\"category\\\">\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><button type=\\\"button\\\" class=\\\"btn btn-danger btn-sm\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\n        `;\\n        table.appendChild(newRow);\\n    }\\n\\n    \\/\\/ Function to delete a row\\n    function deleteRow(button) {\\n        const row = button.closest(\'tr\');\\n        row.remove();\\n    }\\n\\n    \\/\\/ Submit table data via AJAX\\n    async function submitTable(event) {\\n        event.preventDefault();\\n\\n        const rows = [];\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\n\\n        tableRows.forEach(row => {\\n            const rowData = {};\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\n                rowData[input.name] = input.value.trim();\\n            });\\n            rows.push(rowData);\\n        });\\n\\n        try {\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\n                method: \\\"POST\\\",\\n                headers: {\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\n                },\\n                body: JSON.stringify({ athletes: rows })\\n            });\\n\\n            if (response.ok) {\\n                showStatusCard(\\\"Success\\\", \\\"Data submitted successfully!\\\", true);\\n            } else {\\n                showStatusCard(\\\"Error\\\", \\\"Failed to submit data.\\\", false);\\n            }\\n        } catch (error) {\\n            showStatusCard(\\\"Error\\\", \\\"An error occurred: \\\" + error.message, false);\\n        }\\n    }\\n\\n    \\/\\/ Add an initial row on page load\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n        addRow();\\n    });\\n<\\/script>\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2878, 464, '_elementor_pro_version', '3.24.2'),
(2881, 465, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2882, 465, '_elementor_edit_mode', 'builder'),
(2883, 465, '_elementor_template_type', 'wp-page'),
(2884, 465, '_elementor_version', '3.26.5'),
(2885, 465, '_elementor_data', '[{\"id\":\"16ea7a2f\",\"elType\":\"section\",\"settings\":{\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"72ac61a0\",\"elType\":\"column\",\"settings\":{\"_column_size\":100,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"2630643c\",\"elType\":\"widget\",\"settings\":{\"shortcode\":\"[gravityform id=\\\"4\\\" title=\\\"false\\\" description=\\\"false\\\" ajax=\\\"true\\\"]\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"shortcode\"}],\"isInner\":false}],\"isInner\":false},{\"id\":\"e61174d\",\"elType\":\"section\",\"settings\":{\"structure\":\"30\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"4165740\",\"elType\":\"column\",\"settings\":{\"_column_size\":33,\"_inline_size\":null,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"isInner\":false},{\"id\":\"81f2db3\",\"elType\":\"column\",\"settings\":{\"_column_size\":33,\"_inline_size\":null,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"isInner\":false},{\"id\":\"ce0b7f6\",\"elType\":\"column\",\"settings\":{\"_column_size\":33,\"_inline_size\":null,\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"0aec4e7\",\"elType\":\"widget\",\"settings\":{\"text\":\"Anuluj\",\"link\":{\"url\":\"https:\\/\\/live-biegi.sport-timing.pl\\/panel\\/\",\"is_external\":\"\",\"nofollow\":\"\",\"custom_attributes\":\"\"},\"align\":\"center\",\"background_color\":\"#CE6161\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"button\"}],\"isInner\":false}],\"isInner\":false},{\"id\":\"4b62136\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"a0f0252\",\"elType\":\"widget\",\"settings\":{\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2887, 465, '_elementor_pro_version', '3.24.2'),
(2892, 466, '_elementor_edit_mode', 'builder'),
(2893, 466, '_elementor_template_type', 'wp-page'),
(2894, 466, '_elementor_version', '3.26.5'),
(2895, 466, '_elementor_pro_version', '3.24.2'),
(2896, 466, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2897, 466, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"<style>\\n        table {\\n            width: 100%;\\n            border-collapse: collapse;\\n            margin-top: 20px;\\n        }\\n        th, td {\\n            border: 1px solid #ccc;\\n            padding: 8px;\\n            text-align: left;\\n        }\\n        th {\\n            background-color: #f4f4f4;\\n        }\\n        input[type=\\\"text\\\"], select {\\n            width: 100%;\\n            box-sizing: border-box;\\n        }\\n    <\\/style>\\n\\n    <h1>Enter Athlete Data<\\/h1>\\n    <form id=\\\"dataForm\\\">\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\n        <table>\\n            <thead>\\n                <tr>\\n                    <th>BIP<\\/th>\\n                    <th>First Name<\\/th>\\n                    <th>Last Name<\\/th>\\n                    <th>Gender<\\/th>\\n                    <th>FIS Code<\\/th>\\n                    <th>Licence Code<\\/th>\\n                    <th>Licence Type<\\/th>\\n                    <th>Klub<\\/th>\\n                    <th>Country<\\/th>\\n                    <th>Date of Birth<\\/th>\\n                    <th>Category<\\/th>\\n                    <th>Actions<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <!-- Rows will be dynamically added -->\\n            <\\/tbody>\\n        <\\/table>\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\n        <button type=\\\"submit\\\">Submit<\\/button>\\n    <\\/form>\\n\\n    <script>\\n        \\/\\/ Predefined arrays\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\n\\n        \\/\\/ Function to add a new row\\n        function addRow(data = {}) {\\n            const table = document.querySelector(\\\"table tbody\\\");\\n            const newRow = document.createElement(\\\"tr\\\");\\n            newRow.innerHTML = `\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\n                <td>\\n                    <select name=\\\"gender\\\">\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\n                    <\\/select>\\n                <\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\n                <td>\\n                    <select name=\\\"country\\\">\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\n                    <\\/select>\\n                <\\/td>\\n                <td><input type=\\\"date\\\" name=\\\"date_of_birth\\\" value=\\\"${data.date_of_birth || \'\'}\\\"><\\/td>\\n                <td>\\n                    <select name=\\\"category\\\">\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\n                    <\\/select>\\n                <\\/td>\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\n            `;\\n            table.appendChild(newRow);\\n        }\\n\\n        \\/\\/ Function to delete a row\\n        function deleteRow(button) {\\n            const row = button.closest(\'tr\');\\n            row.remove();\\n        }\\n\\n        \\/\\/ Function to handle CSV upload\\n        function handleCSVUpload(event) {\\n            const file = event.target.files[0];\\n            if (!file) return;\\n\\n            const reader = new FileReader();\\n            reader.onload = function (e) {\\n                const content = e.target.result;\\n                const rows = content.split(\\\"\\\\n\\\");\\n                const table = document.querySelector(\\\"table tbody\\\");\\n\\n                \\/\\/ Clear existing rows\\n                table.innerHTML = \\\"\\\";\\n\\n                rows.forEach((row, index) => {\\n                    const cols = row.split(\\\",\\\");\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\n                        addRow({\\n                            bip: cols[0].trim(),\\n                            first_name: cols[1].trim(),\\n                            last_name: cols[2].trim(),\\n                            gender: cols[3].trim(),\\n                            fis_code: cols[4].trim(),\\n                            licence_code: cols[5].trim(),\\n                            licence_type: cols[6].trim(),\\n                            klub: cols[7].trim(),\\n                            country: cols[8].trim(),\\n                            date_of_birth: cols[9].trim(),\\n                            category: cols[10].trim(),\\n                        });\\n                    }\\n                });\\n            };\\n            reader.readAsText(file);\\n        }\\n\\n        \\/\\/ Add an initial row on page load\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n            addRow();\\n        });\\n    <\\/script>\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2901, 467, '_elementor_edit_mode', 'builder'),
(2902, 467, '_elementor_template_type', 'wp-page'),
(2903, 467, '_elementor_version', '3.26.5'),
(2904, 467, '_elementor_pro_version', '3.24.2'),
(2905, 467, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2906, 467, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"<style>\\n        table {\\n            width: 100%;\\n            border-collapse: collapse;\\n            margin-top: 20px;\\n        }\\n        th, td {\\n            border: 1px solid #ccc;\\n            padding: 8px;\\n            text-align: left;\\n        }\\n        th {\\n            background-color: #f4f4f4;\\n        }\\n        input[type=\\\"text\\\"], select {\\n            width: 100%;\\n            box-sizing: border-box;\\n        }\\n    <\\/style>\\n\\n    <h1>Enter Athlete Data<\\/h1>\\n    <form id=\\\"dataForm\\\">\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\n        <table>\\n            <thead>\\n                <tr>\\n                    <th>BIP<\\/th>\\n                    <th>First Name<\\/th>\\n                    <th>Last Name<\\/th>\\n                    <th>Gender<\\/th>\\n                    <th>FIS Code<\\/th>\\n                    <th>Licence Code<\\/th>\\n                    <th>Licence Type<\\/th>\\n                    <th>Klub<\\/th>\\n                    <th>Country<\\/th>\\n                    <th>Date of Birth<\\/th>\\n                    <th>Category<\\/th>\\n                    <th>Actions<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <!-- Rows will be dynamically added -->\\n            <\\/tbody>\\n        <\\/table>\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\n        <button type=\\\"submit\\\">Submit<\\/button>\\n    <\\/form>\\n\\n    <script>\\n        \\/\\/ Predefined arrays\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\n\\n        \\/\\/ Function to add a new row\\n        function addRow(data = {}) {\\n            const table = document.querySelector(\\\"table tbody\\\");\\n            const newRow = document.createElement(\\\"tr\\\");\\n            newRow.innerHTML = `\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\n                <td>\\n                    <select name=\\\"gender\\\">\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\n                    <\\/select>\\n                <\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\n                <td>\\n                    <select name=\\\"country\\\">\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\n                    <\\/select>\\n                <\\/td>\\n                <td><input type=\\\"date\\\" name=\\\"date_of_birth\\\" value=\\\"${data.date_of_birth || \'\'}\\\"><\\/td>\\n                <td>\\n                    <select name=\\\"category\\\">\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\n                    <\\/select>\\n                <\\/td>\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\n            `;\\n            table.appendChild(newRow);\\n        }\\n\\n        \\/\\/ Function to delete a row\\n        function deleteRow(button) {\\n            const row = button.closest(\'tr\');\\n            row.remove();\\n        }\\n\\n        \\/\\/ Function to handle CSV upload\\n        function handleCSVUpload(event) {\\n            const file = event.target.files[0];\\n            if (!file) return;\\n\\n            const reader = new FileReader();\\n            reader.onload = function (e) {\\n                const content = e.target.result;\\n                const rows = content.split(\\\"\\\\n\\\");\\n                const table = document.querySelector(\\\"table tbody\\\");\\n\\n                \\/\\/ Clear existing rows\\n                table.innerHTML = \\\"\\\";\\n\\n                rows.forEach((row, index) => {\\n                    const cols = row.split(\\\",\\\");\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\n                        addRow({\\n                            bip: cols[0].trim(),\\n                            first_name: cols[1].trim(),\\n                            last_name: cols[2].trim(),\\n                            gender: cols[3].trim(),\\n                            fis_code: cols[4].trim(),\\n                            licence_code: cols[5].trim(),\\n                            licence_type: cols[6].trim(),\\n                            klub: cols[7].trim(),\\n                            country: cols[8].trim(),\\n                            date_of_birth: cols[9].trim(),\\n                            category: cols[10].trim(),\\n                        });\\n                    }\\n                });\\n            };\\n            reader.readAsText(file);\\n        }\\n\\n        \\/\\/ Add an initial row on page load\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n            addRow();\\n        });\\n    <\\/script>\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2910, 468, '_elementor_edit_mode', 'builder'),
(2911, 468, '_elementor_template_type', 'wp-page'),
(2912, 468, '_elementor_version', '3.26.5'),
(2913, 468, '_elementor_pro_version', '3.24.2'),
(2914, 468, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2915, 468, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\n    <style>\\n        table {\\n            width: 100%;\\n            border-collapse: collapse;\\n            margin-top: 20px;\\n        }\\n        th, td {\\n            border: 1px solid #ccc;\\n            padding: 8px;\\n            text-align: left;\\n        }\\n        th {\\n            background-color: #f4f4f4;\\n        }\\n        input[type=\\\"text\\\"], select {\\n            width: 100%;\\n            box-sizing: border-box;\\n        }\\n    <\\/style>\\n\\n<div class=\\\"container mt-5\\\">\\n    <h1 class=\\\"mb-4\\\">Enter Athlete Data<\\/h1>\\n\\n    <!-- Information Card -->\\n    <div id=\\\"statusCard\\\" class=\\\"card d-none\\\">\\n        <div class=\\\"card-body\\\">\\n            <h5 id=\\\"statusTitle\\\" class=\\\"card-title\\\"><\\/h5>\\n            <p id=\\\"statusMessage\\\" class=\\\"card-text\\\"><\\/p>\\n        <\\/div>\\n    <\\/div>\\n\\n    <!-- Form -->\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\n        <div class=\\\"mb-3\\\">\\n            <label for=\\\"csvFileInput\\\" class=\\\"form-label\\\">Upload CSV File<\\/label>\\n            <input type=\\\"file\\\" id=\\\"csvFileInput\\\" class=\\\"form-control\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\n        <\\/div>\\n\\n        <table class=\\\"table table-bordered\\\">\\n            <thead class=\\\"table-light\\\">\\n                <tr>\\n                    <th>BIP<\\/th>\\n                    <th>First Name<\\/th>\\n                    <th>Last Name<\\/th>\\n                    <th>Gender<\\/th>\\n                    <th>FIS Code<\\/th>\\n                    <th>Licence Code<\\/th>\\n                    <th>Licence Type<\\/th>\\n                    <th>Klub<\\/th>\\n                    <th>Country<\\/th>\\n                    <th>Date of Birth<\\/th>\\n                    <th>Category<\\/th>\\n                    <th>Actions<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <!-- Rows will be dynamically added -->\\n            <\\/tbody>\\n        <\\/table>\\n        <button type=\\\"button\\\" class=\\\"btn btn-primary mb-3\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\n        <button type=\\\"submit\\\" class=\\\"btn btn-success\\\">Submit<\\/button>\\n    <\\/form>\\n<\\/div>\\n\\n<script>\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\n\\n    \\/\\/ Show status card\\n    function showStatusCard(title, message, isSuccess) {\\n        const statusCard = document.getElementById(\\\"statusCard\\\");\\n        const statusTitle = document.getElementById(\\\"statusTitle\\\");\\n        const statusMessage = document.getElementById(\\\"statusMessage\\\");\\n\\n        statusCard.className = `card ${isSuccess ? \\\"bg-success\\\" : \\\"bg-danger\\\"} text-white`;\\n        statusTitle.textContent = title;\\n        statusMessage.textContent = message;\\n        statusCard.classList.remove(\\\"d-none\\\");\\n    }\\n\\n    \\/\\/ Function to validate unique BIP\\n    function isBipUnique(bip) {\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\n        const duplicateCount = bips.filter(existingBip => existingBip === bip).length;\\n        return duplicateCount <= 1; \\/\\/ A BIP is unique if it appears only once\\n    }\\n\\n    \\/\\/ Function to validate BIP and show a warning if duplicate\\n    function validateBip(input) {\\n        const bip = input.value.trim();\\n        if (!isBipUnique(bip)) {\\n            alert(\\\"BIP number must be unique!\\\");\\n            input.value = \\\"\\\";\\n        }\\n    }\\n\\n    \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\n    function formatDate(input) {\\n        const dateParts = input.split(\'\\/\');\\n        if (dateParts.length === 3) {\\n            const day = dateParts[0].padStart(2, \'0\');\\n            const month = dateParts[1].padStart(2, \'0\');\\n            const year = dateParts[2];\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\n                return `${day}\\/${month}\\/${year}`;\\n            }\\n        }\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\n        return \\\"\\\";\\n    }\\n\\n    \\/\\/ Function to add a new row\\n    function addRow(data = {}) {\\n        const table = document.querySelector(\\\"table tbody\\\");\\n        const newRow = document.createElement(\\\"tr\\\");\\n        newRow.innerHTML = `\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"validateBip(this)\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"gender\\\">\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"country\\\">\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\n            <td>\\n                <select name=\\\"category\\\">\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><button type=\\\"button\\\" class=\\\"btn btn-danger btn-sm\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\n        `;\\n        table.appendChild(newRow);\\n    }\\n\\n    \\/\\/ Function to delete a row\\n    function deleteRow(button) {\\n        const row = button.closest(\'tr\');\\n        row.remove();\\n    }\\n\\n    \\/\\/ Submit table data via AJAX\\n    async function submitTable(event) {\\n        event.preventDefault();\\n\\n        const rows = [];\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\n\\n        tableRows.forEach(row => {\\n            const rowData = {};\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\n                rowData[input.name] = input.value.trim();\\n            });\\n            rows.push(rowData);\\n        });\\n\\n        try {\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\n                method: \\\"POST\\\",\\n                headers: {\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\n                },\\n                body: JSON.stringify({ athletes: rows })\\n            });\\n\\n            if (response.ok) {\\n                showStatusCard(\\\"Success\\\", \\\"Data submitted successfully!\\\", true);\\n            } else {\\n                showStatusCard(\\\"Error\\\", \\\"Failed to submit data.\\\", false);\\n            }\\n        } catch (error) {\\n            showStatusCard(\\\"Error\\\", \\\"An error occurred: \\\" + error.message, false);\\n        }\\n    }\\n\\n    \\/\\/ Add an initial row on page load\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n        addRow();\\n    });\\n<\\/script>\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2921, 469, '_elementor_edit_mode', 'builder'),
(2922, 469, '_elementor_template_type', 'wp-page'),
(2923, 469, '_elementor_version', '3.26.5'),
(2924, 469, '_elementor_pro_version', '3.24.2'),
(2925, 469, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2926, 469, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\n    <style>\\n        table {\\n            width: 100%;\\n            border-collapse: collapse;\\n            margin-top: 20px;\\n        }\\n        th, td {\\n            border: 1px solid #ccc;\\n            padding: 8px;\\n            text-align: left;\\n        }\\n        th {\\n            background-color: #f4f4f4;\\n        }\\n        input[type=\\\"text\\\"], select {\\n            width: 100%;\\n            box-sizing: border-box;\\n        }\\n    <\\/style>\\n\\n<div class=\\\"container mt-5\\\">\\n    <h1 class=\\\"mb-4\\\">Enter Athlete Data<\\/h1>\\n\\n    <!-- Information Card -->\\n    <div id=\\\"statusCard\\\" class=\\\"card d-none\\\">\\n        <div class=\\\"card-body\\\">\\n            <h5 id=\\\"statusTitle\\\" class=\\\"card-title\\\"><\\/h5>\\n            <p id=\\\"statusMessage\\\" class=\\\"card-text\\\"><\\/p>\\n        <\\/div>\\n    <\\/div>\\n\\n    <!-- Form -->\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\n        <div class=\\\"mb-3\\\">\\n            <label for=\\\"csvFileInput\\\" class=\\\"form-label\\\">Upload CSV File<\\/label>\\n            <input type=\\\"file\\\" id=\\\"csvFileInput\\\" class=\\\"form-control\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\n        <\\/div>\\n\\n        <table class=\\\"table table-bordered\\\">\\n            <thead class=\\\"table-light\\\">\\n                <tr>\\n                    <th>BIP<\\/th>\\n                    <th>First Name<\\/th>\\n                    <th>Last Name<\\/th>\\n                    <th>Gender<\\/th>\\n                    <th>FIS Code<\\/th>\\n                    <th>Licence Code<\\/th>\\n                    <th>Licence Type<\\/th>\\n                    <th>Klub<\\/th>\\n                    <th>Country<\\/th>\\n                    <th>Date of Birth<\\/th>\\n                    <th>Category<\\/th>\\n                    <th>Actions<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <!-- Rows will be dynamically added -->\\n            <\\/tbody>\\n        <\\/table>\\n        <button type=\\\"button\\\" class=\\\"btn btn-primary mb-3\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\n        <button type=\\\"submit\\\" class=\\\"btn btn-success\\\">Submit<\\/button>\\n    <\\/form>\\n<\\/div>\\n\\n<script>\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\n\\n    \\/\\/ Show status card\\n    function showStatusCard(title, message, isSuccess) {\\n        const statusCard = document.getElementById(\\\"statusCard\\\");\\n        const statusTitle = document.getElementById(\\\"statusTitle\\\");\\n        const statusMessage = document.getElementById(\\\"statusMessage\\\");\\n\\n        statusCard.className = `card ${isSuccess ? \\\"bg-success\\\" : \\\"bg-danger\\\"} text-white`;\\n        statusTitle.textContent = title;\\n        statusMessage.textContent = message;\\n        statusCard.classList.remove(\\\"d-none\\\");\\n    }\\n\\n    \\/\\/ Function to validate unique BIP\\n    function isBipUnique(bip) {\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\n        const duplicateCount = bips.filter(existingBip => existingBip === bip).length;\\n        return duplicateCount <= 1; \\/\\/ A BIP is unique if it appears only once\\n    }\\n\\n    \\/\\/ Function to validate BIP and show a warning if duplicate\\n    function validateBip(input) {\\n        const bip = input.value.trim();\\n        if (!isBipUnique(bip)) {\\n            alert(\\\"BIP number must be unique!\\\");\\n            input.value = \\\"\\\";\\n        }\\n    }\\n\\n    \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\n    function formatDate(input) {\\n        const dateParts = input.split(\'\\/\');\\n        if (dateParts.length === 3) {\\n            const day = dateParts[0].padStart(2, \'0\');\\n            const month = dateParts[1].padStart(2, \'0\');\\n            const year = dateParts[2];\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\n                return `${day}\\/${month}\\/${year}`;\\n            }\\n        }\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\n        return \\\"\\\";\\n    }\\n\\n    \\/\\/ Function to add a new row\\n    function addRow(data = {}) {\\n        const table = document.querySelector(\\\"table tbody\\\");\\n        const newRow = document.createElement(\\\"tr\\\");\\n        newRow.innerHTML = `\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"validateBip(this)\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"gender\\\">\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"country\\\">\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\n            <td>\\n                <select name=\\\"category\\\">\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><button type=\\\"button\\\" class=\\\"btn btn-danger btn-sm\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\n        `;\\n        table.appendChild(newRow);\\n    }\\n\\n    \\/\\/ Function to delete a row\\n    function deleteRow(button) {\\n        const row = button.closest(\'tr\');\\n        row.remove();\\n    }\\n\\n    \\/\\/ Submit table data via AJAX\\n    async function submitTable(event) {\\n        event.preventDefault();\\n\\n        const rows = [];\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\n\\n        tableRows.forEach(row => {\\n            const rowData = {};\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\n                rowData[input.name] = input.value.trim();\\n            });\\n            rows.push(rowData);\\n        });\\n\\n        try {\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\n                method: \\\"POST\\\",\\n                headers: {\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\n                },\\n                body: JSON.stringify({ athletes: rows })\\n            });\\n\\n            if (response.ok) {\\n                showStatusCard(\\\"Success\\\", \\\"Data submitted successfully!\\\", true);\\n            } else {\\n                showStatusCard(\\\"Error\\\", \\\"Failed to submit data.\\\", false);\\n            }\\n        } catch (error) {\\n            showStatusCard(\\\"Error\\\", \\\"An error occurred: \\\" + error.message, false);\\n        }\\n    }\\n\\n    \\/\\/ Add an initial row on page load\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n        addRow();\\n    });\\n<\\/script>\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2930, 470, '_elementor_edit_mode', 'builder'),
(2931, 470, '_elementor_template_type', 'wp-page'),
(2932, 470, '_elementor_version', '3.26.5'),
(2933, 470, '_elementor_pro_version', '3.24.2'),
(2934, 470, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(2935, 470, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\n    <style>\\n        table {\\n            width: 100%;\\n            border-collapse: collapse;\\n            margin-top: 20px;\\n        }\\n        th, td {\\n            border: 1px solid #ccc;\\n            padding: 8px;\\n            text-align: left;\\n        }\\n        th {\\n            background-color: #f4f4f4;\\n        }\\n        input[type=\\\"text\\\"], select {\\n            width: 100%;\\n            box-sizing: border-box;\\n        }\\n    <\\/style>\\n\\n<div class=\\\"container mt-5\\\">\\n    <h1 class=\\\"mb-4\\\">Enter Athlete Data<\\/h1>\\n\\n    <!-- Information Card -->\\n    <div id=\\\"statusCard\\\" class=\\\"card d-none\\\">\\n        <div class=\\\"card-body\\\">\\n            <h5 id=\\\"statusTitle\\\" class=\\\"card-title\\\"><\\/h5>\\n            <p id=\\\"statusMessage\\\" class=\\\"card-text\\\"><\\/p>\\n        <\\/div>\\n    <\\/div>\\n\\n    <!-- Form -->\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\n        <div class=\\\"mb-3\\\">\\n            <label for=\\\"csvFileInput\\\" class=\\\"form-label\\\">Upload CSV File<\\/label>\\n            <input type=\\\"file\\\" id=\\\"csvFileInput\\\" class=\\\"form-control\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\n        <\\/div>\\n\\n        <table class=\\\"table table-bordered\\\">\\n            <thead class=\\\"table-light\\\">\\n                <tr>\\n                    <th>BIP<\\/th>\\n                    <th>First Name<\\/th>\\n                    <th>Last Name<\\/th>\\n                    <th>Gender<\\/th>\\n                    <th>FIS Code<\\/th>\\n                    <th>Licence Code<\\/th>\\n                    <th>Licence Type<\\/th>\\n                    <th>Klub<\\/th>\\n                    <th>Country<\\/th>\\n                    <th>Date of Birth<\\/th>\\n                    <th>Category<\\/th>\\n                    <th>Actions<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <!-- Rows will be dynamically added -->\\n            <\\/tbody>\\n        <\\/table>\\n        <button type=\\\"button\\\" class=\\\"btn btn-primary mb-3\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\n        <button type=\\\"submit\\\" class=\\\"btn btn-success\\\">Submit<\\/button>\\n    <\\/form>\\n<\\/div>\\n\\n<script>\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\n\\n    \\/\\/ Show status card\\n    function showStatusCard(title, message, isSuccess) {\\n        const statusCard = document.getElementById(\\\"statusCard\\\");\\n        const statusTitle = document.getElementById(\\\"statusTitle\\\");\\n        const statusMessage = document.getElementById(\\\"statusMessage\\\");\\n\\n        statusCard.className = `card ${isSuccess ? \\\"bg-success\\\" : \\\"bg-danger\\\"} text-white`;\\n        statusTitle.textContent = title;\\n        statusMessage.textContent = message;\\n        statusCard.classList.remove(\\\"d-none\\\");\\n    }\\n\\n    \\/\\/ Function to validate unique BIP\\n    function isBipUnique(bip) {\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\n        const duplicateCount = bips.filter(existingBip => existingBip === bip).length;\\n        return duplicateCount <= 1; \\/\\/ A BIP is unique if it appears only once\\n    }\\n\\n    \\/\\/ Function to validate BIP and show a warning if duplicate\\n    function validateBip(input) {\\n        const bip = input.value.trim();\\n        if (!isBipUnique(bip)) {\\n            alert(\\\"BIP number must be unique!\\\");\\n            input.value = \\\"\\\";\\n        }\\n    }\\n\\n    \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\n    function formatDate(input) {\\n        const dateParts = input.split(\'\\/\');\\n        if (dateParts.length === 3) {\\n            const day = dateParts[0].padStart(2, \'0\');\\n            const month = dateParts[1].padStart(2, \'0\');\\n            const year = dateParts[2];\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\n                return `${day}\\/${month}\\/${year}`;\\n            }\\n        }\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\n        return \\\"\\\";\\n    }\\n\\n    \\/\\/ Function to add a new row\\n    function addRow(data = {}) {\\n        const table = document.querySelector(\\\"table tbody\\\");\\n        const newRow = document.createElement(\\\"tr\\\");\\n        newRow.innerHTML = `\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"validateBip(this)\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"gender\\\">\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\n            <td>\\n                <select name=\\\"country\\\">\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\n            <td>\\n                <select name=\\\"category\\\">\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\n                <\\/select>\\n            <\\/td>\\n            <td><button type=\\\"button\\\" class=\\\"btn btn-danger btn-sm\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\n        `;\\n        table.appendChild(newRow);\\n    }\\n\\n    \\/\\/ Function to delete a row\\n    function deleteRow(button) {\\n        const row = button.closest(\'tr\');\\n        row.remove();\\n    }\\n\\n    \\/\\/ Submit table data via AJAX\\n    async function submitTable(event) {\\n        event.preventDefault();\\n\\n        const rows = [];\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\n\\n        tableRows.forEach(row => {\\n            const rowData = {};\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\n                rowData[input.name] = input.value.trim();\\n            });\\n            rows.push(rowData);\\n        });\\n\\n        try {\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\n                method: \\\"POST\\\",\\n                headers: {\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\n                },\\n                body: JSON.stringify({ athletes: rows })\\n            });\\n\\n            if (response.ok) {\\n                showStatusCard(\\\"Success\\\", \\\"Data submitted successfully!\\\", true);\\n            } else {\\n                showStatusCard(\\\"Error\\\", \\\"Failed to submit data.\\\", false);\\n            }\\n        } catch (error) {\\n            showStatusCard(\\\"Error\\\", \\\"An error occurred: \\\" + error.message, false);\\n        }\\n    }\\n\\n    \\/\\/ Add an initial row on page load\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\n        addRow();\\n    });\\n<\\/script>\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2939, 471, '_elementor_edit_mode', 'builder'),
(2940, 471, '_elementor_template_type', 'wp-page'),
(2941, 471, '_elementor_version', '3.26.5'),
(2942, 471, '_elementor_pro_version', '3.24.2'),
(2943, 471, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2944, 471, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <script>\\r\\n        \\/\\/ Predefined arrays\\r\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n        \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\r\\n        function formatDate(input) {\\r\\n            const dateParts = input.split(\'\\/\');\\r\\n            if (dateParts.length === 3) {\\r\\n                const day = dateParts[0].padStart(2, \'0\');\\r\\n                const month = dateParts[1].padStart(2, \'0\');\\r\\n                const year = dateParts[2];\\r\\n                if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                    return `${day}\\/${month}\\/${year}`;\\r\\n                }\\r\\n            }\\r\\n            alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n            return \\\"\\\";\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to add a new row\\r\\n        function addRow(data = {}) {\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n            const newRow = document.createElement(\\\"tr\\\");\\r\\n            newRow.innerHTML = `\\r\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"gender\\\">\\r\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"country\\\">\\r\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"category\\\">\\r\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n            `;\\r\\n            table.appendChild(newRow);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to delete a row\\r\\n        function deleteRow(button) {\\r\\n            const row = button.closest(\'tr\');\\r\\n            row.remove();\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to handle CSV upload\\r\\n        function handleCSVUpload(event) {\\r\\n            const file = event.target.files[0];\\r\\n            if (!file) return;\\r\\n\\r\\n            const reader = new FileReader();\\r\\n            reader.onload = function (e) {\\r\\n                const content = e.target.result;\\r\\n                const rows = content.split(\\\"\\\\n\\\");\\r\\n                const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n                \\/\\/ Clear existing rows\\r\\n                table.innerHTML = \\\"\\\";\\r\\n\\r\\n                rows.forEach((row, index) => {\\r\\n                    const cols = row.split(\\\",\\\");\\r\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                        addRow({\\r\\n                            bip: cols[0].trim(),\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    }\\r\\n                });\\r\\n            };\\r\\n            reader.readAsText(file);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to submit the table data via AJAX\\r\\n        async function submitTable(event) {\\r\\n            event.preventDefault();\\r\\n            const rows = [];\\r\\n            const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n\\r\\n            tableRows.forEach(row => {\\r\\n                const rowData = {};\\r\\n                row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                    rowData[input.name] = input.value;\\r\\n                });\\r\\n                rows.push(rowData);\\r\\n            });\\r\\n\\r\\n            try {\\r\\n                const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                    method: \\\"POST\\\",\\r\\n                    headers: {\\r\\n                        \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                    },\\r\\n                    body: JSON.stringify({ athletes: rows })\\r\\n                });\\r\\n\\r\\n                if (response.ok) {\\r\\n                    alert(\\\"Data submitted successfully!\\\");\\r\\n                } else {\\r\\n                    alert(\\\"Error submitting data.\\\");\\r\\n                }\\r\\n            } catch (error) {\\r\\n                alert(\\\"Failed to submit data: \\\" + error.message);\\r\\n            }\\r\\n        }\\r\\n\\r\\n        \\/\\/ Add an initial row on page load\\r\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n            addRow();\\r\\n        });\\r\\n    <\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2950, 472, '_elementor_edit_mode', 'builder'),
(2951, 472, '_elementor_template_type', 'wp-page'),
(2952, 472, '_elementor_version', '3.26.5'),
(2953, 472, '_elementor_pro_version', '3.24.2'),
(2954, 472, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2955, 472, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <script>\\r\\n        \\/\\/ Predefined arrays\\r\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n        \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\r\\n        function formatDate(input) {\\r\\n            const dateParts = input.split(\'\\/\');\\r\\n            if (dateParts.length === 3) {\\r\\n                const day = dateParts[0].padStart(2, \'0\');\\r\\n                const month = dateParts[1].padStart(2, \'0\');\\r\\n                const year = dateParts[2];\\r\\n                if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                    return `${day}\\/${month}\\/${year}`;\\r\\n                }\\r\\n            }\\r\\n            alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n            return \\\"\\\";\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to add a new row\\r\\n        function addRow(data = {}) {\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n            const newRow = document.createElement(\\\"tr\\\");\\r\\n            newRow.innerHTML = `\\r\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"gender\\\">\\r\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"country\\\">\\r\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"category\\\">\\r\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n            `;\\r\\n            table.appendChild(newRow);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to delete a row\\r\\n        function deleteRow(button) {\\r\\n            const row = button.closest(\'tr\');\\r\\n            row.remove();\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to handle CSV upload\\r\\n        function handleCSVUpload(event) {\\r\\n            const file = event.target.files[0];\\r\\n            if (!file) return;\\r\\n\\r\\n            const reader = new FileReader();\\r\\n            reader.onload = function (e) {\\r\\n                const content = e.target.result;\\r\\n                const rows = content.split(\\\"\\\\n\\\");\\r\\n                const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n                \\/\\/ Clear existing rows\\r\\n                table.innerHTML = \\\"\\\";\\r\\n\\r\\n                rows.forEach((row, index) => {\\r\\n                    const cols = row.split(\\\",\\\");\\r\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                        addRow({\\r\\n                            bip: cols[0].trim(),\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    }\\r\\n                });\\r\\n            };\\r\\n            reader.readAsText(file);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to submit the table data via AJAX\\r\\n        async function submitTable(event) {\\r\\n            event.preventDefault();\\r\\n            const rows = [];\\r\\n            const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n\\r\\n            tableRows.forEach(row => {\\r\\n                const rowData = {};\\r\\n                row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                    rowData[input.name] = input.value;\\r\\n                });\\r\\n                rows.push(rowData);\\r\\n            });\\r\\n\\r\\n            try {\\r\\n                const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                    method: \\\"POST\\\",\\r\\n                    headers: {\\r\\n                        \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                    },\\r\\n                    body: JSON.stringify({ athletes: rows })\\r\\n                });\\r\\n\\r\\n                if (response.ok) {\\r\\n                    alert(\\\"Data submitted successfully!\\\");\\r\\n                } else {\\r\\n                    alert(\\\"Error submitting data.\\\");\\r\\n                }\\r\\n            } catch (error) {\\r\\n                alert(\\\"Failed to submit data: \\\" + error.message);\\r\\n            }\\r\\n        }\\r\\n\\r\\n        \\/\\/ Add an initial row on page load\\r\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n            addRow();\\r\\n        });\\r\\n    <\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2959, 473, '_elementor_edit_mode', 'builder'),
(2960, 473, '_elementor_template_type', 'wp-page'),
(2961, 473, '_elementor_version', '3.26.5'),
(2962, 473, '_elementor_pro_version', '3.24.2'),
(2963, 473, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2964, 473, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <script>\\r\\n        \\/\\/ Predefined arrays\\r\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n        \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\r\\n        function formatDate(input) {\\r\\n            const dateParts = input.split(\'\\/\');\\r\\n            if (dateParts.length === 3) {\\r\\n                const day = dateParts[0].padStart(2, \'0\');\\r\\n                const month = dateParts[1].padStart(2, \'0\');\\r\\n                const year = dateParts[2];\\r\\n                if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                    return `${day}\\/${month}\\/${year}`;\\r\\n                }\\r\\n            }\\r\\n            alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n            return \\\"\\\";\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to add a new row\\r\\n        function addRow(data = {}) {\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n            const newRow = document.createElement(\\\"tr\\\");\\r\\n            newRow.innerHTML = `\\r\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"gender\\\">\\r\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"country\\\">\\r\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"category\\\">\\r\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n            `;\\r\\n            table.appendChild(newRow);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to delete a row\\r\\n        function deleteRow(button) {\\r\\n            const row = button.closest(\'tr\');\\r\\n            row.remove();\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to handle CSV upload\\r\\n        function handleCSVUpload(event) {\\r\\n            const file = event.target.files[0];\\r\\n            if (!file) return;\\r\\n\\r\\n            const reader = new FileReader();\\r\\n            reader.onload = function (e) {\\r\\n                const content = e.target.result;\\r\\n                const rows = content.split(\\\"\\\\n\\\");\\r\\n                const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n                \\/\\/ Clear existing rows\\r\\n                table.innerHTML = \\\"\\\";\\r\\n\\r\\n                rows.forEach((row, index) => {\\r\\n                    const cols = row.split(\\\",\\\");\\r\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                        addRow({\\r\\n                            bip: cols[0].trim(),\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    }\\r\\n                });\\r\\n            };\\r\\n            reader.readAsText(file);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to submit the table data via AJAX\\r\\n        async function submitTable(event) {\\r\\n            event.preventDefault();\\r\\n            const rows = [];\\r\\n            const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n\\r\\n            tableRows.forEach(row => {\\r\\n                const rowData = {};\\r\\n                row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                    rowData[input.name] = input.value;\\r\\n                });\\r\\n                rows.push(rowData);\\r\\n            });\\r\\n\\r\\n            try {\\r\\n                const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                    method: \\\"POST\\\",\\r\\n                    headers: {\\r\\n                        \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                    },\\r\\n                    body: JSON.stringify({ athletes: rows })\\r\\n                });\\r\\n\\r\\n                if (response.ok) {\\r\\n                    alert(\\\"Data submitted successfully!\\\");\\r\\n                } else {\\r\\n                    alert(\\\"Error submitting data.\\\");\\r\\n                }\\r\\n            } catch (error) {\\r\\n                alert(\\\"Failed to submit data: \\\" + error.message);\\r\\n            }\\r\\n        }\\r\\n\\r\\n        \\/\\/ Add an initial row on page load\\r\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n            addRow();\\r\\n        });\\r\\n    <\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2968, 474, '_elementor_edit_mode', 'builder'),
(2969, 474, '_elementor_template_type', 'wp-page'),
(2970, 474, '_elementor_version', '3.26.5'),
(2971, 474, '_elementor_pro_version', '3.24.2'),
(2972, 474, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2973, 474, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <script>\\r\\n        \\/\\/ Predefined arrays\\r\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n        \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\r\\n        function formatDate(input) {\\r\\n            const dateParts = input.split(\'\\/\');\\r\\n            if (dateParts.length === 3) {\\r\\n                const day = dateParts[0].padStart(2, \'0\');\\r\\n                const month = dateParts[1].padStart(2, \'0\');\\r\\n                const year = dateParts[2];\\r\\n                if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                    return `${day}\\/${month}\\/${year}`;\\r\\n                }\\r\\n            }\\r\\n            alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n            return \\\"\\\";\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to add a new row\\r\\n        function addRow(data = {}) {\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n            const newRow = document.createElement(\\\"tr\\\");\\r\\n            newRow.innerHTML = `\\r\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"gender\\\">\\r\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"country\\\">\\r\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"category\\\">\\r\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n            `;\\r\\n            table.appendChild(newRow);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to delete a row\\r\\n        function deleteRow(button) {\\r\\n            const row = button.closest(\'tr\');\\r\\n            row.remove();\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to handle CSV upload\\r\\n        function handleCSVUpload(event) {\\r\\n            const file = event.target.files[0];\\r\\n            if (!file) return;\\r\\n\\r\\n            const reader = new FileReader();\\r\\n            reader.onload = function (e) {\\r\\n                const content = e.target.result;\\r\\n                const rows = content.split(\\\"\\\\n\\\");\\r\\n                const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n                \\/\\/ Clear existing rows\\r\\n                table.innerHTML = \\\"\\\";\\r\\n\\r\\n                rows.forEach((row, index) => {\\r\\n                    const cols = row.split(\\\",\\\");\\r\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                        addRow({\\r\\n                            bip: cols[0].trim(),\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    }\\r\\n                });\\r\\n            };\\r\\n            reader.readAsText(file);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Add an initial row on page load\\r\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n            addRow();\\r\\n        });\\r\\n    <\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2979, 475, '_elementor_edit_mode', 'builder'),
(2980, 475, '_elementor_template_type', 'wp-page'),
(2981, 475, '_elementor_version', '3.26.5'),
(2982, 475, '_elementor_pro_version', '3.24.2'),
(2983, 475, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(2984, 475, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <script>\\r\\n        \\/\\/ Predefined arrays\\r\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n        \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\r\\n        function formatDate(input) {\\r\\n            const dateParts = input.split(\'\\/\');\\r\\n            if (dateParts.length === 3) {\\r\\n                const day = dateParts[0].padStart(2, \'0\');\\r\\n                const month = dateParts[1].padStart(2, \'0\');\\r\\n                const year = dateParts[2];\\r\\n                if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                    return `${day}\\/${month}\\/${year}`;\\r\\n                }\\r\\n            }\\r\\n            alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n            return \\\"\\\";\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to add a new row\\r\\n        function addRow(data = {}) {\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n            const newRow = document.createElement(\\\"tr\\\");\\r\\n            newRow.innerHTML = `\\r\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"gender\\\">\\r\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"country\\\">\\r\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"category\\\">\\r\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n            `;\\r\\n            table.appendChild(newRow);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to delete a row\\r\\n        function deleteRow(button) {\\r\\n            const row = button.closest(\'tr\');\\r\\n            row.remove();\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to handle CSV upload\\r\\n        function handleCSVUpload(event) {\\r\\n            const file = event.target.files[0];\\r\\n            if (!file) return;\\r\\n\\r\\n            const reader = new FileReader();\\r\\n            reader.onload = function (e) {\\r\\n                const content = e.target.result;\\r\\n                const rows = content.split(\\\"\\\\n\\\");\\r\\n                const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n                \\/\\/ Clear existing rows\\r\\n                table.innerHTML = \\\"\\\";\\r\\n\\r\\n                rows.forEach((row, index) => {\\r\\n                    const cols = row.split(\\\",\\\");\\r\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                        addRow({\\r\\n                            bip: cols[0].trim(),\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    }\\r\\n                });\\r\\n            };\\r\\n            reader.readAsText(file);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Add an initial row on page load\\r\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n            addRow();\\r\\n        });\\r\\n    <\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2988, 476, '_elementor_edit_mode', 'builder'),
(2989, 476, '_elementor_template_type', 'wp-page'),
(2990, 476, '_elementor_version', '3.26.5'),
(2991, 476, '_elementor_pro_version', '3.24.2'),
(2992, 476, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(2993, 476, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <script>\\r\\n        \\/\\/ Predefined arrays\\r\\n        const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n        const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n        const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n        \\/\\/ Function to validate and format date as DD\\/MM\\/YYYY\\r\\n        function formatDate(input) {\\r\\n            const dateParts = input.split(\'\\/\');\\r\\n            if (dateParts.length === 3) {\\r\\n                const day = dateParts[0].padStart(2, \'0\');\\r\\n                const month = dateParts[1].padStart(2, \'0\');\\r\\n                const year = dateParts[2];\\r\\n                if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                    return `${day}\\/${month}\\/${year}`;\\r\\n                }\\r\\n            }\\r\\n            alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n            return \\\"\\\";\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to add a new row\\r\\n        function addRow(data = {}) {\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n            const newRow = document.createElement(\\\"tr\\\");\\r\\n            newRow.innerHTML = `\\r\\n                <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"gender\\\">\\r\\n                        ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"country\\\">\\r\\n                        ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n                <td>\\r\\n                    <select name=\\\"category\\\">\\r\\n                        ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                    <\\/select>\\r\\n                <\\/td>\\r\\n                <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n            `;\\r\\n            table.appendChild(newRow);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to delete a row\\r\\n        function deleteRow(button) {\\r\\n            const row = button.closest(\'tr\');\\r\\n            row.remove();\\r\\n        }\\r\\n\\r\\n        \\/\\/ Function to handle CSV upload\\r\\n        function handleCSVUpload(event) {\\r\\n            const file = event.target.files[0];\\r\\n            if (!file) return;\\r\\n\\r\\n            const reader = new FileReader();\\r\\n            reader.onload = function (e) {\\r\\n                const content = e.target.result;\\r\\n                const rows = content.split(\\\"\\\\n\\\");\\r\\n                const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n                \\/\\/ Clear existing rows\\r\\n                table.innerHTML = \\\"\\\";\\r\\n\\r\\n                rows.forEach((row, index) => {\\r\\n                    const cols = row.split(\\\",\\\");\\r\\n                    if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                        addRow({\\r\\n                            bip: cols[0].trim(),\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    }\\r\\n                });\\r\\n            };\\r\\n            reader.readAsText(file);\\r\\n        }\\r\\n\\r\\n        \\/\\/ Add an initial row on page load\\r\\n        document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n            addRow();\\r\\n        });\\r\\n    <\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(2997, 477, '_elementor_edit_mode', 'builder'),
(2998, 477, '_elementor_template_type', 'wp-page'),
(2999, 477, '_elementor_version', '3.26.5'),
(3000, 477, '_elementor_pro_version', '3.24.2'),
(3001, 477, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3002, 477, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique\\r\\n    function isBipUnique(bip) {\\r\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\r\\n        return bips.indexOf(bip) === bips.lastIndexOf(bip); \\/\\/ Ensure it\'s unique\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    addRow({\\r\\n                        bip: cols[0].trim(),\\r\\n                        first_name: cols[1].trim(),\\r\\n                        last_name: cols[2].trim(),\\r\\n                        gender: cols[3].trim(),\\r\\n                        fis_code: cols[4].trim(),\\r\\n                        licence_code: cols[5].trim(),\\r\\n                        licence_type: cols[6].trim(),\\r\\n                        klub: cols[7].trim(),\\r\\n                        country: cols[8].trim(),\\r\\n                        date_of_birth: formatDate(cols[9].trim()),\\r\\n                        category: cols[10].trim(),\\r\\n                    });\\r\\n                }\\r\\n            });\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n            });\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3008, 478, '_elementor_edit_mode', 'builder'),
(3009, 478, '_elementor_template_type', 'wp-page'),
(3010, 478, '_elementor_version', '3.26.5'),
(3011, 478, '_elementor_pro_version', '3.24.2'),
(3012, 478, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3013, 478, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique\\r\\n    function isBipUnique(bip) {\\r\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\r\\n        return bips.indexOf(bip) === bips.lastIndexOf(bip); \\/\\/ Ensure it\'s unique\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    addRow({\\r\\n                        bip: cols[0].trim(),\\r\\n                        first_name: cols[1].trim(),\\r\\n                        last_name: cols[2].trim(),\\r\\n                        gender: cols[3].trim(),\\r\\n                        fis_code: cols[4].trim(),\\r\\n                        licence_code: cols[5].trim(),\\r\\n                        licence_type: cols[6].trim(),\\r\\n                        klub: cols[7].trim(),\\r\\n                        country: cols[8].trim(),\\r\\n                        date_of_birth: formatDate(cols[9].trim()),\\r\\n                        category: cols[10].trim(),\\r\\n                    });\\r\\n                }\\r\\n            });\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n            });\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3017, 479, '_elementor_edit_mode', 'builder'),
(3018, 479, '_elementor_template_type', 'wp-page'),
(3019, 479, '_elementor_version', '3.26.5'),
(3020, 479, '_elementor_pro_version', '3.24.2'),
(3021, 479, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3022, 479, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique\\r\\n    function isBipUnique(bip) {\\r\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\r\\n        return bips.indexOf(bip) === bips.lastIndexOf(bip); \\/\\/ Ensure it\'s unique\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    addRow({\\r\\n                        bip: cols[0].trim(),\\r\\n                        first_name: cols[1].trim(),\\r\\n                        last_name: cols[2].trim(),\\r\\n                        gender: cols[3].trim(),\\r\\n                        fis_code: cols[4].trim(),\\r\\n                        licence_code: cols[5].trim(),\\r\\n                        licence_type: cols[6].trim(),\\r\\n                        klub: cols[7].trim(),\\r\\n                        country: cols[8].trim(),\\r\\n                        date_of_birth: formatDate(cols[9].trim()),\\r\\n                        category: cols[10].trim(),\\r\\n                    });\\r\\n                }\\r\\n            });\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n            });\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3026, 480, '_elementor_edit_mode', 'builder'),
(3027, 480, '_elementor_template_type', 'wp-page'),
(3028, 480, '_elementor_version', '3.26.5'),
(3029, 480, '_elementor_pro_version', '3.24.2'),
(3030, 480, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(3031, 480, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique\\r\\n    function isBipUnique(bip) {\\r\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\r\\n        return bips.indexOf(bip) === bips.lastIndexOf(bip); \\/\\/ Ensure it\'s unique\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    addRow({\\r\\n                        bip: cols[0].trim(),\\r\\n                        first_name: cols[1].trim(),\\r\\n                        last_name: cols[2].trim(),\\r\\n                        gender: cols[3].trim(),\\r\\n                        fis_code: cols[4].trim(),\\r\\n                        licence_code: cols[5].trim(),\\r\\n                        licence_type: cols[6].trim(),\\r\\n                        klub: cols[7].trim(),\\r\\n                        country: cols[8].trim(),\\r\\n                        date_of_birth: formatDate(cols[9].trim()),\\r\\n                        category: cols[10].trim(),\\r\\n                    });\\r\\n                }\\r\\n            });\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3037, 481, '_elementor_edit_mode', 'builder'),
(3038, 481, '_elementor_template_type', 'wp-page'),
(3039, 481, '_elementor_version', '3.26.5'),
(3040, 481, '_elementor_pro_version', '3.24.2'),
(3041, 481, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3042, 481, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique\\r\\n    function isBipUnique(bip) {\\r\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\r\\n        return bips.indexOf(bip) === bips.lastIndexOf(bip); \\/\\/ Ensure it\'s unique\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    addRow({\\r\\n                        bip: cols[0].trim(),\\r\\n                        first_name: cols[1].trim(),\\r\\n                        last_name: cols[2].trim(),\\r\\n                        gender: cols[3].trim(),\\r\\n                        fis_code: cols[4].trim(),\\r\\n                        licence_code: cols[5].trim(),\\r\\n                        licence_type: cols[6].trim(),\\r\\n                        klub: cols[7].trim(),\\r\\n                        country: cols[8].trim(),\\r\\n                        date_of_birth: formatDate(cols[9].trim()),\\r\\n                        category: cols[10].trim(),\\r\\n                    });\\r\\n                }\\r\\n            });\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3046, 482, '_elementor_edit_mode', 'builder'),
(3047, 482, '_elementor_template_type', 'wp-page'),
(3048, 482, '_elementor_version', '3.26.5'),
(3049, 482, '_elementor_pro_version', '3.24.2'),
(3050, 482, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3051, 482, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique\\r\\n    function isBipUnique(bip) {\\r\\n        const bips = Array.from(document.querySelectorAll(\'input[name=\\\"bip\\\"]\')).map(input => input.value.trim());\\r\\n        return bips.indexOf(bip) === bips.lastIndexOf(bip); \\/\\/ Ensure it\'s unique\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    addRow({\\r\\n                        bip: cols[0].trim(),\\r\\n                        first_name: cols[1].trim(),\\r\\n                        last_name: cols[2].trim(),\\r\\n                        gender: cols[3].trim(),\\r\\n                        fis_code: cols[4].trim(),\\r\\n                        licence_code: cols[5].trim(),\\r\\n                        licence_type: cols[6].trim(),\\r\\n                        klub: cols[7].trim(),\\r\\n                        country: cols[8].trim(),\\r\\n                        date_of_birth: formatDate(cols[9].trim()),\\r\\n                        category: cols[10].trim(),\\r\\n                    });\\r\\n                }\\r\\n            });\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3055, 483, '_elementor_edit_mode', 'builder'),
(3056, 483, '_elementor_template_type', 'wp-page'),
(3057, 483, '_elementor_version', '3.26.5'),
(3058, 483, '_elementor_pro_version', '3.24.2'),
(3059, 483, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3060, 483, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3077, 485, '_elementor_edit_mode', 'builder'),
(3078, 485, '_elementor_template_type', 'wp-page'),
(3079, 485, '_elementor_version', '3.26.5'),
(3080, 485, '_elementor_pro_version', '3.24.2'),
(3081, 485, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(3082, 485, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3086, 486, '_elementor_edit_mode', 'builder'),
(3087, 486, '_elementor_template_type', 'wp-page'),
(3088, 486, '_elementor_version', '3.26.5'),
(3089, 486, '_elementor_pro_version', '3.24.2'),
(3090, 486, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3091, 486, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3095, 487, '_elementor_edit_mode', 'builder'),
(3096, 487, '_elementor_template_type', 'wp-page'),
(3097, 487, '_elementor_version', '3.26.5'),
(3098, 487, '_elementor_pro_version', '3.24.2'),
(3099, 487, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3100, 487, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3106, 488, '_elementor_edit_mode', 'builder'),
(3107, 488, '_elementor_template_type', 'wp-page'),
(3108, 488, '_elementor_version', '3.26.5'),
(3109, 488, '_elementor_pro_version', '3.24.2'),
(3110, 488, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3111, 488, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3115, 489, '_elementor_edit_mode', 'builder'),
(3116, 489, '_elementor_template_type', 'wp-page'),
(3117, 489, '_elementor_version', '3.26.5'),
(3118, 489, '_elementor_pro_version', '3.24.2'),
(3119, 489, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(3120, 489, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3124, 490, '_elementor_edit_mode', 'builder'),
(3125, 490, '_elementor_template_type', 'wp-page'),
(3126, 490, '_elementor_version', '3.26.5'),
(3127, 490, '_elementor_pro_version', '3.24.2'),
(3128, 490, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3129, 490, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3135, 491, '_elementor_edit_mode', 'builder'),
(3136, 491, '_elementor_template_type', 'wp-page'),
(3137, 491, '_elementor_version', '3.26.5'),
(3138, 491, '_elementor_pro_version', '3.24.2'),
(3139, 491, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3140, 491, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3144, 492, '_elementor_edit_mode', 'builder'),
(3145, 492, '_elementor_template_type', 'wp-page'),
(3146, 492, '_elementor_version', '3.26.5'),
(3147, 492, '_elementor_pro_version', '3.24.2'),
(3148, 492, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3149, 492, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n        event.preventDefault();\\r\\n\\r\\n        const rows = [];\\r\\n        const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n        let isBipMissing = false;\\r\\n\\r\\n        tableRows.forEach(row => {\\r\\n            const rowData = {};\\r\\n            let bip = \\\"\\\";\\r\\n            row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n                rowData[input.name] = input.value.trim();\\r\\n                if (input.name === \\\"bip\\\") {\\r\\n                    bip = input.value.trim();\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Check if BIP is missing\\r\\n            if (!bip) {\\r\\n                isBipMissing = true;\\r\\n            }\\r\\n\\r\\n            rows.push(rowData);\\r\\n        });\\r\\n\\r\\n        if (isBipMissing) {\\r\\n            alert(\\\"BIP number is required for all athletes.\\\");\\r\\n            return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n        }\\r\\n\\r\\n        try {\\r\\n            const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\\", {\\r\\n                method: \\\"POST\\\",\\r\\n                headers: {\\r\\n                    \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n                },\\r\\n                body: JSON.stringify({ athletes: rows })\\r\\n            });\\r\\n\\r\\n            const result = await response.json();\\r\\n            if (response.ok) {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully!<\\/div>`;\\r\\n            } else {\\r\\n                document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n            }\\r\\n        } catch (error) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3153, 493, '_elementor_edit_mode', 'builder'),
(3154, 493, '_elementor_template_type', 'wp-page'),
(3155, 493, '_elementor_version', '3.26.5'),
(3156, 493, '_elementor_pro_version', '3.24.2'),
(3157, 493, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(3158, 493, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"enter-athlete-data.php\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3164, 494, '_elementor_edit_mode', 'builder'),
(3165, 494, '_elementor_template_type', 'wp-page'),
(3166, 494, '_elementor_version', '3.26.5'),
(3167, 494, '_elementor_pro_version', '3.24.2'),
(3168, 494, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3169, 494, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"enter-athlete-data.php\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3173, 495, '_elementor_edit_mode', 'builder'),
(3174, 495, '_elementor_template_type', 'wp-page'),
(3175, 495, '_elementor_version', '3.26.5'),
(3176, 495, '_elementor_pro_version', '3.24.2'),
(3177, 495, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3178, 495, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"enter-athlete-data.php\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3182, 496, '_elementor_edit_mode', 'builder'),
(3183, 496, '_elementor_template_type', 'wp-page'),
(3184, 496, '_elementor_version', '3.26.5'),
(3185, 496, '_elementor_pro_version', '3.24.2'),
(3186, 496, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3187, 496, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3193, 497, '_elementor_edit_mode', 'builder'),
(3194, 497, '_elementor_template_type', 'wp-page'),
(3195, 497, '_elementor_version', '3.26.5'),
(3196, 497, '_elementor_pro_version', '3.24.2'),
(3197, 497, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(3198, 497, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3202, 498, '_elementor_edit_mode', 'builder'),
(3203, 498, '_elementor_template_type', 'wp-page'),
(3204, 498, '_elementor_version', '3.26.5'),
(3205, 498, '_elementor_pro_version', '3.24.2'),
(3206, 498, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3207, 498, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3211, 499, '_elementor_edit_mode', 'builder'),
(3212, 499, '_elementor_template_type', 'wp-page'),
(3213, 499, '_elementor_version', '3.26.5'),
(3214, 499, '_elementor_pro_version', '3.24.2'),
(3215, 499, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3216, 499, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3222, 500, '_elementor_edit_mode', 'builder'),
(3223, 500, '_elementor_template_type', 'wp-page'),
(3224, 500, '_elementor_version', '3.26.5'),
(3225, 500, '_elementor_pro_version', '3.24.2'),
(3226, 500, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3227, 500, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3231, 501, '_elementor_edit_mode', 'builder'),
(3232, 501, '_elementor_template_type', 'wp-page'),
(3233, 501, '_elementor_version', '3.26.5'),
(3234, 501, '_elementor_pro_version', '3.24.2'),
(3235, 501, '_wp_page_template', 'page-templates/page-sidebar-none.php');
INSERT INTO `scx_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) VALUES
(3236, 501, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\n    async function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const result = await response.json();\\r\\n        if (response.ok) {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-success\\\">Data submitted successfully to Gravity Forms!<\\/div>`;\\r\\n        } else {\\r\\n            document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">Error: ${result.message}<\\/div>`;\\r\\n        }\\r\\n    } catch (error) {\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3240, 502, '_elementor_edit_mode', 'builder'),
(3241, 502, '_elementor_template_type', 'wp-page'),
(3242, 502, '_elementor_version', '3.26.5'),
(3243, 502, '_elementor_pro_version', '3.24.2'),
(3244, 502, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3245, 502, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\nasync function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const responseText = await response.text(); \\/\\/ Get plain text response\\r\\n\\r\\n        \\/\\/ Display the response in the statusMessage container\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-${response.ok ? \'success\' : \'danger\'}\\\">${responseText}<\\/div>`;\\r\\n    } catch (error) {\\r\\n        \\/\\/ Handle fetch errors\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3251, 503, '_elementor_edit_mode', 'builder'),
(3252, 503, '_elementor_template_type', 'wp-page'),
(3253, 503, '_elementor_version', '3.26.5'),
(3254, 503, '_elementor_pro_version', '3.24.2'),
(3255, 503, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3256, 503, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\nasync function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const responseText = await response.text(); \\/\\/ Get plain text response\\r\\n\\r\\n        \\/\\/ Display the response in the statusMessage container\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-${response.ok ? \'success\' : \'danger\'}\\\">${responseText}<\\/div>`;\\r\\n    } catch (error) {\\r\\n        \\/\\/ Handle fetch errors\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3260, 504, '_elementor_edit_mode', 'builder'),
(3261, 504, '_elementor_template_type', 'wp-page'),
(3262, 504, '_elementor_version', '3.26.5'),
(3263, 504, '_elementor_pro_version', '3.24.2'),
(3264, 504, '_wp_page_template', 'page-templates/page-sidebar-none.php'),
(3265, 504, '_elementor_data', '[{\"id\":\"8c62581\",\"elType\":\"container\",\"settings\":{\"flex_direction\":\"column\",\"content_width\":\"full\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[{\"id\":\"cba3f83\",\"elType\":\"widget\",\"settings\":{\"html\":\"\\r\\n    <link href=\\\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/bootstrap@5.3.0\\/dist\\/css\\/bootstrap.min.css\\\" rel=\\\"stylesheet\\\">\\r\\n    <style>\\r\\n        table {\\r\\n            width: 100%;\\r\\n            border-collapse: collapse;\\r\\n            margin-top: 20px;\\r\\n        }\\r\\n        th, td {\\r\\n            border: 1px solid #ccc;\\r\\n            padding: 8px;\\r\\n            text-align: left;\\r\\n        }\\r\\n        th {\\r\\n            background-color: #f4f4f4;\\r\\n        }\\r\\n        input[type=\\\"text\\\"], select {\\r\\n            width: 100%;\\r\\n            box-sizing: border-box;\\r\\n        }\\r\\n    <\\/style>\\r\\n\\r\\n<div class=\\\"container mt-5\\\">\\r\\n    <h1>Enter Athlete Data<\\/h1>\\r\\n    <form id=\\\"dataForm\\\" onsubmit=\\\"submitTable(event)\\\">\\r\\n        <input type=\\\"file\\\" id=\\\"csvFileInput\\\" accept=\\\".csv\\\" onchange=\\\"handleCSVUpload(event)\\\">\\r\\n        <table>\\r\\n            <thead>\\r\\n                <tr>\\r\\n                    <th>BIP<\\/th>\\r\\n                    <th>First Name<\\/th>\\r\\n                    <th>Last Name<\\/th>\\r\\n                    <th>Gender<\\/th>\\r\\n                    <th>FIS Code<\\/th>\\r\\n                    <th>Licence Code<\\/th>\\r\\n                    <th>Licence Type<\\/th>\\r\\n                    <th>Klub<\\/th>\\r\\n                    <th>Country<\\/th>\\r\\n                    <th>Date of Birth<\\/th>\\r\\n                    <th>Category<\\/th>\\r\\n                    <th>Actions<\\/th>\\r\\n                <\\/tr>\\r\\n            <\\/thead>\\r\\n            <tbody>\\r\\n                <!-- Rows will be dynamically added -->\\r\\n            <\\/tbody>\\r\\n        <\\/table>\\r\\n        <button type=\\\"button\\\" onclick=\\\"addRow()\\\">Add Row<\\/button>\\r\\n        <button type=\\\"submit\\\">Submit<\\/button>\\r\\n    <\\/form>\\r\\n\\r\\n    <!-- Status message for the AJAX submission -->\\r\\n    <div id=\\\"statusMessage\\\" class=\\\"mt-3\\\"><\\/div>\\r\\n<\\/div>\\r\\n\\r\\n<script>\\r\\n    \\/\\/ Predefined arrays for gender, countries, and categories\\r\\n    const genders = [\\\"Male\\\", \\\"Female\\\", \\\"Other\\\"];\\r\\n    const countries = [\\\"USA\\\", \\\"Canada\\\", \\\"UK\\\", \\\"Australia\\\", \\\"Germany\\\"];\\r\\n    const categories = [\\\"Junior\\\", \\\"Senior\\\", \\\"Adult\\\", \\\"Professional\\\"];\\r\\n\\r\\n    let allBips = [];  \\/\\/ Store all BIP numbers to check for uniqueness\\r\\n\\r\\n    \\/\\/ Function to format date to DD\\/MM\\/YYYY\\r\\n    function formatDate(input) {\\r\\n        const dateParts = input.split(\'\\/\');\\r\\n        if (dateParts.length === 3) {\\r\\n            const day = dateParts[0].padStart(2, \'0\');\\r\\n            const month = dateParts[1].padStart(2, \'0\');\\r\\n            const year = dateParts[2];\\r\\n            if (day <= 31 && month <= 12 && year.length === 4) {\\r\\n                return `${day}\\/${month}\\/${year}`;\\r\\n            }\\r\\n        }\\r\\n        alert(\\\"Invalid date format. Please use DD\\/MM\\/YYYY.\\\");\\r\\n        return \\\"\\\";\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to check if BIP is unique across all uploads\\r\\n    function isBipUnique(bip) {\\r\\n        return !allBips.includes(bip.trim());\\r\\n    }\\r\\n\\r\\n    \\/\\/ Alert if BIP number already exists\\r\\n    function checkBipUnique(input) {\\r\\n        const bip = input.value.trim();\\r\\n        if (!isBipUnique(bip)) {\\r\\n            alert(\\\"This BIP number already exists!\\\");\\r\\n            input.value = \'\'; \\/\\/ Reset value if duplicate\\r\\n        } else {\\r\\n            allBips.push(bip); \\/\\/ Add new BIP to the list\\r\\n        }\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to add a new row\\r\\n    function addRow(data = {}) {\\r\\n        const table = document.querySelector(\\\"table tbody\\\");\\r\\n        const newRow = document.createElement(\\\"tr\\\");\\r\\n        newRow.innerHTML = `\\r\\n            <td><input type=\\\"text\\\" name=\\\"bip\\\" placeholder=\\\"BIP\\\" value=\\\"${data.bip || \'\'}\\\" onchange=\\\"checkBipUnique(this)\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"first_name\\\" placeholder=\\\"First Name\\\" value=\\\"${data.first_name || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"last_name\\\" placeholder=\\\"Last Name\\\" value=\\\"${data.last_name || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"gender\\\">\\r\\n                    ${genders.map(g => `<option value=\\\"${g.toLowerCase()}\\\" ${data.gender === g.toLowerCase() ? \'selected\' : \'\'}>${g}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"fis_code\\\" placeholder=\\\"FIS Code\\\" value=\\\"${data.fis_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_code\\\" placeholder=\\\"Licence Code\\\" value=\\\"${data.licence_code || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"licence_type\\\" placeholder=\\\"Licence Type\\\" value=\\\"${data.licence_type || \'\'}\\\"><\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"klub\\\" placeholder=\\\"Klub\\\" value=\\\"${data.klub || \'\'}\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"country\\\">\\r\\n                    ${countries.map(c => `<option value=\\\"${c}\\\" ${data.country === c ? \'selected\' : \'\'}>${c}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><input type=\\\"text\\\" name=\\\"date_of_birth\\\" placeholder=\\\"DD\\/MM\\/YYYY\\\" value=\\\"${data.date_of_birth || \'\'}\\\" onchange=\\\"this.value=formatDate(this.value)\\\"><\\/td>\\r\\n            <td>\\r\\n                <select name=\\\"category\\\">\\r\\n                    ${categories.map(cat => `<option value=\\\"${cat}\\\" ${data.category === cat ? \'selected\' : \'\'}>${cat}<\\/option>`).join(\'\')}\\r\\n                <\\/select>\\r\\n            <\\/td>\\r\\n            <td><button type=\\\"button\\\" onclick=\\\"deleteRow(this)\\\">Delete<\\/button><\\/td>\\r\\n        `;\\r\\n        table.appendChild(newRow);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Function to delete a row\\r\\n    function deleteRow(button) {\\r\\n        const row = button.closest(\'tr\');\\r\\n        const bip = row.querySelector(\'input[name=\\\"bip\\\"]\').value.trim();\\r\\n        const index = allBips.indexOf(bip);\\r\\n        if (index > -1) {\\r\\n            allBips.splice(index, 1); \\/\\/ Remove BIP number from the list if row is deleted\\r\\n        }\\r\\n        row.remove();\\r\\n    }\\r\\n\\r\\n    \\/\\/ Handle CSV upload\\r\\n    function handleCSVUpload(event) {\\r\\n        const file = event.target.files[0];\\r\\n        if (!file) return;\\r\\n\\r\\n        const reader = new FileReader();\\r\\n        reader.onload = function (e) {\\r\\n            const content = e.target.result;\\r\\n            const rows = content.split(\\\"\\\\n\\\");\\r\\n            const table = document.querySelector(\\\"table tbody\\\");\\r\\n\\r\\n            \\/\\/ Clear existing rows\\r\\n            table.innerHTML = \\\"\\\";\\r\\n\\r\\n            \\/\\/ Temporary array to store BIPs from this CSV file\\r\\n            const currentBips = [];\\r\\n\\r\\n            rows.forEach((row, index) => {\\r\\n                const cols = row.split(\\\",\\\");\\r\\n                if (cols.length === 11 && index > 0) { \\/\\/ Skip header row\\r\\n                    const bip = cols[0].trim();\\r\\n                    if (isBipUnique(bip)) {\\r\\n                        \\/\\/ Add to currentBips and allBips if BIP is unique\\r\\n                        currentBips.push(bip);\\r\\n                        addRow({\\r\\n                            bip: bip,\\r\\n                            first_name: cols[1].trim(),\\r\\n                            last_name: cols[2].trim(),\\r\\n                            gender: cols[3].trim(),\\r\\n                            fis_code: cols[4].trim(),\\r\\n                            licence_code: cols[5].trim(),\\r\\n                            licence_type: cols[6].trim(),\\r\\n                            klub: cols[7].trim(),\\r\\n                            country: cols[8].trim(),\\r\\n                            date_of_birth: formatDate(cols[9].trim()),\\r\\n                            category: cols[10].trim(),\\r\\n                        });\\r\\n                    } else {\\r\\n                        alert(`BIP number ${bip} already exists and will not be added.`);\\r\\n                    }\\r\\n                }\\r\\n            });\\r\\n\\r\\n            \\/\\/ Add the currentBips to the global list of all BIPs\\r\\n            allBips = [...allBips, ...currentBips];\\r\\n        };\\r\\n        reader.readAsText(file);\\r\\n    }\\r\\n\\r\\n    \\/\\/ Submit table data via AJAX\\r\\nasync function submitTable(event) {\\r\\n    event.preventDefault();\\r\\n\\r\\n    const rows = [];\\r\\n    const tableRows = document.querySelectorAll(\\\"table tbody tr\\\");\\r\\n    let isBipMissing = false;\\r\\n\\r\\n    tableRows.forEach(row => {\\r\\n        const rowData = {};\\r\\n        let bip = \\\"\\\";\\r\\n        row.querySelectorAll(\\\"input, select\\\").forEach(input => {\\r\\n            rowData[input.name] = input.value.trim();\\r\\n            if (input.name === \\\"bip\\\") {\\r\\n                bip = input.value.trim();\\r\\n            }\\r\\n        });\\r\\n\\r\\n        \\/\\/ Check if BIP is missing\\r\\n        if (!bip) {\\r\\n            isBipMissing = true;\\r\\n        }\\r\\n\\r\\n        rows.push(rowData);\\r\\n    });\\r\\n\\r\\n    if (isBipMissing) {\\r\\n        alert(\\\"BIP number is required for all athletes.\\\");\\r\\n        return; \\/\\/ Prevent form submission if any BIP is missing\\r\\n    }\\r\\n\\r\\n    try {\\r\\n        const response = await fetch(\\\"https:\\/\\/live-biegi.sport-timing.pl\\/app-functions\\/enter-athlete-data\\/\\\", {\\r\\n            method: \\\"POST\\\",\\r\\n            headers: {\\r\\n                \\\"Content-Type\\\": \\\"application\\/json\\\"\\r\\n            },\\r\\n            body: JSON.stringify({ athletes: rows })\\r\\n        });\\r\\n\\r\\n        const responseText = await response.text(); \\/\\/ Get plain text response\\r\\n\\r\\n        \\/\\/ Display the response in the statusMessage container\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-${response.ok ? \'success\' : \'danger\'}\\\">${responseText}<\\/div>`;\\r\\n    } catch (error) {\\r\\n        \\/\\/ Handle fetch errors\\r\\n        document.getElementById(\\\"statusMessage\\\").innerHTML = `<div class=\\\"alert alert-danger\\\">An error occurred: ${error.message}<\\/div>`;\\r\\n    }\\r\\n}\\r\\n\\r\\n\\r\\n\\r\\n    \\/\\/ Add an initial row on page load\\r\\n    document.addEventListener(\\\"DOMContentLoaded\\\", () => {\\r\\n        addRow();\\r\\n    });\\r\\n<\\/script>\\r\\n\\r\\n\",\"ha_cmc_text\":\"Happy Addons\"},\"elements\":[],\"widgetType\":\"html\"}],\"isInner\":false}]'),
(3269, 505, '_elementor_edit_mode', 'builder'),
(3270, 505, '_elementor_template_type', 'wp-page'),
(3271, 505, '_elementor_version', '3.26.5'),
(3272, 505, '_elementor_pro_version', '3.24.2'),
(3273, 505, '_wp_page_template', 'page-templates/page-sidebar-none.php');
