diff --git a/Course.php b/Course.php index eecf2a3..bc54479 100644 --- a/Course.php +++ b/Course.php @@ -10,551 +10,536 @@ include 'Header.php';
- - Courses > ($code) $name > Assignments
Faculty: $faculty   Year: $academic   Lecturer: $lecturer -
"; - } else { - $ta_name = ""; - while ($row = mysqli_fetch_assoc($ta_result)) { - $ta_name = $ta_name.$row['Full_Name']." "; - } - $ta_name = trim ($ta_name); - echo "
- Courses > $name ($code) > Lab Reports
Faculty: $faculty | Year: $academic | Lecturer: $lecturer | Teaching Assistant: $ta_name -
"; - } - } - } -} -?> - - -
- '; - $_SESSION['info_general']=null; - } - - if (isset($_SESSION['info_courses'])) { - echo '
'; - $_SESSION['info_courses']=null; + $student_id = $_SESSION["user_student_id"]; + $group_id = $_SESSION["user_group_id"]; + $c_date = date("Y-m-d H:i"); + + + if(!empty($_GET["url"])) + { + $course_url = mysqli_real_escape_string($con, $_GET["url"]); + $result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`," + . " `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` " + . " , users_table.Full_Name FROM `courses_table` INNER JOIN users_table" + . " ON users_table.User_ID=courses_table.Lecturer_User_ID where URL='$course_url' "); + + if(mysqli_num_rows($result)==0) { + + echo "No course matching the given course URL: ".$course_url; + + } else { + while($row = mysqli_fetch_assoc($result)) { + $name = $row['Course_Name']; + $code = $row['Course_Code']; + $faculty = $row['Faculty']; + $lecturer = $row['Full_Name']; + $academic = $row['Academic_Year']; + $url = $row['URL']; + $course_id = $row['Course_ID']; + // also get teaching assistant names(if any) + $ta_result = mysqli_query($con, "SELECT Full_Name FROM users_table where User_ID in (select TA from course_ta where Course_ID='$course_id');"); + if (mysqli_num_rows($ta_result) == 0) { + echo "
+ Courses > ($code) $name > Assignments
Faculty: $faculty   Year: $academic   Lecturer: $lecturer
"; + } else { + $ta_name = ""; + while ($row = mysqli_fetch_assoc($ta_result)) { + $ta_name = $ta_name.$row['Full_Name']." "; + } + $ta_name = trim ($ta_name); + echo "
+ Courses > $name ($code) > Lab Reports
Faculty: $faculty | Year: $academic | Lecturer: $lecturer | Teaching Assistant: $ta_name +
"; + } + } + } } ?> - -
- -if( $_SESSION['user_type'] == "Student") -{ - -?> -
+
-
+
-
- - + - - - - - - -
- + }} + echo ""; + ?> + +
- - - - + ?> -
- -
+
+
+ -








-
-

My groups

- - - - echo " "; - - ?> - -
- My groups + + Create group"; + ?> + +
+ + Invite Others"; - - if($status=="Invited") + + if(mysqli_num_rows($result)==0) { - $extra2=" Accept"; - $extra3=" Decline"; - - } + echo "You have no group in this course."; + } else { + while($row = mysqli_fetch_assoc($result)) { + $name=$row['Group_Name']; + $id=$row['Course_Group_id']; + $status=$row['Status']; - # Add "delete group" button and allow only group creator to delete it - $extra4 = ""; - echo "
$name ($status) $extra $extra2 $extra3" . - (($status == "Created")? "$extra4": "") - ."
"; - - $rs2=mysqli_query($con,"SELECT `ID`, `Course_Group_id`, course_group_members_table.Student_ID, - course_group_members_table.`Status`,users_table.Full_Name FROM `course_group_members_table` + $extra=" - Invite Others"; + + if($status=="Invited") + { + $extra2=" Accept"; + $extra3=" Decline"; + + } + + # Add "delete group" button and allow only group creator to delete it + $extra4 = ""; + + echo "
- - + } else{ + echo "
  • $name - $Student_ID ($status)"; + } - + } + echo "