dara-dashboards/dashboards/crm-pipeline.html

411 lines
No EOL
28 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>اکیپا CRM • پایپ‌لاین جذب اتاق‌های فرار</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<style>
* { font-family: 'Vazirmatn', sans-serif; }
.tnum { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
</style>
</head>
<body class="bg-slate-50 text-slate-800 h-screen flex overflow-hidden antialiased">
<!-- ۱. سایدبار راست (Main Sidebar - 240px) -->
<aside class="w-60 bg-white border-l border-slate-200 flex flex-col justify-between shrink-0 z-20">
<div>
<!-- لوگو و برند -->
<div class="h-16 flex items-center px-5 border-b border-slate-100 gap-3">
<div class="w-8 h-8 rounded-lg bg-blue-600 flex items-center justify-center text-white font-black text-lg shadow-sm">
E
</div>
<div class="flex flex-col">
<span class="font-bold text-slate-900 tracking-tight text-base">اکیپا CRM</span>
<span class="text-[11px] text-slate-400 font-medium">مدیریت جذب مجموعه‌ها</span>
</div>
</div>
<!-- منوی ناوبری اصلی -->
<nav class="p-3 space-y-1">
<a href="#" class="flex items-center gap-3 px-3 py-2.5 rounded-lg text-slate-600 hover:bg-slate-50 hover:text-slate-900 text-sm font-medium transition-colors">
<svg class="w-5 h-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" />
</svg>
<span>داشبورد و آمار کل</span>
</a>
<!-- آیتم فعال: پایپ‌لاین جذب -->
<a href="#" class="flex items-center gap-3 px-3 py-2.5 rounded-lg bg-blue-50 text-blue-700 text-sm font-bold border-r-4 border-blue-600 transition-colors">
<svg class="w-5 h-5 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
</svg>
<span>پایپ‌لاین جذب</span>
<span class="mr-auto bg-blue-600 text-white text-[10px] px-2 py-0.5 rounded-full font-bold tnum">۳۸</span>
</a>
<a href="#" class="flex items-center gap-3 px-3 py-2.5 rounded-lg text-slate-600 hover:bg-slate-50 hover:text-slate-900 text-sm font-medium transition-colors">
<svg class="w-5 h-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z" />
</svg>
<span>آنبوردینگ و نگهداشت</span>
</a>
<a href="#" class="flex items-center gap-3 px-3 py-2.5 rounded-lg text-slate-600 hover:bg-slate-50 hover:text-slate-900 text-sm font-medium transition-colors">
<svg class="w-5 h-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
</svg>
<span>باشگاه مجموعه‌داران</span>
</a>
<a href="#" class="flex items-center gap-3 px-3 py-2.5 rounded-lg text-slate-600 hover:bg-slate-50 hover:text-slate-900 text-sm font-medium transition-colors">
<svg class="w-5 h-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" />
</svg>
<span>لوپ محتوایی پیامک</span>
</a>
<a href="#" class="flex items-center gap-3 px-3 py-2.5 rounded-lg text-slate-600 hover:bg-slate-50 hover:text-slate-900 text-sm font-medium transition-colors">
<svg class="w-5 h-5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
<span>تنظیمات پایگاه داده</span>
</a>
</nav>
</div>
<!-- فوتر سایدبار: مشخصات کارشناس -->
<div class="p-3 border-t border-slate-100">
<div class="flex items-center gap-3 p-2 rounded-lg bg-slate-50">
<div class="w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center font-bold text-slate-700 text-sm shrink-0">
دا
</div>
<div class="flex flex-col min-w-0">
<span class="text-sm font-bold text-slate-900 truncate">کارشناس فروش (دارا)</span>
<span class="text-xs text-emerald-600 font-medium flex items-center gap-1.5">
<span class="w-2 h-2 rounded-full bg-emerald-500 inline-block animate-pulse"></span>
آنلاین • شیفت صبح
</span>
</div>
</div>
</div>
</aside>
<!-- ۲. محتوای اصلی و ستون کار (Main Content) -->
<main class="flex-1 flex flex-col min-w-0 overflow-y-auto">
<!-- هدر بالای صفحه (Top Header) -->
<header class="h-16 bg-white border-b border-slate-200 px-8 flex items-center justify-between shrink-0">
<div class="flex items-center gap-4">
<h1 class="text-xl font-extrabold text-slate-900">پایپ‌لاین جذب اتاق‌فرارها</h1>
<span class="bg-blue-100 text-blue-700 text-xs px-2.5 py-1 rounded-full font-bold">پایپ‌لاین فعال فروش</span>
</div>
<div class="flex items-center gap-3">
<!-- سوئیچ حالت نمایش (جدول / کانبان) -->
<div class="bg-slate-100 p-1 rounded-lg flex items-center gap-1 border border-slate-200 text-xs font-bold">
<button id="viewTableBtn" class="bg-blue-600 text-white px-3 py-1.5 rounded-md shadow-sm transition-all">نمای جدولی</button>
<button id="viewKanbanBtn" class="text-slate-600 hover:text-slate-900 px-3 py-1.5 rounded-md transition-all">کانبان ۵ مرحله‌ای</button>
</div>
<!-- دکمه‌های اکشن بالا -->
<button onclick="openSmsTemplateModal()" class="px-4 py-2 border border-slate-300 rounded-lg text-slate-700 hover:bg-slate-50 font-bold text-sm flex items-center gap-2 transition-all">
<svg class="w-4 h-4 text-slate-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" />
</svg>
<span>الگوهای پیامک (۴.۳)</span>
</button>
<button onclick="openAddLeadModal()" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-bold text-sm shadow-sm flex items-center gap-2 transition-all">
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
</svg>
<span>+ افزودن سرنخ جدید (۴.۱)</span>
</button>
</div>
</header>
<!-- بدنه محتوا -->
<div class="p-8 space-y-6">
<!-- کارت‌های ۴گانه شاخص‌های عملیاتی (KPI Cards) -->
<div class="grid grid-cols-4 gap-4">
<!-- کارت ۱: کل سرنخ‌های فعال -->
<div class="bg-white p-5 rounded-xl border border-slate-200 shadow-xs flex flex-col justify-between">
<div class="flex items-center justify-between text-slate-500 text-xs font-bold">
<span>سرنخ‌های فعال</span>
<span class="text-slate-400 hover:text-slate-600 cursor-pointer" title="تعداد کل سرنخ‌های در جریان پایپ‌لاین">ⓘ</span>
</div>
<div class="my-3">
<span class="text-3xl font-black text-slate-900 tnum">۳۸</span>
</div>
<div class="text-xs text-blue-600 font-bold flex items-center gap-1">
<span>▲ ۱۲٪ رشد هفتگی</span>
</div>
</div>
<!-- کارت ۲: پیگیری‌های امروز -->
<div class="bg-white p-5 rounded-xl border border-slate-200 shadow-xs flex flex-col justify-between">
<div class="flex items-center justify-between text-slate-500 text-xs font-bold">
<span>تماس‌های موعد امروز</span>
<span class="text-slate-400 hover:text-slate-600 cursor-pointer" title="لیدهایی که موعد تماس آنها امروز است">ⓘ</span>
</div>
<div class="my-3">
<span class="text-3xl font-black text-red-600 tnum">۱۴</span>
</div>
<div class="text-xs text-amber-600 font-bold flex items-center gap-1">
<span>⚠ ۴ تماس اولویت بالا</span>
</div>
</div>
<!-- کارت ۳: قراردادهای موفق ماه -->
<div class="bg-white p-5 rounded-xl border border-slate-200 shadow-xs flex flex-col justify-between">
<div class="flex items-center justify-between text-slate-500 text-xs font-bold">
<span>قراردادهای موفق ماه</span>
<span class="text-slate-400 hover:text-slate-600 cursor-pointer" title="اتاق‌هایی که در این ماه قرارداد بسته‌اند">ⓘ</span>
</div>
<div class="my-3">
<span class="text-3xl font-black text-emerald-600 tnum">۶</span>
</div>
<div class="text-xs text-emerald-600 font-bold flex items-center gap-1">
<span>کمیسیون تخمینی: ۷۲ م.ت</span>
</div>
</div>
<!-- کارت ۴: نرخ تبدیل پایپ‌لاین -->
<div class="bg-white p-5 rounded-xl border border-slate-200 shadow-xs flex flex-col justify-between">
<div class="flex items-center justify-between text-slate-500 text-xs font-bold">
<span>نرخ تبدیل پایپ‌لاین</span>
<span class="text-slate-400 hover:text-slate-600 cursor-pointer" title="درصد تبدیل سرنخ خام به قرارداد قطعی">ⓘ</span>
</div>
<div class="my-3">
<span class="text-3xl font-black text-slate-900 tnum">۱۵.۷٪</span>
</div>
<div class="text-xs text-slate-500 font-medium">
<span>تارگت ماه: ۱۸٪</span>
</div>
</div>
</div>
<!-- نوار ابزار جستجو و فیلترها (Filter Toolbar) -->
<div class="bg-white p-3.5 rounded-xl border border-slate-200 flex items-center justify-between gap-4">
<div class="flex items-center gap-3 flex-1">
<!-- جستجوی زنده -->
<div class="relative w-80">
<input id="searchInput" oninput="renderTable()" type="text" placeholder="...جستجوی نام اتاق، مالک، تلفن یا شهر" class="w-full pl-3 pr-9 py-2 rounded-lg border border-slate-200 text-xs focus:outline-none focus:border-blue-500 text-slate-700 bg-slate-50">
<svg class="w-4 h-4 text-slate-400 absolute right-3 top-2.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
</div>
<!-- دراپ‌داون شهر -->
<select id="cityFilter" onchange="renderTable()" class="px-3 py-2 rounded-lg border border-slate-200 text-xs bg-slate-50 text-slate-700 focus:outline-none focus:border-blue-500 font-medium">
<option value="all">همه شهرها</option>
<option value="تهران">تهران</option>
<option value="کرج">کرج</option>
<option value="مشهد">مشهد</option>
<option value="اصفههان">اصفهان</option>
<option value="شیراز">شیراز</option>
</select>
<!-- دراپ‌داون مرحله -->
<select id="stageFilter" onchange="renderTable()" class="px-3 py-2 rounded-lg border border-slate-200 text-xs bg-slate-50 text-slate-700 focus:outline-none focus:border-blue-500 font-medium">
<option value="all">همه مراحل پایپ‌لاین</option>
<option value="تماس ۱">تماس ۱ (کشف نیاز)</option>
<option value="تماس ۲">تماس ۲ (پرزنت)</option>
<option value="تماس ۳">تماس ۳ (رفع مانع)</option>
<option value="تماس ۴">تماس ۴ (تخفیف/کمیسیون)</option>
<option value="تماس ۵">تماس ۵ (عقد قرارداد)</option>
</select>
<!-- دراپ‌داون وضعیت -->
<select id="statusFilter" onchange="renderTable()" class="px-3 py-2 rounded-lg border border-slate-200 text-xs bg-slate-50 text-slate-700 focus:outline-none focus:border-blue-500 font-medium">
<option value="all">همه وضعیت‌ها</option>
<option value="امروز">موعد امروز</option>
<option value="فردا">موعد فردا</option>
<option value="معوقه">معوقه‌ها</option>
</select>
</div>
<!-- پاک کردن فیلترها -->
<button onclick="resetFilters()" class="text-xs text-red-600 hover:text-red-700 font-bold flex items-center gap-1 shrink-0">
<span>پاک کردن فیلترها</span>
<span>×</span>
</button>
</div>
<!-- جدول اصلی لیدها (Data Table) -->
<div class="bg-white rounded-xl border border-slate-200 shadow-xs overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-right border-collapse">
<thead>
<tr class="bg-slate-50 border-b border-slate-200 text-slate-500 text-xs font-bold">
<th class="p-4 w-10 text-center">
<input type="checkbox" id="selectAll" onchange="toggleSelectAll()" class="rounded border-slate-300 text-blue-600 focus:ring-blue-500">
</th>
<th class="p-4 w-20">شناسه</th>
<th class="p-4">نام مجموعه / اتاق فرار</th>
<th class="p-4">شهر و منطقه</th>
<th class="p-4">مالک و شماره تماس</th>
<th class="p-4">مرحله جاری</th>
<th class="p-4">مهم‌ترین اعتراض</th>
<th class="p-4">موعد پیگیری</th>
<th class="p-4 text-center">اقدام سریع</th>
<th class="p-4 text-center w-14">منو</th>
</tr>
</thead>
<tbody id="leadsTableBody" class="divide-y divide-slate-100 text-xs text-slate-700">
<!-- ردیف‌های پویا از طریق جاوااسکریپت رندر می‌شوند -->
</tbody>
</table>
</div>
<!-- پیجینیشن و پاورقی جدول -->
<div class="p-4 border-t border-slate-100 flex items-center justify-between text-xs text-slate-500">
<span id="tableCountSummary">نمایش ۸ مورد از ۳۸ سرنخ</span>
<div class="flex items-center gap-1 font-bold">
<button class="px-2.5 py-1 rounded border border-slate-200 bg-white hover:bg-slate-50 text-slate-600">قبلی</button>
<button class="px-2.5 py-1 rounded bg-blue-600 text-white">۱</button>
<button class="px-2.5 py-1 rounded border border-slate-200 bg-white hover:bg-slate-50 text-slate-600">۲</button>
<button class="px-2.5 py-1 rounded border border-slate-200 bg-white hover:bg-slate-50 text-slate-600">۳</button>
<button class="px-2.5 py-1 rounded border border-slate-200 bg-white hover:bg-slate-50 text-slate-600">بعدی</button>
</div>
</div>
</div>
</div>
</main>
<!-- جاوااسکریپت تعاملی و سبک داده‌ها -->
<script>
// بانک داده‌های سرنخ‌ها (دقیقاً مطابق جدول تصویر و PRD)
const leadsData = [
{ id: 'EKP-121', name: 'دخمه سیاه', branch: 'اصفهان، چهارباغ بالا', city: 'اصفهان', owner: 'کامران نوری', phone: '09139990011', stage: 'تماس ۱', objection: 'بی‌اعتمادی به رزرو آنلاین', due: 'امروز ۱۰:۳۰', status: 'امروز' },
{ id: 'EKP-122', name: 'رستاخیز', branch: 'تهران، سعادت‌آباد', city: 'تهران', owner: 'رضا کمالی', phone: '09121112233', stage: 'تماس ۳', objection: 'کمیسیون ۱۵٪ بالاست', due: 'امروز ۱۱:۱۵', status: 'امروز' },
{ id: 'EKP-123', name: 'کلبه وحشت جنگلی', branch: 'مشهد، وکیل‌آباد', city: 'مشهد', owner: 'سعید موسوی', phone: '09154445566', stage: 'تماس ۴', objection: 'تسویه ۴۸ ساعته دیر است', due: 'امروز ۱۴:۰۰', status: 'امروز' },
{ id: 'EKP-124', name: 'اسکیپ لند مهرشهر', branch: 'کرج، مهرشهر فاز ۱', city: 'کرج', owner: 'احسان طاهری', phone: '09358889900', stage: 'تماس ۲', objection: 'نیاز به صحبت با شریک', due: 'فردا ۱۰:۰۰', status: 'فردا' },
{ id: 'EKP-125', name: 'معمای شرلوک', branch: 'تهران، نیاوران', city: 'تهران', owner: 'پویا مرادی', phone: '09127778899', stage: 'تماس ۵', objection: 'تنظیم بند قرارداد', due: 'فردا ۱۲:۳۰', status: 'فردا' },
{ id: 'EKP-126', name: 'اسکیپ کلوب کوروش', branch: 'تهران، ستاری شمال', city: 'تهران', owner: 'میثم احمدی', phone: '09123332211', stage: 'تماس ۱', objection: 'سایت شخصی داریم', due: 'پس‌فردا', status: 'آینده' },
{ id: 'EKP-127', name: 'زندان آلکاتراز', branch: 'شیراز، قدوسی غربی', city: 'شیراز', owner: 'بهنام فرهمند', phone: '09171114455', stage: 'تماس ۳', objection: 'مشکل تداخل تقویم سانس‌ها', due: 'پس‌فردا', status: 'آینده' },
{ id: 'EKP-128', name: 'طلسم سیاه', branch: 'کرج، گوهردشت', city: 'کرج', owner: 'آرش صادقی', phone: '09112223344', stage: 'تماس ۴', objection: 'درخواست تخفیف کارمزد', due: '۳ روز دیگر', status: 'آینده' }
];
let selectedLeads = new Set();
function renderTable() {
const tbody = document.getElementById('leadsTableBody');
const search = document.getElementById('searchInput').value.trim().toLowerCase();
const city = document.getElementById('cityFilter').value;
const stage = document.getElementById('stageFilter').value;
const status = document.getElementById('statusFilter').value;
const filtered = leadsData.filter(lead => {
const matchSearch = lead.name.toLowerCase().includes(search) ||
lead.owner.toLowerCase().includes(search) ||
lead.phone.includes(search) ||
lead.city.includes(search);
const matchCity = (city === 'all') || lead.city.includes(city);
const matchStage = (stage === 'all') || lead.stage === stage;
const matchStatus = (status === 'all') || lead.status === status;
return matchSearch && matchCity && matchStage && matchStatus;
});
tbody.innerHTML = '';
filtered.forEach(lead => {
const tr = document.createElement('tr');
tr.className = "hover:bg-slate-50 transition-colors border-b border-slate-100";
const isChecked = selectedLeads.has(lead.id) ? 'checked' : '';
tr.innerHTML = `
<td class="p-4 text-center">
<input type="checkbox" ${isChecked} onchange="toggleLeadSelect('${lead.id}')" class="rounded border-slate-300 text-blue-600 focus:ring-blue-500">
</td>
<td class="p-4 font-mono text-slate-500 font-bold">${lead.id}</td>
<td class="p-4">
<div class="font-bold text-slate-900">${lead.name}</div>
<div class="text-[11px] text-slate-400 font-medium">${lead.branch}</div>
</td>
<td class="p-4 font-medium">${lead.city}</td>
<td class="p-4">
<div class="font-bold text-slate-800">${lead.owner}</div>
<div class="font-mono text-[11px] text-slate-400">${lead.phone}</div>
</td>
<td class="p-4">
<span class="bg-blue-50 text-blue-700 px-2.5 py-1 rounded-md font-bold text-xs border border-blue-200/50">
${lead.stage}
</span>
</td>
<td class="p-4">
<span class="bg-red-50 text-red-600 px-2 py-0.5 rounded text-[11px] font-bold border border-red-100">
${lead.objection}
</span>
</td>
<td class="p-4 font-bold text-slate-700 tnum">
${lead.due.includes('امروز') ? `<span class="text-red-600">● ${lead.due}</span>` : lead.due}
</td>
<td class="p-4 text-center">
<button onclick="alert('اقدام برای ' + '${lead.name}')" class="px-3 py-1 bg-white hover:bg-slate-100 text-slate-700 border border-slate-200 rounded-md font-bold text-xs shadow-2xs transition-all">
کشو (۳)
</button>
</td>
<td class="p-4 text-center">
<button class="p-1 rounded hover:bg-slate-100 text-slate-400 hover:text-slate-600">
⋮
</button>
</td>
`;
tbody.appendChild(tr);
});
document.getElementById('tableCountSummary').innerText = `نمایش ${filtered.length} مورد از ${leadsData.length} سرنخ`;
}
function toggleLeadSelect(id) {
if (selectedLeads.has(id)) {
selectedLeads.delete(id);
} else {
selectedLeads.add(id);
}
}
function toggleSelectAll() {
const all = document.getElementById('selectAll').checked;
if (all) {
leadsData.forEach(l => selectedLeads.add(l.id));
} else {
selectedLeads.clear();
}
renderTable();
}
function resetFilters() {
document.getElementById('searchInput').value = '';
document.getElementById('cityFilter').value = 'all';
document.getElementById('stageFilter').value = 'all';
document.getElementById('statusFilter').value = 'all';
renderTable();
}
function openAddLeadModal() {
alert('مدال افزودن سرنخ (در فاز بعد فعال می‌شود)');
}
function openSmsTemplateModal() {
alert('مدال الگوهای پیامک (در فاز بعد فعال می‌شود)');
}
// بارگذاری اولیه
renderTable();
</script>
</body>
</html>