-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude-deleted-courses.php
More file actions
46 lines (36 loc) · 2.34 KB
/
include-deleted-courses.php
File metadata and controls
46 lines (36 loc) · 2.34 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
<?php
include("includes/db_connection.php");
require_once("includes/functions.php");
require_once("includes/session.php");
$show_deleted = $_POST["show_deleted"];
echo " <thead>";
echo " <tr>";
echo " <th>Courses Name</th>";
echo " <th>Courses Code</th>";
echo " <th>Courses Deleted?</th>";
echo " <th>Options</th>";
echo " </tr></thead><tbody>";
$query = "SELECT * FROM courses WHERE course_deleted ='".$show_deleted."' ORDER BY course_deleted";
$result = mysqli_query($connection, $query);
while($row = mysqli_fetch_assoc($result))
{
echo "<tr>";
echo "<td>".$row['course_desc']."</td>";
echo "<td>".$row['course_code']."</td>";
if ($row['course_deleted'] == 1) {
echo "<td>Yes</td>";
echo "<td class=\"options-td\"><a class=\"btn btn-warning btn-xs a-modal\" title=\"Edit Course\" href=\"edit-course.php?course_id=".$row['course_id']."\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></a><a class=\"btn btn-success btn-xs \" title=\"Print Course Subjects\" target=\"_blank\" href=\"print-course-subjects.php?course_id=".urlencode($row['course_id'])."\"><i class=\"fa fa-print\" aria-hidden=\"true\"></i></a>";
echo "<a class=\"btn btn-success btn-xs a-modal\" title=\"Restore Course\" href=\"restore-course.php?course_id=".$row['course_id']."\"><i class=\"fa fa-undo\" aria-hidden=\"true\"></i></a></td>";
echo "</tr>";
}
else{
echo "<td>No</td>";
$text_delete = "Delete Course";
$link_delete = "delete-course.php";
echo "<td class=\"options-td\"><a class=\"btn btn-warning btn-xs a-modal\" title=\"Edit Course\" href=\"edit-course.php?course_id=".$row['course_id']."\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i></a><a class=\"btn btn-success btn-xs \" title=\"Print Course Subjects\" target=\"_blank\" href=\"print-course-subjects.php?course_id=".urlencode($row['course_id'])."\"><i class=\"fa fa-print\" aria-hidden=\"true\"></i></a>";
echo "<a class=\"btn btn-danger btn-xs a-modal\" title=\"Delete Course\" href=\"delete-course.php?course_id=".$row['course_id']."\"><i class=\"fa fa-window-close\" aria-hidden=\"true\"></i></a></td>";
echo "</tr>";
}
}
echo "</tbody>";
?>