From 47b5f091102a6b7ea4fec5a9c0311c2faa8247d0 Mon Sep 17 00:00:00 2001 From: fish <280768265@qq.com> Date: Wed, 20 May 2020 13:46:35 +0800 Subject: [PATCH 1/6] Update Script.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改Script.php文件中的connection为本地root连接 --- Script.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Script.php b/Script.php index 968faae..7abf942 100644 --- a/Script.php +++ b/Script.php @@ -10,7 +10,8 @@ session_start(); date_default_timezone_set('Asia/Shanghai'); // CONNeCTION -$con=mysqli_connect("localhost","Teecloudy","5q7Ol2e!#!","lrr"); +//$con=mysqli_connect("localhost","Teecloudy","5q7Ol2e!#!","lrr"); +$con=mysqli_connect("localhost","root","","lrr"); // Check connection if (mysqli_connect_errno()) { From 099d0e044587fe8403378ddd99dfeda2d2c7bc22 Mon Sep 17 00:00:00 2001 From: fish <280768265@qq.com> Date: Wed, 20 May 2020 13:49:46 +0800 Subject: [PATCH 2/6] Update Header.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加jquery-ui.css和jquery-ui.js的1.12.1版本 --- Header.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Header.php b/Header.php index 4f8118f..fcf5ce8 100644 --- a/Header.php +++ b/Header.php @@ -35,7 +35,8 @@ else - + + From 454d3062c31f421f4fd6252b334888d3c9f25add Mon Sep 17 00:00:00 2001 From: fish <280768265@qq.com> Date: Wed, 20 May 2020 17:50:16 +0800 Subject: [PATCH 3/6] Update Script.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 邀请前检查该student_id是否已存在 --- Script.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Script.php b/Script.php index 7abf942..a44accd 100644 --- a/Script.php +++ b/Script.php @@ -1101,8 +1101,13 @@ if($result>20) - $sql="INSERT INTO `course_group_members_table`( `Course_Group_id`, `Student_ID`, `Status`) - VALUES ($groupid,$student_id,'Invited')"; + $result = mysqli_query($con,"SELECT * FROM course_group_members_table where Course_Group_id = '$groupid' and Student_ID = '$student_id'"); + if(mysqli_num_rows($result)>0){ + header("Location: Course.php?url=".$url); + }else{ + $sql="INSERT INTO `course_group_members_table`( `Course_Group_id`, `Student_ID`, `Status`) + VALUES ($groupid,$student_id,'Invited')"; + } if ($con->query($sql) === TRUE) { $_SESSION["info_ReMarking"]=$student_id . " was invited to the group"; header("Location: Course.php?url=".$url); From 45554cd5b5bd5b62e71e0e39276d5d434acb376b Mon Sep 17 00:00:00 2001 From: fish <280768265@qq.com> Date: Mon, 25 May 2020 13:43:00 +0800 Subject: [PATCH 4/6] Update Script.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了错误的title,添加插入course_groups_table的代码 --- Script.php | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Script.php b/Script.php index a44accd..bb7a571 100644 --- a/Script.php +++ b/Script.php @@ -1087,7 +1087,7 @@ if($result>20) - #Create Group Request + //---------------------------------------Invite Group Request and add a new member into the database------------------------------------ if (!empty($_GET["groupinvite"])) { @@ -1103,12 +1103,50 @@ if($result>20) $result = mysqli_query($con,"SELECT * FROM course_group_members_table where Course_Group_id = '$groupid' and Student_ID = '$student_id'"); if(mysqli_num_rows($result)>0){ + $_SESSION["info_ReMarking"]="This student has already been invited"; header("Location: Course.php?url=".$url); }else{ $sql="INSERT INTO `course_group_members_table`( `Course_Group_id`, `Student_ID`, `Status`) VALUES ($groupid,$student_id,'Invited')"; } + + if ($con->query($sql) === TRUE) { + $resultx1 = mysqli_query($con,"SELECT * FROM course_groups_table where Course_Group_id ='$groupid'"); + + while($row = mysqli_fetch_assoc($resultx1)) + { + $Group_Member=$row['Group_Member']; + $Group_Member4=$row['Group_Member4']; + $Group_Member2=$row['Group_Member2']; + $Group_Member3=$row['Group_Member3']; + $_SESSION['Group_Member4']=$Group_Member4; + $_SESSION['Group_Member3']=$Group_Member3; + $_SESSION['Group_Member2']=$Group_Member2; + $_SESSION['Group_Member']=$Group_Member; + + if($Group_Member=='0'){ + mysqli_query($con,"UPDATE `course_groups_table` SET `Group_Member` = ('" . $student_id . "') WHERE `course_groups_table`.`Course_Group_id` = '$groupid'"); + $_SESSION["info_ReMarking"]=$student_id . " was invited to the group"; + header("Location: Course.php?url=".$url); + }elseif($Group_Member2=='0'){ + mysqli_query($con,"UPDATE `course_groups_table` SET `Group_Member2` = ('" . $student_id . "') WHERE `course_groups_table`.`Course_Group_id` = '$groupid'"); + $_SESSION["info_ReMarking"]=$student_id . " was invited to the group"; + header("Location: Course.php?url=".$url); + }elseif($Group_Member3=='0'){ + mysqli_query($con,"UPDATE `course_groups_table` SET `Group_Member3` = ('" . $student_id . "') WHERE `course_groups_table`.`Course_Group_id` = '$groupid'"); + $_SESSION["info_ReMarking"]=$student_id . " was invited to the group"; + header("Location: Course.php?url=".$url); + }elseif($Group_Member4=='0'){ + mysqli_query($con,"UPDATE `course_groups_table` SET `Group_Member4` = ('" . $student_id . "') WHERE `course_groups_table`.`Course_Group_id` = '$groupid'"); + $_SESSION["info_ReMarking"]=$student_id . " was invited to the group"; + header("Location: Course.php?url=".$url); + } else { + $_SESSION["info_ReMarking"]= " You cant add any more members"; + header("Location: Course.php?url=".$url); + + } + } $_SESSION["info_ReMarking"]=$student_id . " was invited to the group"; header("Location: Course.php?url=".$url); } else { From 1dcbb9bb3f24fe2b5a22c9e175e9b78e2f0c1c52 Mon Sep 17 00:00:00 2001 From: fish <280768265@qq.com> Date: Mon, 25 May 2020 15:31:05 +0800 Subject: [PATCH 5/6] Update Script.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改已添加成员后的提示 --- Script.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Script.php b/Script.php index bb7a571..1127bb7 100644 --- a/Script.php +++ b/Script.php @@ -1103,7 +1103,7 @@ if($result>20) $result = mysqli_query($con,"SELECT * FROM course_group_members_table where Course_Group_id = '$groupid' and Student_ID = '$student_id'"); if(mysqli_num_rows($result)>0){ - $_SESSION["info_ReMarking"]="This student has already been invited"; + $_SESSION["info_ReMarking"]=$student_id . " has already been invited"; header("Location: Course.php?url=".$url); }else{ $sql="INSERT INTO `course_group_members_table`( `Course_Group_id`, `Student_ID`, `Status`) From e504e83038287a610a73920e99f34c87a483dd7a Mon Sep 17 00:00:00 2001 From: fish <280768265@qq.com> Date: Mon, 15 Jun 2020 14:10:37 +0800 Subject: [PATCH 6/6] Update Overview.html --- homepage/Overview.html | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/homepage/Overview.html b/homepage/Overview.html index 2312fb3..7c39cc8 100644 --- a/homepage/Overview.html +++ b/homepage/Overview.html @@ -48,7 +48,7 @@ -