| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/activitysummary.php |
<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?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: /cceconvenors/login.php");
die();
}
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
?>
<?php include "header.php" ?>
<style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
</style>
<style type="text/css">
<!--
@media print {
.scrolldiv {
width:100%;
}
.ewMenuColumn {
display:none;
}
.ewHeaderRow {
display:none;
}
@page {size: landscape}
}
.table {
padding:0px;
color:black;
text-align:general;
vertical-align:bottom;
border:none;
white-space:nowrap;
}
.cell {
padding:0px;
color:black;
text-align:center;
vertical-align:middle;
border:.5pt solid windowtext;
white-space:normal;
}
.cell a {
color:black;
text-decoration:none;
}
.notevaluated {
background:#92D050;
}
.achieved {
background:#0070C0;
}
.notsubmitted {
background: #feade3;
}
.resubmitted {
background:yellow;
}
.missing {
background:#C5D9F1;
}
.notachieved {
background:red;
color:white;
}
.hardcopy {
background:#FABF8F;
}
.darkcell {
background:#DA9694;
}
.lightcell {
background:#F2DCDB;
}
.whitetext {
color: white;
}
-->
</style>
<h1>Activity Workbook Summary</h1>
<?php
function getInitials($name){
//split name using spaces
$words=explode(" ",$name);
$inits='';
//loop through array extracting initial letters
foreach($words as $word){
$inits.=strtoupper(substr($word,0,1));
}
return $inits;
}
$conn = mysqli_connect(EW_CONN_HOST, EW_CONN_USER, EW_CONN_PASS, EW_CONN_DB);
?>
<table border="0" cellspacing="0" cellpadding="0" width="930">
<tr>
<td class="cell darkcell">NAME<br><br><br><br></td>
<td class="cell lightcell" style="border-left:none;">Surname<br><br><br><br></td>
<td class="cell darkcell" style="border-left:none;">Facl<br><br><br><br></td>
<?php
$arrModules=array();
$sql = "SELECT CCEActivityID, WorkbookName FROM CCEActivities WHERE Archived=0 ORDER BY RefNum";
$recMod = mysqli_query($conn, $sql);
while ($rowMod = mysqli_fetch_assoc($recMod)) {
$cellclass=" hardcopy";
$arrModules[]=$rowMod["CCEActivityID"];
?>
<td class="cell<?php echo $cellclass; ?>" width="150" style="border-left:none;"><?php echo $rowMod["WorkbookName"]; ?> Activities</td>
<?php
}
?>
</tr>
<tr>
<?php
$sql="SELECT CCEStudents.CCEStudentID, CCEStudents.Surname, CCEStudents.FirstName, CCEStudents.KnownAs,
CCEFacilitators.FacilitatorName FROM (CCEStudents INNER JOIN CCEStudentCourses USING (CCEStudentID) inner join CCESetup ON (CCEStudentCourses.CCECourseScheduleID=CCESetup.CurrentScheduleID))
LEFT JOIN CCEFacilitators ON (CCEFacilitatorID=FacilitatorID)
WHERE CCEStudents.Archived=0
ORDER BY " . CCEStudentDisplayOrder::sqlOrderByDisplayName('CCEStudents') . "";
$recStudents=mysqli_query($conn, $sql);
$iLastFacilitator="";
$cellclass=" darkcell";
while ($rowStudents=mysqli_fetch_assoc($recStudents)) {
if ($iLastFacilitator != $rowStudents["FacilitatorName"]) {
$iLastFacilitator = $rowStudents["FacilitatorName"];
if ($cellclass==" darkcell") {
$cellclass=" lightcell";
} else {
$cellclass=" darkcell";
}
}
?>
<td class="cell<?php echo $cellclass; ?>" style="border-top:none;" nowrap><?php echo $rowStudents["KnownAs"]; ?></td>
<td class="cell<?php echo $cellclass; ?>" style="border-top:none;border-left:none; nowrap"><?php echo $rowStudents["Surname"]; ?></td>
<td class="cell<?php echo $cellclass; ?>" style="border-top:none;border-left:none;" nowrap><?php echo getInitials($rowStudents["FacilitatorName"]); ?></td>
<?php
// Activities
foreach ($arrModules as $ModID) {
$NumWB=0;
$sql="SELECT * FROM CCEStudentActivities WHERE CCEStudentID='".$rowStudents["CCEStudentID"]."' AND CCEActivityID=".$ModID." ORDER BY ActivityRef";
$recAssig=mysqli_query($conn, $sql);
while ($rowAssig=mysqli_fetch_assoc($recAssig)) {
$NumWB++;
}
?>
<td class="cell<?php echo $cellclass2; ?>" style="border-top:none;border-left:none;<?php if (empty($NumWB)) echo "background: #feade3;"; ?>"><?php if (!empty($NumWB)) echo "X"; ?></td>
<?php
}
?>
</tr>
<?php
}
?>
</table>
<?php include "footer.php" ?>