| Current Path : /var/www/cesa.co.za/cesanet/ |
| Current File : /var/www/cesa.co.za/cesanet/inc_functions.php |
<?php
session_start();
include_once($_SERVER['DOCUMENT_ROOT'] . "/php/inc_db.php");
include_once($_SERVER['DOCUMENT_ROOT'] . "/cesanet/inc_shared.php");
include_once($_SERVER['DOCUMENT_ROOT'] . "/php/includes/CceUploadedFileService.php");
function ShowStatus($iPassed) {
if (($iPassed == 1) || ($iPassed == 2)) {
return "Evaluated";
} elseif ($iPassed == 3) {
return "Added to PoE";
} else {
return "Not Yet Evaluated";
}
}
function ShowRuling($sRuling) {
/*
switch ($sRuling) {
case "E": return "Excellent";
case "S": return "Satisfactory";
case "NE": return "Needs Enhancement";
case "R": return "Resubmit";
default: return $sRuling;
}
*/
return $sRuling;
}
function GetUnreadMessages() {
global $conni;
$sql = "SELECT * "
. "FROM CCEPopupMessages "
. "WHERE (MessageText IS NOT NULL) "
. "AND (MessageText <> '') "
. "AND (StartDate IS NULL OR StartDate<='" . date("Y-m-d") . "') "
. "AND (EndDate IS NULL OR EndDate>='" . date("Y-m-d") . "') ";
$sql .= " AND MessageID NOT IN (SELECT MessageID FROM CCEReadPopups WHERE CCEStudentID='" . $_SESSION['StudentID'] . "') "
. "AND Archived = 0 ";
$sql .= " ORDER BY MessageID DESC";
// echo $sql;
$recMsgs = mysqli_query($conni, $sql);
return $recMsgs;
}
function GetReadMessages() {
global $conni;
$sql = "SELECT * FROM CCEPopupMessages WHERE MessageID IN (SELECT MessageID FROM CCEReadPopups WHERE CCEStudentID='" . $_SESSION['StudentID'] . "') AND Archived = 0 ";
$sql .= " ORDER BY MessageID DESC";
$recMsgs = mysqli_query($conni, $sql);
return $recMsgs;
}
function CurrentStudent() {
return (empty($_SESSION["StudentYear"]) || isTestStudent($_SESSION["StudentID"]));
}