טופס רישום למתווכים למערכת הפרסום

// אישור פרסום async function confirmPublish() { const propertyId = document.getElementById('publishModal').getAttribute('data-property-id'); const selectedPlatforms = []; let totalCost = 0; // איסוף פלטפורמות נבחרות וחישוב עלות const costs = { facebook: 3, linkedin: 5, whatsapp: 2, auto_schedule: 10 }; if (document.getElementById('publishFacebook')?.checked) { selectedPlatforms.push('facebook'); totalCost += costs.facebook; } if (document.getElementById('publishLinkedIn')?.checked) { selectedPlatforms.push('linkedin'); totalCost += costs.linkedin; } if (document.getElementById('publishWhatsApp')?.checked) { selectedPlatforms.push('whatsapp'); totalCost += costs.whatsapp; } if (document.getElementById('publishAutoSchedule')?.checked) { selectedPlatforms.push('auto_schedule'); totalCost += costs.auto_schedule; } if (selectedPlatforms.length === 0) { showStatus('בחר לפחות פלטפורמה אחת לפרסום', 'warning'); return; } if (totalCost > (currentBroker.credits || 0)) { showStatus(`⚠️ אין מספיק ניקוד נדלני! דרוש: ${totalCost} נק׳, זמין: ${currentBroker.credits || 0} נק׳`, 'error'); return; } setLoading(true); closeModal(); try { const response = await fetch(WEBHOOK_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'auto_publish_property', broker_id: currentBroker.id, property_id: propertyId, platforms: selectedPlatforms, cost: totalCost }) }); const data = await response.json(); if (data.success) { // עדכון ניקוד נדלני currentBroker.credits -= totalCost; document.getElementById('nadelaniCredits').textContent = currentBroker.credits; showStatus(`🚀 הנכס נשלח לפרסום אוטומטי! השתמשנו ב-${totalCost} נקודות נדלני`, 'success'); } else { showStatus(data.message || 'שגי

🏠 פאנל ניהול נכסים - נָדְלָנִי

טוען...

מתווך נדל"ן | מערכת פרסום אוטומטית

0
נכסים פעילים
0
⭐ ניקוד נדלני