<?php
include("sessionLogin.php");
include("connect.php");
$user=$_SESSION['client'];

$id=$_GET['id'];
$query=mysql_query("select * from customer where userID='$user'");
$display=mysql_fetch_array($query);
$no=$display['no'];

$query2=mysql_query("select * from inbox where inboxID='$id' and companyID='$no'");
if(mysql_num_rows($query2)==0){
	echo"<script language=javascript>window.location='indexLogin.php'</script>";
}
$display2=mysql_fetch_array($query2);
$date=$display2['date'];
$time=$display2['time'];
$title=$display2['title'];
$content=$display2['content'];
$sendBy=$display2['sendBy'];
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="messageFrame.css" />
</head>
<body>
<h3>Message Detail</h3>
<table width=580 cellpadding=5>
<tr>
	<td>Received time :</td>
	<td><?php echo $date."&nbsp;&nbsp;&nbsp;".$time;?></td>
	</tr>
<tr>
	<td>Send By :</td>
	<td><?php echo $sendBy;?></td>
	</tr>
<tr>
	<td>Title</td>
	<td><?php echo $title;?></td>
	</tr>
<tr>
	<td valign=top>Content</td>
	<td><textarea rows=14 cols=60 disabled=yes><?php echo $content;?></textarea></td>
	</tr>
<tr>
	<td colspan=2 align=center><input type="button" value="Back" onclick="backFun()"/></td>
	</tr>
</table>
<script type="text/javascript">
function backFun(){
	window.location = "inboxAll.php";
	
}


</script>

</body>
</html>