alll / index.html
Alaa123's picture
ุตู…ู… ู…ูˆู‚ุน ุชุณุฌูŠู„ ุจูŠุงู†ุงุช ุงู„ุนุงู…ู„ูŠู† ุจุงู„ุงุฏุงุฑุฉ ุงู„ุชุนู„ูŠู…ูŠู‡ ู…ู† ุฎู„ุงู„ ุฑุงุจุท ูŠู…ูƒู† ุงู„ุฏุฎูˆู„ ุนู„ูŠู‡ ู„ุชุณุฌูŠู„ ุชู„ูƒ ุงู„ุจุงูŠู†ุงุช ููŠ ุนู„ูŠ ุงู† ูŠุชู… ุงู„ุชุณุฌูŠู„ ู„ูƒูุงู‡ ุงู„ุจูŠุงู†ุงุช ููŠ ู…ู„ู ุงูƒุณูŠู„ ุนู„ูŠ ุงู† ุชุดู…ู„ ุงู„ุจุงูŠุงู†ุงุช ุงู„ุชุงู„ูŠู‡ ุงู„ุงุณู… ุงู„ูƒูˆุฏ ุงู„ุฑู‚ู… ุงู„ู‚ูˆู…ูŠ ุงู„ูˆุธูŠูู‡ ุชุงุฑูŠุฎ ุงู„ู…ูŠู„ุงุฏ ุชุงุฑูŠุฎ ุงู„ุชุนูŠูŠู† ุงู„ุชู„ูŠููˆู† ุงู„ุนู†ูˆุงู† - Follow Up Deployment
b48f5cc verified
<!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>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Tajawal', sans-serif;
}
</style>
</head>
<body class="bg-gray-50">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-blue-700 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-4">
<i data-feather="users" class="w-8 h-8"></i>
<h1 class="text-2xl font-bold">ู†ุธุงู… ุชุณุฌูŠู„ ุจูŠุงู†ุงุช ุงู„ุนุงู…ู„ูŠู†</h1>
</div>
<div>
<p class="text-sm">ุงู„ุฅุฏุงุฑุฉ ุงู„ุชุนู„ูŠู…ูŠุฉ</p>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-grow container mx-auto px-4 py-8">
<div class="max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-blue-600 px-6 py-4">
<h2 class="text-xl font-bold text-white">ู†ู…ูˆุฐุฌ ุชุณุฌูŠู„ ุจูŠุงู†ุงุช ุงู„ุนุงู…ู„ูŠู†</h2>
</div>
<form id="employeeForm" class="p-6 space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- ุงู„ุงุณู… -->
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-1">ุงู„ุงุณู… ุจุงู„ูƒุงู…ู„</label>
<input type="text" id="name" name="name" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุงู„ูƒูˆุฏ -->
<div>
<label for="code" class="block text-sm font-medium text-gray-700 mb-1">ุงู„ูƒูˆุฏ</label>
<input type="text" id="code" name="code" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุงู„ุฑู‚ู… ุงู„ู‚ูˆู…ูŠ -->
<div>
<label for="nationalId" class="block text-sm font-medium text-gray-700 mb-1">ุงู„ุฑู‚ู… ุงู„ู‚ูˆู…ูŠ</label>
<input type="text" id="nationalId" name="nationalId" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุงู„ูˆุธูŠูุฉ -->
<div>
<label for="jobTitle" class="block text-sm font-medium text-gray-700 mb-1">ุงู„ูˆุธูŠูุฉ</label>
<input type="text" id="jobTitle" name="jobTitle" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุชุงุฑูŠุฎ ุงู„ู…ูŠู„ุงุฏ -->
<div>
<label for="birthDate" class="block text-sm font-medium text-gray-700 mb-1">ุชุงุฑูŠุฎ ุงู„ู…ูŠู„ุงุฏ</label>
<input type="date" id="birthDate" name="birthDate" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุชุงุฑูŠุฎ ุงู„ุชุนูŠูŠู† -->
<div>
<label for="hireDate" class="block text-sm font-medium text-gray-700 mb-1">ุชุงุฑูŠุฎ ุงู„ุชุนูŠูŠู†</label>
<input type="date" id="hireDate" name="hireDate" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุงู„ุชู„ูŠููˆู† -->
<div>
<label for="phone" class="block text-sm font-medium text-gray-700 mb-1">ุฑู‚ู… ุงู„ุชู„ูŠููˆู†</label>
<input type="tel" id="phone" name="phone" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- ุงู„ุนู†ูˆุงู† -->
<div class="md:col-span-2">
<label for="address" class="block text-sm font-medium text-gray-700 mb-1">ุงู„ุนู†ูˆุงู†</label>
<textarea id="address" name="address" rows="3" required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"></textarea>
</div>
</div>
<div class="flex justify-end space-x-4">
<button type="reset" class="px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300">
ู…ุณุญ ุงู„ุจูŠุงู†ุงุช
</button>
<button type="submit" class="px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 flex items-center">
<i data-feather="save" class="w-4 h-4 ml-2"></i>
ุญูุธ ุงู„ุจูŠุงู†ุงุช
</button>
</div>
</form>
</div>
<!-- Data Table Section -->
<div class="mt-12 max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-blue-600 px-6 py-4">
<h2 class="text-xl font-bold text-white">ุจูŠุงู†ุงุช ุงู„ุนุงู…ู„ูŠู† ุงู„ู…ุณุฌู„ุฉ</h2>
</div>
<div class="p-6">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">ุงู„ูƒูˆุฏ</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">ุงู„ุงุณู…</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">ุงู„ูˆุธูŠูุฉ</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">ุงู„ุชู„ูŠููˆู†</th>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">ุฎูŠุงุฑุงุช</th>
</tr>
</thead>
<tbody id="employeeTable" class="bg-white divide-y divide-gray-200">
<!-- Data will be inserted here by JavaScript -->
<tr>
<td colspan="5" class="px-6 py-4 text-center text-gray-500">ู„ุง ุชูˆุฌุฏ ุจูŠุงู†ุงุช ู…ุณุฌู„ุฉ ุจุนุฏ</td>
</tr>
</tbody>
</table>
</div>
<div class="mt-4 flex justify-end">
<button id="exportBtn" class="px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 flex items-center">
<i data-feather="download" class="w-4 h-4 ml-2"></i>
ุชุตุฏูŠุฑ ุฅู„ู‰ Excel
</button>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-6">
<div class="container mx-auto px-4 text-center">
<p>ุฌู…ูŠุน ุงู„ุญู‚ูˆู‚ ู…ุญููˆุธุฉ ยฉ ู†ุธุงู… ุงู„ุฅุฏุงุฑุฉ ุงู„ุชุนู„ูŠู…ูŠุฉ 2023</p>
</div>
</footer>
</div>
<!-- Success Modal -->
<div id="successModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg p-6 max-w-sm w-full">
<div class="text-center">
<div class="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100">
<i data-feather="check" class="h-6 w-6 text-green-600"></i>
</div>
<h3 class="mt-3 text-lg font-medium text-gray-900">ุชู… ุจู†ุฌุงุญ!</h3>
<div class="mt-2 text-sm text-gray-500">
<p>ุชู… ุญูุธ ุจูŠุงู†ุงุช ุงู„ุนุงู…ู„ ุจู†ุฌุงุญ</p>
</div>
<div class="mt-4">
<button onclick="document.getElementById('successModal').classList.add('hidden')"
class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">
ู…ูˆุงูู‚
</button>
</div>
</div>
</div>
</div>
<script>
feather.replace();
// Employee data array
let employees = [];
// Form submission
document.getElementById('employeeForm').addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const employee = {
name: formData.get('name'),
code: formData.get('code'),
nationalId: formData.get('nationalId'),
jobTitle: formData.get('jobTitle'),
birthDate: formData.get('birthDate'),
hireDate: formData.get('hireDate'),
phone: formData.get('phone'),
address: formData.get('address')
};
employees.push(employee);
updateEmployeeTable();
this.reset();
// Show success modal
document.getElementById('successModal').classList.remove('hidden');
});
// Update employee table
function updateEmployeeTable() {
const tableBody = document.getElementById('employeeTable');
if (employees.length === 0) {
tableBody.innerHTML = `
<tr>
<td colspan="5" class="px-6 py-4 text-center text-gray-500">ู„ุง ุชูˆุฌุฏ ุจูŠุงู†ุงุช ู…ุณุฌู„ุฉ ุจุนุฏ</td>
</tr>
`;
return;
}
tableBody.innerHTML = '';
employees.forEach((employee, index) => {
const row = document.createElement('tr');
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${employee.code}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${employee.name}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${employee.jobTitle}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${employee.phone}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
<button onclick="viewEmployeeDetails(${index})" class="text-blue-600 hover:text-blue-900 ml-2">
<i data-feather="eye" class="w-4 h-4"></i>
</button>
<button onclick="editEmployee(${index})" class="text-yellow-600 hover:text-yellow-900 ml-2">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button onclick="deleteEmployee(${index})" class="text-red-600 hover:text-red-900 ml-2">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</td>
`;
tableBody.appendChild(row);
});
feather.replace();
}
// View employee details
function viewEmployeeDetails(index) {
const employee = employees[index];
alert(
`ุงู„ุงุณู…: ${employee.name}\n` +
`ุงู„ูƒูˆุฏ: ${employee.code}\n` +
`ุงู„ุฑู‚ู… ุงู„ู‚ูˆู…ูŠ: ${employee.nationalId}\n` +
`ุงู„ูˆุธูŠูุฉ: ${employee.jobTitle}\n` +
`ุชุงุฑูŠุฎ ุงู„ู…ูŠู„ุงุฏ: ${employee.birthDate}\n` +
`ุชุงุฑูŠุฎ ุงู„ุชุนูŠูŠู†: ${employee.hireDate}\n` +
`ุงู„ุชู„ูŠููˆู†: ${employee.phone}\n` +
`ุงู„ุนู†ูˆุงู†: ${employee.address}`
);
}
// Edit employee
function editEmployee(index) {
const employee = employees[index];
const form = document.getElementById('employeeForm');
form.name.value = employee.name;
form.code.value = employee.code;
form.nationalId.value = employee.nationalId;
form.jobTitle.value = employee.jobTitle;
form.birthDate.value = employee.birthDate;
form.hireDate.value = employee.hireDate;
form.phone.value = employee.phone;
form.address.value = employee.address;
// Remove the employee from the array
employees.splice(index, 1);
updateEmployeeTable();
}
// Delete employee
function deleteEmployee(index) {
if (confirm('ู‡ู„ ุฃู†ุช ู…ุชุฃูƒุฏ ู…ู† ุญุฐู ู‡ุฐุง ุงู„ู…ูˆุธูุŸ')) {
employees.splice(index, 1);
updateEmployeeTable();
}
}
// Export to Excel
document.getElementById('exportBtn').addEventListener('click', function() {
if (employees.length === 0) {
alert('ู„ุง ุชูˆุฌุฏ ุจูŠุงู†ุงุช ู„ุชุตุฏูŠุฑู‡ุง');
return;
}
// Create CSV content
let csvContent = "data:text/csv;charset=utf-8,";
// Add headers
csvContent += "ุงู„ูƒูˆุฏ,ุงู„ุงุณู…,ุงู„ุฑู‚ู… ุงู„ู‚ูˆู…ูŠ,ุงู„ูˆุธูŠูุฉ,ุชุงุฑูŠุฎ ุงู„ู…ูŠู„ุงุฏ,ุชุงุฑูŠุฎ ุงู„ุชุนูŠูŠู†,ุงู„ุชู„ูŠููˆู†,ุงู„ุนู†ูˆุงู†\n";
// Add employee data
employees.forEach(employee => {
csvContent += `${employee.code},${employee.name},${employee.nationalId},${employee.jobTitle},${employee.birthDate},${employee.hireDate},${employee.phone},"${employee.address}"\n`;
});
// Create download link
const encodedUri = encodeURI(csvContent);
const link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "ุจูŠุงู†ุงุช_ุงู„ุนุงู…ู„ูŠู†.csv");
document.body.appendChild(link);
// Trigger download
link.click();
document.body.removeChild(link);
});
</script>
</body>
</html>