-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_confirmation.php
More file actions
65 lines (60 loc) · 2.27 KB
/
task_confirmation.php
File metadata and controls
65 lines (60 loc) · 2.27 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
if (!isset($_SESSION['user']) || $_SESSION['user']['role'] !== 'Team Member') {
header('Location: login.php');
exit();
}
require 'db.php.inc';
if (!isset($_GET['task_id'])) {
die("Error: Task ID not provided.");
}
$taskId = $_GET['task_id'];
try {
$stmt = $pdo->prepare("
SELECT t.task_id, t.task_name, t.description, t.priority, t.status, t.effort, ta.role, t.start_date, t.end_date
FROM tasks t
JOIN task_allocations ta ON t.task_id = ta.task_id
WHERE t.task_id = :task_id AND ta.user_id = :user_id
");
$stmt->execute([
':task_id' => $taskId,
':user_id' => $_SESSION['user']['user_id']]);
$task = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$task) {
die("Error: Task not found or not assigned to you.");
}
} catch (PDOException $e) {
die("Database error: " . $e->getMessage());
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Task Confirmation</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php include 'header.php'; ?>
<main>
<h2>Task Confirmation</h2>
<form action="task_confirmation_process.php" method="POST">
<fieldset>
<legend>Task Details</legend>
<p><strong>Task ID:</strong> <?= $task['task_id'] ?></p>
<p><strong>Title:</strong> <?= $task['task_name'] ?></p>
<p><strong>Description:</strong> <?= $task['description'] ?></p>
<p><strong>Priority:</strong> <?= $task['priority'] ?></p>
<p><strong>Status:</strong> <?= $task['status'] ?></p>
<p><strong>Effort:</strong> <?= $task['effort'] ?> man-months</p>
<p><strong>Role:</strong> <?= $task['role'] ?></p>
<p><strong>Start Date:</strong> <?= $task['start_date'] ?></p>
<p><strong>End Date:</strong> <?= $task['end_date'] ?></p>
</fieldset>
<input type="hidden" name="task_id" value="<?= $task['task_id'] ?>">
<button type="submit" name="action" value="accept" class="btn-accept">Accept Task</button>
<button type="submit" name="action" value="reject" class="btn-reject">Reject Task</button>
</form>
</main>
<?php include 'footer.php'; ?>
</body>
</html>