";
- $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 Academic_Year >= $oldest_academic_year and Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id) order by Academic_Year desc");
- }
- // the user has entered something under "Find course by Code"
- else
- {
- echo "
";
- $result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`,
+
+
+ Search Results for Course Code $search
";
+ $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 Academic_Year >= $oldest_academic_year and Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id) order by Academic_Year desc");
+ }
+ // the user has entered something under "Find course by Code"
+ else
+ {
+ echo "
Find Courses under faculty $faculty
";
+ $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 Academic_Year >= $oldest_academic_year and Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id) order by Academic_Year desc");
- }
-
+ }
+
- if(mysqli_num_rows($result)==0)
- {
- echo "No results found for your Search
";
+ if(mysqli_num_rows($result)==0)
+ {
+ echo "No results found for your Search
";
- } 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'];
- $id=$row['Course_ID'];
- $v=$row['Verify_New_Members'];
- $msg2="Join Course";
- if($v>0)
- {
- $msg="
Lecturer verification required";
- $msg2="Send Joining Request";
- }
-
- echo "
+ } 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'];
+ $id=$row['Course_ID'];
+ $v=$row['Verify_New_Members'];
+ $msg2="Join Course";
+ if($v>0)
+ {
+ $msg="
Lecturer verification required";
+ $msg2="Send Joining Request";
+ }
+
+ echo "
[$code] $name
($url)
$msg2
Faculty: $faculty | Year: $academic | Lecturer: $lecturer $msg
";
- }
- }
- }
- // Otherwise, list the student's joined courses (already done), in reverse chronological order
- echo "
My Courses
";
- $result = mysqli_query($con,"SELECT users_table.Full_Name, course_students_table.Status, courses_table.Course_ID, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
+ }
+ }
+ }
+ // Otherwise, list the student's joined courses (already done), in reverse chronological order
+ echo "
My Courses
";
+ $result = mysqli_query($con,"SELECT users_table.Full_Name, course_students_table.Status, courses_table.Course_ID, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table`
INNER JOIN users_table
ON users_table.User_ID=courses_table.Lecturer_User_ID
INNER JOIN course_students_table on course_students_table.Course_ID=courses_table.Course_ID
where course_students_table.Student_ID=$student_id order by Academic_Year desc");
-
- if(mysqli_num_rows($result)==0)
- {
- echo "
You are not Enrolled in any Course";
- } 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'];
- $id=$row['Course_ID'];
- $Status=$row['Status'];
-
- if($Status=="Joined")
- {
- echo "
+
+ if(mysqli_num_rows($result)==0)
+ {
+ echo "
You are not Enrolled in any Course";
+ } 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'];
+ $id=$row['Course_ID'];
+ $Status=$row['Status'];
+
+ if($Status=="Joined")
+ {
+ echo "
($code) - $name
($url)
$Status
Open
Faculty : $faculty Year : $academic Lecturer :$lecturer
";
- }
- else
- {
- echo "
+ }
+ else
+ {
+ echo "
($code) - $name $Status
Faculty : $faculty Year : $academic Lecturer :$lecturer
";
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- echo "
+ }
+ }
+ }
+
+ echo "
+ echo "