diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..faa1838 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.vscode + diff --git a/Admin.php b/Admin.php index fcbe519..0c8b4ca 100644 --- a/Admin.php +++ b/Admin.php @@ -1,367 +1,323 @@ -
-

Administration Panel

- -
+
+

Administration Panel

+
+ +
- - - - -
-

User Account Management


- - Lecturer / TA Accounts
- - - - - - -
+
+

User Account Management

+
+ Lecturer / TA Accounts
+
- - -

- - Create Lecturer/TA Accounts -
- - Full_Name - -Email - - - Passport_Number / ID (Used as Intial Password) - -
User Type : - Lecturer - T/A -
- +
-error_reporting(E_ALL); -if(isset($_SESSION['info_Admin_Users'])) { - echo '
'; - $_SESSION['info_Admin_Users']=null; -} -if(isset($_SESSION['info_Admin_Users'])) { - echo '
'; - $_SESSION['info_Admin_Users']=null; -} +

-?> + Create Lecturer/TA Accounts + + + Full_Name + + Email + - - -
+ Passport_Number / ID (Used as Intial Password) + +
User Type : + Lecturer + T/A +
+ '; + $_SESSION['info_Admin_Users'] = null; + } + if (isset($_SESSION['info_Admin_Users'])) { + echo '
'; + $_SESSION['info_Admin_Users'] = null; + } + ?> -
- - - - +
- - - - - -
-
- - -
- -
- - - -
- - - - -
- - - - - + + + + + + + +
- - -
- - - - - + +
+ +
+ +
+ + + + +
+ + + + +
+ +
+ + \ No newline at end of file diff --git a/Course.php b/Course.php index d7683ef..8946d75 100644 --- a/Course.php +++ b/Course.php @@ -2,32 +2,28 @@ include 'NoDirectPhpAcess.php'; ?> - Courses > $name ($code) > Lab Reports
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 = $ta_name . $row['Full_Name'] . " "; } - $ta_name = trim ($ta_name); + $ta_name = trim($ta_name); echo " "; +
"; } } } @@ -54,79 +50,77 @@ if(!empty($_GET["url"])) ?>
- -'; - $_SESSION['info_ReMarking']=null; -} - -if (isset($_SESSION['info_courses'])) { - echo '
'; - $_SESSION['info_courses']=null; -} -?> - + + '; + $_SESSION['info_ReMarking'] = null; + } + + if (isset($_SESSION['info_courses'])) { + echo '
'; + $_SESSION['info_courses'] = null; + } + ?> +
- - +if ($_SESSION['user_type'] == "Student") { + +?>
-
- - +
-
@@ -134,645 +128,547 @@ if( $_SESSION['user_type'] == "Student")
-
- - -// Connect to MySQL database -$con = mysqli_connect("localhost", $mysql_username, $mysql_password, "lrr"); + + // Connect to MySQL database + $con = mysqli_connect("localhost", $mysql_username, $mysql_password, "lrr"); - - - - - - - - - -
- - +
- +
-

Class Groups

- -Class Groups - - echo " "; - - ?> - - - -
- 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, + + if (mysqli_num_rows($result) == 0) { + 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']; + + $extra = " - 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)
  • "; - + + 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)
  • "; + } } - - - - - - - } - } - ?> - + ?> - - -
    - +
    - - - - - + window.location.href = data + "&details=" + details; + } + \ No newline at end of file diff --git a/Courses.php b/Courses.php index e7ea2ee..51373a9 100644 --- a/Courses.php +++ b/Courses.php @@ -181,9 +181,9 @@ New Date/Time
    Invidual Group"; + echo "Submission Type Individual Group"; } else { - echo "Submission Type Invidual Group"; + echo "Submission Type Individual Group"; } ?> @@ -238,7 +238,7 @@ New Date/Time

    - Submission Type Invidual + Submission Type Individual Group
    diff --git a/Footer.php b/Footer.php index 08d99e8..de442d2 100644 --- a/Footer.php +++ b/Footer.php @@ -1,23 +1,4 @@ - - - - - - - - - - - - - - - - - - -








    -
    - +
    +
    \ No newline at end of file diff --git a/Header.php b/Header.php index 6899665..60977ba 100644 --- a/Header.php +++ b/Header.php @@ -13,155 +13,159 @@ if (mysqli_connect_errno()) { ?> - - - - - - - - + + + + + + - -
    - - - - - - - - - - diff --git a/logout.php b/logout.php index d09c644..ad306cc 100644 --- a/logout.php +++ b/logout.php @@ -2,9 +2,9 @@ // Destory sessions & redirect to index - session_destroy(); - session_unset(); - // Start a new session +session_destroy(); +session_unset(); +// Start a new session session_start(); // Generate a new session ID @@ -12,11 +12,12 @@ session_regenerate_id(true); // Then finally, make sure you pick up the new session ID $session_id = session_id(); - - - unset( $_SESSION['user_id']); - unset( $_SESSION['user_email']); - unset( $_SESSION['user_type']); - unset( $_SESSION['user_student_id']); - unset( $_SESSION['user_fullname']); + +unset($_SESSION['user_id']); +unset($_SESSION['user_email']); +unset($_SESSION['user_type']); +unset($_SESSION['user_student_id']); +unset($_SESSION['user_fullname']); header("Location: index.php"); + +?>