{"id":1956,"date":"2026-02-08T20:28:13","date_gmt":"2026-02-08T16:58:13","guid":{"rendered":"https:\/\/emif.ir\/?page_id=1956"},"modified":"2026-02-08T20:28:18","modified_gmt":"2026-02-08T16:58:18","slug":"%d8%ac%d8%b3%d8%aa%d8%ac%d9%88%db%8c-%d9%81%d8%a7%da%a9%d8%aa%d9%88%d8%b1","status":"publish","type":"page","link":"https:\/\/emif.ir\/?page_id=1956","title":{"rendered":"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631"},"content":{"rendered":"\n<style>\n@font-face {\n    font-family: 'BTitrBold';\n    src: url('https:\/\/emif.ir\/wp-content\/uploads\/2025\/09\/BTitrBold.woff2') format('woff2');\n}\n\n* {\n    font-family: 'BTitrBold', Tahoma;\n    box-sizing: border-box;\n}\n\n\/* \u062c\u0633\u062a\u062c\u0648 *\/\n.search-box {\n    display: flex;\n    gap: 10px;\n    align-items: center;\n}\n.search-box input {\n    padding:10px;\n    width:300px;\n    border-radius:6px;\n    border:1px solid #ccc;\n}\n.search-box button {\n    padding:10px 20px;\n    background:#0073aa;\n    color:#fff;\n    border:none;\n    border-radius:6px;\n    cursor:pointer;\n    font-weight: bold;\n    transition: all 0.3s;\n}\n.search-box button:hover {\n    background:#005a87;\n    transform: translateY(-2px);\n    box-shadow: 0 4px 8px rgba(0,0,0,0.2);\n}\n.btn-show-all {\n    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;\n}\n.btn-show-all:hover {\n    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;\n}\n\n\/* \u062c\u062f\u0648\u0644 \u0646\u062a\u0627\u06cc\u062c *\/\n.result-table {\n    width:100%;\n    border-collapse:collapse;\n    margin-top:20px;\n    box-shadow: 0 4px 15px rgba(0,0,0,0.1);\n    border-radius: 10px;\n    overflow: hidden;\n}\n.result-table thead {\n    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n    color: white;\n}\n.result-table th {\n    padding:15px 10px;\n    text-align:center;\n    font-weight: bold;\n    font-size: 14px;\n}\n.result-table td {\n    padding:12px 10px;\n    border-bottom:1px solid #e0e0e0;\n    text-align:center;\n    font-size: 13px;\n}\n.result-table tbody tr {\n    transition: all 0.3s;\n}\n.result-table tbody tr:hover {\n    background: linear-gradient(to right, #f8f9ff, #fff);\n    transform: scale(1.01);\n    box-shadow: 0 2px 8px rgba(0,0,0,0.1);\n}\n.result-table tbody tr:nth-child(even) {\n    background: #f9f9f9;\n}\n\n\/* \u062f\u06a9\u0645\u0647\u200c\u0647\u0627\u06cc \u0639\u0645\u0644\u06cc\u0627\u062a *\/\n.action-btn {\n    padding:8px 15px;\n    margin:2px;\n    border:none;\n    border-radius:6px;\n    cursor:pointer;\n    font-size:12px;\n    font-weight: bold;\n    transition: all 0.3s;\n}\n.action-btn:hover {\n    transform: translateY(-2px);\n    box-shadow: 0 4px 8px rgba(0,0,0,0.2);\n}\n.btn-edit {\n    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);\n    color:#fff;\n}\n.btn-delete {\n    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);\n    color:#fff;\n}\n.btn-view {\n    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);\n    color:#fff;\n}\n\n\/* Modal \u0648\u06cc\u0631\u0627\u06cc\u0634 *\/\n.modal {\n    display:none;\n    position:fixed;\n    z-index:1000;\n    left:0;\n    top:0;\n    width:100%;\n    height:100%;\n    background:rgba(0,0,0,0.6);\n    backdrop-filter: blur(5px);\n}\n.modal-content {\n    background:#fff;\n    margin:30px auto;\n    padding:30px;\n    border-radius:15px;\n    width:90%;\n    max-width:700px;\n    max-height:90vh;\n    overflow-y:auto;\n    box-shadow: 0 10px 40px rgba(0,0,0,0.3);\n    animation: slideDown 0.3s ease;\n}\n@keyframes slideDown {\n    from {transform: translateY(-50px); opacity: 0;}\n    to {transform: translateY(0); opacity: 1;}\n}\n.modal-header {\n    display:flex;\n    justify-content:space-between;\n    align-items:center;\n    margin-bottom:25px;\n    padding-bottom:15px;\n    border-bottom: 3px solid #667eea;\n}\n.modal-header h2 {\n    color: #667eea;\n    margin: 0;\n}\n.close {\n    font-size:32px;\n    font-weight:bold;\n    cursor:pointer;\n    color:#999;\n    transition: all 0.3s;\n}\n.close:hover {\n    color:#dc3545;\n    transform: rotate(90deg);\n}\n\n\/* \u0641\u0631\u0645 \u0648\u06cc\u0631\u0627\u06cc\u0634 *\/\n.edit-form {\n    display: grid;\n    grid-template-columns: repeat(2, 1fr);\n    gap: 15px;\n}\n.form-group {\n    display: flex;\n    flex-direction: column;\n}\n.form-group.full-width {\n    grid-column: 1 \/ -1;\n}\n.edit-form label {\n    margin-bottom: 8px;\n    font-weight:bold;\n    color: #333;\n    font-size: 14px;\n}\n.edit-form input, .edit-form textarea {\n    width:100%;\n    padding:12px;\n    border:2px solid #e0e0e0;\n    border-radius:8px;\n    transition: all 0.3s;\n    font-size: 14px;\n}\n.edit-form input:focus, .edit-form textarea:focus {\n    border-color: #667eea;\n    outline: none;\n    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);\n}\n.edit-form button {\n    grid-column: 1 \/ -1;\n    margin-top:20px;\n    padding:14px 30px;\n    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n    color:#fff;\n    border:none;\n    border-radius:8px;\n    cursor:pointer;\n    font-size:16px;\n    font-weight: bold;\n    transition: all 0.3s;\n}\n.edit-form button:hover {\n    transform: translateY(-2px);\n    box-shadow: 0 6px 20px rgba(102,126,234,0.4);\n}\n\n\/* \u067e\u06cc\u0627\u0645\u200c\u0647\u0627 *\/\n.msg {\n    padding:15px 20px;\n    margin:15px 0;\n    border-radius:8px;\n    text-align:center;\n    font-weight:bold;\n    animation: fadeIn 0.5s;\n}\n@keyframes fadeIn {\n    from {opacity: 0; transform: translateY(-10px);}\n    to {opacity: 1; transform: translateY(0);}\n}\n.msg-success {\n    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);\n    color:#155724;\n}\n.msg-error {\n    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);\n    color:#721c24;\n}\n\n\/* Loading *\/\n.loading {\n    text-align: center;\n    padding: 30px;\n    font-size: 16px;\n    color: #667eea;\n}\n.loading::after {\n    content: \"...\";\n    animation: dots 1.5s infinite;\n}\n@keyframes dots {\n    0%, 20% {content: \".\";}\n    40% {content: \"..\";}\n    60%, 100% {content: \"...\";}\n}\n\n\/* \u0641\u0627\u06a9\u062a\u0648\u0631 *\/\n#invoice {\n    display:none;\n    margin-top:40px;\n    padding:30px;\n    border:2px solid #000;\n    background:#fff;\n}\n\n.invoice-header {\n    text-align:center;\n}\n\n.invoice-meta {\n    margin-top:20px;\n    text-align:right;\n    line-height:2;\n}\n\n.invoice-table {\n    width:100%;\n    border-collapse:collapse;\n    margin-top:20px;\n}\n.invoice-table th, .invoice-table td {\n    border:1px solid #000;\n    padding:12px;\n    text-align:center;\n}\n\n.invoice-footer {\n    display:flex;\n    justify-content:space-between;\n    margin-top:150px;\n}\n\n.qr {\n    text-align:center;\n    margin-top:30px;\n}\n\n\/* Responsive *\/\n@media (max-width: 768px) {\n    .edit-form {\n        grid-template-columns: 1fr;\n    }\n    .search-box {\n        flex-direction: column;\n    }\n    .search-box input, .search-box button {\n        width: 100%;\n    }\n}\n\n\/* \u062a\u0646\u0638\u06cc\u0645 \u0686\u0627\u067e A4 *\/\n@page {\n    size: A4;\n    margin: 20mm;\n}\n\n@media print {\n    body * {\n        visibility: hidden;\n    }\n    #invoice, #invoice * {\n        visibility: visible;\n    }\n    #invoice {\n        position: absolute;\n        left: 0;\n        top: 0;\n        width: 100%;\n    }\n}\n<\/style>\n\n<div id=\"message-box\"><\/div>\n\n<form method=\"post\" class=\"search-box\">\n    <input type=\"text\" name=\"national_id\" placeholder=\"\ud83d\udd0d \u062c\u0633\u062a\u062c\u0648 \u0628\u0627 \u06a9\u062f \u0645\u0644\u06cc\">\n    <button type=\"submit\">\u062c\u0633\u062a\u062c\u0648<\/button>\n    <button type=\"button\" class=\"btn-show-all\" onclick=\"showAllRecords()\">\ud83d\udccb \u0646\u0645\u0627\u06cc\u0634 \u0647\u0645\u0647<\/button>\n<\/form>\n\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t<!-- Modal \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 -->\n<div id=\"passwordModal\" class=\"modal\">\n    <div class=\"modal-content\" style=\"max-width: 400px;\">\n        <div class=\"modal-header\">\n            <h2>\ud83d\udd10 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631<\/h2>\n            <span class=\"close\" onclick=\"closePasswordModal()\">&times;<\/span>\n        <\/div>\n        <form id=\"passwordForm\" style=\"display: block;\">\n            <div class=\"form-group full-width\">\n                <label>\u0644\u0637\u0641\u0627\u064b \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/label>\n                <input type=\"password\" id=\"password-input\" placeholder=\"\u0631\u0645\u0632 \u0639\u0628\u0648\u0631\" \n                       style=\"width:100%;padding:12px;border:2px solid #e0e0e0;border-radius:8px;margin-top:10px;\">\n            <\/div>\n            <button type=\"submit\" style=\"width:100%;margin-top:20px;padding:12px;background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);color:#fff;border:none;border-radius:8px;font-weight:bold;cursor:pointer;\">\n                \u2713 \u062a\u0627\u06cc\u06cc\u062f\n            <\/button>\n        <\/form>\n    <\/div>\n<\/div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n<div id=\"results-container\">\n<\/div>\n\n<!-- Modal \u0648\u06cc\u0631\u0627\u06cc\u0634 -->\n<div id=\"editModal\" class=\"modal\">\n    <div class=\"modal-content\">\n        <div class=\"modal-header\">\n            <h2>\u270f\ufe0f \u0648\u06cc\u0631\u0627\u06cc\u0634 \u0631\u06a9\u0648\u0631\u062f<\/h2>\n            <span class=\"close\" onclick=\"closeModal()\">&times;<\/span>\n        <\/div>\n        <form class=\"edit-form\" id=\"editForm\">\n            <input type=\"hidden\" id=\"edit-id\" name=\"id\">\n            \n            <div class=\"form-group\">\n                <label>\u0634\u0645\u0627\u0631\u0647 \u0641\u0627\u06a9\u062a\u0648\u0631:<\/label>\n                <input type=\"text\" id=\"edit-shomare\" name=\"shomare_faktor\" required>\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u0646\u0627\u0645 \u0648 \u0646\u0627\u0645 \u062e\u0627\u0646\u0648\u0627\u062f\u06af\u06cc:<\/label>\n                <input type=\"text\" id=\"edit-fullname\" name=\"fullname\" required>\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u06a9\u062f \u0645\u0644\u06cc:<\/label>\n                <input type=\"text\" id=\"edit-nid\" name=\"national_id\" required maxlength=\"10\">\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u0634\u0645\u0627\u0631\u0647 \u062a\u0645\u0627\u0633:<\/label>\n                <input type=\"text\" id=\"edit-phone\" name=\"phone\" maxlength=\"11\">\n            <\/div>\n            \n            <div class=\"form-group full-width\">\n                <label>\u0634\u0631\u062d \u06a9\u0627\u0644\u0627:<\/label>\n                <textarea id=\"edit-sharh\" name=\"sharh\" rows=\"3\" required><\/textarea>\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u062a\u0627\u0631\u06cc\u062e:<\/label>\n                <input type=\"date\" id=\"edit-tarikh\" name=\"tarikh\" required>\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u0645\u0628\u0644\u063a \u06a9\u0644:<\/label>\n                <input type=\"number\" id=\"edit-mablagh\" name=\"mablagh\" required>\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u062a\u0639\u062f\u0627\u062f \u0642\u0633\u0637:<\/label>\n                <input type=\"number\" id=\"edit-tedad\" name=\"tedad_ghest\" required value=\"1\" min=\"1\">\n            <\/div>\n            \n            <div class=\"form-group\">\n                <label>\u0645\u0628\u0644\u063a \u0647\u0631 \u0642\u0633\u0637:<\/label>\n                <input type=\"number\" id=\"edit-mablagh-ghest\" name=\"mablagh_har_ghest\" required>\n            <\/div>\n            \n            <button type=\"submit\">\ud83d\udcbe \u0630\u062e\u06cc\u0631\u0647 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a<\/button>\n        <\/form>\n    <\/div>\n<\/div>\n\n<!-- \u0641\u0627\u06a9\u062a\u0648\u0631 -->\n<div id=\"invoice\">\n    <div class=\"invoice-header\">\n        <img decoding=\"async\" src=\"https:\/\/emif.ir\/wp-content\/uploads\/2026\/01\/cropped-Untitled-removebg-preview-2.png\" width=\"160\">\n        <h3>\u0634\u0631\u06a9\u062a Emif Pasargad Consultants<\/h3>\n        <h3>\u0635\u0648\u0631\u062a\u062d\u0633\u0627\u0628 \u0641\u0631\u0648\u0634 \u06a9\u0627\u0644\u0627 \u0648 \u062e\u062f\u0645\u0627\u062a<\/h3>\n    <\/div>\n\n    <div class=\"invoice-meta\">\n        <strong>\u0634\u0645\u0627\u0631\u0647 \u0641\u0627\u06a9\u062a\u0648\u0631:<\/strong> <span id=\"inv-no\"><\/span><br>\n        <strong>\u062a\u0627\u0631\u06cc\u062e \u0645\u06cc\u0644\u0627\u062f\u06cc:<\/strong> <span id=\"gdate\"><\/span><br>\n        <strong>\u062a\u0627\u0631\u06cc\u062e \u0634\u0645\u0633\u06cc:<\/strong> <span id=\"jdate\"><\/span>\n    <\/div>\n\n    <table class=\"invoice-table\">\n        <tr>\n            <th>\u0646\u0627\u0645 \u0648 \u0646\u0627\u0645 \u062e\u0627\u0646\u0648\u0627\u062f\u06af\u06cc<\/th>\n            <th>\u06a9\u062f \u0645\u0644\u06cc<\/th>\n            <th>\u0634\u0631\u062d \u06a9\u0627\u0644\u0627<\/th>\n            <th>\u0645\u0628\u0644\u063a \u06a9\u0644<\/th>\n            <th>\u062a\u0639\u062f\u0627\u062f \u0642\u0633\u0637<\/th>\n            <th>\u0645\u0628\u0644\u063a \u0647\u0631 \u0642\u0633\u0637<\/th>\n        <\/tr>\n        <tr>\n            <td id=\"i-name\"><\/td>\n            <td id=\"i-nid\"><\/td>\n            <td id=\"i-desc\"><\/td>\n            <td id=\"i-price\"><\/td>\n            <td id=\"i-tedad\"><\/td>\n            <td id=\"i-ghest\"><\/td>\n        <\/tr>\n    <\/table>\n\n    <div class=\"invoice-footer\">\n        <div>\u0646\u0627\u0645 \u062e\u0631\u06cc\u062f\u0627\u0631: <span id=\"buyer\"><\/span><\/div>\n        <div>\u0645\u0647\u0631 \u0648 \u0627\u0645\u0636\u0627\u0621 \u0641\u0631\u0648\u0634\u0646\u062f\u0647<\/div>\n    <\/div>\n\n    <div class=\"qr\">\n        <img id=\"qr-img\">\n    <\/div>\n\n    <button onclick=\"window.print()\">\ud83d\udda8 \u0686\u0627\u067e \u0641\u0627\u06a9\u062a\u0648\u0631<\/button>\n<\/div>\n\n<script>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\/\/ \u0646\u0645\u0627\u06cc\u0634 \u0647\u0645\u0647 \u0631\u06a9\u0648\u0631\u062f\u0647\u0627\nfunction showAllRecords() {\n    \/\/ \u0628\u0627\u0632 \u06a9\u0631\u062f\u0646 Modal \u0631\u0645\u0632 \u0639\u0628\u0648\u0631\n    document.getElementById('passwordModal').style.display = 'block';\n    document.getElementById('password-input').value = '';\n    document.getElementById('password-input').focus();\n}\n\n\/\/ \u0628\u0633\u062a\u0646 Modal \u0631\u0645\u0632\nfunction closePasswordModal() {\n    document.getElementById('passwordModal').style.display = 'none';\n    document.getElementById('password-input').value = '';\n}\n\n\/\/ \u0686\u06a9 \u06a9\u0631\u062f\u0646 \u0631\u0645\u0632 \u0648 \u0646\u0645\u0627\u06cc\u0634 \u062c\u062f\u0648\u0644\ndocument.getElementById('passwordForm').addEventListener('submit', function(e) {\n    e.preventDefault();\n    \n    let password = document.getElementById('password-input').value;\n    \n    if(password === 'm1652i') {\n        closePasswordModal();\n        loadAllRecords(); \/\/ \u062a\u0627\u0628\u0639 \u0627\u0635\u0644\u06cc \u0646\u0645\u0627\u06cc\u0634 \u062c\u062f\u0648\u0644\n    } else {\n        showMessage('\u274c \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0627\u0634\u062a\u0628\u0627\u0647 \u0627\u0633\u062a', 'error');\n        document.getElementById('password-input').value = '';\n        document.getElementById('password-input').focus();\n    }\n});\n\n\/\/ \u062a\u0627\u0628\u0639 \u0627\u0635\u0644\u06cc \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0647\u0645\u0647 \u0631\u06a9\u0648\u0631\u062f\u0647\u0627 (\u0642\u0628\u0644\u0627\u064b showAllRecords \u0628\u0648\u062f)\nfunction loadAllRecords() {\n    let container = document.getElementById('results-container');\n    container.innerHTML = '<div class=\"loading\">\u062f\u0631 \u062d\u0627\u0644 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc<\/div>';\n    \n    fetch('https:\/\/emif.ir\/wp-admin\/admin-ajax.php', {\n        method: 'POST',\n        headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\n        body: 'action=get_all_faktors'\n    })\n    .then(r => r.json())\n    .then(data => {\n        if(data.success && data.data.length > 0) {\n            let html = '<table class=\"result-table\"><thead><tr>';\n            html += '<th>\u0631\u062f\u06cc\u0641<\/th>';\n            html += '<th>\u0634\u0645\u0627\u0631\u0647 \u0641\u0627\u06a9\u062a\u0648\u0631<\/th>';\n            html += '<th>\u0646\u0627\u0645 \u0648 \u0646\u0627\u0645 \u062e\u0627\u0646\u0648\u0627\u062f\u06af\u06cc<\/th>';\n            html += '<th>\u06a9\u062f \u0645\u0644\u06cc<\/th>';\n            html += '<th>\u0634\u0631\u062d \u06a9\u0627\u0644\u0627<\/th>';\n            html += '<th>\u062a\u0627\u0631\u06cc\u062e<\/th>';\n            html += '<th>\u0645\u0628\u0644\u063a \u06a9\u0644<\/th>';\n            html += '<th>\u062a\u0639\u062f\u0627\u062f \u0642\u0633\u0637<\/th>';\n            html += '<th>\u0645\u0628\u0644\u063a \u0647\u0631 \u0642\u0633\u0637<\/th>';\n            html += '<th>\u0639\u0645\u0644\u06cc\u0627\u062a<\/th>';\n            html += '<\/tr><\/thead><tbody>';\n            \n            data.data.forEach((row, i) => {\n                html += `<tr id=\"row-${row.id}\">\n                    <td>${i+1}<\/td>\n                    <td>${row.shomare_faktor}<\/td>\n                    <td>${row.fullname}<\/td>\n                    <td>${row.national_id}<\/td>\n                    <td>${row.sharh}<\/td>\n                    <td>${row.jalali_date}<\/td>\n                    <td>${Number(row.mablagh).toLocaleString()} \u062a\u0648\u0645\u0627\u0646<\/td>\n                    <td>${row.tedad_ghest}<\/td>\n                    <td>${Number(row.mablagh_har_ghest).toLocaleString()} \u062a\u0648\u0645\u0627\u0646<\/td>\n                    <td>\n                        <button class=\"action-btn btn-view\" onclick='viewInvoice(${JSON.stringify(row)})'>\n                            \ud83d\udc41\ufe0f \u0645\u0634\u0627\u0647\u062f\u0647\n                        <\/button>\n                        <button class=\"action-btn btn-edit\" onclick=\"editRow(${row.id})\">\n                            \u270f\ufe0f \u0648\u06cc\u0631\u0627\u06cc\u0634\n                        <\/button>\n                        <button class=\"action-btn btn-delete\" onclick=\"deleteRow(${row.id})\">\n                            \ud83d\uddd1\ufe0f \u062d\u0630\u0641\n                        <\/button>\n                    <\/td>\n                <\/tr>`;\n            });\n            \n            html += '<\/tbody><\/table>';\n            container.innerHTML = html;\n        } else {\n            container.innerHTML = '<div class=\"msg msg-error\">\u274c \u0647\u06cc\u0686 \u0631\u06a9\u0648\u0631\u062f\u06cc \u06cc\u0627\u0641\u062a \u0646\u0634\u062f<\/div>';\n        }\n    })\n    .catch(err => {\n        container.innerHTML = '<div class=\"msg msg-error\">\u274c \u062e\u0637\u0627 \u062f\u0631 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a<\/div>';\n    });\n}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\/\/ \u0646\u0645\u0627\u06cc\u0634 \u0641\u0627\u06a9\u062a\u0648\u0631\nfunction viewInvoice(data) {\n    document.getElementById('invoice').style.display = 'block';\n    \n    document.getElementById('inv-no').innerText = data.shomare_faktor;\n    document.getElementById('gdate').innerText = data.tarikh;\n    document.getElementById('jdate').innerText = data.jalali_date || data.tarikh;\n    \n    document.getElementById('i-name').innerText = data.fullname;\n    document.getElementById('i-nid').innerText = data.national_id;\n    document.getElementById('i-desc').innerText = data.sharh;\n    document.getElementById('i-price').innerText = Number(data.mablagh).toLocaleString() + ' \u062a\u0648\u0645\u0627\u0646';\n    document.getElementById('i-tedad').innerText = data.tedad_ghest;\n    document.getElementById('i-ghest').innerText = Number(data.mablagh_har_ghest).toLocaleString() + ' \u062a\u0648\u0645\u0627\u0646';\n    \n    document.getElementById('buyer').innerText = data.fullname;\n    \n    let qrText = data.fullname + ' | ' + data.national_id + ' | ' + data.sharh + ' | ' + data.mablagh;\n    document.getElementById('qr-img').src = 'https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150x150&data=' + encodeURIComponent(qrText);\n    \n    \/\/ \u0627\u0633\u06a9\u0631\u0648\u0644 \u0628\u0647 \u0641\u0627\u06a9\u062a\u0648\u0631\n    document.getElementById('invoice').scrollIntoView({behavior: 'smooth'});\n}\n\n\/\/ \u0628\u0627\u0632 \u06a9\u0631\u062f\u0646 Modal \u0648\u06cc\u0631\u0627\u06cc\u0634\nfunction editRow(id) {\n    fetch('https:\/\/emif.ir\/wp-admin\/admin-ajax.php', {\n        method: 'POST',\n        headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\n        body: 'action=get_faktor_row&id=' + id\n    })\n    .then(r => r.json())\n    .then(data => {\n        if(data.success) {\n            let row = data.data;\n            document.getElementById('edit-id').value = row.id;\n            document.getElementById('edit-shomare').value = row.shomare_faktor;\n            document.getElementById('edit-fullname').value = row.fullname;\n            document.getElementById('edit-nid').value = row.national_id;\n            document.getElementById('edit-phone').value = row.phone || '';\n            document.getElementById('edit-sharh').value = row.sharh;\n            document.getElementById('edit-tarikh').value = row.tarikh;\n            document.getElementById('edit-mablagh').value = row.mablagh;\n            document.getElementById('edit-tedad').value = row.tedad_ghest;\n            document.getElementById('edit-mablagh-ghest').value = row.mablagh_har_ghest;\n            \n            document.getElementById('editModal').style.display = 'block';\n        } else {\n            showMessage('\u062e\u0637\u0627 \u062f\u0631 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a', 'error');\n        }\n    });\n}\n\n\/\/ \u0628\u0633\u062a\u0646 Modal\nfunction closeModal() {\n    document.getElementById('editModal').style.display = 'none';\n}\n\n\/\/ \u0630\u062e\u06cc\u0631\u0647 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\ndocument.getElementById('editForm').addEventListener('submit', function(e) {\n    e.preventDefault();\n    \n    let formData = new FormData(this);\n    formData.append('action', 'update_faktor_row');\n    \n    fetch('https:\/\/emif.ir\/wp-admin\/admin-ajax.php', {\n        method: 'POST',\n        body: formData\n    })\n    .then(r => r.json())\n    .then(data => {\n        if(data.success) {\n            showMessage('\u2705 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a \u0628\u0627 \u0645\u0648\u0641\u0642\u06cc\u062a \u0630\u062e\u06cc\u0631\u0647 \u0634\u062f', 'success');\n            closeModal();\n            setTimeout(() => location.reload(), 1500);\n        } else {\n            showMessage(data.data || '\u274c \u062e\u0637\u0627 \u062f\u0631 \u0630\u062e\u06cc\u0631\u0647', 'error');\n        }\n    });\n});\n\n\/\/ \u062d\u0630\u0641 \u0631\u06a9\u0648\u0631\u062f\nfunction deleteRow(id) {\n    if(!confirm('\u26a0\ufe0f \u0622\u06cc\u0627 \u0627\u0632 \u062d\u0630\u0641 \u0627\u06cc\u0646 \u0631\u06a9\u0648\u0631\u062f \u0645\u0637\u0645\u0626\u0646 \u0647\u0633\u062a\u06cc\u062f\u061f')) return;\n    \n    fetch('https:\/\/emif.ir\/wp-admin\/admin-ajax.php', {\n        method: 'POST',\n        headers: {'Content-Type': 'application\/x-www-form-urlencoded'},\n        body: 'action=delete_faktor_row&id=' + id\n    })\n    .then(r => r.json())\n    .then(data => {\n        if(data.success) {\n            document.getElementById('row-' + id).remove();\n            showMessage('\u2705 \u0631\u06a9\u0648\u0631\u062f \u0628\u0627 \u0645\u0648\u0641\u0642\u06cc\u062a \u062d\u0630\u0641 \u0634\u062f', 'success');\n        } else {\n            showMessage(data.data || '\u274c \u062e\u0637\u0627 \u062f\u0631 \u062d\u0630\u0641', 'error');\n        }\n    });\n}\n\n\/\/ \u0646\u0645\u0627\u06cc\u0634 \u067e\u06cc\u0627\u0645\nfunction showMessage(text, type) {\n    let box = document.getElementById('message-box');\n    box.className = 'msg msg-' + type;\n    box.innerText = text;\n    setTimeout(() => box.className = '', 4000);\n}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\n\/\/ \u0628\u0633\u062a\u0646 Modal \u0628\u0627 \u06a9\u0644\u06cc\u06a9 \u062e\u0627\u0631\u062c\nwindow.onclick = function(e) {\n    let editModal = document.getElementById('editModal');\n    let passModal = document.getElementById('passwordModal');\n    \n    if (e.target == editModal) closeModal();\n    if (e.target == passModal) closePasswordModal();\n}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\/\/ \u0645\u062d\u0627\u0633\u0628\u0647 \u062e\u0648\u062f\u06a9\u0627\u0631 \u0645\u0628\u0644\u063a \u0647\u0631 \u0642\u0633\u0637\ndocument.getElementById('edit-mablagh').addEventListener('input', calculateGhest);\ndocument.getElementById('edit-tedad').addEventListener('input', calculateGhest);\n\nfunction calculateGhest() {\n    let mablagh = parseInt(document.getElementById('edit-mablagh').value) || 0;\n    let tedad = parseInt(document.getElementById('edit-tedad').value) || 1;\n    let ghest = Math.floor(mablagh \/ tedad);\n    document.getElementById('edit-mablagh-ghest').value = ghest;\n}\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1956","page","type-page","status-publish"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631 - \u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/emif.ir\/?page_id=1956\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631 - \u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )\" \/>\n<meta property=\"og:url\" content=\"https:\/\/emif.ir\/?page_id=1956\" \/>\n<meta property=\"og:site_name\" content=\"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-08T16:58:18+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 \u062f\u0642\u06cc\u0642\u0647\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/emif.ir\/?page_id=1956\",\"url\":\"https:\/\/emif.ir\/?page_id=1956\",\"name\":\"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631 - \u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )\",\"isPartOf\":{\"@id\":\"https:\/\/emif.ir\/#website\"},\"datePublished\":\"2026-02-08T16:58:13+00:00\",\"dateModified\":\"2026-02-08T16:58:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/emif.ir\/?page_id=1956#breadcrumb\"},\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/emif.ir\/?page_id=1956\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/emif.ir\/?page_id=1956#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u062e\u0627\u0646\u0647\",\"item\":\"https:\/\/emif.ir\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/emif.ir\/#website\",\"url\":\"https:\/\/emif.ir\/\",\"name\":\"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/emif.ir\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/emif.ir\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/emif.ir\/#organization\",\"name\":\"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )\",\"url\":\"https:\/\/emif.ir\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/emif.ir\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/emif.ir\/wp-content\/uploads\/2026\/01\/cropped-Untitled-removebg-preview-1.png\",\"contentUrl\":\"https:\/\/emif.ir\/wp-content\/uploads\/2026\/01\/cropped-Untitled-removebg-preview-1.png\",\"width\":345,\"height\":372,\"caption\":\"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )\"},\"image\":{\"@id\":\"https:\/\/emif.ir\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631 - \u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/emif.ir\/?page_id=1956","og_locale":"fa_IR","og_type":"article","og_title":"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631 - \u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )","og_url":"https:\/\/emif.ir\/?page_id=1956","og_site_name":"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )","article_modified_time":"2026-02-08T16:58:18+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646":"1 \u062f\u0642\u06cc\u0642\u0647"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/emif.ir\/?page_id=1956","url":"https:\/\/emif.ir\/?page_id=1956","name":"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631 - \u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )","isPartOf":{"@id":"https:\/\/emif.ir\/#website"},"datePublished":"2026-02-08T16:58:13+00:00","dateModified":"2026-02-08T16:58:18+00:00","breadcrumb":{"@id":"https:\/\/emif.ir\/?page_id=1956#breadcrumb"},"inLanguage":"fa-IR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/emif.ir\/?page_id=1956"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/emif.ir\/?page_id=1956#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u062e\u0627\u0646\u0647","item":"https:\/\/emif.ir\/"},{"@type":"ListItem","position":2,"name":"\u062c\u0633\u062a\u062c\u0648\u06cc \u0641\u0627\u06a9\u062a\u0648\u0631"}]},{"@type":"WebSite","@id":"https:\/\/emif.ir\/#website","url":"https:\/\/emif.ir\/","name":"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )","description":"","publisher":{"@id":"https:\/\/emif.ir\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/emif.ir\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fa-IR"},{"@type":"Organization","@id":"https:\/\/emif.ir\/#organization","name":"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )","url":"https:\/\/emif.ir\/","logo":{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/emif.ir\/#\/schema\/logo\/image\/","url":"https:\/\/emif.ir\/wp-content\/uploads\/2026\/01\/cropped-Untitled-removebg-preview-1.png","contentUrl":"https:\/\/emif.ir\/wp-content\/uploads\/2026\/01\/cropped-Untitled-removebg-preview-1.png","width":345,"height":372,"caption":"\u0634\u0631\u06a9\u062a Emif Pasargad Consultants ( S.R.L )"},"image":{"@id":"https:\/\/emif.ir\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/emif.ir\/index.php?rest_route=\/wp\/v2\/pages\/1956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emif.ir\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/emif.ir\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/emif.ir\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emif.ir\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1956"}],"version-history":[{"count":1,"href":"https:\/\/emif.ir\/index.php?rest_route=\/wp\/v2\/pages\/1956\/revisions"}],"predecessor-version":[{"id":1957,"href":"https:\/\/emif.ir\/index.php?rest_route=\/wp\/v2\/pages\/1956\/revisions\/1957"}],"wp:attachment":[{"href":"https:\/\/emif.ir\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}