<%- include('partials/sidebar', { currentPage: 'users' }) %>

إدارة المستخدمين

إجمالي الحسابات: <%= users.length %>

<% if (success === '1') { %>
check_circle تم إنشاء المستخدم بنجاح.
<% } else if (success === '2') { %>
check_circle تم تحديث المستخدم بنجاح.
<% } else if (success === '3') { %>
check_circle تم تغيير كلمة المرور بنجاح.
<% } else if (success === '4') { %>
check_circle تم حذف المستخدم.
<% } %> <% if (error) { %>
error <%= error %>
<% } %>

person_add إنشاء مستخدم جديد

<% users.forEach(u => { %> <% }) %>
المستخدم الدور الحالة آخر دخول تاريخ الإنشاء العمليات
<%= u.id === currentUser ? 'manage_accounts' : 'person' %>
<%= u.full_name || '—' %> <% if (u.id === currentUser) { %> أنت <% } %>
<%= u.username %>
<% if (u.role === 'manager') { %> مدير <% } else { %> موظف مبيعات <% } %> <% if (u.is_active) { %> نشط <% } else { %> موقوف <% } %> <% if (u.last_login) { %> <%= fmtDate(u.last_login) %> <%= fmtTime(u.last_login) %> <% } else { %> لم يسجّل دخولاً <% } %> <%= fmtDate(u.created_at) %> bar_chart <%= u.action_count || 0 %> <% if (u.id !== currentUser) { %>
<% if (u.is_active) { %> <% } %>
<% } else { %> <% } %>