Azad95's picture
Add 3 files
32be294 verified
Raw History Blame Contribute Delete
31.3 kB
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>نظام إدارة الموظفين</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
body {
font-family: 'Tajawal', sans-serif;
background-color: #f5f7fa;
}
.sidebar {
transition: all 0.3s;
}
.sidebar-item:hover {
background-color: rgba(59, 130, 246, 0.1);
}
.active-sidebar-item {
background-color: rgba(59, 130, 246, 0.2);
border-right: 4px solid #3b82f6;
}
.dropdown-content {
display: none;
transition: all 0.3s;
}
.dropdown:hover .dropdown-content {
display: block;
}
.employee-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
</style>
</head>
<body class="flex h-screen bg-gray-50">
<!-- Sidebar -->
<div class="sidebar w-64 bg-white shadow-lg flex flex-col">
<!-- Logo -->
<div class="p-4 flex items-center justify-center border-b">
<div class="flex items-center">
<i class="fas fa-users-cog text-blue-500 text-2xl mr-2"></i>
<span class="text-xl font-bold text-gray-800">إدارة الموظفين</span>
</div>
</div>
<!-- User Profile -->
<div class="p-4 flex items-center border-b">
<div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user text-blue-500 text-xl"></i>
</div>
<div class="mr-3">
<p class="font-medium text-gray-800">المدير العام</p>
<p class="text-sm text-gray-500">صلاحية: مدير</p>
</div>
</div>
<!-- Navigation -->
<div class="flex-1 overflow-y-auto">
<ul class="py-2">
<li class="px-2">
<a href="#" class="sidebar-item active-sidebar-item flex items-center p-3 rounded-lg">
<i class="fas fa-users text-blue-500 ml-2"></i>
<span>الموظفين</span>
</a>
</li>
<li class="px-2 mt-1">
<div class="dropdown">
<a href="#" class="sidebar-item flex items-center justify-between p-3 rounded-lg">
<div class="flex items-center">
<i class="fas fa-chart-line text-blue-500 ml-2"></i>
<span>التقارير</span>
</div>
<i class="fas fa-chevron-down text-xs text-gray-500"></i>
</a>
<div class="dropdown-content mr-8 mt-1 bg-white rounded-lg shadow-lg py-1">
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تقرير الحضور</a>
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تقرير المهام</a>
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تقرير الأداء</a>
</div>
</div>
</li>
<li class="px-2 mt-1">
<a href="#" class="sidebar-item flex items-center p-3 rounded-lg">
<i class="fas fa-cog text-blue-500 ml-2"></i>
<span>الإعدادات</span>
</a>
</li>
</ul>
</div>
<!-- Logout -->
<div class="p-4 border-t">
<a href="#" class="flex items-center text-red-500 p-2 rounded-lg hover:bg-red-50">
<i class="fas fa-sign-out-alt ml-2"></i>
<span>تسجيل الخروج</span>
</a>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Top Navigation -->
<header class="bg-white shadow-sm">
<div class="flex items-center justify-between p-4">
<div class="flex items-center">
<button class="text-gray-500 focus:outline-none lg:hidden">
<i class="fas fa-bars"></i>
</button>
<h1 class="text-xl font-bold text-gray-800 mr-4">قائمة الموظفين</h1>
</div>
<div class="flex items-center">
<div class="relative mr-4">
<input type="text" placeholder="بحث..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<button class="p-2 text-gray-500 hover:text-gray-700 focus:outline-none">
<i class="fas fa-bell"></i>
</button>
</div>
</div>
</header>
<!-- Content -->
<main class="flex-1 overflow-y-auto p-6 bg-gray-50">
<!-- Header and Add Button -->
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">إدارة الموظفين</h2>
<button onclick="openAddEmployeeModal()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-plus ml-2"></i>
إضافة موظف جديد
</button>
</div>
<!-- Filters -->
<div class="bg-white p-4 rounded-lg shadow mb-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">نوع الموظف</label>
<select class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">الكل</option>
<option value="manager">مدير</option>
<option value="branch_manager">مدير فرع</option>
<option value="supervisor">متابع</option>
<option value="representative">مندوب</option>
<option value="client">عميل</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الدور</label>
<select class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">الكل</option>
<option value="admin">إداري</option>
<option value="finance">مالي</option>
<option value="hr">موارد بشرية</option>
<option value="sales">مبيعات</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">حالة الحساب</label>
<select class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">الكل</option>
<option value="active">نشط</option>
<option value="inactive">غير نشط</option>
</select>
</div>
<div class="flex items-end">
<button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg w-full">
تطبيق الفلتر
</button>
</div>
</div>
</div>
<!-- Employees Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Employee Card 1 -->
<div class="employee-card bg-white rounded-lg shadow overflow-hidden transition duration-300">
<div class="p-4 border-b flex items-center">
<div class="w-16 h-16 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user-tie text-blue-500 text-2xl"></i>
</div>
<div class="mr-3 flex-1">
<h3 class="font-bold text-lg">أحمد محمد</h3>
<p class="text-sm text-gray-500">مدير عام</p>
</div>
<div class="dropdown relative">
<button class="text-gray-500 hover:text-gray-700 focus:outline-none">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="dropdown-content absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg py-1 z-10 hidden">
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تعديل</a>
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تعطيل</a>
<a href="#" class="block px-4 py-2 text-sm text-red-500 hover:bg-red-50">حذف</a>
</div>
</div>
</div>
<div class="p-4">
<div class="flex items-center mb-2">
<i class="fas fa-id-card text-gray-400 ml-2"></i>
<span>EMP-001</span>
</div>
<div class="flex items-center mb-2">
<i class="fas fa-envelope text-gray-400 ml-2"></i>
<span>ahmed@example.com</span>
</div>
<div class="flex items-center mb-2">
<i class="fas fa-phone text-gray-400 ml-2"></i>
<span>+966501234567</span>
</div>
<div class="flex items-center">
<i class="fas fa-calendar-alt text-gray-400 ml-2"></i>
<span>تاريخ الإضافة: 15/03/2023</span>
</div>
</div>
<div class="px-4 py-2 bg-gray-50 flex justify-between items-center">
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">نشط</span>
<div class="flex space-x-2 space-x-reverse">
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-eye"></i>
</button>
<button class="text-yellow-500 hover:text-yellow-700">
<i class="fas fa-edit"></i>
</button>
<button class="text-red-500 hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
</div>
<!-- Employee Card 2 -->
<div class="employee-card bg-white rounded-lg shadow overflow-hidden transition duration-300">
<div class="p-4 border-b flex items-center">
<div class="w-16 h-16 rounded-full bg-green-100 flex items-center justify-center">
<i class="fas fa-user-shield text-green-500 text-2xl"></i>
</div>
<div class="mr-3 flex-1">
<h3 class="font-bold text-lg">خالد عبدالله</h3>
<p class="text-sm text-gray-500">مدير فرع</p>
</div>
<div class="dropdown relative">
<button class="text-gray-500 hover:text-gray-700 focus:outline-none">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="dropdown-content absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg py-1 z-10 hidden">
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تعديل</a>
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تعطيل</a>
<a href="#" class="block px-4 py-2 text-sm text-red-500 hover:bg-red-50">حذف</a>
</div>
</div>
</div>
<div class="p-4">
<div class="flex items-center mb-2">
<i class="fas fa-id-card text-gray-400 ml-2"></i>
<span>EMP-002</span>
</div>
<div class="flex items-center mb-2">
<i class="fas fa-envelope text-gray-400 ml-2"></i>
<span>khaled@example.com</span>
</div>
<div class="flex items-center mb-2">
<i class="fas fa-phone text-gray-400 ml-2"></i>
<span>+966501234568</span>
</div>
<div class="flex items-center">
<i class="fas fa-calendar-alt text-gray-400 ml-2"></i>
<span>تاريخ الإضافة: 20/03/2023</span>
</div>
</div>
<div class="px-4 py-2 bg-gray-50 flex justify-between items-center">
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">نشط</span>
<div class="flex space-x-2 space-x-reverse">
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-eye"></i>
</button>
<button class="text-yellow-500 hover:text-yellow-700">
<i class="fas fa-edit"></i>
</button>
<button class="text-red-500 hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
</div>
<!-- Employee Card 3 (Client) -->
<div class="employee-card bg-white rounded-lg shadow overflow-hidden transition duration-300">
<div class="p-4 border-b flex items-center">
<div class="w-16 h-16 rounded-full bg-purple-100 flex items-center justify-center">
<i class="fas fa-user text-purple-500 text-2xl"></i>
</div>
<div class="mr-3 flex-1">
<h3 class="font-bold text-lg">شركة التقنية المحدودة</h3>
<p class="text-sm text-gray-500">عميل</p>
</div>
<div class="dropdown relative">
<button class="text-gray-500 hover:text-gray-700 focus:outline-none">
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="dropdown-content absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg py-1 z-10 hidden">
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تعديل</a>
<a href="#" class="block px-4 py-2 text-sm hover:bg-blue-50">تعطيل</a>
<a href="#" class="block px-4 py-2 text-sm text-red-500 hover:bg-red-50">حذف</a>
</div>
</div>
</div>
<div class="p-4">
<div class="flex items-center mb-2">
<i class="fas fa-id-card text-gray-400 ml-2"></i>
<span>CLI-001</span>
</div>
<div class="flex items-center mb-2">
<i class="fas fa-user text-gray-400 ml-2"></i>
<span>المسؤول: محمد علي</span>
</div>
<div class="flex items-center mb-2">
<i class="fas fa-phone text-gray-400 ml-2"></i>
<span>+966112345678</span>
</div>
<div class="flex items-center">
<i class="fas fa-map-marker-alt text-gray-400 ml-2"></i>
<span>الرياض - حي العليا</span>
</div>
</div>
<div class="px-4 py-2 bg-gray-50 flex justify-between items-center">
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">نشط</span>
<div class="flex space-x-2 space-x-reverse">
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-eye"></i>
</button>
<button class="text-yellow-500 hover:text-yellow-700">
<i class="fas fa-edit"></i>
</button>
<button class="text-red-500 hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Pagination -->
<div class="mt-8 flex justify-center">
<nav class="flex items-center space-x-2 space-x-reverse">
<button class="px-3 py-1 rounded-lg border hover:bg-gray-100">
<i class="fas fa-chevron-right"></i>
</button>
<button class="px-3 py-1 rounded-lg bg-blue-500 text-white">1</button>
<button class="px-3 py-1 rounded-lg border hover:bg-gray-100">2</button>
<button class="px-3 py-1 rounded-lg border hover:bg-gray-100">3</button>
<button class="px-3 py-1 rounded-lg border hover:bg-gray-100">
<i class="fas fa-chevron-left"></i>
</button>
</nav>
</div>
</main>
</div>
<!-- Add Employee Modal -->
<div id="addEmployeeModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-lg w-full max-w-2xl max-h-screen overflow-y-auto">
<div class="p-4 border-b flex justify-between items-center">
<h3 class="text-lg font-bold">إضافة موظف جديد</h3>
<button onclick="closeAddEmployeeModal()" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-6">
<form id="employeeForm">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">نوع الحساب*</label>
<select id="accountType" name="accountType" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<option value="">اختر نوع الحساب</option>
<option value="manager">مدير</option>
<option value="branch_manager">مدير فرع</option>
<option value="supervisor">متابع</option>
<option value="representative">مندوب</option>
<option value="client">عميل</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الدور*</label>
<select name="role" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<option value="">اختر الدور</option>
<option value="admin">إداري</option>
<option value="finance">مالي</option>
<option value="hr">موارد بشرية</option>
<option value="sales">مبيعات</option>
<option value="operations">عمليات</option>
</select>
</div>
</div>
<div class="mt-6">
<h4 class="font-medium text-gray-700 mb-3">المعلومات الأساسية</h4>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الاسم الأول*</label>
<input type="text" name="firstName" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الاسم الأخير*</label>
<input type="text" name="lastName" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">البريد الإلكتروني*</label>
<input type="email" name="email" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">رقم الجوال*</label>
<input type="tel" name="phone" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
</div>
</div>
<!-- Client Specific Fields (hidden by default) -->
<div id="clientFields" class="mt-6 hidden">
<h4 class="font-medium text-gray-700 mb-3">معلومات العميل</h4>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">اسم الشركة*</label>
<input type="text" name="companyName" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">اسم المسؤول*</label>
<input type="text" name="responsiblePerson" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="md:col-span-2">
<label class="block text-sm font-medium text-gray-700 mb-1">عنوان العميل*</label>
<textarea name="clientAddress" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" rows="2"></textarea>
</div>
</div>
</div>
<div class="mt-6">
<h4 class="font-medium text-gray-700 mb-3">معلومات الحساب</h4>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">اسم المستخدم*</label>
<input type="text" name="username" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">كلمة المرور*</label>
<div class="relative">
<input type="password" name="password" class="w-full border rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<button type="button" class="absolute left-3 top-3 text-gray-400 hover:text-gray-600" onclick="togglePassword(this)">
<i class="fas fa-eye"></i>
</button>
</div>
</div>
</div>
</div>
<div class="mt-8 flex justify-end space-x-3 space-x-reverse">
<button type="button" onclick="closeAddEmployeeModal()" class="px-4 py-2 border rounded-lg hover:bg-gray-100">
إلغاء
</button>
<button type="submit" class="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600">
حفظ الموظف
</button>
</div>
</form>
</div>
</div>
</div>
<script>
// Toggle dropdown menus
document.querySelectorAll('.dropdown button').forEach(button => {
button.addEventListener('click', function() {
const dropdownContent = this.nextElementSibling;
dropdownContent.classList.toggle('hidden');
});
});
// Close dropdowns when clicking outside
document.addEventListener('click', function(event) {
if (!event.target.matches('.dropdown button')) {
document.querySelectorAll('.dropdown-content').forEach(content => {
content.classList.add('hidden');
});
}
});
// Add Employee Modal Functions
function openAddEmployeeModal() {
document.getElementById('addEmployeeModal').classList.remove('hidden');
}
function closeAddEmployeeModal() {
document.getElementById('addEmployeeModal').classList.add('hidden');
}
// Toggle password visibility
function togglePassword(button) {
const passwordInput = button.previousElementSibling;
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
button.innerHTML = '<i class="fas fa-eye-slash"></i>';
} else {
passwordInput.type = 'password';
button.innerHTML = '<i class="fas fa-eye"></i>';
}
}
// Show/hide client fields based on account type
document.getElementById('accountType').addEventListener('change', function() {
const clientFields = document.getElementById('clientFields');
if (this.value === 'client') {
clientFields.classList.remove('hidden');
// Make client fields required
clientFields.querySelectorAll('input, textarea').forEach(field => {
field.required = true;
});
} else {
clientFields.classList.add('hidden');
// Remove required from client fields
clientFields.querySelectorAll('input, textarea').forEach(field => {
field.required = false;
});
}
});
// Form submission
document.getElementById('employeeForm').addEventListener('submit', function(e) {
e.preventDefault();
alert('تم حفظ بيانات الموظف بنجاح');
closeAddEmployeeModal();
this.reset();
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Azad95/https-huggingface-co-spaces-azad95-https-huggingface-co-spaces-azad95-spaces-apps-mursal" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>