From 207d12a4a3366bcb1b2429045a9354d4f59136a9 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Tue, 16 Nov 2021 22:20:40 +0800 Subject: [PATCH 1/5] LAMASHEVSKYI DMYTRO's work on mobile phone UI adaption. Need more detail? Check the Kanban card at http://118.25.96.118/kanboard/?controller=TaskViewController&action=show&task_id=1483&project_id=170 --- Courses.php | 1131 +++++++++++++++++++++------------------ Courses.php.rej | 1209 ++++++++++++++++++++++++++++++++++++++++++ Footer.php | 13 +- Footer.php.rej | 16 + Header.php | 221 ++++---- Header.php.rej | 241 +++++++++ css/Styles.css | 15 + index.php | 171 +++--- index.php.rej | 193 +++++++ js/CustomDropdown.js | 9 + signup.php | 27 +- signup.php.rej | 53 ++ 12 files changed, 2525 insertions(+), 774 deletions(-) create mode 100644 Courses.php.rej create mode 100644 Footer.php.rej create mode 100644 Header.php.rej create mode 100644 css/Styles.css create mode 100644 index.php.rej create mode 100644 js/CustomDropdown.js create mode 100644 signup.php.rej diff --git a/Courses.php b/Courses.php index 8db2318..4b4154a 100644 --- a/Courses.php +++ b/Courses.php @@ -7,105 +7,104 @@ include 'NoDirectPhpAcess.php'; $page = 'Courses'; include 'Header.php'; +echo "
"; + $user_d = $_SESSION['user_id']; if ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") { -?> + ?> - -
+ + +
- - - + - } catch (e) { - alert(e); - } - } - +
- ($code) - $name -
Faculty: $faculty | Year: $academic | Lecturer: $lecturer -
-
- "; +
+ ($code) - $name +
Faculty: $faculty | Year: $academic | Lecturer: $lecturer +
+
+ "; - echo "
"; - } + echo "
"; + } // ------------------------------Editing Lab Assignment by Lecturer ------------------------------------ - if ($_GET['act'] == "edit") { - $getid = $_GET["cid"]; - $result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'"); + if ($_GET['act'] == "edit") { + $getid = $_GET["cid"]; + $result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'"); - while ($row1 = mysqli_fetch_assoc($result1)) { - $Deadline = $row1['Deadline']; - $_SESSION['Date'] = trim(strstr($Deadline, ' ', true)); - $_SESSION['Time'] = trim(strstr($Deadline, ' ')); - $_SESSION['Instructions'] = $row1['Instructions']; - $_SESSION['Title'] = $row1['Title']; - $_SESSION['Marks'] = $row1['Marks']; - $_SESSION['Type'] = $row1['Type']; - } + while ($row1 = mysqli_fetch_assoc($result1)) { + $Deadline = $row1['Deadline']; + $_SESSION['Date'] = trim(strstr($Deadline, ' ', true)); + $_SESSION['Time'] = trim(strstr($Deadline, ' ')); + $_SESSION['Instructions'] = $row1['Instructions']; + $_SESSION['Title'] = $row1['Title']; + $_SESSION['Marks'] = $row1['Marks']; + $_SESSION['Type'] = $row1['Type']; + } - if (isset($_POST['frm_uploadlab'])) { + if (isset($_POST['frm_uploadlab'])) { $deadlinedate = trim($_POST["deadlinedate"]); // remove spaces $deadlinetime = trim($_POST["deadlinetime"]); // remove spaces $instructions = $_POST["instructions"]; @@ -116,501 +115,597 @@ New Date/Time
query($sql) === TRUE) { - $_SESSION["info_Updated"] = "Assignment information updated successfully."; - } else { - // echo "Error: " . $sql . "
" . $con->error; - echo "Serious error happened whiling updating assignment information."; - } - } - - if ($_SESSION['user_type'] == "Lecturer") { - $Date = $_SESSION['Date']; - $Time = $_SESSION['Time']; - $Instructions = $_SESSION['Instructions']; - $Title = $_SESSION['Title']; - $Marks = $_SESSION['Marks']; - $Type = $_SESSION['Type']; - - echo "

Editing Lab Assignment

"; - ?> -
- - - - - Dealine Date/Time -
-
">
-
">
-
- - Title - "> - Instructions - - Marks - "> - Attachment 1 - - - Attachment 2 - - - Attachment 3 - - - Attachment 4 - -
- - Individual Group"; + if ($con->query($sql) === TRUE) { + $_SESSION["info_Updated"] = "Assignment information updated successfully."; } else { - echo "Submission Type Individual Group"; + // echo "Error: " . $sql . "
" . $con->error; + echo "Serious error happened whiling updating assignment information."; } - ?> + } -
-
-




- Editing Lab Assignment "; + ?> +
+ + + + + Dealine Date/Time +
+
">
+
">
+
+ + Title + "> + Instructions + + Marks + "> + Attachment 1 + + + Attachment 2 + + + Attachment 3 + + + Attachment 4 + +
+ + Individual Group"; + } else { + echo "Submission Type Individual Group"; + } + ?> + +
+
+




+ - -

Post new Lab Assignment

- -
- - - - - Dealine Date/Time -
-
-
-
+

Post new Lab Assignment

- Title - - Instructions - - Marks - - Attachment 1 - + + + + + - Attachment 2 - + Dealine Date/Time +
+
+
+
- Attachment 3 - + Title + + Instructions + + Marks + + Attachment 1 + - Attachment 4 - -
- Submission Type Individual + Attachment 2 + - Group -
-
-




- "; + Attachment 3 + - echo "

Lab Report Assignment list

"; + Attachment 4 + +
+ Submission Type Individual - error_reporting(0); - if (isset($_SESSION["info_Updated"])) { - echo '
'; - $_SESSION['info_Updated'] = null; - } - if (isset($_SESSION['info_courses'])) { - echo '
'; - $_SESSION['info_courses'] = null; - } - if (isset($_SESSION['info_courses'])) { - echo '
'; - $_SESSION['info_courses'] = null; - } - - $result = mysqli_query($con, " SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, " - . "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC"); - - if ($_SESSION['user_type'] == "TA") { - echo "*Only Lecturer can post a new lab report assignment
"; - } - if (mysqli_num_rows($result) == 0) { - echo "No assignments posted so far."; - } else { - while ($row = mysqli_fetch_assoc($result)) { - $marks = $row['Marks']; - $title = $row['Title']; - $ins = $row['Instructions']; - $posted = $row['Posted_Date']; - $deadline = $row['Deadline']; - $att1 = $row['Attachment_link_1']; - $att2 = $row['Attachment_link_2']; - $att3 = $row['Attachment_link_3']; - $att4 = $row['Attachment_link_4']; - $id = $row['Lab_Report_ID']; - $cours_id = $row['Course_ID']; - $as_type = $row['Type']; - $full_link = "$att1"; - - if ($att2 != "") { - $full_link = $full_link . "  |  $att2"; - } - if ($att3 != "") { - $full_link = $full_link . "  |  $att3"; - } - - if ($att4 != "") { - $full_link = $full_link . "   |   $att4"; - } - - $resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id"); - while ($row = mysqli_fetch_assoc($resultx1)) { - $count_subs = $row['cnt']; - } - - $resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Marks is not null"); - if (mysqli_num_rows($resultx2) == 0) { - $count_marked = 0; - } else { - while ($row = mysqli_fetch_assoc($resultx2)) { - $count_marked = $row['cnt']; + Group +
+
+



+ " . $name . "($code) > Assignments > " . $title; - - echo "
- $title ($as_type)
$ins - -
Posted : $posted Deadline : $deadline   ($marks Marks)           " - . "
" - - . "    $count_subs Submissions ( $count_marked Marked )       Edit   |   View    |   Extend Deadline
Attachments : $full_link
" - . "  
- "; } - } - echo "
"; + echo "
"; - $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM -`course_students_table` -INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID -WHERE Course_ID=$course_id"); + echo "

