inbox.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. // $Id: inbox.php 9690 2006-10-24 16:13:08Z evie_em $
  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. $langFile= "messages";
  25. $cidReset=true;
  26. include('../../main/inc/global.inc.php');
  27. include('./functions.inc.php');
  28. api_block_anonymous_users();
  29. $htmlHeadXtra[]='<script language="javascript">
  30. <!--
  31. function enviar(miforma)
  32. {
  33. if(confirm("'.get_lang("SureYouWantToDeleteSelectedMessages").'"))
  34. miforma.submit();
  35. }
  36. function select_all(formita)
  37. {
  38. for (i=0;i<formita.elements.length;i++)
  39. {
  40. if(formita.elements[i].type == "checkbox")
  41. formita.elements[i].checked=1
  42. }
  43. }
  44. function deselect_all(formita)
  45. {
  46. for (i=0;i<formita.elements.length;i++)
  47. {
  48. if(formita.elements[i].type == "checkbox")
  49. formita.elements[i].checked=0
  50. }
  51. }
  52. //-->
  53. </script>';
  54. /*
  55. ==============================================================================
  56. MAIN CODE
  57. ==============================================================================
  58. */
  59. $nameTools = get_lang('Messages');
  60. Display::display_header($nameTools,"Inbox");
  61. api_display_tool_title($nameTools);
  62. echo $_SESSION['prueba'];
  63. if(!isset($_GET[del_msg]))
  64. inbox_display();
  65. else
  66. {
  67. $num_msg = $_POST['total'];
  68. for ($i=0;$i<$num_msg;$i++)
  69. {
  70. if($_POST[$i])
  71. {
  72. $query = "DELETE FROM `".MESSAGES_DATABASE."` WHERE id_reciv=".$_SESSION['_uid']." AND id='".$_POST['_'.$i]."';";
  73. api_sql_query($query,__FILE__,__LINE__);
  74. }
  75. }
  76. inbox_display();
  77. }
  78. /*
  79. ==============================================================================
  80. FOOTER
  81. ==============================================================================
  82. */
  83. Display::display_footer();
  84. ?>