| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/assignmentanswers.php |
<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
$id = intval($_REQUEST["id"]);
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "CCEAssignmentsinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
if (!isset($_SESSION[EW_SESSION_STATUS]) || ($_SESSION[EW_SESSION_STATUS] != "login")) {
header("Location: "."http".($_SERVER["HTTPS"]=="on"?"s":"")."://".$_SERVER["HTTP_HOST"]."/cceconvenors/login.php");
die();
}
$conni = mysqli_connect(EW_CONN_HOST, EW_CONN_USER, EW_CONN_PASS, EW_CONN_DB);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
$gsExport="nomenu";
?>
<?php include "header.php" ?>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<div class="container">
<?php
$sql = "SELECT CCEStudentAssigAnswers.*, CCEAssignmentQuestions.*,
CCEStudentAssignments.References,
CCEAssignments.AssignmentName, CCEStudents.FirstName, CCEStudents.Surname
FROM CCEStudentAssigAnswers JOIN CCEAssignmentQuestions USING (CCEAssignmentQID)
JOIN CCEAssignments ON (CCEStudentAssigAnswers.CCEAssignmentID=CCEAssignments.`CCEAssignmentID`)
JOIN CCEStudentAssignments USING (CCEStudentAssigID)
JOIN CCEStudents ON (CCEStudentAssigAnswers.CCEStudentID=CCEStudents.`CCEStudentID`)
WHERE CCEStudentAssigAnswers.CCEStudentAssigID=".$id."
ORDER BY QuestionType, QuestionNum";
//echo $sql;
$rec = mysqli_query($conni,$sql);
if ($row=mysqli_fetch_assoc($rec)) {
?>
<div class="row">
<div class="col-lg-12">
<h1><?php echo htmlspecialchars($row["AssignmentName"]); ?></h1>
<h2><?php echo htmlspecialchars($row["FirstName"]." ".$row["Surname"]); ?></h2>
</div></div>
<?php
$sReferences=$row["References"];
mysqli_data_seek($rec,0);
while ($row=mysqli_fetch_assoc($rec)) {
$QuestionTitle=$row["QuestionNum"].": ".$row["QuestionText"];
?>
<div class="card">
<div class="card-header">
<u><?php if ($row["QuestionType"]=="A") { echo "Assignment"; } else { echo "Activity"; } ?></u><br>
<?php echo $QuestionTitle; ?>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12"><?php echo nl2br($row["CCEStudentAnswer"]); ?></div>
</div>
</div>
</div>
<?php
}
?>
<h2>References</h2>
<?php
echo "<p>".nl2br($sReferences)."</p>";
} else {
?>
<div class="row">
<div class="col-12 d-flex justify-content-center">
No answers found.
</div></div>
<?php
}
?>
</div>
<?php include "footer.php" ?>