| Current Path : /var/www/cesa.co.za/ccmadmin/ |
| Current File : /var/www/cesa.co.za/ccmadmin/assigsummary.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
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">
<!--
.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> Assignment Submissions 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 = mysql_connect(EW_CONN_HOST, EW_CONN_USER, EW_CONN_PASS);
mysql_select_db(EW_CONN_DB);
?>
<table border="0" cellspacing="0" cellpadding="0" width="930">
<tr><td width="410" valign="top">
<table cellspacing="0" cellpadding="2" class="table" width="410">
<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;">Conv<br><br><br><br></td>
</tr>
<?php
$sql="SELECT CCEStudents.CCEStudentID, CCEStudents.Surname, CCEStudents.FirstName, CCEStudents.KnownAs, CCEFacilitators.FacilitatorName FROM CCEStudents LEFT JOIN CCEFacilitators ON (CCEFacilitatorID=FacilitatorID) WHERE CCEStudents.Archived=0 ORDER BY CCEStudents.CCEFacilitatorID, CCEStudents.Surname, CCEStudents.FirstName";
$recStudents=mysql_query($sql);
$iLastFacilitator="";
$cellclass=" darkcell";
while ($rowStudents=mysql_fetch_assoc($recStudents)) {
if ($iLastFacilitator != $rowStudents["FacilitatorName"]) {
$iLastFacilitator = $rowStudents["FacilitatorName"];
if ($cellclass==" darkcell") {
$cellclass=" lightcell";
} else {
$cellclass=" darkcell";
}
}
?>
<tr>
<td class="cell<?php echo $cellclass; ?>" width="200" style="border-top:none;" nowrap><a href='assigextensions.php?CCEStudentID=<?php echo $rowStudents["CCEStudentID"]; ?>'><?php echo $rowStudents["KnownAs"]; ?></a></td>
<td class="cell<?php echo $cellclass; ?>" width="170" style="border-top:none;border-left:none; nowrap"><a href='assigextensions.php?CCEStudentID=<?php echo $rowStudents["CCEStudentID"]; ?>'><?php echo $rowStudents["Surname"]; ?></a></td>
<td class="cell<?php echo $cellclass; ?>" width="40" style="border-top:none;border-left:none;" nowrap><?php echo getInitials($rowStudents["FacilitatorName"]); ?></td>
</tr>
<?php
}
?>
</table>
</td><td width="520" valign="top">
<div style="width:520px; overflow:scroll">
<table cellspacing="0" cellpadding="2" class="table" width="520">
<tr>
<?php
$sql = "SELECT CCEAssignments.* FROM CCEAssignments
WHERE Archived=0 AND ReleaseDate <= '".date("Y-m-d")."'
ORDER BY RefNum";
$rec = mysql_query($sql);
while ($row = mysql_fetch_assoc($rec)) {
$cellclass="";
if ($row["AssigType"]==0) { $cellclass=" lightcell"; } else { $cellclass=" hardcopy"; }
?>
<td class="cell<?php echo $cellclass; ?>" width="41" style="border-left:none;width:25pt;"><?php echo $row["RefNum"]; ?><br>
<?php echo $row["DueDate"]; ?></td>
<?php
}
?>
<td class="cell darkcell"> <br><br><br><br></td>
</tr>
<?php
mysql_data_seek($recStudents,0);
$iLastFacilitator="";
$cellclass=" darkcell";
while ($rowStudents=mysql_fetch_assoc($recStudents)) {
if ($iLastFacilitator != $rowStudents["FacilitatorName"]) {
$iLastFacilitator = $rowStudents["FacilitatorName"];
if ($cellclass==" darkcell") {
$cellclass=" lightcell";
} else {
$cellclass=" darkcell";
}
}
?>
<tr>
<?php
mysql_data_seek($rec,0);
while ($row = mysql_fetch_assoc($rec)) {
// Achieved assignments that need enhancement must say "E" instead of "Y"
// Enhancements and resubmissions - add an E or an R as required
$sql = "SELECT * FROM CCEStudentAssignments WHERE CCEStudentID='".$rowStudents["CCEStudentID"]."' AND CCEAssignmentID=".$row["CCEAssignmentID"]." ORDER BY CCEStudentAssigID DESC";
$recAssig=mysql_query($sql);
$cellclass2=" notsubmitted";
$cellvalue="N";
if ($rowAssig=mysql_fetch_assoc($recAssig)) {
$iStatus=$rowAssig["Passed"];
$cellvalue="Y";
// if ($iStatus==0) $cellvalue="Y";
// if ($iStatus==1) $cellvalue="Y";
// if ($iStatus==2) $cellvalue="N";
if ((mysql_num_rows($recAssig)>1) && ($iStatus!=1)) {
if ($rowAssig=mysql_fetch_assoc($recAssig)) {
if (($rowAssig["RulingCode"]=="NE") || ($rowAssig["RulingCode"]=="U") || ($rowAssig["RulingCode"]=="R")) {
$cellclass2=" resubmitted";
if ($rowAssig["RulingCode"]=="NE") $cellvalue.="E";
if (($rowAssig["RulingCode"]=="U") || ($rowAssig["RulingCode"]=="R")) $cellvalue.="R";
}
}
} else {
if ($iStatus==0) {
$cellclass2=" notevaluated";
} elseif ($iStatus==1) {
$cellclass2=" achieved";
// Needs enhancement?
if ($rowAssig["RulingCode"]=="NE") {
$cellvalue="E";
$cellclass2=" achieved whitetext";
}
} elseif ($iStatus==2) {
$cellclass2=" notachieved";
$cellvalue="R";
}
}
} else {
$sql="SELECT * FROM CCEStAssigExtensions WHERE CCEStudentID='".$rowStudents["CCEStudentID"]."' AND CCEAssignmentID=".$row["CCEAssignmentID"];
$recAssig=mysql_query($sql);
if ($rowAssig=mysql_fetch_assoc($recAssig)) {
if ($rowAssig["CCEExtensionDate"] >= date("Y-m-d")) $cellvalue.="*";
}
}
mysql_free_result($recAssig);
?>
<td class="cell<?php echo $cellclass2; ?>" width="41" style="border-top:none;border-left:none;width:25pt;"><?php echo $cellvalue; ?></td>
<?php
}
?>
<td></td>
</tr>
<?php
}
?>
</table>
</div>
</td></tr></table>
<br>
<table cellspacing="0" cellpadding="0">
<tr><td>
<table cellspacing="0" cellpadding="0">
<tr>
<td width="63" class="notevaluated"> </td>
<td width="300">Submitted / Not Yet Evaluated</td>
</tr>
<tr>
<td width="63" class="achieved"> </td>
<td width="300">Achieved</td>
</tr>
<tr>
<td width="63" class="notsubmitted"> </td>
<td width="300">Not yet Submitted</td>
</tr>
<tr>
<td width="63" class="resubmitted"> </td>
<td width="300">Re-Submitted Enhancement</td>
</tr>
<tr>
<td width="63" class="notachieved"> </td>
<td width="300">Not Yet Achieved</td>
</tr>
<tr>
<td width="63" class="hardcopy"> </td>
<td width="300">Hard copy based activity</td>
</tr>
</table>
</td>
<td> </td>
<td>
<table cellspacing="0" cellpadding="0">
<tr>
<td width="63" align="center" class="achieved whitetext">E</td>
<td width="300">Achieved but needs enhancement</td>
</tr>
<tr>
<td width="63" align="center" class="resubmitted">YE</td>
<td width="300">Enhancement received</td>
</tr>
<tr>
<td width="63" align="center" class="resubmitted">YR</td>
<td width="300">Resubmission received</td>
</tr>
<tr>
<td width="63" align="center" class="notsubmitted">N*</td>
<td width="300">Extension granted</td>
</tr>
<tr><td colspan="2">Click on the student's name to access extensions</td></tr>
</table>
</td></tr></table>
<?php include "footer.php" ?>