forked from mrlan/LRR
SubmitLab.php: indent code
parent
6083fa3a6c
commit
4b278fbcd1
188
SubmitLab.php
188
SubmitLab.php
|
@ -3,133 +3,123 @@ include 'NoDirectPhpAcess.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$page='Submit LAB+';
|
$page = 'Submit LAB+';
|
||||||
include 'Header.php';
|
include 'Header.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class='row' style='width:80%;margin:auto;'>
|
<div class='row' style='width:80%;margin:auto;'>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
<?php
|
$c_date = date("Y-m-d H:i");
|
||||||
|
$student_id = $_SESSION["user_student_id"];
|
||||||
|
|
||||||
$c_date = date("Y-m-d H:i");
|
if (!empty($_GET["id"])) {
|
||||||
$student_id = $_SESSION["user_student_id"];
|
$id = $_GET["id"];
|
||||||
|
$url = $_GET["url"];
|
||||||
if(!empty($_GET["id"]))
|
|
||||||
{
|
$result1 = mysqli_query($con, " SELECT `Type`, `Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` FROM `lab_reports_table` WHERE Lab_Report_ID=$id and Deadline > '$c_date' ORDER by Lab_Report_ID DESC");
|
||||||
$id = $_GET["id"];
|
if (mysqli_num_rows($result1) == 0) {
|
||||||
$url = $_GET["url"];
|
echo "No active assignments for this course so far.";
|
||||||
|
} else {
|
||||||
$result1 = mysqli_query($con," SELECT `Type`, `Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` FROM `lab_reports_table` WHERE Lab_Report_ID=$id and Deadline > '$c_date' ORDER by Lab_Report_ID DESC");
|
|
||||||
if(mysqli_num_rows($result1) == 0)
|
while ($row = mysqli_fetch_assoc($result1)) {
|
||||||
{
|
|
||||||
echo "No active assignments for this course so far.";
|
$Course_ID = $row['Course_ID'];
|
||||||
|
$title = $row['Title'];
|
||||||
} else {
|
$ins = $row['Instructions'];
|
||||||
|
$posted = $row['Posted_Date'];
|
||||||
while($row = mysqli_fetch_assoc($result1)) {
|
$deadline = $row['Deadline'];
|
||||||
|
$att1 = $row['Attachment_link_1'];
|
||||||
$Course_ID = $row['Course_ID'];
|
$att2 = $row['Attachment_link_2'];
|
||||||
$title = $row['Title'];
|
$att3 = $row['Attachment_link_3'];
|
||||||
$ins = $row['Instructions'];
|
$att4 = $row['Attachment_link_4'];
|
||||||
$posted = $row['Posted_Date'];
|
$labid = $row['Lab_Report_ID'];
|
||||||
$deadline = $row['Deadline'];
|
$type = $row['Type'];
|
||||||
$att1 = $row['Attachment_link_1'];
|
|
||||||
$att2 = $row['Attachment_link_2'];
|
//----------------------------------Giving both the Group Admin and Group Members same priviledges to submit assignment--------------------------------------
|
||||||
$att3 = $row['Attachment_link_3'];
|
if ($type == "Group") {
|
||||||
$att4 = $row['Attachment_link_4'];
|
$resultx1 = mysqli_query($con, "SELECT Course_Group_id FROM `course_groups_table` WHERE (Course_id=$Course_ID) and ((Group_Member=$student_id ) or (Group_Member2=$student_id ) or (Group_Member3=$student_id ) or (Group_Member4=$student_id ) or (Group_Leader=$student_id))");
|
||||||
$labid = $row['Lab_Report_ID'];
|
while ($row = mysqli_fetch_assoc($resultx1)) {
|
||||||
$type = $row['Type'];
|
$_SESSION["Group_ID"] = $row['Course_Group_id'];
|
||||||
|
}
|
||||||
//----------------------------------Giving both the Group Admin and Group Members same priviledges to submit assignment--------------------------------------
|
|
||||||
if($type=="Group"){
|
if ($_SESSION["Group_ID"] < 1) {
|
||||||
$resultx1 = mysqli_query($con,"SELECT Course_Group_id FROM `course_groups_table` WHERE (Course_id=$Course_ID) and ((Group_Member=$student_id ) or (Group_Member2=$student_id ) or (Group_Member3=$student_id ) or (Group_Member4=$student_id ) or (Group_Leader=$student_id))");
|
echo " <center><h3> This Lab report can only be submitted by Group Admin </h3> </center> ";
|
||||||
while($row = mysqli_fetch_assoc($resultx1)) {
|
return;
|
||||||
$_SESSION["Group_ID"] = $row['Course_Group_id'];
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if($_SESSION["Group_ID"] < 1)
|
|
||||||
{
|
|
||||||
echo" <center><h3> This Lab report can only be submitted by Group Admin </h3> </center> ";
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
$full_link = "<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
|
||||||
|
|
||||||
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";
|
if ($att2 != "") {
|
||||||
|
$full_link = $full_link . "| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
|
||||||
if($att2!=""){
|
}
|
||||||
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att2'>$att2</a>";
|
if ($att3 != "") {
|
||||||
}
|
$full_link = $full_link . "| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
|
||||||
if($att3!=""){
|
}
|
||||||
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att3'>$att3</a>";
|
|
||||||
}
|
if ($att4 != "") {
|
||||||
|
$full_link = $full_link . "| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
|
||||||
if($att4!=""){
|
}
|
||||||
$full_link = $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
|
|
||||||
}
|
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
|
||||||
|
|
||||||
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
|
|
||||||
Courses > $url > Submlit Lab Report > $title
|
Courses > $url > Submlit Lab Report > $title
|
||||||
<br>
|
<br>
|
||||||
</a></div>
|
</a></div>
|
||||||
";
|
";
|
||||||
|
|
||||||
echo "";
|
echo "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$Group_ID = $_SESSION["Group_ID"];
|
$Group_ID = $_SESSION["Group_ID"];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div style="width:80%;margin:auto;">
|
<div style="width:80%;margin:auto;">
|
||||||
|
|
||||||
<h3> Submit Lab Report Assignment </h3>
|
<h3> Submit Lab Report Assignment </h3>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-6">
|
|
||||||
|
|
||||||
|
|
||||||
<form method='post' enctype='multipart/form-data' action='Script.php'>
|
<div class="col-md-6">
|
||||||
<input type='hidden' name='frm_submitlab' value='true' required=''/>
|
|
||||||
<input type='hidden' name='lab_id' value='<?php echo $id; ?>' required=''/>
|
|
||||||
<input type='hidden' name='student_id' value='<?php echo $student_id; ?>' required=''/>
|
|
||||||
<input type='hidden' name='group_id' value='<?php echo $Group_ID; ?>' required=''/>
|
|
||||||
<input type='hidden' name='url' value='<?php echo $url; ?>' required=''/>
|
|
||||||
|
|
||||||
Title
|
|
||||||
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
|
|
||||||
|
|
||||||
Attachment 1
|
<form method='post' enctype='multipart/form-data' action='Script.php'>
|
||||||
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' required=''>
|
<input type='hidden' name='frm_submitlab' value='true' required='' />
|
||||||
|
<input type='hidden' name='lab_id' value='<?php echo $id; ?>' required='' />
|
||||||
|
<input type='hidden' name='student_id' value='<?php echo $student_id; ?>' required='' />
|
||||||
|
<input type='hidden' name='group_id' value='<?php echo $Group_ID; ?>' required='' />
|
||||||
|
<input type='hidden' name='url' value='<?php echo $url; ?>' required='' />
|
||||||
|
|
||||||
Attachment 2
|
Title
|
||||||
<input type='file' name='attachment2' placeholder='Attachment 2' class='form-control'>
|
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
|
||||||
|
|
||||||
</div>
|
Attachment 1
|
||||||
|
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' required=''>
|
||||||
|
|
||||||
<div class="col-md-6">
|
Attachment 2
|
||||||
|
<input type='file' name='attachment2' placeholder='Attachment 2' class='form-control'>
|
||||||
|
|
||||||
Attachment 3
|
</div>
|
||||||
<input type='file' name='attachment3' placeholder='Attachment 3' class='form-control' >
|
|
||||||
|
|
||||||
Attachment 4
|
<div class="col-md-6">
|
||||||
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<input type='submit' class='btn btn-primary' value='Submit Lab Assignment'><br>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
Attachment 3
|
||||||
|
<input type='file' name='attachment3' placeholder='Attachment 3' class='form-control'>
|
||||||
</div>
|
|
||||||
|
Attachment 4
|
||||||
|
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control'>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<input type='submit' class='btn btn-primary' value='Submit Lab Assignment'><br>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
Loading…
Reference in New Issue