-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd-task.php
More file actions
29 lines (23 loc) · 850 Bytes
/
Copy pathadd-task.php
File metadata and controls
29 lines (23 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
// تضمين إعدادات الجلسة
require_once __DIR__ . '/config/session.php';
require_once __DIR__ . '/config/database.php';
require_once __DIR__ . '/config/config.php';
require_once __DIR__ . '/models/Database.php';
require_once __DIR__ . '/controllers/AuthController.php';
require_once __DIR__ . '/models/Category.php';
// التحقق من تسجيل الدخول
$authController = new AuthController();
if(!$authController->isLoggedIn()) {
header('Location: index.php');
exit();
}
$user = $authController->getCurrentUser();
// إنشاء كائنات النماذج
$database = new Database();
$conn = $database->getConnection();
$categoryModel = new Category($conn);
// الحصول على الفئات
$categories = $categoryModel->getCategoriesByUser($_SESSION['user_id']);
include 'views/tasks/add-task.php';
?>