<?php
if (isset($_GET['m']) && !empty($_GET['m']) && is_numeric($_GET['m']))
{
if (file_exists("functions/site_functions.php"))
	{
	include_once("functions/site_functions.php");
	}
else
	{
include_once("../../functions/site_functions.php");
	}

$m=$_GET['m'];
db_open();
$sql="SELECT * FROM messages WHERE message_id='$m'";
@ $result=mysql_query($sql);
if ($result!=0)
	{
	$row=mysql_fetch_array($result);
	$user_id=$row['user_id'];
	$device_id=$row['device_id'];
	$sql1="SELECT email FROM users WHERE user_id='$user_id'";
	$row1=mysql_fetch_array(mysql_query($sql1));
	$email=$row1['email'];
	$subject=$row['subject'];
	$date=$row['dater'];
	$message= $row['message'];
	$sql2="UPDATE messages SET r='1' WHERE message_id='$m'";
	@ $result2=mysql_query($sql2);
	$delete= '<a class="delete" title="delete message" onclick="delete_yn('.$m.','.$m.');" ><span>Delete</span></a>';
	}
db_close();
echo<<<a
<div id="marginn">
<table id="p_i" class="messages">
<tr>
<td class="td_title_troubleshoot_aa">-</td>
<td class="td_title_troubleshoot_small">Email</td>
<td class="td_title_troubleshoot_small">Date</td>
<td class="td_title_troubleshoot_big">Subject</td>
</tr>
<tr class="tr_troubleshoot_hover">
<td class="td_data_troubleshoots">$delete</td>
<td class="td_data_troubleshoots"><a href="mailto:$email" title="Reply here!">$email</a></td>
<td class="td_data_troubleshoots center">$date</td>
<td class="td_data_troubleshoots center">$subject</td>
</tr>
</table>
<div id="message">
$message
</div>
a;
}
?>