new_survey.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /*
  3. DOKEOS - elearning and course management software
  4. For a full list of contributors, see documentation/credits.html
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. See "documentation/licence.html" more details.
  10. Contact:
  11. Dokeos
  12. Rue des Palais 44 Paleizenstraat
  13. B-1030 Brussels - Belgium
  14. Tel. +32 (2) 211 34 56
  15. */
  16. /**
  17. * @package dokeos.survey
  18. * @author
  19. * @version $Id: new_survey.php 10603 2007-01-06 17:01:47Z pcool $
  20. */
  21. // name of the language file that needs to be included
  22. $language_file = 'admin';
  23. require ('../inc/global.inc.php');
  24. api_protect_admin_script();
  25. require_once(api_get_path(LIBRARY_PATH).'/usermanager.lib.php');
  26. $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('AdministrationTools'));
  27. $interbreadcrumb[] = array ("url" => 'user_list.php', "name" => get_lang('UserList'));
  28. $tool_name = get_lang('Survey');
  29. Display::display_header($tool_name);
  30. ?>
  31. <?php
  32. $group_table = Database :: get_main_table(TABLE_MAIN_GROUP);
  33. if (isset ($_GET['keyword']))
  34. {
  35. $keyword = addslashes($_GET['keyword']);
  36. $sql = "SELECT * FROM ".$group_table." WHERE groupname LIKE '%".$keyword."%'";
  37. $parameters = array ('keyword' => $_GET['keyword']);
  38. }
  39. else
  40. {
  41. $sql = "SELECT * FROM ".$group_table;
  42. $parameters = array ();
  43. }
  44. $res = api_sql_query($sql,__FILE__,__LINE__);
  45. if (mysql_num_rows($res) > 0)
  46. {
  47. $users = array ();
  48. while ($obj = mysql_fetch_object($res))
  49. {
  50. $group = array ();
  51. $group[] = '<input type="checkbox" name="group[]" value="'.$obj->group_id.'"/>';
  52. $group[] = $obj->group_id;
  53. $group[] = $obj->groupname;
  54. $group[] = $group;
  55. }
  56. $table_header[] = array('',false);
  57. $table_header[] = array (get_lang('SerialNo'), true);
  58. $table_header[] = array (get_lang('FirstName'), true);
  59. $table_header[] = array (get_lang('LastName'), true);
  60. $table_header[] = array (get_lang('LoginName'), true);
  61. $table_header[] = array ('', false);
  62. echo '<form method="post" action="new_survey.php">';
  63. /** @todo remove $curr_dbname from the parameters. This is not used. */
  64. Display :: display_sortable_table($table_header, $users, array (), array (), $parameters);
  65. echo '<input type="submit" value="'.get_lang('Ok').'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang('ConfirmYourChoice')))."'".')) return false;"/>';
  66. echo '</form>';
  67. }
  68. Display::display_footer();
  69. ?>