| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/readmessage.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 "CCEMessagesinfo.php" ?>
<?php include "CCEModulesinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
if (!isset($_SESSION[EW_SESSION_STATUS]) || ($_SESSION[EW_SESSION_STATUS] != "login")) {
header("Location: /ccconvenors/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" ?>
<h1>Read Message</h1>
<p><a href="sendmessage.php">Click here to send a message now.</a></p>
<?php
$conni = mysqli_connect(EW_CONN_HOST, EW_CONN_USER, EW_CONN_PASS, EW_CONN_DB);
$sql = "SELECT CCEMessages.* FROM CCEMessages WHERE CCEMessages.CCEMessageID=" . $_GET["CCEMessageID"];
$rec = mysqli_query($conni, $sql);
if ($row = mysqli_fetch_assoc($rec)) {
?>
<table border="0">
<tr>
<td valign="top"><b>From:</b></td>
<td valign="top"><?php echo $row["SentByName"]; ?></td>
</tr>
<tr>
<td valign="top"><b>To:</b></td>
<td valign="top"><?php echo $row["SentTo"]; ?></td>
</tr>
<tr>
<td valign="top"><b>Subject:</b></td>
<td valign="top"><?php echo $row["MessageSubject"]; ?></td>
</tr>
<tr>
<td valign="top"><b>Message:</b></td>
<td valign="top"><?php echo formatCceMessageForDisplay($row["MessageText"]); ?></td>
</tr>
<tr>
<td valign="top"><b>Attachment:</b></td>
<td valign="top"><?php if (!empty($row["MessageFile"])) echo "<a href='/cceadmin/msgattach/" . $row["MessageFile"] . "' target='_blank'>" . $row["MessageFile"] . "</a>"; ?></td>
</tr>
<tr>
<td colspan="2" align="center">
<b><a href="sendmessage.php?replyto=<?php echo $row["CCEMessageID"]; ?>&all=1">Reply to All</a>
<a href="sendmessage.php?replyto=<?php echo $row["CCEMessageID"]; ?>">Reply</a> <a href="sendmessage.php?fwd=<?php echo $row["CCEMessageID"]; ?>">Forward</a></b>
</td>
</tr>
</table>
<?php
}
$sql = "INSERT INTO CCEMessageLog (CCEMessageID, ReadByType, ReadByID, ReadDateTime) SELECT " . $_GET["CCEMessageID"] . ", 'Facilitator', FacilitatorID, '" . date("Y-m-d H:i:s") . "' FROM CCEFacilitatorUsers WHERE Username='" . $_SESSION[EW_SESSION_USER_NAME] . "'";
// echo $sql;
mysqli_query($conni, $sql);
?>
<p></p>
<?php include "footer.php" ?>