Lab Report Assignment list

"; - echo "
"; + + $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM + `course_students_table` + INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID + WHERE Course_ID=$course_id"); + + echo ""; - return; - } - - ?> - - - "; - - $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 courses_table.Lecturer_User_ID=$user_d"); - - if ($_SESSION['user_type'] == "TA") { - $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, - `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` -INNER JOIN -course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); + return; } - // $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"); - if (mysqli_num_rows($result) == 0) { - } else { - while ($row = mysqli_fetch_assoc($result)) { - $id = $row['Course_ID']; - $name = $row['Course_Name']; - $code = $row['Course_Code']; - $faculty = $row['Faculty']; - $lecturer = $row['Full_Name']; - $academic = $row['Academic_Year']; - $url = $row['URL']; - - $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` -INNER JOIN users_table on users_table.User_ID=course_ta.TA -where course_ta.Course_ID=$id"); - - $ta = ""; - while ($rowTA = mysqli_fetch_assoc($resultTA)) { - $ta = $ta . " - " . $rowTA['TA_NAME']; - } - - echo " - -
- ($code) - $name -
Faculty : $faculty        Year : $academic        Lecturer :$lecturer        TA:$ta -
- "; - } - } ?> -
-
-
- Course Joining Requests - - No Course joining request so far for all your courses
"; - } else { - while ($row = mysqli_fetch_assoc($result)) { - $id = $row['ID']; - - $name = $row['Course_Name']; - $code = $row['Course_Code']; - $faculty = $row['Faculty']; - $std_name = $row['Full_Name']; - $academic = $row['Academic_Year']; - - echo "
- $std_name is Requesting to join
[($code) - $name ]     
Accept -    Decline -
"; - } - } ?> - Only Lecturers can Post new Lab report Assignments"; - } - if ($_SESSION['user_type'] == "Lecturer") { ?> +
- Create new Course Portal - -
- - - Course Name - - - Course Code - - - URL (Leave blank to use Course Code & Year) - - - Academic Year - - - Faculty
- - - - - Verify Joining Students - Yes - No - -
-
- -
- - - -
- - - - - - -
-
-
Course Portal > Students
' . $_SESSION['info_Courses_student'] . ''; - $_SESSION['info_Courses_student'] = null; - } - ?> -

-
-
-
- -
-
- - 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 Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); - } 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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); + echo " + "; + + $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 courses_table.Lecturer_User_ID=$user_d"); + + if ($_SESSION['user_type'] == "TA") { + $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, + `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` + INNER JOIN + course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); } + // $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"); if (mysqli_num_rows($result) == 0) { - echo "No results found for your Search
"; } else { - + + echo "
"; while ($row = mysqli_fetch_assoc($result)) { + $id = $row['Course_ID']; $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"; + + $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` + INNER JOIN users_table on users_table.User_ID=course_ta.TA + where course_ta.Course_ID=$id"); + + $ta = ""; + while ($rowTA = mysqli_fetch_assoc($resultTA)) { + $ta = $ta . " - " . $rowTA['TA_NAME']; } - echo "
- [$code] $name
($url)
$msg2 -
Faculty: $faculty | Year: $academic | Lecturer: $lecturer
$msg
- "; + echo " + +
+
($code) - $name
+
+

Faculty : $faculty Year : $academic Lecturer :$lecturer TA:$ta

+
"; } - } - } - 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"); - - 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 "
- ($code) - $name $Status -
Faculty : $faculty Year : $academic Lecturer :$lecturer
- "; - } - } - } - - echo "
- -
-
-
-
Find course by Code - -
-List courses by faculty - -
- -
-

- + } ?>
- -
-
- -
"; +
+
+
+ Course Joining Requests + + No Course joining request so far for all your courses
"; + } else { + while ($row = mysqli_fetch_assoc($result)) { + $id = $row['ID']; + + $name = $row['Course_Name']; + $code = $row['Course_Code']; + $faculty = $row['Faculty']; + $std_name = $row['Full_Name']; + $academic = $row['Academic_Year']; + + echo "
+ $std_name is Requesting to join
[($code) - $name ]     
Accept +    Decline +
"; + } + } + ?> + + Only Lecturers can Post new Lab report Assignments"; + } + if ($_SESSION['user_type'] == "Lecturer") { ?> + + Create new Course Portal + +
+ + + Course Name + + + Course Code + + + URL (Leave blank to use Course Code & Year) + + + Academic Year + + + Faculty
+ + + + + Verify Joining Students + Yes + No + +
+
+ +
+ + + +
+ + + + - \ No newline at end of file + + ?> +
+
+ + +
"; + echo "

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 Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); + } else { + echo "
"; + 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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); + } + + echo "
"; + 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 "
+
+
+ +
+
+
$code
+

$academic

+

$faculty

+

$lecturer

+ Open +
+
+
"; + + } + } + + echo "
"; + } + ?> +
+
+
+ +
+

My Courses

+
+ 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']; + + ?> + + +
+
+ +
+
+
$code
+

$academic

+

$faculty

+

$lecturer

+ Open +
+
+
"; + } else { + + echo "
+
+
+ +
+
+
$code
+

$academic

+

$faculty

+

$lecturer

+
+
+
"; + + } + } + } + + ?> +
+
+
+ + +
\ No newline at end of file diff --git a/Courses.php.rej b/Courses.php.rej new file mode 100644 index 0000000..ddaa5b7 --- /dev/null +++ b/Courses.php.rej @@ -0,0 +1,1209 @@ +diff a/Courses.php b/Courses.php (rejected hunks) +@@ -7,105 +7,104 @@ include 'NoDirectPhpAcess.php'; + $page = 'Courses'; + include 'Header.php'; + ++echo "
"; ++ + $user_d = $_SESSION['user_id']; + + if ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") { +-?> ++ ?> + +- + +-
++ ++ ++
+ +- +- +- ++ + +- } catch (e) { +- alert(e); +- } +- } +- +- +-
+- ($code) - $name +-
Faculty: $faculty | Year: $academic | Lecturer: $lecturer +-
+-
+- "; +- +- echo "
++ "; ++ ++ echo "
"; ++ } + + // ------------------------------Editing Lab Assignment by Lecturer ------------------------------------ + +- if ($_GET['act'] == "edit") { +- $getid = $_GET["cid"]; +- $result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'"); +- +- while ($row1 = mysqli_fetch_assoc($result1)) { +- $Deadline = $row1['Deadline']; +- $_SESSION['Date'] = trim(strstr($Deadline, ' ', true)); +- $_SESSION['Time'] = trim(strstr($Deadline, ' ')); +- $_SESSION['Instructions'] = $row1['Instructions']; +- $_SESSION['Title'] = $row1['Title']; +- $_SESSION['Marks'] = $row1['Marks']; +- $_SESSION['Type'] = $row1['Type']; +- } ++ if ($_GET['act'] == "edit") { ++ $getid = $_GET["cid"]; ++ $result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'"); ++ ++ while ($row1 = mysqli_fetch_assoc($result1)) { ++ $Deadline = $row1['Deadline']; ++ $_SESSION['Date'] = trim(strstr($Deadline, ' ', true)); ++ $_SESSION['Time'] = trim(strstr($Deadline, ' ')); ++ $_SESSION['Instructions'] = $row1['Instructions']; ++ $_SESSION['Title'] = $row1['Title']; ++ $_SESSION['Marks'] = $row1['Marks']; ++ $_SESSION['Type'] = $row1['Type']; ++ } + +- if (isset($_POST['frm_uploadlab'])) { ++ if (isset($_POST['frm_uploadlab'])) { + $deadlinedate = trim($_POST["deadlinedate"]); // remove spaces + $deadlinetime = trim($_POST["deadlinetime"]); // remove spaces + $instructions = $_POST["instructions"]; +@@ -116,501 +115,597 @@ New Date/Time
query($sql) === TRUE) { +- $_SESSION["info_Updated"] = "Assignment information updated successfully."; +- } else { ++ if ($con->query($sql) === TRUE) { ++ $_SESSION["info_Updated"] = "Assignment information updated successfully."; ++ } else { + // echo "Error: " . $sql . "
" . $con->error; +- echo "Serious error happened whiling updating assignment information."; ++ echo "Serious error happened whiling updating assignment information."; ++ } + } +- } +- +- if ($_SESSION['user_type'] == "Lecturer") { +- $Date = $_SESSION['Date']; +- $Time = $_SESSION['Time']; +- $Instructions = $_SESSION['Instructions']; +- $Title = $_SESSION['Title']; +- $Marks = $_SESSION['Marks']; +- $Type = $_SESSION['Type']; +- +- echo "

Editing Lab Assignment

"; +- ?> +-
+- +- +- +- +- Dealine Date/Time +-
+-
">
+-
">
+-
+- +- Title +- "> +- Instructions +- +- Marks +- "> +- Attachment 1 +- + +- Attachment 2 +- ++ if ($_SESSION['user_type'] == "Lecturer") { ++ $Date = $_SESSION['Date']; ++ $Time = $_SESSION['Time']; ++ $Instructions = $_SESSION['Instructions']; ++ $Title = $_SESSION['Title']; ++ $Marks = $_SESSION['Marks']; ++ $Type = $_SESSION['Type']; + +- Attachment 3 +- +- +- Attachment 4 +- +-
+- +- Individual Group"; +- } else { +- echo "Submission Type Individual Group"; +- } ++ echo "

Editing Lab Assignment

"; + ?> +- +-
+-
+-




+- ++ ++ ++ ++ ++ Dealine Date/Time ++
++
">
++
">
++
++ ++ Title ++ "> ++ Instructions ++ ++ Marks ++ "> ++ Attachment 1 ++ ++ ++ Attachment 2 ++ ++ ++ Attachment 3 ++ ++ ++ Attachment 4 ++ ++
++ ++ Individual Group"; ++ } else { ++ echo "Submission Type Individual Group"; ++ } ++ ?> ++ ++
++
++



++ +- +-

Post new Lab Assignment

+- +-
+- +- +- +- +- +- Dealine Date/Time +-
+-
+-
+-
+ +- Title +- +- Instructions +- +- Marks +- +- Attachment 1 +- +- +- Attachment 2 +- +- +- Attachment 3 +- +- +- Attachment 4 +- +-
+- Submission Type Individual +- +- Group +-
+-
+-




+- Post new Lab Assignment ++ ++
++ ++ ++ ++ ++ ++ Dealine Date/Time ++
++
++
++
++ ++ Title ++ ++ Instructions ++ ++ Marks ++ ++ Attachment 1 ++ ++ ++ Attachment 2 ++ ++ ++ Attachment 3 ++ ++ ++ Attachment 4 ++ ++
++ Submission Type Individual ++ ++ Group ++
++
++




++ "; +- +- echo "

Lab Report Assignment list

"; +- +- error_reporting(0); +- if (isset($_SESSION["info_Updated"])) { +- echo '
'; +- $_SESSION['info_Updated'] = null; +- } +- if (isset($_SESSION['info_courses'])) { +- echo '
'; +- $_SESSION['info_courses'] = null; +- } +- if (isset($_SESSION['info_courses'])) { +- echo '
'; +- $_SESSION['info_courses'] = null; +- } ++ echo "
"; + +- $result = mysqli_query($con, " SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, " +- . "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC"); ++ echo "

Lab Report Assignment list

"; + +- if ($_SESSION['user_type'] == "TA") { +- echo "*Only Lecturer can post a new lab report assignment
"; +- } +- if (mysqli_num_rows($result) == 0) { +- echo "No assignments posted so far."; +- } else { +- while ($row = mysqli_fetch_assoc($result)) { +- $marks = $row['Marks']; +- $title = $row['Title']; +- $ins = $row['Instructions']; +- $posted = $row['Posted_Date']; +- $deadline = $row['Deadline']; +- $att1 = $row['Attachment_link_1']; +- $att2 = $row['Attachment_link_2']; +- $att3 = $row['Attachment_link_3']; +- $att4 = $row['Attachment_link_4']; +- $id = $row['Lab_Report_ID']; +- $cours_id = $row['Course_ID']; +- $as_type = $row['Type']; +- $full_link = "$att1"; +- +- if ($att2 != "") { +- $full_link = $full_link . "  |  $att2"; +- } +- if ($att3 != "") { +- $full_link = $full_link . "  |  $att3"; +- } ++ error_reporting(0); ++ if (isset($_SESSION["info_Updated"])) { ++ echo '
'; ++ $_SESSION['info_Updated'] = null; ++ } ++ if (isset($_SESSION['info_courses'])) { ++ echo '
'; ++ $_SESSION['info_courses'] = null; ++ } ++ if (isset($_SESSION['info_courses'])) { ++ echo '
'; ++ $_SESSION['info_courses'] = null; ++ } + +- if ($att4 != "") { +- $full_link = $full_link . "   |   $att4"; +- } ++ $result = mysqli_query($con, " SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, " ++ . "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC"); + +- $resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id"); +- while ($row = mysqli_fetch_assoc($resultx1)) { +- $count_subs = $row['cnt']; +- } ++ if ($_SESSION['user_type'] == "TA") { ++ echo "*Only Lecturer can post a new lab report assignment
"; ++ } ++ if (mysqli_num_rows($result) == 0) { ++ echo "No assignments posted so far."; ++ } else { ++ echo "
"; ++ while ($row = mysqli_fetch_assoc($result)) { ++ $marks = $row['Marks']; ++ $title = $row['Title']; ++ $ins = $row['Instructions']; ++ $posted = $row['Posted_Date']; ++ $deadline = $row['Deadline']; ++ $att1 = $row['Attachment_link_1']; ++ $att2 = $row['Attachment_link_2']; ++ $att3 = $row['Attachment_link_3']; ++ $att4 = $row['Attachment_link_4']; ++ $id = $row['Lab_Report_ID']; ++ $cours_id = $row['Course_ID']; ++ $as_type = $row['Type']; ++ $full_link = "$att1"; ++ ++ if ($att2 != "") { ++ $full_link = $full_link . " $att2"; ++ } ++ if ($att3 != "") { ++ $full_link = $full_link . " $att3"; ++ } + +- $resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Marks is not null"); +- if (mysqli_num_rows($resultx2) == 0) { +- $count_marked = 0; +- } else { +- while ($row = mysqli_fetch_assoc($resultx2)) { +- $count_marked = $row['cnt']; ++ if ($att4 != "") { ++ $full_link = $full_link . " $att4"; + } +- } + +- $header = "Courses > " . $name . "($code) > Assignments > " . $title; ++ $resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id"); ++ while ($row = mysqli_fetch_assoc($resultx1)) { ++ $count_subs = $row['cnt']; ++ } + +- echo "
+- $title ($as_type)
$ins +- +-
Posted : $posted Deadline : $deadline   ($marks Marks)           " +- . "
" ++ $resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Marks is not null"); ++ if (mysqli_num_rows($resultx2) == 0) { ++ $count_marked = 0; ++ } else { ++ while ($row = mysqli_fetch_assoc($resultx2)) { ++ $count_marked = $row['cnt']; ++ } ++ } + +- . "    $count_subs Submissions ( $count_marked Marked )       Edit   |   View    |   Extend Deadline
Attachments : $full_link
" +- . "  
+- "; ++ $header = "Courses > " . $name . "($code) > Assignments > " . $title; ++ ++ ++ echo"
++
++
$title ($as_type)
++

$ins

++
++ ++ ++
++ $full_link ++
++
"; ++ } + } +- } +- echo "
"; ++ echo "
"; + +- $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM +-`course_students_table` +-INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID +-WHERE Course_ID=$course_id"); ++ $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM ++ `course_students_table` ++ INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID ++ WHERE Course_ID=$course_id"); + +- echo ""; + +- return; +- } ++ return; ++ } + +- ?> ++ ?> + +-
++ +- "; +- +- $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 courses_table.Lecturer_User_ID=$user_d"); +- +- if ($_SESSION['user_type'] == "TA") { +- $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, +- `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` +-INNER JOIN +-course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); +- } ++ ++ Course Portal > $user_name (Lecturer) > Course Listing ++
++
++ "; ++ ++ $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 courses_table.Lecturer_User_ID=$user_d"); ++ ++ if ($_SESSION['user_type'] == "TA") { ++ $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, ++ `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` ++ INNER JOIN ++ course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); ++ } + // $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"); + +- if (mysqli_num_rows($result) == 0) { +- } else { +- while ($row = mysqli_fetch_assoc($result)) { +- $id = $row['Course_ID']; +- $name = $row['Course_Name']; +- $code = $row['Course_Code']; +- $faculty = $row['Faculty']; +- $lecturer = $row['Full_Name']; +- $academic = $row['Academic_Year']; +- $url = $row['URL']; +- +- $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` +-INNER JOIN users_table on users_table.User_ID=course_ta.TA +-where course_ta.Course_ID=$id"); +- +- $ta = ""; +- while ($rowTA = mysqli_fetch_assoc($resultTA)) { +- $ta = $ta . " - " . $rowTA['TA_NAME']; ++ if (mysqli_num_rows($result) == 0) { ++ } else { ++ ++ echo "
"; ++ while ($row = mysqli_fetch_assoc($result)) { ++ $id = $row['Course_ID']; ++ $name = $row['Course_Name']; ++ $code = $row['Course_Code']; ++ $faculty = $row['Faculty']; ++ $lecturer = $row['Full_Name']; ++ $academic = $row['Academic_Year']; ++ $url = $row['URL']; ++ ++ $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` ++ INNER JOIN users_table on users_table.User_ID=course_ta.TA ++ where course_ta.Course_ID=$id"); ++ ++ $ta = ""; ++ while ($rowTA = mysqli_fetch_assoc($resultTA)) { ++ $ta = $ta . " - " . $rowTA['TA_NAME']; ++ } ++ ++ echo " ++ ++
++
($code) - $name
++
++

