Make Course.php look better.

Bug430-Eden2
Lan Hui 2023-08-02 15:09:49 +08:00
parent 7ed74390ce
commit 7f870d8c7a
1 changed files with 20 additions and 85 deletions

View File

@ -53,6 +53,7 @@ if(!empty($_GET["url"]))
}
?>
<div class="row" style='margin-left:20px;float:left'>
<?php
@ -71,7 +72,6 @@ if(!empty($_GET["url"]))
</div>
<?php
if( $_SESSION['user_type'] == "Student")
@ -179,7 +179,6 @@ if( $_SESSION['user_type'] == "Student")
<div id="menu2" class="container tab-pane"><br>
<?php
@ -197,8 +196,6 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
. ""
. "ORDER by Lab_Report_ID DESC");
if(mysqli_num_rows($result)==0)
{
echo "You missed no lab reports in this course.";
@ -216,9 +213,6 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
$att4=$row['Attachment_link_4'];
$id=$row['Lab_Report_ID'];
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
if($att2!=""){
@ -301,7 +295,6 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
<br> <span style='font-size:8pt'>Posted : $posted Deadline : $deadline ($marks Marks) &nbsp; &nbsp; $submittedx&nbsp; <span class='btn-sm btn-success' style='margin-left:50px;'><i class='fa fa-Edit-circle'></i> Submitted </span>
<br> Submitted files: ";
$Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
@ -345,24 +338,15 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
}
}
echo "</span></div></k>";
}}
echo "";
?>
</div>
<?php
$sqli=mysqli_query($con, "SELECT * from course_groups_table WHERE Course_Group_id=$group_id and Course_id=$course_id");
while($row = mysqli_fetch_assoc($sqli))
@ -375,7 +359,6 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
?>
<div id="menu4" class="container tab-pane"><br>
<?php
$resultx = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_reports_table.`Lab_Report_ID`, `Student_id`, "
@ -396,9 +379,6 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
. " lab_reports_table.Lab_Report_ID in (select Lab_Report_ID from lab_report_submissions"
. " where (Status='Marked' or Status='Remarking') and (Student_id=$student_id or Course_Group_id=$group_id) and Course_ID=$course_id) ORDER by Submission_ID DESC");
if(mysqli_num_rows($resultx)==0)
{
echo "You have no marked submissions in this course";
@ -434,8 +414,6 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
echo " <k href='#'> <div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
$title <b> ($marks Marks out of $Originalmarks)</b><br><small> Lecturer Feedback : $notes </small> &nbsp; $remarking <br> Submission files :";
$Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`,
`Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status,
@ -473,17 +451,10 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
}
}
}}
echo "</div></k>";
?>
</div>
</div>
@ -502,8 +473,6 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
?>
<hr>
<?php
@ -531,7 +500,7 @@ course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id W
}
# Add "delete group" button and allow only group creator to delete it
$extra4 = "<button onclick='delete_group($id)' class='btn btn-danger' style='height: 25px; width: 90px;
$extra4 = "<button onclick='deleteGroup($id)' class='btn btn-danger' style='height: 25px; width: 90px;
line-height: 10px; font-size: 10px'>DELETE GROUP</button>";
echo "<div class='btn-default'><small> $name ($status) $extra $extra2 $extra3" .
@ -555,7 +524,7 @@ where course_group_members_table.Course_Group_id=$id");
#Show group members + remove button next to each member except the creator of the group
if($flag){
echo "<li><small> $name-$Student_ID ($status)</small>".(($status != "Created")?"<button onclick='remove_member($Student_ID, $id)'
echo "<li><small> $name-$Student_ID ($status)</small>".(($status != "Created")?"<button onclick='removeMember($Student_ID, $id)'
class='btn btn-danger' style='height: 25px; width: 80px; line-height: 10px;'>remove</button>":"")."</li>";
}else{
echo "<li><small> $name-$Student_ID ($status)</small>";
@ -563,27 +532,14 @@ where course_group_members_table.Course_Group_id=$id");
}
}
}
?>
</div>
</div>
<?php
}
include 'Footer.php';
@ -596,12 +552,8 @@ include 'Footer.php';
<script>
function createGroup() {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="creategroup" value="true">\n\
<input type="hidden" name="student_id" value="<?php echo $student_id; ?>" > Group Name <input type="text" name="name">\n\
<input type="hidden" name="url" value="<?php echo $url; ?>"> <input type="hidden" name="id" value="<?php echo $course_id; ?>"> </form>').dialog({
@ -613,7 +565,7 @@ include 'Footer.php';
$(this).dialog('close');
},
'X': function () {
'Cancel': function () {
$(this).dialog('close');
}
@ -626,14 +578,10 @@ include 'Footer.php';
function invite(id) {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="groupinvite" value="true">\n\
<input type="hidden" name="groupid" value="'+id+'" > Enter Student_ID to Invite <input type="text" name="student_id">\n\
<input type="hidden" name="url" value="<?php echo $url; ?>"> <input type="hidden" name="courseid" value="<?php echo $course_id; ?>"> </form>').dialog({
@ -645,30 +593,22 @@ include 'Footer.php';
$(this).dialog('close');
},
'X': function () {
'Cancel': function () {
$(this).dialog('close');
}
}
});
} catch(e){ alert(e); }
}
function accept(id,val) {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="acceptinvite" value="true">\n\
<input type="hidden" name="groupid" value="'+id+'" > \n\ <input type="hidden" name="action" value="'+val+'" > \n\
\n\
@ -682,14 +622,13 @@ include 'Footer.php';
$(this).dialog('close');
},
'X': function () {
'Cancel': function () {
$(this).dialog('close');
}
}
});
} catch(e){ alert(e); }
}
@ -697,18 +636,17 @@ include 'Footer.php';
function remarking(data)
{
var details = prompt("Please enter your remarking reasons","");
const details = prompt("Please enter your remarking reasons","");
window.location.href = data+"&details="+details;
}
function remove_member(student_id, group_id) {
function removeMember(student_id, group_id) {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="removemember" value="true">\n\
<input type="hidden" name="student_id" value="'+student_id+'" > \n\
<input type="hidden" name="group_id" value="'+group_id+'">\n\
@ -721,23 +659,22 @@ include 'Footer.php';
$(this).dialog('close');
},
'X': function () {
'Cancel': function () {
$(this).dialog('close');
}
}
});
} catch(e){ alert(e); }
}
function delete_group(id) {
function deleteGroup(id) {
try
{
$('<form id="frm" method="get" action="Script.php"><input type="hidden" name="deletegroup" value="true">\n\
<input type="hidden" name="group_id" value="'+id+'" > \n\
<input type="hidden" name="url" value="<?php echo $url; ?>"></form>').dialog({
@ -749,16 +686,14 @@ include 'Footer.php';
$(this).dialog('close');
},
'X': function () {
'Cancel': function () {
$(this).dialog('close');
}
}
});
} catch(e){ alert(e); }
}
</script>