حسین پاشائی

مشاوره و مدیریت

طراح و گرافیست

عکاسی

طراحی سایت

خدمات معماری

0
سبد خرید خالی است.
حسین پاشائی
حسین پاشائی

مشاوره و مدیریت

طراح و گرافیست

عکاسی

طراحی سایت

خدمات معماری

محسن پاشایی

نمایش 5–5 از 5 نتیجه

`;printWin.document.open(); printWin.document.write(htmlContent); printWin.document.close(); }document.addEventListener('click', function(e) { const tabTrigger = e.target.closest('[data-tab]'); if (tabTrigger) { e.preventDefault(); switchTab(tabTrigger.getAttribute('data-tab')); return; }const actionBtn = e.target.closest('[data-action]'); if (!actionBtn) return;e.preventDefault(); const action = actionBtn.getAttribute('data-action');if (action === 'print-invoice') { printInvoiceClean(); } else if (action === 'open-invoice') { const orderId = actionBtn.getAttribute('data-order-id'); document.querySelectorAll('.pasha-module-section').forEach(el => el.style.display = 'none'); const modalSec = document.getElementById('invoice-modal-section'); const wrap = document.getElementById('pasha-modal-content-wrap'); if (modalSec && wrap) { modalSec.style.display = 'block'; wrap.innerHTML = '
در حال بارگذاری فاکتور رسمی...
'; const fd = new FormData(); fd.append('action', 'pasha_get_invoice_detail'); fd.append('security', nonce); fd.append('order_id', orderId); fetch(ajaxUrl, { method: 'POST', body: fd }) .then(r => r.json()) .then(res => { wrap.innerHTML = res.success ? res.data.html : '
خطا
'; }); } } else if (action === 'delete-invoice') { const orderId = actionBtn.getAttribute('data-order-id'); if (confirm('آیا از حذف فاکتور #' + toPersianNum(orderId) + ' اطمینان دارید؟')) { const fd = new FormData(); fd.append('action', 'pasha_admin_delete_invoice'); fd.append('security', nonce); fd.append('order_id', orderId); fetch(ajaxUrl, { method: 'POST', body: fd }) .then(r => r.json()) .then(res => { if (res.success) { const card = document.getElementById('order-card-' + orderId); if (card) card.remove(); const countEl = document.getElementById('pasha-nav-orders-count'); const statTotal = document.getElementById('pasha-stat-total'); if (countEl) countEl.innerText = toPersianNum(Math.max(0, toEnglishNum(countEl.innerText) - 1)); if (statTotal) statTotal.innerText = toPersianNum(Math.max(0, toEnglishNum(statTotal.innerText) - 1)); } else { alert(res.data.message); } }); } } else if (action === 'add-service') { const title = actionBtn.getAttribute('data-title') || ''; const price = actionBtn.getAttribute('data-price') || ''; const container = document.getElementById('pasha_items_container'); if (container) { const row = document.createElement('div'); row.className = 'pasha-item-row'; row.innerHTML = '' + '' + '' + ''; container.appendChild(row); } } else if (action === 'submit-invoice') { const name = document.getElementById('pasha_cust_name').value; const mobile = document.getElementById('pasha_cust_mobile').value; const project = document.getElementById('pasha_project_title').value; const discount = document.getElementById('pasha_discount').value; const feedback = document.getElementById('pasha_admin_feedback');const items = []; document.querySelectorAll('#pasha_items_container .pasha-item-row').forEach(row => { const t = row.querySelector('.item-title').value; const p = row.querySelector('.item-price').value; const q = row.querySelector('.item-qty').value; if (t && p) items.push({ title: t, price: p, qty: q }); });feedback.style.color = '#0284c7'; feedback.innerText = 'در حال ثبت در ووکامرس و ارسال پیامک...'; const fd = new FormData(); fd.append('action', 'pasha_admin_create_invoice'); fd.append('security', nonce); fd.append('customer_name', name); fd.append('mobile', mobile); fd.append('project_title', project); fd.append('discount', discount); fd.append('items', JSON.stringify(items));fetch(ajaxUrl, { method: 'POST', body: fd }) .then(r => r.json()) .then(res => { if (res.success) { feedback.style.color = '#15803d'; feedback.innerHTML = '✅ ' + res.data.message + ' '; const grid = document.getElementById('pasha-orders-grid'); const noMsg = document.getElementById('pasha-no-orders-msg'); if (noMsg) noMsg.style.display = 'none'; if (grid && res.data.card_html) { grid.insertAdjacentHTML('afterbegin', res.data.card_html); } const countEl = document.getElementById('pasha-nav-orders-count'); const statTotal = document.getElementById('pasha-stat-total'); const statUnpaid = document.getElementById('pasha-stat-unpaid'); if (countEl) countEl.innerText = toPersianNum(toEnglishNum(countEl.innerText) + 1); if (statTotal) statTotal.innerText = toPersianNum(toEnglishNum(statTotal.innerText) + 1); if (statUnpaid) statUnpaid.innerText = toPersianNum(toEnglishNum(statUnpaid.innerText) + 1); } else { feedback.style.color = '#dc2626'; feedback.innerText = '❌ ' + res.data.message; } }); } else if (action === 'save-sms') { const msg = document.getElementById('pasha_sms_save_msg'); msg.innerText = 'در حال ذخیره...'; const fd = new FormData(); fd.append('action', 'pasha_save_sms_settings'); fd.append('security', nonce); fd.append('mp_username', document.getElementById('mp_username').value); fd.append('mp_password', document.getElementById('mp_password').value); fd.append('mp_from', document.getElementById('mp_from').value); fd.append('mp_pattern_welcome', document.getElementById('mp_pattern_welcome').value); fd.append('mp_pattern_invoice', document.getElementById('mp_pattern_invoice').value); fd.append('mp_pattern_otp', document.getElementById('mp_pattern_otp').value); const logoInput = document.getElementById('pasha_invoice_logo_url'); if (logoInput) fd.append('invoice_logo_url', logoInput.value); const stampInput = document.getElementById('pasha_invoice_stamp_url'); if (stampInput) fd.append('invoice_stamp_url', stampInput.value); fetch(ajaxUrl, { method: 'POST', body: fd }).then(r => r.json()).then(res => { msg.innerText = res.success ? '✅ ذخیره شد' : '❌ خطا'; }); } else if (action === 'save-address') { const msg = document.getElementById('pasha_addr_msg'); msg.innerText = 'در حال ذخیره...'; const fd = new FormData(); fd.append('action', 'pasha_save_address'); fd.append('security', nonce); fd.append('billing_company', document.getElementById('addr_company').value); fd.append('billing_phone', document.getElementById('addr_phone').value); fd.append('billing_state', document.getElementById('addr_state').value); fd.append('billing_city', document.getElementById('addr_city').value); fd.append('billing_address_1', document.getElementById('addr_line1').value); fd.append('billing_postcode', document.getElementById('addr_postcode').value); fetch(ajaxUrl, { method: 'POST', body: fd }).then(r => r.json()).then(res => { msg.innerText = res.success ? '✅ ذخیره شد' : '❌ خطا'; }); } else if (action === 'save-account') { const msg = document.getElementById('pasha_acc_msg'); msg.innerText = 'در حال بروزرسانی...'; const fd = new FormData(); fd.append('action', 'pasha_save_account_details'); fd.append('security', nonce); fd.append('first_name', document.getElementById('acc_fname').value); fd.append('last_name', document.getElementById('acc_lname').value); fd.append('display_name', document.getElementById('acc_dname').value); fd.append('email', document.getElementById('acc_email').value); fd.append('new_password', document.getElementById('acc_pass').value); fetch(ajaxUrl, { method: 'POST', body: fd }).then(r => r.json()).then(res => { msg.innerText = res.success ? '✅ بروزرسانی شد' : '❌ ' + res.data.message; }); } else if (action === 'send-otp') { const mobile = document.getElementById('pasha_login_mobile').value; const msg = document.getElementById('pasha_login_msg'); msg.innerText = 'ارسال...'; const fd = new FormData(); fd.append('action', 'pasha_send_otp'); fd.append('security', nonce); fd.append('mobile', mobile); fetch(ajaxUrl, { method: 'POST', body: fd }).then(r => r.json()).then(res => { if (res.success) { document.getElementById('pasha_otp_step1').style.display = 'none'; document.getElementById('pasha_otp_step2').style.display = 'flex'; msg.innerText = res.data.message; } else { msg.innerText = res.data.message; } }); } else if (action === 'verify-otp') { const mobile = document.getElementById('pasha_login_mobile').value; const code = document.getElementById('pasha_login_code').value; const fd = new FormData(); fd.append('action', 'pasha_verify_otp'); fd.append('security', nonce); fd.append('mobile', mobile); fd.append('code', code); fetch(ajaxUrl, { method: 'POST', body: fd }).then(r => r.json()).then(res => { if (res.success) { window.location.reload(); } else { document.getElementById('pasha_login_msg').innerText = res.data.message; } }); } }); })();