Faculty : $faculty Year : $academic Lecturer :$lecturer TA:$ta

++
"; + } + +- echo " +- +-
+- ($code) - $name +-
Faculty : $faculty        Year : $academic        Lecturer :$lecturer        TA:$ta +-
+- "; ++ } ?> ++
++
++
++
++ Course Joining Requests ++ ++ No Course joining request so far for all your courses
"; ++ } else { ++ while ($row = mysqli_fetch_assoc($result)) { ++ $id = $row['ID']; ++ ++ $name = $row['Course_Name']; ++ $code = $row['Course_Code']; ++ $faculty = $row['Faculty']; ++ $std_name = $row['Full_Name']; ++ $academic = $row['Academic_Year']; ++ ++ echo "
++ $std_name is Requesting to join
[($code) - $name ]     
Accept ++    Decline ++
"; ++ } + } +- } ?> +-
+-
+-
+- Course Joining Requests ++ ?> + +- No Course joining request so far for all your courses
"; +- } else { +- while ($row = mysqli_fetch_assoc($result)) { +- $id = $row['ID']; +- +- $name = $row['Course_Name']; +- $code = $row['Course_Code']; +- $faculty = $row['Faculty']; +- $std_name = $row['Full_Name']; +- $academic = $row['Academic_Year']; +- +- echo "
+- $std_name is Requesting to join
[($code) - $name ]     
Accept +-    Decline +-
"; ++ Only Lecturers can Post new Lab report Assignments"; + } +- } +- ?> ++ if ($_SESSION['user_type'] == "Lecturer") { ?> + +- Only Lecturers can Post new Lab report Assignments"; +- } +- if ($_SESSION['user_type'] == "Lecturer") { ?> ++ Create new Course Portal + +- Create new Course Portal ++
++ ++ ++ Course Name ++ + +- +- +- +- Course Name +- ++ Course Code ++ + +- Course Code +- ++ URL (Leave blank to use Course Code & Year) ++ + +- URL (Leave blank to use Course Code & Year) +- ++ Academic Year ++ + +- Academic Year +- ++ Faculty
++ + +- Faculty
+- ++ + +- ++ Verify Joining Students ++ Yes ++ No + +- Verify Joining Students +- Yes +- No ++
++
+ +-
+-
++
+ +- ++ + +- ++
+ +- ++ + +- ++ + +-if ($_SESSION['user_type'] == "Student") { +- ?> ++ ++
++
++
++
Course Portal > Students
++ +-
+-
+-
Course Portal > Students
++ error_reporting(0); ++ if (isset($_SESSION['info_Courses_student'])) { ++ echo '
'; ++ $_SESSION['info_Courses_student'] = null; ++ } ++ ?> ++

++
++
++
++ ++
++ ++
+ ++ ++
++
++ ++
++
++ ++
+ +- 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 Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); +- } 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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); ++ ++
++ ++
++ ++
++ "; + } + +- if (mysqli_num_rows($result) == 0) { +- echo "No results found for your Search
"; +- } else { ++ ?> ++
++
++ ++ ++
"; ++ echo "

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 Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); ++ } else { ++ echo "
"; ++ 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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); ++ } + +- 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 "
"; ++ 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 "
++
++
++ ++
++
++
$code
++

$academic

++

$faculty

++

$lecturer

++ Open ++
++
++
"; ++ ++ } + } + +- echo "
+- [$code] $name
($url)
$msg2 +-
Faculty: $faculty | Year: $academic | Lecturer: $lecturer
$msg
+- "; ++ echo "
"; + } +- } +- } ++ ?> ++
++
++
+ +- 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"); +- +- 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 "
+- ($code) - $name $Status +-
Faculty : $faculty Year : $academic Lecturer :$lecturer
+- "; +- } +- } +- } ++
++

My Courses

++
++
+- +-
+-
+-
+-
Find course by Code +- +-
+-List courses by faculty +- +-
++ where course_students_table.Student_ID=$student_id"); + +-
+-

+- +-
+- +-
+-
+- +-
"; +- } ++ 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']; + +- ?> ++ ?> ++ ++ ++
++
++ ++
++
++
$code
++

$academic

++

$faculty

++

$lecturer

++ Open ++
++
++
"; ++ } else { ++ ++ echo "
++
++
++ ++
++
++
$code
++

$academic

++

$faculty

++

$lecturer

++
++
++
"; ++ ++ } ++ } ++ } + +- +\ No newline at end of file ++ ?> ++
++
++
++ ++ ++
+\ No newline at end of file diff --git a/Footer.php b/Footer.php index de442d2..004ba3e 100644 --- a/Footer.php +++ b/Footer.php @@ -1,4 +1,9 @@ -








-
- -
\ No newline at end of file + + + + diff --git a/Footer.php.rej b/Footer.php.rej new file mode 100644 index 0000000..54f1748 --- /dev/null +++ b/Footer.php.rej @@ -0,0 +1,16 @@ +diff a/Footer.php b/Footer.php (rejected hunks) +@@ -1,4 +1,9 @@ +-








+-
+- +-
+\ No newline at end of file ++ ++ ++ ++ diff --git a/Header.php b/Header.php index 86ac5ce..45a80a2 100644 --- a/Header.php +++ b/Header.php @@ -18,138 +18,36 @@ if (mysqli_connect_errno()) { + + + + - - - + - + + + + + + + - + } + \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/Header.php.rej b/Header.php.rej new file mode 100644 index 0000000..5b0f412 --- /dev/null +++ b/Header.php.rej @@ -0,0 +1,241 @@ +diff a/Header.php b/Header.php (rejected hunks) +@@ -18,138 +18,36 @@ if (mysqli_connect_errno()) { + + + ++ ++ ++ ++ + +- +- +- ++ + + +- ++ ++ ++ ++ + ++ ++ ++ +- ++ } ++ + +\ No newline at end of file ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file diff --git a/css/Styles.css b/css/Styles.css new file mode 100644 index 0000000..32a72b9 --- /dev/null +++ b/css/Styles.css @@ -0,0 +1,15 @@ +/* Sticky footer styles +-------------------------------------------------- */ +html { + position: relative; + min-height: 100%; +} +body { + margin-bottom: 100px; /* Margin bottom by footer height */ +} +.footer { + position: absolute; + bottom: 0; + width: 100%; + height: 100px; /* Set the fixed height of the footer here */ +} diff --git a/index.php b/index.php index 9d4a499..6bc4fc3 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ +
+
-


+
-
-
-

- -

-
-

Lab Report Repository

-

-
-
-
-
-

Sign in

-
+
+
+ +
+

Lab Report Repository

+
+
+
-
+
+
+
+

Sign in

+
+
+
+ + Student ID / Instructor Email + +
+ Password + +
+
+
+
Reset my password +
+
Don't have an account? + Sign Up +
+ + '; + $_SESSION['info_login']=null; + } - - - Student ID / Instructor Email - -
- Password - -
-
-
-
Reset my password -
-
Don't have an account? - Sign Up - -
- '; - $_SESSION['info_login']=null; - } - - // wrong pass - if(isset($_SESSION['wrong_pass'])) { - echo '
'; - $_SESSION['wrong_pass']=null; - } - - - if(isset($_SESSION['infoChangePassword'])) { - echo '
'; - $_SESSION['infoChangePassword']=null; - } - ?> - -
- -
-
-
-
- -
+ if(isset($_SESSION['wrong_pass'])) { + echo '
'; + $_SESSION['wrong_pass']=null; + } - + if(isset($_SESSION['infoChangePassword'])) { + echo '
'; + $_SESSION['infoChangePassword']=null; + } + ?> + + +
+
+
+
+ + + + - diff --git a/index.php.rej b/index.php.rej new file mode 100644 index 0000000..2aa7edc --- /dev/null +++ b/index.php.rej @@ -0,0 +1,193 @@ +diff a/index.php b/index.php (rejected hunks) +@@ -1,7 +1,7 @@ + + + ++
++
+ +-


++
+ +-
+-
+-

+- +-

+-
+-

Lab Report Repository

+-

+-
+-
+-
+-
+-

Sign in

+-
++
++
++ ++
++

Lab Report Repository

++
++
++
+ +-
++
++
++
++

Sign in

++
++
++
++ ++ Student ID / Instructor Email ++ ++
++ Password ++ ++
++
++
++
Reset my password ++
++
Don't have an account? ++ Sign Up ++
+ +- +- +- Student ID / Instructor Email +- +-
+- Password +- +-
+-
+-
+-
Reset my password +-
+-
Don't have an account? +- Sign Up +- +-
++ '; +- $_SESSION['info_login']=null; +- } +- +- +- // wrong pass +- if(isset($_SESSION['wrong_pass'])) { +- echo '
'; +- $_SESSION['wrong_pass']=null; +- } +- +- +- if(isset($_SESSION['infoChangePassword'])) { +- echo '
'; +- $_SESSION['infoChangePassword']=null; +- } +- ?> +- +-
+- +-
+-
+-
+-
++ error_reporting(E_ALL); + +-
++ if(isset($_SESSION['info_login'])) { ++ echo '
'; ++ $_SESSION['info_login']=null; ++ } + + +- ++ // wrong pass ++ if(isset($_SESSION['wrong_pass'])) { ++ echo '
'; ++ $_SESSION['wrong_pass']=null; ++ } + +- + +- + + diff --git a/js/CustomDropdown.js b/js/CustomDropdown.js new file mode 100644 index 0000000..2613fca --- /dev/null +++ b/js/CustomDropdown.js @@ -0,0 +1,9 @@ +$(document).ready(function(e){ + $('.search-panel .dropdown-menu').find('a').click(function(e) { + e.preventDefault(); + var param = $(this).attr("href").replace("#",""); + var concept = $(this).text(); + $('.search-panel span#search_concept').text(concept); + $('.input-group #search_param').val(param); + }); +}); \ No newline at end of file diff --git a/signup.php b/signup.php index 95bdfe3..55cc2b2 100644 --- a/signup.php +++ b/signup.php @@ -6,16 +6,17 @@ include 'NoDirectPhpAcess.php'; include 'Header.php'; ?> -
- -
+
+
+ +

Please fill in each field below

-
+
@@ -34,7 +35,7 @@ include 'Header.php'; Confirm Password
- +
- \ No newline at end of file +
+ diff --git a/signup.php.rej b/signup.php.rej new file mode 100644 index 0000000..a461694 --- /dev/null +++ b/signup.php.rej @@ -0,0 +1,53 @@ +diff a/signup.php b/signup.php (rejected hunks) +@@ -6,16 +6,17 @@ include 'NoDirectPhpAcess.php'; + include 'Header.php'; + ?> + +-
+- +-
++
++
++ ++
+ +
+ +

Please fill in each field below

+
+ +-
++
+ + + +@@ -34,7 +35,7 @@ include 'Header.php'; + Confirm Password + +
+- ++ + +
+
+- +\ No newline at end of file ++
++ -- 2.17.1 From 036489041f56a084e5cb716984f48917fbf0e4b8 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Mon, 22 Nov 2021 10:46:49 +0800 Subject: [PATCH 2/5] Remove all *.rej files. --- Courses.php.rej | 1209 ----------------------------------------------- Footer.php.rej | 16 - Header.php.rej | 241 ---------- index.php.rej | 193 -------- signup.php.rej | 53 --- 5 files changed, 1712 deletions(-) delete mode 100644 Courses.php.rej delete mode 100644 Footer.php.rej delete mode 100644 Header.php.rej delete mode 100644 index.php.rej delete mode 100644 signup.php.rej diff --git a/Courses.php.rej b/Courses.php.rej deleted file mode 100644 index ddaa5b7..0000000 --- a/Courses.php.rej +++ /dev/null @@ -1,1209 +0,0 @@ -diff a/Courses.php b/Courses.php (rejected hunks) -@@ -7,105 +7,104 @@ include 'NoDirectPhpAcess.php'; - $page = 'Courses'; - include 'Header.php'; - -+echo "
"; -+ - $user_d = $_SESSION['user_id']; - - if ($_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") { --?> -+ ?> - -- - --
-+ -+ -+
- -- -- -- -+ - -- } catch (e) { -- alert(e); -- } -- } -- -- --
-- ($code) - $name --
Faculty: $faculty | Year: $academic | Lecturer: $lecturer --
--
-+ "; -+ -+ echo "
"; -+ } - - // ------------------------------Editing Lab Assignment by Lecturer ------------------------------------ - -- if ($_GET['act'] == "edit") { -- $getid = $_GET["cid"]; -- $result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'"); -- -- while ($row1 = mysqli_fetch_assoc($result1)) { -- $Deadline = $row1['Deadline']; -- $_SESSION['Date'] = trim(strstr($Deadline, ' ', true)); -- $_SESSION['Time'] = trim(strstr($Deadline, ' ')); -- $_SESSION['Instructions'] = $row1['Instructions']; -- $_SESSION['Title'] = $row1['Title']; -- $_SESSION['Marks'] = $row1['Marks']; -- $_SESSION['Type'] = $row1['Type']; -- } -+ if ($_GET['act'] == "edit") { -+ $getid = $_GET["cid"]; -+ $result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'"); -+ -+ while ($row1 = mysqli_fetch_assoc($result1)) { -+ $Deadline = $row1['Deadline']; -+ $_SESSION['Date'] = trim(strstr($Deadline, ' ', true)); -+ $_SESSION['Time'] = trim(strstr($Deadline, ' ')); -+ $_SESSION['Instructions'] = $row1['Instructions']; -+ $_SESSION['Title'] = $row1['Title']; -+ $_SESSION['Marks'] = $row1['Marks']; -+ $_SESSION['Type'] = $row1['Type']; -+ } - -- if (isset($_POST['frm_uploadlab'])) { -+ if (isset($_POST['frm_uploadlab'])) { - $deadlinedate = trim($_POST["deadlinedate"]); // remove spaces - $deadlinetime = trim($_POST["deadlinetime"]); // remove spaces - $instructions = $_POST["instructions"]; -@@ -116,501 +115,597 @@ New Date/Time
query($sql) === TRUE) { -- $_SESSION["info_Updated"] = "Assignment information updated successfully."; -- } else { -+ if ($con->query($sql) === TRUE) { -+ $_SESSION["info_Updated"] = "Assignment information updated successfully."; -+ } else { - // echo "Error: " . $sql . "
" . $con->error; -- echo "Serious error happened whiling updating assignment information."; -+ echo "Serious error happened whiling updating assignment information."; -+ } - } -- } -- -- if ($_SESSION['user_type'] == "Lecturer") { -- $Date = $_SESSION['Date']; -- $Time = $_SESSION['Time']; -- $Instructions = $_SESSION['Instructions']; -- $Title = $_SESSION['Title']; -- $Marks = $_SESSION['Marks']; -- $Type = $_SESSION['Type']; -- -- echo "

Editing Lab Assignment

"; -- ?> -- -- -- -- -- -- Dealine Date/Time --
--
">
--
">
--
-- -- Title -- "> -- Instructions -- -- Marks -- "> -- Attachment 1 -- - -- Attachment 2 -- -+ if ($_SESSION['user_type'] == "Lecturer") { -+ $Date = $_SESSION['Date']; -+ $Time = $_SESSION['Time']; -+ $Instructions = $_SESSION['Instructions']; -+ $Title = $_SESSION['Title']; -+ $Marks = $_SESSION['Marks']; -+ $Type = $_SESSION['Type']; - -- Attachment 3 -- -- -- Attachment 4 -- --
-- -- Individual Group"; -- } else { -- echo "Submission Type Individual Group"; -- } -+ echo "

Editing Lab Assignment

"; - ?> -- --
--
--



-- -+ -+ -+ -+ -+ Dealine Date/Time -+
-+
">
-+
">
-+
-+ -+ Title -+ "> -+ Instructions -+ -+ Marks -+ "> -+ Attachment 1 -+ -+ -+ Attachment 2 -+ -+ -+ Attachment 3 -+ -+ -+ Attachment 4 -+ -+
-+ -+ Individual Group"; -+ } else { -+ echo "Submission Type Individual Group"; -+ } -+ ?> -+ -+
-+
-+



-+ -- --

Post new Lab Assignment

-- --
-- -- -- -- -- -- Dealine Date/Time --
--
--
--
- -- Title -- -- Instructions -- -- Marks -- -- Attachment 1 -- -- -- Attachment 2 -- -- -- Attachment 3 -- -- -- Attachment 4 -- --
-- Submission Type Individual -- -- Group --
--
--




-- Post new Lab Assignment -+ -+
-+ -+ -+ -+ -+ -+ Dealine Date/Time -+
-+
-+
-+
-+ -+ Title -+ -+ Instructions -+ -+ Marks -+ -+ Attachment 1 -+ -+ -+ Attachment 2 -+ -+ -+ Attachment 3 -+ -+ -+ Attachment 4 -+ -+
-+ Submission Type Individual -+ -+ Group -+
-+
-+




-+ "; -- -- echo "

Lab Report Assignment list

"; -- -- error_reporting(0); -- if (isset($_SESSION["info_Updated"])) { -- echo '
'; -- $_SESSION['info_Updated'] = null; -- } -- if (isset($_SESSION['info_courses'])) { -- echo '
'; -- $_SESSION['info_courses'] = null; -- } -- if (isset($_SESSION['info_courses'])) { -- echo '
'; -- $_SESSION['info_courses'] = null; -- } -+ echo "
"; - -- $result = mysqli_query($con, " SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, " -- . "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC"); -+ echo "

Lab Report Assignment list

"; - -- if ($_SESSION['user_type'] == "TA") { -- echo "*Only Lecturer can post a new lab report assignment
"; -- } -- if (mysqli_num_rows($result) == 0) { -- echo "No assignments posted so far."; -- } else { -- while ($row = mysqli_fetch_assoc($result)) { -- $marks = $row['Marks']; -- $title = $row['Title']; -- $ins = $row['Instructions']; -- $posted = $row['Posted_Date']; -- $deadline = $row['Deadline']; -- $att1 = $row['Attachment_link_1']; -- $att2 = $row['Attachment_link_2']; -- $att3 = $row['Attachment_link_3']; -- $att4 = $row['Attachment_link_4']; -- $id = $row['Lab_Report_ID']; -- $cours_id = $row['Course_ID']; -- $as_type = $row['Type']; -- $full_link = "$att1"; -- -- if ($att2 != "") { -- $full_link = $full_link . "  |  $att2"; -- } -- if ($att3 != "") { -- $full_link = $full_link . "  |  $att3"; -- } -+ error_reporting(0); -+ if (isset($_SESSION["info_Updated"])) { -+ echo '
'; -+ $_SESSION['info_Updated'] = null; -+ } -+ if (isset($_SESSION['info_courses'])) { -+ echo '
'; -+ $_SESSION['info_courses'] = null; -+ } -+ if (isset($_SESSION['info_courses'])) { -+ echo '
'; -+ $_SESSION['info_courses'] = null; -+ } - -- if ($att4 != "") { -- $full_link = $full_link . "   |   $att4"; -- } -+ $result = mysqli_query($con, " SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, " -+ . "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC"); - -- $resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id"); -- while ($row = mysqli_fetch_assoc($resultx1)) { -- $count_subs = $row['cnt']; -- } -+ if ($_SESSION['user_type'] == "TA") { -+ echo "*Only Lecturer can post a new lab report assignment
"; -+ } -+ if (mysqli_num_rows($result) == 0) { -+ echo "No assignments posted so far."; -+ } else { -+ echo "
"; -+ while ($row = mysqli_fetch_assoc($result)) { -+ $marks = $row['Marks']; -+ $title = $row['Title']; -+ $ins = $row['Instructions']; -+ $posted = $row['Posted_Date']; -+ $deadline = $row['Deadline']; -+ $att1 = $row['Attachment_link_1']; -+ $att2 = $row['Attachment_link_2']; -+ $att3 = $row['Attachment_link_3']; -+ $att4 = $row['Attachment_link_4']; -+ $id = $row['Lab_Report_ID']; -+ $cours_id = $row['Course_ID']; -+ $as_type = $row['Type']; -+ $full_link = "$att1"; -+ -+ if ($att2 != "") { -+ $full_link = $full_link . " $att2"; -+ } -+ if ($att3 != "") { -+ $full_link = $full_link . " $att3"; -+ } - -- $resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Marks is not null"); -- if (mysqli_num_rows($resultx2) == 0) { -- $count_marked = 0; -- } else { -- while ($row = mysqli_fetch_assoc($resultx2)) { -- $count_marked = $row['cnt']; -+ if ($att4 != "") { -+ $full_link = $full_link . " $att4"; - } -- } - -- $header = "Courses > " . $name . "($code) > Assignments > " . $title; -+ $resultx1 = mysqli_query($con, "Select Count(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id"); -+ while ($row = mysqli_fetch_assoc($resultx1)) { -+ $count_subs = $row['cnt']; -+ } - -- echo "
-- $title ($as_type)
$ins -- --
Posted : $posted Deadline : $deadline   ($marks Marks)           " -- . "
" -+ $resultx2 = mysqli_query($con, "Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Marks is not null"); -+ if (mysqli_num_rows($resultx2) == 0) { -+ $count_marked = 0; -+ } else { -+ while ($row = mysqli_fetch_assoc($resultx2)) { -+ $count_marked = $row['cnt']; -+ } -+ } - -- . "    $count_subs Submissions ( $count_marked Marked )       Edit   |   View    |   Extend Deadline
Attachments : $full_link
" -- . "  
-- "; -+ $header = "Courses > " . $name . "($code) > Assignments > " . $title; -+ -+ -+ echo"
-+
-+
$title ($as_type)
-+

$ins

-+
-+ -+ -+
-+ $full_link -+
-+
"; -+ } - } -- } -- echo "
"; -+ echo "
"; - -- $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM --`course_students_table` --INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID --WHERE Course_ID=$course_id"); -+ $resultx1 = mysqli_query($con, "SELECT course_students_table.Student_ID,users_table.Full_Name FROM -+ `course_students_table` -+ INNER JOIN users_table on users_table.Student_ID=course_students_table.Student_ID -+ WHERE Course_ID=$course_id"); - -- echo ""; - -- return; -- } -+ return; -+ } - -- ?> -+ ?> - --
-+ -- "; -- -- $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 courses_table.Lecturer_User_ID=$user_d"); -- -- if ($_SESSION['user_type'] == "TA") { -- $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, -- `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` --INNER JOIN --course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); -- } -+ -+ Course Portal > $user_name (Lecturer) > Course Listing -+
-+
-+ "; -+ -+ $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 courses_table.Lecturer_User_ID=$user_d"); -+ -+ if ($_SESSION['user_type'] == "TA") { -+ $result = mysqli_query($con, "SELECT course_ta.Course_ID, `Course_Name`, -+ `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` -+ INNER JOIN -+ course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); -+ } - // $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"); - -- if (mysqli_num_rows($result) == 0) { -- } else { -- while ($row = mysqli_fetch_assoc($result)) { -- $id = $row['Course_ID']; -- $name = $row['Course_Name']; -- $code = $row['Course_Code']; -- $faculty = $row['Faculty']; -- $lecturer = $row['Full_Name']; -- $academic = $row['Academic_Year']; -- $url = $row['URL']; -- -- $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` --INNER JOIN users_table on users_table.User_ID=course_ta.TA --where course_ta.Course_ID=$id"); -- -- $ta = ""; -- while ($rowTA = mysqli_fetch_assoc($resultTA)) { -- $ta = $ta . " - " . $rowTA['TA_NAME']; -+ if (mysqli_num_rows($result) == 0) { -+ } else { -+ -+ echo "
"; -+ while ($row = mysqli_fetch_assoc($result)) { -+ $id = $row['Course_ID']; -+ $name = $row['Course_Name']; -+ $code = $row['Course_Code']; -+ $faculty = $row['Faculty']; -+ $lecturer = $row['Full_Name']; -+ $academic = $row['Academic_Year']; -+ $url = $row['URL']; -+ -+ $resultTA = mysqli_query($con, "SELECT `Course_ID`, `TA`,users_table.Full_Name as TA_NAME FROM `course_ta` -+ INNER JOIN users_table on users_table.User_ID=course_ta.TA -+ where course_ta.Course_ID=$id"); -+ -+ $ta = ""; -+ while ($rowTA = mysqli_fetch_assoc($resultTA)) { -+ $ta = $ta . " - " . $rowTA['TA_NAME']; -+ } -+ -+ echo " -+ -+
-+
($code) - $name
-+
-+

Faculty : $faculty Year : $academic Lecturer :$lecturer TA:$ta

-+
"; - } - -- echo " -- --
-- ($code) - $name --
Faculty : $faculty        Year : $academic        Lecturer :$lecturer        TA:$ta --
-- "; -+ } ?> -+
-+
-+
-+
-+ Course Joining Requests -+ -+ No Course joining request so far for all your courses
"; -+ } else { -+ while ($row = mysqli_fetch_assoc($result)) { -+ $id = $row['ID']; -+ -+ $name = $row['Course_Name']; -+ $code = $row['Course_Code']; -+ $faculty = $row['Faculty']; -+ $std_name = $row['Full_Name']; -+ $academic = $row['Academic_Year']; -+ -+ echo "
-+ $std_name is Requesting to join
[($code) - $name ]     
Accept -+    Decline -+
"; -+ } - } -- } ?> --
--
--
-- Course Joining Requests -+ ?> - -- No Course joining request so far for all your courses
"; -- } else { -- while ($row = mysqli_fetch_assoc($result)) { -- $id = $row['ID']; -- -- $name = $row['Course_Name']; -- $code = $row['Course_Code']; -- $faculty = $row['Faculty']; -- $std_name = $row['Full_Name']; -- $academic = $row['Academic_Year']; -- -- echo "
-- $std_name is Requesting to join
[($code) - $name ]     
Accept --    Decline --
"; -+ Only Lecturers can Post new Lab report Assignments"; - } -- } -- ?> -+ if ($_SESSION['user_type'] == "Lecturer") { ?> - -- Only Lecturers can Post new Lab report Assignments"; -- } -- if ($_SESSION['user_type'] == "Lecturer") { ?> -+ Create new Course Portal - -- Create new Course Portal -+
-+ -+ -+ Course Name -+ - -- -- -- -- Course Name -- -+ Course Code -+ - -- Course Code -- -+ URL (Leave blank to use Course Code & Year) -+ - -- URL (Leave blank to use Course Code & Year) -- -+ Academic Year -+ - -- Academic Year -- -+ Faculty
-+ - -- Faculty
-- -+ - -- -+ Verify Joining Students -+ Yes -+ No - -- Verify Joining Students -- Yes -- No -+
-+
- --
--
-+
- -- -+ - -- -+
- --
-+ - -- -+ - --if ($_SESSION['user_type'] == "Student") { -- ?> -+ -+
-+
-+
-+
Course Portal > Students
-+ --
--
--
Course Portal > Students
-+ error_reporting(0); -+ if (isset($_SESSION['info_Courses_student'])) { -+ echo '
'; -+ $_SESSION['info_Courses_student'] = null; -+ } -+ ?> -+

-+
-+
-+
-+ -+
-+ -+
- -+ -+
-+
-+ -+
-+
-+ -+
- -- 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 Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); -- } 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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); -+ -+
-+ -+
-+ -+
-+ "; - } - -- if (mysqli_num_rows($result) == 0) { -- echo "No results found for your Search
"; -- } else { -+ ?> -+
-+
-+ -+ -+
"; -+ echo "

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 Course_Code like '%{$search}%' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); -+ } else { -+ echo "
"; -+ 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 Faculty='$faculty' and courses_table.Course_ID not in (select course_id from course_students_table where Student_ID=$student_id)"); -+ } - -- 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 "
"; -+ 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 "
-+
-+
-+ -+
-+
-+
$code
-+

$academic

-+

$faculty

-+

$lecturer

-+ Open -+
-+
-+
"; -+ -+ } - } - -- echo "
-- [$code] $name
($url)
$msg2 --
Faculty: $faculty | Year: $academic | Lecturer: $lecturer
$msg
-- "; -+ echo "
"; - } -- } -- } -+ ?> -+
-+
-+
- -- 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"); -- -- 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 "
-- ($code) - $name $Status --
Faculty : $faculty Year : $academic Lecturer :$lecturer
-- "; -- } -- } -- } -+
-+

My Courses

-+
-+
-- --
--
--
--
Find course by Code -- --
--List courses by faculty -- --
-+ where course_students_table.Student_ID=$student_id"); - --
--

-- --
-- --
--
-- --
"; -- } -+ 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']; - -- ?> -+ ?> -+ -+ -+
-+
-+ -+
-+
-+
$code
-+

$academic

-+

$faculty

-+

$lecturer

-+ Open -+
-+
-+
"; -+ } else { -+ -+ echo "
-+
-+
-+ -+
-+
-+
$code
-+

$academic

-+

$faculty

-+

$lecturer

-+
-+
-+
"; -+ -+ } -+ } -+ } - -- -\ No newline at end of file -+ ?> -+
-+
-+
-+ -+ -+ -\ No newline at end of file diff --git a/Footer.php.rej b/Footer.php.rej deleted file mode 100644 index 54f1748..0000000 --- a/Footer.php.rej +++ /dev/null @@ -1,16 +0,0 @@ -diff a/Footer.php b/Footer.php (rejected hunks) -@@ -1,4 +1,9 @@ --








--
-- --
-\ No newline at end of file -+ -+ -+ -+ diff --git a/Header.php.rej b/Header.php.rej deleted file mode 100644 index 5b0f412..0000000 --- a/Header.php.rej +++ /dev/null @@ -1,241 +0,0 @@ -diff a/Header.php b/Header.php (rejected hunks) -@@ -18,138 +18,36 @@ if (mysqli_connect_errno()) { - - - -+ -+ -+ -+ - -- -- -- -+ - - -- -+ -+ -+ -+ - -+ -+ -+ -- -+ } -+ - -\ No newline at end of file -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file diff --git a/index.php.rej b/index.php.rej deleted file mode 100644 index 2aa7edc..0000000 --- a/index.php.rej +++ /dev/null @@ -1,193 +0,0 @@ -diff a/index.php b/index.php (rejected hunks) -@@ -1,7 +1,7 @@ - - - -+
-+
- --


-+
- --
--
--

-- --

--
--

Lab Report Repository

--

--
--
--
--
--

Sign in

--
-+
-+
-+ -+
-+

Lab Report Repository

-+
-+
-+
- --
-+
-+
-+
-+

Sign in

-+
-+
-+
-+ -+ Student ID / Instructor Email -+ -+
-+ Password -+ -+
-+
-+
-+
Reset my password -+
-+
Don't have an account? -+ Sign Up -+
- -- -- -- Student ID / Instructor Email -- --
-- Password -- --
--
--
--
Reset my password --
--
Don't have an account? -- Sign Up -- --
-+ '; -- $_SESSION['info_login']=null; -- } -- -- -- // wrong pass -- if(isset($_SESSION['wrong_pass'])) { -- echo '
'; -- $_SESSION['wrong_pass']=null; -- } -- -- -- if(isset($_SESSION['infoChangePassword'])) { -- echo '
'; -- $_SESSION['infoChangePassword']=null; -- } -- ?> -- --
-- --
--
--
--
-+ error_reporting(E_ALL); - --
-+ if(isset($_SESSION['info_login'])) { -+ echo '
'; -+ $_SESSION['info_login']=null; -+ } - - -- -+ // wrong pass -+ if(isset($_SESSION['wrong_pass'])) { -+ echo '
'; -+ $_SESSION['wrong_pass']=null; -+ } - -- - -- - - diff --git a/signup.php.rej b/signup.php.rej deleted file mode 100644 index a461694..0000000 --- a/signup.php.rej +++ /dev/null @@ -1,53 +0,0 @@ -diff a/signup.php b/signup.php (rejected hunks) -@@ -6,16 +6,17 @@ include 'NoDirectPhpAcess.php'; - include 'Header.php'; - ?> - --
-- --
-+
-+
-+ -+
- -
- -

Please fill in each field below

-
- --
-+
- -
- -@@ -34,7 +35,7 @@ include 'Header.php'; - Confirm Password - -
-- -+ - -
-
-- -\ No newline at end of file -+
-+ -- 2.17.1 From 18a41dd1bb25abfc7591d038da988571b1bc3124 Mon Sep 17 00:00:00 2001 From: Dmytro Lamashevski <56080362+DmytroLamashevskyi@users.noreply.github.com> Date: Wed, 1 Dec 2021 00:03:37 +0100 Subject: [PATCH 3/5] Fixed merge commits Fixed merge commits Added password pattern: https://www.w3schools.com/howto/howto_js_password_validation.asp Validating to make password one and two similar: https://stackoverflow.com/questions/9142527/can-you-require-two-form-fields-to-match-with-html5 Fixed Button and HTML Tags for text in login and registration form --- Header.php | 4 +++- index.php | 14 +++++++------- signup.php | 15 ++++++++------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Header.php b/Header.php index 45a80a2..718d8f3 100644 --- a/Header.php +++ b/Header.php @@ -23,7 +23,7 @@ if (mysqli_connect_errno()) { - + @@ -42,6 +42,8 @@ if (mysqli_connect_errno()) { user-select: none; } + /*Rule to include a block of CSS properties only if a certain condition is true.*/ + /*https://www.w3schools.com/css/css_rwd_mediaqueries.asp*/ @media (min-width: 768px) { .bd-placeholder-img-lg { font-size: 3.5rem; diff --git a/index.php b/index.php index 6bc4fc3..8c1dc9f 100644 --- a/index.php +++ b/index.php @@ -30,20 +30,20 @@ if (isset($_SESSION["user_fullname"])) {

Sign in

- + - Student ID / Instructor Email +

Student ID / Instructor Email


- Password - +

Password

+
-
+

Reset my password
-
Don't have an account? - Sign Up +
Don't have an account? + Sign Up
- Full Name +

Full Name

- Student ID +

Student ID

- Email +

Email

- Password (must include uppercase and lowercase letters, digits and special characters) - +

Password (must include uppercase and lowercase letters, digits and special characters)

+ - Confirm Password - +

Confirm Password

+
+ Date: Thu, 16 Jun 2022 12:28:12 +0200 Subject: [PATCH 4/5] Fixed 418 Update SQL and change UI --- Admin.php | 11 ++++++++--- Course.php | 7 ++----- Header.php | 9 ++++++++- index.php | 14 +++++++------- signup.php | 15 ++++++++------- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Admin.php b/Admin.php index 563dcdf..e233a2a 100644 --- a/Admin.php +++ b/Admin.php @@ -200,19 +200,24 @@ where course_ta.Course_ID=$c_id"); } echo " - $code - $name $faculty $lecturer$ta "; while ($row = mysqli_fetch_assoc($resultx)) { $id = $row['User_ID']; $name = $row['Full_Name']; echo ""; } + echo " "; } - echo " + echo " "; } } ?> diff --git a/Course.php b/Course.php index 8946d75..d9a75e0 100644 --- a/Course.php +++ b/Course.php @@ -94,11 +94,7 @@ if ($_SESSION['user_type'] == "Student") { -
  • - - - - +
  • +
  • diff --git a/Header.php b/Header.php index 45a80a2..ebd90ad 100644 --- a/Header.php +++ b/Header.php @@ -23,7 +23,7 @@ if (mysqli_connect_errno()) { - + @@ -32,7 +32,12 @@ if (mysqli_connect_errno()) { + + + + +