Skip to content

Commit fb20583

Browse files
author
shahriar
committed
Delete Course Implemented
1 parent e82a8e1 commit fb20583

File tree

3 files changed

+356
-345
lines changed

3 files changed

+356
-345
lines changed

course.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@
6767

6868
if (isset($row['ID'])) {
6969
$course_id = $row['ID'];
70-
if (chk_taken_course_by_id($_SESSION['id'], $row['ID'])) {
71-
goto skip;
72-
}
7370
}
7471
if (isset($row['id'])) {
7572
$course_id = $row['id'];
@@ -99,12 +96,12 @@
9996
// echo '<li><a href="edit.php?email=';
10097
// echo urlencode($row["Email"]);
10198
// echo '"><i class="fa fa-pencil fa-fw"></i> Edit</a></li>
102-
// <li><a href="delete.php?email=';
103-
// echo urlencode($row["Email"]);
104-
// echo '"><i class="fa fa-trash-o fa-fw"></i> Delete</a></li>';
99+
echo '<li><a href="delete_course.php?id=';
100+
echo urlencode($row["ID"]);
101+
echo '"><i class="fa fa-trash-o fa-fw"></i> Delete</a></li>';
105102
}
106103

107-
if (!($_SESSION['role'] == 'admin') && !($show == "taken")) {
104+
if (!($_SESSION['role'] == 'admin') && !($show == "taken") && !(chk_taken_course_by_id($_SESSION['id'], $row['ID']))) {
108105
echo '<li><a href="add_course.php?id=';
109106
echo $course_id;
110107
echo '"><i class="fa fa-plus fa-fw"></i> Add</a></li>';
@@ -127,7 +124,7 @@
127124
}
128125
$counter++;
129126

130-
skip:
127+
131128
}
132129
?>
133130
<div class="row-fluid">

0 commit comments

Comments
 (0)