-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverview_list.php
More file actions
211 lines (188 loc) · 7.36 KB
/
Copy pathoverview_list.php
File metadata and controls
211 lines (188 loc) · 7.36 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
/**
* Created by PhpStorm.
* User: Pauline
* Date: 16/03/2019
* Time: 09:28
*/
session_start();
include("config.php");
if (!IsSet($_SESSION["userID"])) //user variable must exist in session to stay here
header("Location: login.php"); //if not, go back to login page
$username=$_SESSION["userID"]; //get user name into variable $username
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<title>Actions overview</title>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/table.css">
</head>
<!--- Main body --->
<body>
<div class="container colour">
<header>
<nav class="navbar navbar-expand-sm">
<a href="index.php"><h2 class="col-sm-4 logo navbar-text">FORECAST</h2></a>
<h2 class="col-sm-4 forecast center navbar-text2">Overview</h2>
<ul class="col-sm-4 nav nav-pills">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown">My Account</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="full_list.php">My task list</a>
<a class="dropdown-item" href="module.php">Module</a>
<a class="dropdown-item" href="./update/password_updateform.php">Update password</a>
<a class="dropdown-item" href="log_out.php">Sign out</a>
</div>
</li>
</ul>
</nav>
</header>
<!-- start of main section -->
<main>
<!-- check if user is the head of school - if not, deny access -->
<div class="denied">
<?php
if($username!='jr001')
{ echo"<br>";
echo "Access denied";
echo"<br>";
echo"<br>";
echo"<a href='full_list.php'>Return to my action list</a>";
echo"<br>";
echo"<br>";
exit();
}
?>
</div>
<!-- Not used in final version as onward click functionality not implemented
<div class="dropdown">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
Select staff member
</button>
<div class="dropdown-menu">
<?php /*
$sql_query="SELECT * FROM user";
$result = $db->query($sql_query);
while($row = $result->fetch_array()) {
$firstname = $row['firstname'];
$lastname = $row['lastname'];
echo "<a class='dropdown-item' href='#'>{$firstname} {$lastname}</a>";
};
echo "<a class='dropdown-item' href='#' >All</a>";
*/?>
</div>
</div>
-->
<article><!--to keep together the two table sections displayed on the page-->
<!-- start of display of all tasks for all staff members section -->
<section>
<h3>Module</h3>
<table class="module">
<tr>
<th>Name</th>
<th>Date</th>
<th>Course</th>
<th>Action</th>
<th>Notes(status)</th>
<th>Deadline</th>
<th>Completed</th>
</tr>
<?php
$sql_query="SELECT * FROM module_task,user WHERE module_task.username= user.username";
$result = $db->query($sql_query);
while($row = $result->fetch_array()) {
$today = $row['today'];
$code = $row['code'];
$task = $row['task'];
$comments = $row['comments'];
$deadline = $row['deadline'];
$completed = $row['completed'];
$id=$row['id'];
$firstname=$row['firstname'];
$lastname=$row['lastname'];
echo "
<tr>
<td>{$firstname} {$lastname}</td>
<td>{$today}</td>
<td>{$code}</td>
<td>{$task}</td>
<td>{$comments}</td>
<td>{$deadline}</td>
<td>{$completed}</td>
</tr>
";
}
?>
</table>
</section>
<!-- end of display of all tasks for all staff members section -->
<br><br>
<!-- start of display of all department related tasks for all staff members section -->
<section>
<h3>Department</h3>
<!-- insert collapse button -->
<button type="button" data-toggle="collapse" data-target="#tasks">Show all tasks</button>
<div id="tasks" class="collapse" >
<table class="department">
<tr>
<th>Name</th>
<th>Date</th>
<th>Action</th>
<th>Notes(status)</th>
<th>Deadline</th>
<th>Completed</th>
</tr>
<?php
$sql_query="SELECT * FROM department, user WHERE department.username= user.username";
$result = $db->query($sql_query);
while($row = $result->fetch_array()) {
$today = $row['today'];
$task = $row['task'];
$comments = $row['comments'];
$deadline = $row['deadline'];
$completed = $row['completed'];
$id=$row['id'];
$firstname=$row['firstname'];
$lastname=$row['lastname'];
echo "
<tr>
<td>{$firstname} {$lastname}</td>
<td>{$today}</td>
<td>{$task}</td>
<td>{$comments}</td>S
<td>{$deadline}</td>
<td>{$completed}</td>
</tr>
";
}
?>
</table>
</div>
</section>
<!-- end of display of all department related tasks for all staff members section -->
</article>
</main>
<!-- End of main -->
<!-- Start of footer -->
<?php
include("footer.html");
?>
<!-- End of footer -->
<!-- End of <div class="container colour">-->
</div>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5c853fcb8b82e462"></script>
<!-- Required for drop down lists -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<!-- Bootstrap script for general CSS layout-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>