inbox.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. // $Id: inbox.php 10204 2006-11-26 20:46:53Z pcool $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) Facultad de Matematicas, UADY (México)
  7. Copyright (c) Evie, Free University of Brussels (Belgium)
  8. For a full list of contributors, see "credits.txt".
  9. The full license can be read in "license.txt".
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License
  12. as published by the Free Software Foundation; either version 2
  13. of the License, or (at your option) any later version.
  14. See the GNU General Public License for more details.
  15. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  16. Mail: info@dokeos.com
  17. ==============================================================================
  18. */
  19. /*
  20. ==============================================================================
  21. INIT SECTION
  22. ==============================================================================
  23. */
  24. // name of the language file that needs to be included
  25. $language_file= "messages";
  26. $cidReset=true;
  27. include('../../main/inc/global.inc.php');
  28. include('./functions.inc.php');
  29. api_block_anonymous_users();
  30. $htmlHeadXtra[]='<script language="javascript">
  31. <!--
  32. function enviar(miforma)
  33. {
  34. if(confirm("'.get_lang("SureYouWantToDeleteSelectedMessages").'"))
  35. miforma.submit();
  36. }
  37. function select_all(formita)
  38. {
  39. for (i=0;i<formita.elements.length;i++)
  40. {
  41. if(formita.elements[i].type == "checkbox")
  42. formita.elements[i].checked=1
  43. }
  44. }
  45. function deselect_all(formita)
  46. {
  47. for (i=0;i<formita.elements.length;i++)
  48. {
  49. if(formita.elements[i].type == "checkbox")
  50. formita.elements[i].checked=0
  51. }
  52. }
  53. //-->
  54. </script>';
  55. /*
  56. ==============================================================================
  57. MAIN CODE
  58. ==============================================================================
  59. */
  60. $nameTools = get_lang('Messages');
  61. Display::display_header($nameTools,"Inbox");
  62. api_display_tool_title($nameTools);
  63. echo $_SESSION['prueba'];
  64. if(!isset($_GET[del_msg]))
  65. inbox_display();
  66. else
  67. {
  68. $num_msg = $_POST['total'];
  69. for ($i=0;$i<$num_msg;$i++)
  70. {
  71. if($_POST[$i])
  72. {
  73. $query = "DELETE FROM `".MESSAGES_DATABASE."` WHERE id_receiver=".$_SESSION['_uid']." AND id='".$_POST['_'.$i]."';";
  74. api_sql_query($query,__FILE__,__LINE__);
  75. }
  76. }
  77. inbox_display();
  78. }
  79. /*
  80. ==============================================================================
  81. FOOTER
  82. ==============================================================================
  83. */
  84. Display::display_footer();
  85. ?>