diff --git a/assets/css/custom.css b/assets/css/custom.css
index 789132e..5efdb64 100644
--- a/assets/css/custom.css
+++ b/assets/css/custom.css
@@ -1,403 +1,109 @@
+@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');
+
body {
- background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
- background-size: 400% 400%;
- animation: gradient 15s ease infinite;
- color: #212529;
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
- font-size: 14px;
- margin: 0;
- min-height: 100vh;
+ font-family: 'Cairo', sans-serif;
+ background-color: #f8f9fa;
+ color: #333;
+ direction: rtl;
+ text-align: right;
+ overflow-x: hidden;
}
-.main-wrapper {
- display: flex;
- align-items: center;
- justify-content: center;
- min-height: 100vh;
- width: 100%;
- padding: 20px;
- box-sizing: border-box;
- position: relative;
- z-index: 1;
+.navbar {
+ background-color: #fff;
+ box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
-@keyframes gradient {
- 0% {
- background-position: 0% 50%;
- }
- 50% {
- background-position: 100% 50%;
- }
- 100% {
- background-position: 0% 50%;
- }
+.nav-link {
+ color: #444;
+ font-weight: 600;
}
-.chat-container {
- width: 100%;
- max-width: 600px;
- background: rgba(255, 255, 255, 0.85);
- border: 1px solid rgba(255, 255, 255, 0.3);
- border-radius: 20px;
- display: flex;
- flex-direction: column;
- height: 85vh;
- box-shadow: 0 20px 40px rgba(0,0,0,0.2);
- backdrop-filter: blur(15px);
- -webkit-backdrop-filter: blur(15px);
- overflow: hidden;
+.nav-link.active {
+ color: #007bff !important;
}
-.chat-header {
- padding: 1.5rem;
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
- background: rgba(255, 255, 255, 0.5);
- font-weight: 700;
- font-size: 1.1rem;
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.chat-messages {
- flex: 1;
- overflow-y: auto;
- padding: 1.5rem;
- display: flex;
- flex-direction: column;
- gap: 1.25rem;
-}
-
-/* Custom Scrollbar */
-::-webkit-scrollbar {
- width: 6px;
-}
-
-::-webkit-scrollbar-track {
- background: transparent;
-}
-
-::-webkit-scrollbar-thumb {
- background: rgba(255, 255, 255, 0.3);
- border-radius: 10px;
-}
-
-::-webkit-scrollbar-thumb:hover {
- background: rgba(255, 255, 255, 0.5);
-}
-
-.message {
- max-width: 85%;
- padding: 0.85rem 1.1rem;
- border-radius: 16px;
- line-height: 1.5;
- font-size: 0.95rem;
+.card {
+ border: none;
+ border-radius: 12px;
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
- animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
+ background-color: #fff;
+ margin-bottom: 20px;
+}
+
+.card:hover {
+ transform: translateY(-5px);
+ box-shadow: 0 10px 25px rgba(0,0,0,0.1);
+}
+
+.btn-primary {
+ background: linear-gradient(45deg, #007bff, #0056b3);
+ border: none;
+ padding: 10px 25px;
+ border-radius: 8px;
+ font-weight: 600;
+}
+
+.btn-success {
+ background: linear-gradient(45deg, #28a745, #218838);
+ border: none;
+ padding: 10px 25px;
+ border-radius: 8px;
+ font-weight: 600;
+}
+
+.btn:hover {
+ opacity: 0.9;
+ transform: scale(1.02);
+ transition: all 0.2s ease;
+}
+
+.login-container {
+ max-width: 400px;
+ margin: 100px auto;
+}
+
+.fade-in {
+ animation: fadeIn 0.8s ease-in-out;
}
@keyframes fadeIn {
- from { opacity: 0; transform: translateY(20px) scale(0.95); }
- to { opacity: 1; transform: translateY(0) scale(1); }
-}
-
-.message.visitor {
- align-self: flex-end;
- background: linear-gradient(135deg, #212529 0%, #343a40 100%);
- color: #fff;
- border-bottom-right-radius: 4px;
-}
-
-.message.bot {
- align-self: flex-start;
- background: #ffffff;
- color: #212529;
- border-bottom-left-radius: 4px;
-}
-
-.chat-input-area {
- padding: 1.25rem;
- background: rgba(255, 255, 255, 0.5);
- border-top: 1px solid rgba(0, 0, 0, 0.05);
-}
-
-.chat-input-area form {
- display: flex;
- gap: 0.75rem;
-}
-
-.chat-input-area input {
- flex: 1;
- border: 1px solid rgba(0, 0, 0, 0.1);
- border-radius: 12px;
- padding: 0.75rem 1rem;
- outline: none;
- background: rgba(255, 255, 255, 0.9);
- transition: all 0.3s ease;
-}
-
-.chat-input-area input:focus {
- border-color: #23a6d5;
- box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
-}
-
-.chat-input-area button {
- background: #212529;
- color: #fff;
- border: none;
- padding: 0.75rem 1.5rem;
- border-radius: 12px;
- cursor: pointer;
- font-weight: 600;
- transition: all 0.3s ease;
-}
-
-.chat-input-area button:hover {
- background: #000;
- transform: translateY(-2px);
- box-shadow: 0 5px 15px rgba(0,0,0,0.2);
-}
-
-/* Background Animations */
-.bg-animations {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 0;
- overflow: hidden;
- pointer-events: none;
-}
-
-.blob {
- position: absolute;
- width: 500px;
- height: 500px;
- background: rgba(255, 255, 255, 0.2);
- border-radius: 50%;
- filter: blur(80px);
- animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
-}
-
-.blob-1 {
- top: -10%;
- left: -10%;
- background: rgba(238, 119, 82, 0.4);
-}
-
-.blob-2 {
- bottom: -10%;
- right: -10%;
- background: rgba(35, 166, 213, 0.4);
- animation-delay: -7s;
- width: 600px;
- height: 600px;
-}
-
-.blob-3 {
- top: 40%;
- left: 30%;
- background: rgba(231, 60, 126, 0.3);
- animation-delay: -14s;
- width: 450px;
- height: 450px;
-}
-
-@keyframes move {
- 0% { transform: translate(0, 0) rotate(0deg) scale(1); }
- 33% { transform: translate(150px, 100px) rotate(120deg) scale(1.1); }
- 66% { transform: translate(-50px, 200px) rotate(240deg) scale(0.9); }
- 100% { transform: translate(0, 0) rotate(360deg) scale(1); }
-}
-
-.header-link {
- font-size: 14px;
- color: #fff;
- text-decoration: none;
- background: rgba(0, 0, 0, 0.2);
- padding: 0.5rem 1rem;
- border-radius: 8px;
- transition: all 0.3s ease;
-}
-
-.header-link:hover {
- background: rgba(0, 0, 0, 0.4);
- text-decoration: none;
-}
-
-/* Admin Styles */
-.admin-container {
- max-width: 900px;
- margin: 3rem auto;
- padding: 2.5rem;
- background: rgba(255, 255, 255, 0.85);
- backdrop-filter: blur(20px);
- -webkit-backdrop-filter: blur(20px);
- border-radius: 24px;
- box-shadow: 0 20px 50px rgba(0,0,0,0.15);
- border: 1px solid rgba(255, 255, 255, 0.4);
- position: relative;
- z-index: 1;
-}
-
-.admin-container h1 {
- margin-top: 0;
- color: #212529;
- font-weight: 800;
+ from { opacity: 0; transform: translateY(10px); }
+ to { opacity: 1; transform: translateY(0); }
}
.table {
- width: 100%;
- border-collapse: separate;
- border-spacing: 0 8px;
- margin-top: 1.5rem;
+ background-color: #fff;
+ border-radius: 12px;
+ overflow: hidden;
}
.table th {
- background: transparent;
- border: none;
- padding: 1rem;
- color: #6c757d;
- font-weight: 600;
- text-transform: uppercase;
- font-size: 0.75rem;
- letter-spacing: 1px;
-}
-
-.table td {
- background: #fff;
- padding: 1rem;
- border: none;
-}
-
-.table tr td:first-child { border-radius: 12px 0 0 12px; }
-.table tr td:last-child { border-radius: 0 12px 12px 0; }
-
-.form-group {
- margin-bottom: 1.25rem;
-}
-
-.form-group label {
- display: block;
- margin-bottom: 0.5rem;
- font-weight: 600;
- font-size: 0.9rem;
-}
-
-.form-control {
- width: 100%;
- padding: 0.75rem 1rem;
- border: 1px solid rgba(0, 0, 0, 0.1);
- border-radius: 12px;
- background: #fff;
- transition: all 0.3s ease;
- box-sizing: border-box;
-}
-
-.form-control:focus {
- outline: none;
- border-color: #23a6d5;
- box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.1);
-}
-
-.header-container {
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.header-links {
- display: flex;
- gap: 1rem;
-}
-
-.admin-card {
- background: rgba(255, 255, 255, 0.6);
- padding: 2rem;
- border-radius: 20px;
- border: 1px solid rgba(255, 255, 255, 0.5);
- margin-bottom: 2.5rem;
- box-shadow: 0 10px 30px rgba(0,0,0,0.05);
-}
-
-.admin-card h3 {
- margin-top: 0;
- margin-bottom: 1.5rem;
+ background-color: #f8f9fa;
+ border-bottom: 2px solid #eee;
font-weight: 700;
}
-.btn-delete {
- background: #dc3545;
- color: white;
- border: none;
- padding: 0.25rem 0.5rem;
- border-radius: 4px;
- cursor: pointer;
+.stat-icon {
+ font-size: 2.5rem;
+ color: #007bff;
+ opacity: 0.2;
+ position: absolute;
+ left: 20px;
+ top: 20px;
}
-.btn-add {
- background: #212529;
- color: white;
- border: none;
- padding: 0.5rem 1rem;
- border-radius: 4px;
- cursor: pointer;
- margin-top: 1rem;
+.sidebar {
+ min-height: 100vh;
+ background-color: #fff;
+ border-left: 1px solid #eee;
}
-.btn-save {
- background: #0088cc;
- color: white;
- border: none;
- padding: 0.8rem 1.5rem;
- border-radius: 12px;
- cursor: pointer;
- font-weight: 600;
- width: 100%;
- transition: all 0.3s ease;
+@media (max-width: 768px) {
+ .sidebar {
+ min-height: auto;
+ border-left: none;
+ border-bottom: 1px solid #eee;
+ }
}
-
-.webhook-url {
- font-size: 0.85em;
- color: #555;
- margin-top: 0.5rem;
-}
-
-.history-table-container {
- overflow-x: auto;
- background: rgba(255, 255, 255, 0.4);
- padding: 1rem;
- border-radius: 12px;
- border: 1px solid rgba(255, 255, 255, 0.3);
-}
-
-.history-table {
- width: 100%;
-}
-
-.history-table-time {
- width: 15%;
- white-space: nowrap;
- font-size: 0.85em;
- color: #555;
-}
-
-.history-table-user {
- width: 35%;
- background: rgba(255, 255, 255, 0.3);
- border-radius: 8px;
- padding: 8px;
-}
-
-.history-table-ai {
- width: 50%;
- background: rgba(255, 255, 255, 0.5);
- border-radius: 8px;
- padding: 8px;
-}
-
-.no-messages {
- text-align: center;
- color: #777;
-}
\ No newline at end of file
diff --git a/assets/js/main.js b/assets/js/main.js
index d349598..b04a4c7 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -1,39 +1,44 @@
-document.addEventListener('DOMContentLoaded', () => {
- const chatForm = document.getElementById('chat-form');
- const chatInput = document.getElementById('chat-input');
- const chatMessages = document.getElementById('chat-messages');
+document.addEventListener('DOMContentLoaded', function() {
+ // Add fade-in classes to sections
+ const sections = document.querySelectorAll('section, .card, .table');
+ sections.forEach(el => el.classList.add('fade-in'));
- const appendMessage = (text, sender) => {
- const msgDiv = document.createElement('div');
- msgDiv.classList.add('message', sender);
- msgDiv.textContent = text;
- chatMessages.appendChild(msgDiv);
- chatMessages.scrollTop = chatMessages.scrollHeight;
- };
-
- chatForm.addEventListener('submit', async (e) => {
- e.preventDefault();
- const message = chatInput.value.trim();
- if (!message) return;
-
- appendMessage(message, 'visitor');
- chatInput.value = '';
-
- try {
- const response = await fetch('api/chat.php', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ message })
- });
- const data = await response.json();
-
- // Artificial delay for realism
- setTimeout(() => {
- appendMessage(data.reply, 'bot');
- }, 500);
- } catch (error) {
- console.error('Error:', error);
- appendMessage("Sorry, something went wrong. Please try again.", 'bot');
- }
+ // Form validation and feedback
+ const forms = document.querySelectorAll('.needs-validation');
+ Array.from(forms).forEach(form => {
+ form.addEventListener('submit', event => {
+ if (!form.checkValidity()) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ form.classList.add('was-validated');
+ }, false);
});
-});
+
+ // Simple toast notification
+ window.showAlert = function(message, type = 'success') {
+ const toastContainer = document.getElementById('toast-container');
+ if (!toastContainer) {
+ const container = document.createElement('div');
+ container.id = 'toast-container';
+ container.style.position = 'fixed';
+ container.style.bottom = '20px';
+ container.style.left = '20px';
+ container.style.zIndex = '1050';
+ document.body.appendChild(container);
+ }
+
+ const toast = document.createElement('div');
+ toast.className = `alert alert-${type} fade show`;
+ toast.role = 'alert';
+ toast.style.marginBottom = '10px';
+ toast.innerHTML = message;
+
+ document.getElementById('toast-container').appendChild(toast);
+
+ setTimeout(() => {
+ toast.classList.remove('show');
+ setTimeout(() => toast.remove(), 500);
+ }, 3000);
+ };
+});
\ No newline at end of file
diff --git a/attendance.php b/attendance.php
new file mode 100644
index 0000000..bf25edd
--- /dev/null
+++ b/attendance.php
@@ -0,0 +1,148 @@
+prepare("INSERT INTO attendance (employee_id, date, check_in) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE check_in = ?");
+ if ($stmt->execute([$emp_id, $today, date('H:i:s'), date('H:i:s')])) {
+ $msg = 'تم تسجيل الحضور بنجاح!';
+ }
+ } elseif ($action === 'check_out') {
+ $stmt = $db->prepare("UPDATE attendance SET check_out = ? WHERE employee_id = ? AND date = ?");
+ if ($stmt->execute([date('H:i:s'), $emp_id, $today])) {
+ $msg = 'تم تسجيل الانصراف بنجاح!';
+ }
+ }
+}
+
+// Fetch all employees and their today's attendance
+$employees = $db->query("SELECT e.*, a.check_in, a.check_out FROM employees e LEFT JOIN attendance a ON e.id = a.employee_id AND a.date = '$today' ORDER BY e.id DESC")->fetchAll();
+$project_name = $_SERVER['PROJECT_NAME'] ?? 'نظام الموارد البشرية';
+
+?>
+
+
+
+
+
+ تسجيل الحضور -
+
+
+
+
+
+
+
+
+
+
+
+
سجل الحضور والغياب
+
تاريخ اليوم:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | الموظف |
+ وقت الحضور |
+ وقت الانصراف |
+ إجراءات |
+
+
+
+
+ | لا يوجد موظفين مسجلين حالياً |
+
+
+
+ |
+
+ |
+
+
+
+
+ --:--
+
+ |
+
+
+
+
+ --:--
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/employees.php b/employees.php
new file mode 100644
index 0000000..32ee08f
--- /dev/null
+++ b/employees.php
@@ -0,0 +1,160 @@
+prepare("INSERT INTO employees (name, phone, salary) VALUES (?, ?, ?)");
+ if ($stmt->execute([$name, $phone, $salary])) {
+ $msg = 'تم إضافة الموظف بنجاح!';
+ }
+ }
+}
+
+// Delete employee logic
+if (isset($_GET['delete'])) {
+ $stmt = $db->prepare("DELETE FROM employees WHERE id = ?");
+ if ($stmt->execute([$_GET['delete']])) {
+ $msg = 'تم حذف الموظف بنجاح!';
+ }
+}
+
+$employees = $db->query("SELECT * FROM employees ORDER BY id DESC")->fetchAll();
+$project_name = $_SERVER['PROJECT_NAME'] ?? 'نظام الموارد البشرية';
+
+?>
+
+
+
+
+
+ إدارة الموظفين -
+
+
+
+
+
+
+
+
+
+
+
قائمة الموظفين
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | الموظف |
+ رقم الهاتف |
+ الراتب الأساسي |
+ تاريخ الانضمام |
+ إجراءات |
+
+
+
+
+ | لا يوجد موظفين حالياً |
+
+
+
+ |
+
+ |
+ |
+ ج.م |
+ |
+
+
+ حذف
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/index.php b/index.php
index 7205f3d..c86de59 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,179 @@
query("SELECT COUNT(*) FROM employees")->fetchColumn();
+$todayDate = date('Y-m-d');
+$todayAttendance = $db->query("SELECT COUNT(*) FROM attendance WHERE date = '$todayDate' AND check_in IS NOT NULL")->fetchColumn();
+
+// Project meta tags from environment
+$project_name = $_SERVER['PROJECT_NAME'] ?? 'نظام إدارة الموارد البشرية';
+$project_description = $_SERVER['PROJECT_DESCRIPTION'] ?? 'نظام متكامل لإدارة الموظفين والحضور والرواتب باللغة العربية.';
+$project_image = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
-$phpVersion = PHP_VERSION;
-$now = date('Y-m-d H:i:s');
?>
-
-
+
+
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ - لوحة التحكم
+
+
+
+
+
+
+
+
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
-
-
-
+
+
+
+
+
+
+
أهلاً بك في لوحة التحكم، !
+
نظرة عامة سريعة على أداء الشركة اليوم.
+
+
+
+
+
+
+
+
+
إجمالي الموظفين
+
+
+
+ موظف مسجل حالياً
+
+
+
+
+
+
+
+
+
الحضور اليوم
+
+
+
+ موظف حاضر اليوم
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | الاسم |
+ رقم الهاتف |
+ الراتب |
+ التاريخ |
+
+
+
+ query("SELECT * FROM employees ORDER BY created_at DESC LIMIT 5")->fetchAll();
+ if (empty($latestEmployees)) {
+ echo '| لا يوجد موظفين حالياً |
';
+ } else {
+ foreach ($latestEmployees as $emp) {
+ echo '
+ | '.htmlspecialchars($emp['name']).' |
+ '.htmlspecialchars($emp['phone']).' |
+ '.number_format($emp['salary'], 2).' ج.م |
+ '.date('Y-m-d', strtotime($emp['created_at'])).' |
+
';
+ }
+ }
+ ?>
+
+
+
+
+
+
+
+
+
نصيحة اليوم للإدارة
+
التواصل الفعال مع الموظفين يزيد من الإنتاجية بنسبة 25%. احرص على الاجتماع بفريقك بانتظام.
+
+ فريق الموارد البشرية
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..13e2c1c
--- /dev/null
+++ b/login.php
@@ -0,0 +1,92 @@
+ 'مسؤول الموارد البشرية',
+ 'email' => $email
+ ];
+ header('Location: index.php');
+ exit;
+ }
+}
+
+$project_name = $_SERVER['PROJECT_NAME'] ?? 'نظام الموارد البشرية';
+?>
+
+
+
+
+
+ تسجيل الدخول -
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/payroll.php b/payroll.php
new file mode 100644
index 0000000..89f3ccb
--- /dev/null
+++ b/payroll.php
@@ -0,0 +1,110 @@
+query("SELECT * FROM employees ORDER BY id DESC")->fetchAll();
+$project_name = $_SERVER['PROJECT_NAME'] ?? 'نظام الموارد البشرية';
+
+?>
+
+
+
+
+
+ إدارة الرواتب -
+
+
+
+
+
+
+
+
+
+
+
+
مسير الرواتب
+
متابعة الرواتب الأساسية والمستحقات.
+
+
+
+
+
+
+
إجمالي الرواتب الشهرية
+
+ ج.م
+
+
+
+
+
+
+
+
+
+
+ | الموظف |
+ الراتب الأساسي |
+ الحالة |
+ إجراءات |
+
+
+
+
+ | لا يوجد بيانات موظفين حالياً |
+
+
+
+ |
+
+ |
+ ج.م |
+
+ نشط
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+