view_message.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php // $Id: view_message.php 9584 2006-10-19 13:07:05Z evie_em $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) Facultad de Matematicas, UADY (México)
  6. Copyright (c) Evie, Free University of Brussels (Belgium)
  7. For a full list of contributors, see "credits.txt".
  8. The full license can be read in "license.txt".
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License
  11. as published by the Free Software Foundation; either version 2
  12. of the License, or (at your option) any later version.
  13. See the GNU General Public License for more details.
  14. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  15. Mail: info@dokeos.com
  16. ==============================================================================
  17. */
  18. /*
  19. ==============================================================================
  20. INIT SECTION
  21. =========================================================================5====
  22. */
  23. $langFile= "messages";
  24. include('../../main/inc/global.inc.php');
  25. api_block_anonymous_users();
  26. include('./functions.inc.php');
  27. $nameTools = get_lang("Messages");
  28. $interbredcrump[]=array("url" => "inbox.php","name" => get_lang("Inbox"));
  29. Display::display_header($nameTools,"messages");
  30. $query = "UPDATE `".MESSAGES_DATABASE."` SET `status` = '0' WHERE `id_reciv`=".$_SESSION['_uid']." AND `id`='".mysql_real_escape_string($_GET['id'])."';";
  31. $result = api_sql_query($query,__FILE__,__LINE__);
  32. $query = "SELECT * FROM `".MESSAGES_DATABASE."` WHERE id_reciv=".$_SESSION['_uid']." AND id='".mysql_real_escape_string($_GET['id'])."';";
  33. $result = api_sql_query($query,__FILE__,__LINE__);
  34. $row = mysql_fetch_array($result);
  35. echo '
  36. <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#dbeaf5 border=0>
  37. <TBODY>
  38. <TR>
  39. <TD width=10>&nbsp; </TD>
  40. <TD vAlign=top width="100%">
  41. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  42. <TBODY>
  43. <TR>
  44. <TD class=HT vAlign=top width="100%">
  45. <TABLE class=TH>
  46. <TBODY>
  47. <TR>
  48. <TD noWrap>'.get_lang("From").':&nbsp;</TD>
  49. <TD>'.GetFullUserName($row[1],$mysqlMainDb).'</TD>
  50. </TR>
  51. <TR>
  52. <TD noWrap>'.get_lang("Date").'&nbsp;</TD>
  53. <TD>'.$row[4].'</TD>
  54. </TR>
  55. <TR>
  56. <TD noWrap>'.get_lang("To").':&nbsp; </TD>
  57. <TD>'.GetFullUserName($row[2],$mysqlMainDb).'</TD>
  58. </TR>
  59. <TR>
  60. <TD style="PADDING-BOTTOM: 0px"></TD>
  61. <TD style="PADDING-BOTTOM: 0px"
  62. width="100%"></TD>
  63. </TR>
  64. </TBODY>
  65. </TABLE></TD>
  66. <TD class=HT vAlign=top align=right>&nbsp; </TD>
  67. </TR>
  68. </TBODY>
  69. </TABLE>
  70. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  71. <TBODY>
  72. <TR>
  73. <TD style="PADDING-BOTTOM: 5px" width="100%"><HR border="1"></TD>
  74. </TR>
  75. </TBODY>
  76. </TABLE>
  77. <TABLE height=209 width="100%" bgColor=#ffffff>
  78. <TBODY>
  79. <TR>
  80. <TD vAlign=top>'.$row[5].'</TD>
  81. </TR>
  82. </TBODY>
  83. </TABLE>
  84. <DIV class=HT style="PADDING-BOTTOM: 5px"> </DIV></TD>
  85. <TD width=10>&nbsp;</TD>
  86. <TD vAlign=top width=160></TD>
  87. </TR>
  88. </TBODY>
  89. </TABLE>
  90. <p><a href="inbox.php">'.get_lang("BackToInbox").'</a>
  91. ';
  92. $user_con = users_connected_by_id();
  93. $band=0;
  94. for($i=0;$i<count($user_con);$i++)
  95. if($row[1]==$user_con[$i])
  96. $band=1;
  97. if($band==1)
  98. echo '- <a href="new_message.php?re_id='.$_GET['id'].'">'.get_lang("ReplyToMessage").'</a> </p>';
  99. else
  100. echo "</a> </p>";
  101. /*
  102. ==============================================================================
  103. FOOTER
  104. ==============================================================================
  105. */
  106. Display::display_footer();
  107. ?>