diff --git a/Admin.php b/Admin.php
new file mode 100644
index 0000000..3c6ca89
--- /dev/null
+++ b/Admin.php
@@ -0,0 +1,335 @@
+
+
+
+
+
+
+
+
+
+
+
+
User account Management
+
+
Lecturer / TA Accounts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Create Lecturer/TA Accounts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Connect.php b/Connect.php
new file mode 100644
index 0000000..d82d890
--- /dev/null
+++ b/Connect.php
@@ -0,0 +1,23 @@
+connect_error) {
+ die("Database Connection failed: " . $conn->connect_error);
+}
+// else
+// {
+
+// echo "Connected";
+// }
+session_start();
\ No newline at end of file
diff --git a/Course.php b/Course.php
new file mode 100644
index 0000000..d0a61cf
--- /dev/null
+++ b/Course.php
@@ -0,0 +1,760 @@
+
+
+ Courses > $name ($code) > Lab Reports
+ Faculty : $faculty Year : $academic Lecturer :$lecturer
+
+
+
+ ";
+
+ }}
+ }
+?>
+
+
+
' . $_SESSION['info_ReMarking'] . '
';
+ $_SESSION['info_ReMarking']=null;
+}
+
+ if (isset($_SESSION['info_courses'])) {
+ echo '
' . $_SESSION['info_courses'] . '
';
+ $_SESSION['info_courses']=null;
+}
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Class Groups
+
+ Create Group";
+
+ ?>
+
+
+
+
+ Invite Others";
+
+ if($status=="Invited")
+ {
+ $extra2="
Accept ";
+ $extra3="
Decline ";
+
+ }
+ echo "
$name ($status) $extra $extra2 $extra3
";
+
+ $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`
+INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID
+where course_group_members_table.Course_Group_id=$id");
+
+ while($row = mysqli_fetch_assoc($rs2)) {
+ $name=$row['Full_Name'];
+ $id=$row['Course_Group_id'];
+ $status=$row['Status'];
+ $Student_ID=$row['Student_ID'];
+
+
+ echo "
$name-$Student_ID ($status) ";
+
+ }
+
+
+
+
+
+
+
+ }
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Courses.php b/Courses.php
new file mode 100644
index 0000000..8adb6dd
--- /dev/null
+++ b/Courses.php
@@ -0,0 +1,825 @@
+
+
+
+
+
+
+
+
+
+
+
+ ";
+
+ echo "
";
+
+
+
+ if( $_SESSION['user_type']=="Lecturer"){
+ echo "
Post new Lab Assignment
+ ";
+
+ }
+ }
+ }
+ echo "
";
+
+ echo "
Lab Report Assignment list ";
+
+ error_reporting(0);
+if (isset($_SESSION['info_courses'])) {
+ echo '
' . $_SESSION['info_courses'] . '
';
+ $_SESSION['info_courses'] = null;
+}
+if (isset($_SESSION['info_courses'])) {
+ echo '
' . $_SESSION['info_courses'] . '
';
+ $_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 Lecturers can Post new Lab report Assignments ";
+ }
+ 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'];
+ $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'];}}
+
+
+ $header="Courses > ".$name."($code) > Assignments > ".$title;
+
+ echo "
+ $title ($as_type)
$ins
+
Posted : $posted Deadline : $deadline ($marks Marks) "
+ . " "
+
+ . " $count_subs Submissions ( $count_marked Marked ) View | Extend Deadline Attachments : $full_link "
+ . "
+ ";
+
+
+
+ }}
+ 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 "
";
+ while($row = mysqli_fetch_assoc($resultx1))
+ {
+ $stdid=$row['Student_ID'];
+ $stdname=$row['Full_Name'];
+
+ echo " $stdname($stdid) ";
+ }
+ echo " Reason "
+ . " "
+ . " ";
+
+
+
+
+ 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");
+
+ }
+ // $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
+
+ ";
+
+ }}?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Search Results for 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='$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 { 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 this Course";
+ if($v>0)
+ {
+ $msg="
Lecturer Verification required";
+ $msg2="Send Joining Request";
+ }
+
+ echo "
+ ($code) - $name
($url)
$msg2
+
Faculty : $faculty Year : $academic Lecturer :$lecturer $msg
+ ";
+
+
+ }
+ }
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+ 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 "
";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Header.php b/Header.php
new file mode 100644
index 0000000..4f8118f
--- /dev/null
+++ b/Header.php
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
'.$_SESSION['info_Marking'].'
';
+ $_SESSION['info_Marking']=null;
+}
+
+
+
+
+$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 Status='Marked'");
+ if(mysqli_num_rows($resultx2)==0){$count_marked=0;} else { while($row = mysqli_fetch_assoc($resultx2)) {$count_marked =$row['cnt'];}}
+
+ $resultx3 = mysqli_query($con,"Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Pending'");
+ if(mysqli_num_rows($resultx3)==0){$count_unmarked=0;} else { while($row = mysqli_fetch_assoc($resultx3)) {$count_unmarked =$row['cnt'];}}
+
+ $resultx4 = mysqli_query($con,"Select COUNT(*) as cnt from lab_report_submissions where lab_report_submissions.Lab_Report_ID=$id and Status='Remarking'");
+ if(mysqli_num_rows($resultx4)==0){$count_remark=0;} else { while($row = mysqli_fetch_assoc($resultx4)) {$count_remark =$row['cnt'];}}
+
+
+?>
+
+
Lab Report Submissions ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ";
+
+ $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`
+INNER JOIN users_table on users_table.Student_ID=course_group_members_table.Student_ID
+where course_group_members_table.Course_Group_id=$id");
+
+ while($row = mysqli_fetch_assoc($rs2)) {
+ $name=$row['Full_Name'];
+ $id=$row['Course_Group_id'];
+ $status=$row['Status'];
+ $Student_ID=$row['Student_ID'];
+
+
+ echo "
$name-$Student_ID ($status) ";
+
+ }
+
+
+
+
+
+
+
+ }
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ '$c_date' ORDER by Lab_Report_ID DESC");
+if(mysqli_num_rows($result1)==0)
+ {
+ echo "No Active assignments for this course so far.";
+
+ } else { while($row = mysqli_fetch_assoc($result1)) {
+
+ $Course_ID=$row['Course_ID'];
+ $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'];
+ $labid=$row['Lab_Report_ID'];
+
+ $type=$row['Type'];
+ if($type=="Group"){
+ $resultx1 = mysqli_query($con,"SELECT Course_Group_id FROM `course_groups_table` WHERE Group_Leader=$student_id and Course_id=$Course_ID");
+ while($row = mysqli_fetch_assoc($resultx1)) {$group_id=$row['Course_Group_id'];}
+
+ if($group_id<1)
+ {
+ echo"
This Lab report can only be submitted by Group Admin ";
+ return;
+ }
+ }
+
+
+
+
+ $full_link="
$att1 ";
+
+ if($att2!=""){
+ $full_link= $full_link."|
$att2 ";
+ }
+ if($att3!=""){
+ $full_link= $full_link."|
$att3 ";
+ }
+
+ if($att4!=""){
+ $full_link= $full_link."|
$att4 ";
+ }
+
+
+ echo "
+ ";
+
+// echo "
+// $title $ins
+// Posted : $posted Deadline : $deadline Attachments : $full_link
+//
";
+
+
+
+
+
+
+ echo "";
+
+
+
+
+
+
+
+ }}
+
+
+ }
+?>
+
+
+
+
+
+
+
+
+