<?php
# include "include/cookiesupport.inc.php";
include "include/checkcookie.inc.php";
$mymsgsStrings = "true";
$_GET['sendmsg'] =
(isset($_GET['sendmsg'])) ?
$_GET['sendmsg'] :
"";
$_GET['uid'] =
(isset($_GET['uid'])) ?
$_GET['uid'] :
"";
$_GET['reply_msg'] =
(isset($_GET['reply_msg'])) ?
$_GET['reply_msg'] :
"";
$_GET['read_msg'] =
(isset($_GET['read_msg'])) ?
$_GET['read_msg'] :
"";
if ((isset($_POST['sendmsg']) &&
$_POST['sendmsg'] ==
"true" ) ||
(isset($_GET['sendmsg']) &&
$_GET['sendmsg'] ==
"true" ) ||
(isset($_GET['reply_msg']) &&
$_GET['reply_msg'] ==
"true" )) {
$dontDrawLeft = "true";
$hideMenu = "true";
}
$page = "view_bug";
$incEditor = "truly";
if (!
isset($link)) { include "include/constants.inc.php";
} $indexStrings = "true";
$BUGSuser = loginCheck();
$BUGSuser['isLoggedin'];
include "header.htm";
?>
<!-- Contents begin -->
<?
if ($BUGSuser['isLoggedin'] != "truly" ):
print "<br><b>" ,
$s022p007,
"</b>";
print "<BR><BR><BR><BR>";
include "include/footer.inc.php";
endif;
if (isset($_POST['sendmsg']) &&
$_POST['sendmsg'] ==
"true" ) {
$the_message = $_POST['message'];
$title = $_POST['title'];
{
$msg_to = $_POST['msg_to'];
}
else
{
$sql = "select id from userstable where uname='" . $_POST['msg_to'] . "' limit 1";
$res = bugs_mysql_query($sql, $link);
{
$msg_to = $row['id'];
}
else
{
$msg_to = 0;
}
}
if ($title != "" )
{
$msg_from = $_SESSION['login_uid'];
if ($msg_to != 0)
{
$sql = "insert into pmtable values ('','$now','$msg_to','$msg_from','$title','$the_message','0')";
$res = bugs_mysql_query($sql, $link);
print "<br><b>" ,
$s029p001,
"</b><br><br>" ,
$s029p002;
sendEmailNotification($msg_to, "message" );
}
else
{
print "<br><b>" ,
$s029p003a,
"</b><br>" ,
$s029p004,
"</b><br><br><br><br><br>";
}
}
else
{
print "<br><b>" ,
$s029p003b,
"</b><br>" ,
$s029p004,
"</b><br><br><br><br><br>";
}
}
else
{
if ((!
isset($_POST['sendmsg']) ||
$_POST['sendmsg'] ==
"" ) &&
(!
isset($_GET['sendmsg']) ||
$_GET['sendmsg'] ==
"" ) &&
(!
isset($_GET['reply_msg']) ||
$_GET['reply_msg'] ==
"" )) {
?>
<div class="mainhead">
<?php
print $s029p005; ?>
</div>
<div class="mainbox"><br>
<table class="midshade" border="0" cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed; padding: 5px;">
<tr>
<td style="width: 20px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/edit.png"></td>
<td style=
"font-weight: none; width: 150px;"><a href=
"javascript:void(0);" onclick=
"javascript:showHelp('mymsgs.php?sendmsg=true')"><?php
print $s029p006; ?></a></td>
<td style="width: auto;"> </td>
<td style="width: 20px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/reload.png"></td>
<td style=
"font-weight: none; width: 80px;"><a href=
"mymsgs.php"><?php
print $s029p007; ?></a></td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; table-layout: auto;">
<tr><td style="width: 350px;" valign="top"><div style="width: 350px; height: 400px; overflow: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<?php
{
$sql = "select message, msg_to from pmtable where id='" . $_GET['read_msg'] ."' and msg_to='" . $_SESSION['login_uid'] . "'";
$res = bugs_mysql_query($sql, $link);
$pm_msg = $row['message'];
if ($row['msg_to'] == $_SESSION['login_uid'])
{
$sql = "update pmtable set msg_read='1' where id='" . $_GET['read_msg'] . "' limit 1";
$res = bugs_mysql_query($sql, $link);
}
}
{
$sql = "select msg_to from pmtable where id='" . $_GET['msg_id'] ."' and msg_to='" . $_SESSION['login_uid'] . "'";
$res = bugs_mysql_query($sql, $link);
if ($row['msg_to'] == $_SESSION['login_uid'])
{
$sql = "update pmtable set msg_read='0' where id='" . $_GET['msg_id'] . "' limit 1";
$res = bugs_mysql_query($sql, $link);
}
}
{
$sql = "select msg_to from pmtable where id='" . $_GET['msg_id'] ."' and msg_to='" . $_SESSION['login_uid'] . "'";
$res = bugs_mysql_query($sql, $link);
if ($row['msg_to'] == $_SESSION['login_uid'])
{
$sql = "delete from pmtable where id='" . $_GET['msg_id'] . "' limit 1";
$res = bugs_mysql_query($sql, $link);
}
}
$sql = "select pmtable.*, userstable.uname from pmtable LEFT JOIN userstable ON pmtable.msg_from=userstable.id where msg_to='" . $_SESSION['login_uid'] . "' order by msg_read asc, id desc";
$res = bugs_mysql_query($sql, $link);
$msg_cc = 0;
{
if (strlen($row['title']) >=
40) {
$row['title'] =
substr($row['title'],
0,
40) .
"...";
}
?>
<tr>
<td <?php
{
if ($row['id'] == $_GET['read_msg'])
{
print "class=\"midshade\" ";
}
}
?>style="border: 0px; width: 20px; padding: 8px 2px 0px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/<?php
if ($row['msg_read'] == 0)
{
print "mail_generic";
}
else
{
print "mail_read";
}
?>.png"></td>
<td <?php
{
if ($row['id'] == $_GET['read_msg'])
{
print "class=\"midshade\" ";
}
}
?>style="border: 0px; padding: 8px 2px 0px; font-weight: none;"><?php
if ($row['msg_read'] == 0)
{
print "<a href=\"mymsgs.php?read_msg=" .
$row['id'] .
"\"><b>" .
htmlspecialchars($row['title']) .
"</b></a>";
}
else
{
}
?></td>
</tr>
<tr>
<td colspan="2" <?php
{
if ($row['id'] == $_GET['read_msg'])
{
print "class=\"midshadelight\" ";
}
else
{
print "class=\"lightshadelight\" ";
}
}
else
{
print "class=\"lightshadelight\" ";
}
?>style=
"border: 0px; width: auto; font-size: 10px;"><b><?php
print $s029p009a .
"</b>" .
$row['uname'] .
$s029p009b .
"<b>" .
$s029p009c; ?></b><?php
print bugDateForm
($row['sent'],
"long" );
?></td>
</tr>
<?php
$msg_cc++;
}
if ($msg_cc == 0)
{
?>
<tr>
<td style=
"padding: 4px;"><?php
print $s029p010; ?></td>
</tr>
<?php
}
?>
</table></div></td>
<td valign="top" style="padding: 3px;"><div class="leftbox" style="width: auto; height: 350px; overflow: auto;"><?php
if ($_GET['read_msg'] == "" )
{
if ($msg_cc >= 1)
{
}
}
else
{
}
?></div><?php
if (isset($_GET['read_msg'])) {
?>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td style="width: 20px; padding: 2px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/edit.png"></td>
<td style=
"padding: 1px; font-weight: none; width: 60px;"><a href=
"javascript:void(0);" width=
16 height=
16 onclick=
"javascript:showHelp('mymsgs.php?reply_msg=true&msg_id=<?php print $_GET['read_msg']; ?>')"><?php
print $s029p012; ?></a></td>
<td style="width: 20px; padding: 2px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/editdelete.png"></td>
<td style=
"padding: 1px; font-weight: none; width: 60px;"><a href=
"javascript:void(0);" onclick=
"showHide('delete_box');"><?php
print $s029p013; ?></a><br>
<div class="leftbox" style="background-color: #FFF; position: absolute; width: 170px; display: none;" id="delete_box">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td style=
"padding: 3px; width: 20px;"><img height=
16 width=
16 border=
"0" valign=
"middle" title=
"[?]" src=
"themes/<?php print $theme; ?>/16x16/actions/info.png"></td><td style=
"padding: 3px;"><?php
print $s029p014; ?><br><a href=
"mymsgs.php?delete_msg=true&msg_id=<?php print $_GET['read_msg']; ?>" onclick=
"showHide('delete_box')"><?php
?></a><b> | </b><a href="javascript:void(0);" onclick="showHide('delete_box');"><?php
?></a></td></tr>
</table>
</div>
</td>
<td style="width: 20px; padding: 2px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/edit.png"></td>
<td style=
"padding: 1px; font-weight: none; width: 60px;"><a href=
"mymsgs.php"><?php
print $s029p015; ?></a></td>
<td style="width: 20px; padding: 2px;"><img height=16 width=16 border="0" valign="middle" src="themes/<?php print $theme; ?>/16x16/actions/mail_generic.png"></td>
<td style=
"padding: 2px; font-weight: none;"><a href=
"mymsgs.php?unread_msg=true&msg_id=<?php print $_GET['read_msg']; ?>"><?php
print $s029p016; ?></a></td>
</tr>
</table>
<?php
}
?>
</td>
</table>
</div>
</div>
<?php
}
else
{
?>
<div class="mainhead" style="width: auto; margin-right: 10px;"><?php
if ($_GET['sendmsg'] == "true" )
{
if ($_GET['uid'] != "" )
{
$sql = "select uname from userstable where id='" . $_GET['uid'] . "'";
$res = bugs_mysql_query($sql, $link);
}
}
elseif ($_GET['reply_msg'] == "true" )
{
$sql = "select pmtable.msg_from, pmtable.title, userstable.uname from pmtable LEFT JOIN userstable ON pmtable.msg_from=userstable.id where pmtable.id='" . $_GET['msg_id'] . "'";
$res = bugs_mysql_query($sql, $link);
}
?></div>
<div class="mainbox" style="width: auto; margin-right: 10px; padding: 10px;">
<form name="theForm" id="theForm" action="mymsgs.php" method="POST">
<input type="hidden" name="sendmsg" value="true">
<table border="0" cellpadding="0" cellspacing="0" style="width: auto; height: auto; table-layout: fixed;">
<tr>
<td style=
"width: 100px; padding: 5px;"><b><?php
print $s029p019; ?></b></td>
<td style="padding: 2px;"><?php
if ($_GET['sendmsg'] == "true" )
{
if ($_GET['uid'] != "" )
{
print "<input type=\"hidden\" name=\"msg_to\" value=\"" .
$row['uname'] .
"\">";
}
else
{
print "<input type=\"text\" style=\"width: 150px;\" name=\"msg_to\">";
}
}
else
{
print "<input type=\"hidden\" name=\"msg_to\" value=\"" .
$row['msg_from'] .
"\">";
}
?></td>
</tr>
<tr>
<td style=
"width: 100px; padding: 5px;"><b><?php
print $s029p020; ?></b></td>
<td style="padding: 2px;"><input type="text" style="width: 420px;" name="title"<?php
if ($_GET['reply_msg'] == "true" )
{
print " value=\"RE: " .
$row['title'] .
"\"";
}
?>></td>
</tr>
<tr>
<td style=
"width: 100px; padding: 5px;" valign=
"top"><b><?php
print $s029p021; ?></b></td>
<td style="padding: 2px;">
<textarea name="message" id="comm_comment" style="width: 420px; height: 250px;" rows="7" onfocus='storeCaret(this);' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea></td>
</tr>
<tr>
<td> </td>
<td style="text-align: left;">
<?php
insertBBimgs("comm_comment" );
?>
</tr>
<tr><td colspan="2" style="padding: 5px;" align="right" valign="middle"><?php
print "<input type=\"submit\" value=\"" ,
$s029p022,
"\" style=\"font-weight: bold;\" onclick='bbstyle(-1)'>";
?></td></tr>
</table>
</form>
</div>
<?php
}
}
include "include/footer.inc.php";
?>