`); w.document.close(); w.print(); }; // ───────────────────────────────────────────────────────────────────────── // DASHBOARD // ───────────────────────────────────────────────────────────────────────── function Dashboard() { const certs = participations.filter(p => p.certificate).length; const topMembers = members .map(m => ({ ...m, count: memberParticipations(m.id).length })) .sort((a, b) => b.count - a.count).slice(0, 5); const recentActs = [...activities].sort((a, b) => (b.date || "").localeCompare(a.date || "")).slice(0, 5); return (

لوحة التحكم

نظرة عامة على نشاط الكيان

{members.length}👥 إجمالي الأعضاء
{activities.length}🎯 إجمالي الأنشطة
{participations.length}✅ إجمالي المشاركات
{certs}🏅 شهادات ممنوحة

🏆 أكثر الأعضاء نشاطًا

{topMembers.length === 0 &&

لا يوجد أعضاء بعد

} {topMembers.map((m, i) => (
{i+1} {m.name} {m.count} نشاط
))}

📅 أحدث الأنشطة

{recentActs.length === 0 &&

لا توجد أنشطة بعد

} {recentActs.map((a, i) => (
{a.type} {a.name} {a.date}
))}
☁️ البيانات محفوظة تلقائياً على Firebase — متاحة من أي جهاز في أي وقت
); } // ───────────────────────────────────────────────────────────────────────── // MEMBERS // ───────────────────────────────────────────────────────────────────────── function MembersPage() { const filtered = members.filter(m => (m.name.toLowerCase().includes(search.toLowerCase()) || (m.email||"").toLowerCase().includes(search.toLowerCase()) || (m.faculty||"").toLowerCase().includes(search.toLowerCase()) || (m.phone||"").includes(search)) && (filterSeason === "all" || m.joinedSeason === filterSeason) ); return (

الأعضاء

إدارة بيانات الأعضاء وسجل مشاركاتهم

🔍 setSearch(e.target.value)} />
{filtered.length === 0 ? (
👤

لا يوجد أعضاء مطابقون للبحث

) : ( {/* Desktop Table */}
{filtered.map(m => ( ))}
الاسمالكلية / السنةموسم الانضمامالمشاركاتالحالةإجراءات
{m.name}
{m.email}
{m.faculty}
{m.year}
{getSeasonName(m.joinedSeason)} {memberParticipations(m.id).length} نشاط {m.status}
{/* Mobile Cards */}
{filtered.map(m => (
{m.name}
{m.faculty} · {m.year}
{m.email}
{m.status}
{getSeasonName(m.joinedSeason)} {memberParticipations(m.id).length} نشاط
))}
)}
); } // ───────────────────────────────────────────────────────────────────────── // ACTIVITIES // ───────────────────────────────────────────────────────────────────────── function ActivitiesPage() { const filtered = activities.filter(a => ((a.name||"").toLowerCase().includes(search.toLowerCase()) || (a.type||"").toLowerCase().includes(search.toLowerCase())) && (filterSeason === "all" || a.seasonId === filterSeason) ); return (

الأنشطة والمشاريع

إدارة أنشطة الكيان لكل موسم

🔍 setSearch(e.target.value)} />
{filtered.length === 0 ? (
🎯

لا توجد أنشطة مطابقة

) : ( {/* Desktop Table */}
{filtered.map(a => ( ))}
النشاطالنوعالموسمالتاريخالمشاركونإجراءات
{a.name} {a.type} {getSeasonName(a.seasonId)} {a.date} {activityParticipations(a.id).length} عضو
{/* Mobile Cards */}
{filtered.map(a => (
{a.name}
{a.type}
📅 {a.date} {activityParticipations(a.id).length} عضو {getSeasonName(a.seasonId)}
))}
)}
); } // ───────────────────────────────────────────────────────────────────────── // PARTICIPATIONS // ───────────────────────────────────────────────────────────────────────── function ParticipationsPage() { const filtered = participations.filter(p => { const m = members.find(x => x.id === p.memberId); const a = activities.find(x => x.id === p.activityId); return ( ((m ? m.name : "").toLowerCase().includes(search.toLowerCase()) || (a ? a.name : "").toLowerCase().includes(search.toLowerCase()) || (p.role||"").toLowerCase().includes(search.toLowerCase())) && (filterSeason === "all" || (a && a.seasonId === filterSeason)) ); }); return (

سجل المشاركات

كل المشاركات المسجلة في النظام

🔍 setSearch(e.target.value)} />
{/* Desktop Table */}
{filtered.length === 0 ? ( ) : filtered.map(p => { const a = activities.find(x => x.id === p.activityId); return ( ); })}
العضوالنشاطالموسمالدورشهادةملاحظاتحذف
📋

لا توجد مشاركات مطابقة

{getMemberName(p.memberId)} {a ? a.name : "—"}
{a && {a.type}}
{a ? getSeasonName(a.seasonId) : "—"} {p.role} {p.certificate ? "🏅" : "—"} {p.notes || "—"}
{/* Mobile Cards */} {filtered.length === 0 ? (
📋

لا توجد مشاركات مطابقة

) : (
{filtered.map(p => { const a = activities.find(x => x.id === p.activityId); return (
{getMemberName(p.memberId)}
{a ? a.name : "—"}
{a && {a.type}} {p.role} {p.certificate && 🏅 شهادة}
{p.notes &&
💬 {p.notes}
}
{a ? getSeasonName(a.seasonId) : ""} {a ? "· "+a.date : ""}
); })}
)}
); } // ───────────────────────────────────────────────────────────────────────── // SEASONS // ───────────────────────────────────────────────────────────────────────── function SeasonsPage() { return (

المواسم

إدارة مواسم الكيان

{seasons.length === 0 &&
📅

لا توجد مواسم

} {seasons.map(s => (
📅
{s.name}
{activities.filter(a => a.seasonId === s.id).length} نشاط  ·  {members.filter(m => m.joinedSeason === s.id).length} عضو انضم في هذا الموسم
))}
); } // ───────────────────────────────────────────────────────────────────────── // MEMBER MODAL // ───────────────────────────────────────────────────────────────────────── function MemberModal() { const [form, setForm] = useState(memberModal.data); const set = (k, v) => setForm(f => ({...f, [k]:v})); const submit = async () => { if (!form.name.trim()) { alert("اسم العضو مطلوب"); return; } await fsAdd("members", form); if (memberModal.mode === "edit") await fsUpdate("members", form.id, form); notify(memberModal.mode === "add" ? "تم إضافة العضو" : "تم تحديث البيانات"); setMemberModal(null); }; return (

{memberModal.mode === "add" ? "إضافة عضو جديد" : "تعديل بيانات العضو"}

set("name",e.target.value)} placeholder="الاسم بالكامل" />
set("email",e.target.value)} placeholder="example@email.com" />
set("phone",e.target.value)} placeholder="010xxxxxxxx" />
set("faculty",e.target.value)} placeholder="Medicine / Pharmacy ..." />
set("year",e.target.value)} placeholder="3rd Year" />
); } // ───────────────────────────────────────────────────────────────────────── // ACTIVITY MODAL // ───────────────────────────────────────────────────────────────────────── function ActivityModal() { const [form, setForm] = useState(activityModal.data); const set = (k, v) => setForm(f => ({...f, [k]:v})); const submit = async () => { if (!form.name.trim()) { alert("اسم النشاط مطلوب"); return; } if (activityModal.mode === "add") await fsAdd("activities", form); else await fsUpdate("activities", form.id, form); notify(activityModal.mode === "add" ? "تم إضافة النشاط" : "تم تحديث النشاط"); setActivityModal(null); }; return (

{activityModal.mode==="add"?"إضافة نشاط جديد":"تعديل النشاط"}

set("name",e.target.value)} placeholder="مثال: Medical Convoy — Fayoum" />
set("date",e.target.value)} />
); } // ───────────────────────────────────────────────────────────────────────── // PARTICIPATION MODAL // ───────────────────────────────────────────────────────────────────────── function PartModal() { const [form, setForm] = useState(partModal.data); const set = (k, v) => setForm(f => ({...f, [k]:v})); const submit = async () => { if (!form.memberId) { alert("اختر عضو"); return; } if (!form.activityId) { alert("اختر نشاط"); return; } if (!form.role.trim()) { alert("أدخل الدور"); return; } const dup = participations.some(p => p.memberId === form.memberId && p.activityId === form.activityId); if (dup) { alert("هذا العضو مسجل بالفعل في هذا النشاط"); return; } await fsAdd("participations", form); notify("تم تسجيل المشاركة"); setPartModal(null); }; return (

تسجيل مشاركة جديدة

set("role",e.target.value)} placeholder="مثال: Volunteer, Team Leader, Organizer, Presenter..." />