choose_language.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php // $Id: index.php,v 1.44 2005/07/01 10:03:36 olivierb78 Exp $
  2. /*
  3. ==============================================================================
  4. Dokeos - elearning and course management software
  5. Copyright (c) 2004 Dokeos S.A.
  6. Copyright (c) 2003 University of Ghent (UGent)
  7. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  8. Copyright (c) Olivier Brouckaert
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  17. ==============================================================================
  18. */
  19. /**
  20. ==============================================================================
  21. * Index of the admin tools
  22. *
  23. * @package dokeos.admin
  24. ==============================================================================
  25. */
  26. $langFile='survey';
  27. $cidReset=true;
  28. session_start();
  29. $_SESSION["user_language_choice"]='english';
  30. require_once ('../inc/global.inc.php');
  31. //api_protect_admin_script();
  32. require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
  33. require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
  34. require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
  35. require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
  36. require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
  37. require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
  38. require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
  39. //$tool_name=get_lang("AdministrationTools");
  40. $surveyid = $_REQUEST['surveyid'];
  41. $uid = $_REQUEST['uid'];
  42. $uid1 = $_REQUEST['uid1'];
  43. $db_name = $_REQUEST['db_name'];
  44. $temp = $_REQUEST['temp'];
  45. $mail = $_REQUEST['mail'];
  46. if(isset($_GET['next'])){
  47. $lang = $_REQUEST['lang'];
  48. $code_survey = $_REQUEST['code_survey'];
  49. $sql = 'SELECT survey.survey_id
  50. FROM '.$db_name.'.survey as survey
  51. WHERE survey.code="'.addslashes($code_survey).'"
  52. AND survey.lang="'.addslashes($lang).'"';
  53. $rs = api_sql_query($sql, __FILE__, __LINE__);
  54. $surveyid = mysql_result($rs,0,'survey_id');
  55. header('Location:template1.php?'.$_SERVER['QUERY_STRING'].'&surveyid='.$surveyid);
  56. }
  57. $sql_sname = " SELECT survey2.* FROM $db_name.survey as survey1
  58. INNER JOIN $db_name.survey as survey2
  59. ON survey1.code = survey2.code
  60. WHERE survey1.survey_id='$surveyid'";
  61. $res_sname = api_sql_query($sql_sname,__FILE__,__LINE__);
  62. $code_survey = mysql_result($res_sname, 0, 'code');
  63. mysql_data_seek($res_sname,0);
  64. $surveyname = '';
  65. while($obj_sname = mysql_fetch_object($res_sname)){
  66. $surveyname .= $obj_sname->title.'<br>';
  67. }
  68. mysql_data_seek($res_sname,0);
  69. Display::display_header($tool_name);
  70. ?><center><?api_display_tool_title($surveyname);?></center><?
  71. api_display_tool_title($tool_name);
  72. if($error_message)
  73. {
  74. Display::display_error_message($error_message);
  75. }
  76. ?>
  77. <link href="../css/survey_white.css" rel="stylesheet" type="text/css">
  78. <table width="727" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F6F5F5">
  79. <tr>
  80. <td width="23" height="21">&nbsp;</td>
  81. <td height="21">&nbsp;</td>
  82. <td width="20" height="21">&nbsp;</td>
  83. </tr>
  84. <tr>
  85. <td>&nbsp;</td>
  86. <td valign="top">
  87. <table width="100%" height="132" border="0" cellpadding="0" cellspacing="0" bgcolor="#F6F5F5">
  88. <form method="GET" action="<?php echo $_SERVER['PHP_SELF'] ?>">
  89. <input type="hidden" name="uid" value="<?=$uid;?>">
  90. <input type="hidden" name="db_name" value="<?=$db_name;?>">
  91. <input type="hidden" name="temp" value="<?=$temp;?>">
  92. <input type="hidden" name="email" value="<?=$email;?>">
  93. <input type="hidden" name="mail" value="<?=$mail;?>">
  94. <input type="hidden" name="uid1" value="<?=$uid1;?>">
  95. <input type="hidden" name="code_survey" value="<?=$code_survey;?>">
  96. Select in which language you want to see this survey :
  97. <select name="lang">
  98. <?php
  99. while($survey = mysql_fetch_object($res_sname)){
  100. echo '<option value="'.$survey->lang.'">'.$survey->lang.'</option>';
  101. }
  102. ?>
  103. </select>
  104. <br /><br />
  105. <input type="submit" name="next" value="<?php echo get_lang('Next') ?>" />
  106. </form>
  107. </table>
  108. </td>
  109. <td>&nbsp;</td>
  110. </tr>
  111. <tr>
  112. <td>&nbsp;</td>
  113. <td>&nbsp;</td>
  114. <td>&nbsp;</td>
  115. </tr>
  116. </table>
  117. <?php
  118. /*
  119. ==============================================================================
  120. FOOTER
  121. ==============================================================================
  122. */
  123. Display::display_footer();
  124. ?>