view_message.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php // $Id: view_message.php 10675 2007-01-11 13:03:10Z bmol $
  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. // name of the language file that needs to be included
  24. $language_file= "messages";
  25. include('../../main/inc/global.inc.php');
  26. api_block_anonymous_users();
  27. include('./functions.inc.php');
  28. $nameTools = get_lang("Messages");
  29. $interbredcrump[]=array("url" => "inbox.php","name" => get_lang("Inbox"));
  30. Display::display_header($nameTools,"messages");
  31. $query = "UPDATE `".MESSAGES_DATABASE."` SET `status` = '0' WHERE `id_receiver`=".api_get_user_id()." AND `id`='".mysql_real_escape_string($_GET['id'])."';";
  32. $result = api_sql_query($query,__FILE__,__LINE__);
  33. $query = "SELECT * FROM `".MESSAGES_DATABASE."` WHERE id_receiver=".api_get_user_id()." AND id='".mysql_real_escape_string($_GET['id'])."';";
  34. $result = api_sql_query($query,__FILE__,__LINE__);
  35. $row = mysql_fetch_array($result);
  36. echo '
  37. <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#dbeaf5 border=0>
  38. <TBODY>
  39. <TR>
  40. <TD width=10>&nbsp; </TD>
  41. <TD vAlign=top width="100%">
  42. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  43. <TBODY>
  44. <TR>
  45. <TD class=HT vAlign=top width="100%">
  46. <TABLE class=TH>
  47. <TBODY>
  48. <TR>
  49. <TD noWrap>'.get_lang("From").':&nbsp;</TD>
  50. <TD>'.GetFullUserName($row[1],$mysqlMainDb).'</TD>
  51. </TR>
  52. <TR>
  53. <TD noWrap>'.get_lang("Date").'&nbsp;</TD>
  54. <TD>'.$row[4].'</TD>
  55. </TR>
  56. <TR>
  57. <TD noWrap>'.get_lang("To").':&nbsp; </TD>
  58. <TD>'.GetFullUserName($row[2],$mysqlMainDb).'</TD>
  59. </TR>
  60. <TR>
  61. <TD noWrap>'.get_lang("Title").':&nbsp; </TD>
  62. <TD>'.$row[5].'</TD>
  63. </TR>
  64. <TR>
  65. <TD style="PADDING-BOTTOM: 0px"></TD>
  66. <TD style="PADDING-BOTTOM: 0px"
  67. width="100%"></TD>
  68. </TR>
  69. </TBODY>
  70. </TABLE></TD>
  71. <TD class=HT vAlign=top align=right>&nbsp; </TD>
  72. </TR>
  73. </TBODY>
  74. </TABLE>
  75. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  76. <TBODY>
  77. <TR>
  78. <TD style="PADDING-BOTTOM: 5px" width="100%"><HR border="1"></TD>
  79. </TR>
  80. </TBODY>
  81. </TABLE>
  82. <TABLE height=209 width="100%" bgColor=#ffffff>
  83. <TBODY>
  84. <TR>
  85. <TD vAlign=top>'.$row[6].'</TD>
  86. </TR>
  87. </TBODY>
  88. </TABLE>
  89. <DIV class=HT style="PADDING-BOTTOM: 5px"> </DIV></TD>
  90. <TD width=10>&nbsp;</TD>
  91. <TD vAlign=top width=160></TD>
  92. </TR>
  93. </TBODY>
  94. </TABLE>
  95. <p><a href="inbox.php">'.get_lang("BackToInbox").'</a>
  96. ';
  97. $user_con = users_connected_by_id();
  98. $band=0;
  99. for($i=0;$i<count($user_con);$i++)
  100. if($row[1]==$user_con[$i])
  101. $band=1;
  102. if($band==1)
  103. echo '- <a href="new_message.php?re_id='.$_GET['id'].'">'.get_lang("ReplyToMessage").'</a> </p>';
  104. else
  105. echo "</a> </p>";
  106. /*
  107. ==============================================================================
  108. FOOTER
  109. ==============================================================================
  110. */
  111. Display::display_footer();
  112. ?>