| Current Path : /home2/wtmwscom/www/member/ |
| Current File : /home2/wtmwscom/www/member/full_message.php |
<?php
$title= "Full Message";
include 'header.php';
include_once('lib/ps_pagination.php');
$uid = $_SESSION['userid'];
if(!isset($_GET['id'])){
redirect('./inbox.php');
die();
}
$id = $_GET['id'];
$row = mysqli_fetch_object(mysqli_query($connection, "SELECT * FROM `message` WHERE `id`='$id' AND `to`='$uid' ORDER BY `datetime` DESC"));
if(!$row){
redirect('./inbox.php');
die();
}
else{
mysqli_query($connection, "UPDATE `message` SET `read`=1 WHERE `id`='".$id."'");
$name = mysqli_fetch_object(mysqli_query($connection, "SELECT login_id, name FROM user WHERE uid='".$row->by."'"));
}
?>
<h1>Full Message</h1>
<section>
<table style="width: 60%;">
<tbody>
<tr class="light">
<td>Sender</td>
<td><?php if($row->by=='admin'){echo 'Admin';}else{echo $name." (".$name->login_id.")";}?></td>
</tr>
<tr class="dark">
<td>Date</td>
<td><?php echo date("d M, Y h:i A", strtotime($row->datetime));?></td>
</tr>
<tr class="light">
<td>Subject</td>
<td><?php echo $row->subject;?></td>
</tr>
<tr class="dark">
<td>Message</td>
<td><?php echo $row->message;?></td>
</tr>
<tr class="light">
<td>Attach File</td>
<td>
<?php if(file_exists("../member/uploads/attachment/".$row->filename) && $row->filename!=''){?>
<img src="../member/uploads/attachment/<?php echo $row->filename;?>" />
<?php }?>
</td>
</tr>
</tbody>
</table>
</section>
<?php include 'footer.php';?>