welcome_1.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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_answer';
  27. $cidReset=true;
  28. session_start();
  29. $lang = $_REQUEST['lang'];
  30. $_SESSION["user_language_choice"]=$lang;
  31. require_once ('../inc/global.inc.php');
  32. //api_protect_admin_script();
  33. require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
  34. require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
  35. require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
  36. require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
  37. require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
  38. require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
  39. require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
  40. //$tool_name=get_lang("AdministrationTools");
  41. $surveyid = $_REQUEST['surveyid'];
  42. $uid = $_REQUEST['uid'];
  43. $uid1 = $_REQUEST['uid1'];
  44. $db_name = $_REQUEST['db_name'];
  45. $temp = $_REQUEST['temp'];
  46. $mail = $_REQUEST['mail'];
  47. //$temp = 'template3';
  48. //$db_name = "stableJAZ";
  49. //$uid = 2;
  50. //$surveyid = 1;
  51. $user_table = Database :: get_main_table(MAIN_USER_TABLE);
  52. $sql_sname = "select * from $db_name.survey where survey_id='$surveyid'";
  53. $res_sname = api_sql_query($sql_sname,__FILE__,__LINE__);
  54. $obj_sname = mysql_fetch_object($res_sname);
  55. $surveyname = $obj_sname->title;
  56. $intro=$obj_sname->intro;
  57. if(isset($_POST['Next']))
  58. {
  59. $firstname = $_REQUEST['firstname'];
  60. $lastname = $_REQUEST['lastname'];
  61. $temp = $_REQUEST['temp'];
  62. $surveyid = $_REQUEST['surveyid'];
  63. $uid = $_REQUEST['uid'];
  64. $uid1 = $_REQUEST['uid1'];
  65. $db_name = $_REQUEST['db_name'];
  66. $email = $_REQUEST['email'];
  67. $organization = $_REQUEST['organization'];
  68. $age = $_REQUEST['age'];
  69. if(isset($uid))
  70. {$registered='Y';}
  71. else{$registered='N';}
  72. $user_table = Database :: get_main_table(MAIN_USER_TABLE);
  73. $survey_user_info_table = Database :: get_main_table(MAIN_SURVEY_USER_TABLE);
  74. if($uid1!=""){
  75. header("location:surveytemp_white.php?temp=$temp&surveyid=$surveyid&uid1=$uid1&db_name=$db_name&mail=$mail&lang=$lang");
  76. exit;
  77. }else{
  78. header("location:surveytemp_white.php?temp=$temp&surveyid=$surveyid&uid1=$uid1&db_name=$db_name&mail=$mail&lang=$lang");
  79. exit;
  80. }
  81. }
  82. if($uid1){
  83. $survey_user_info_table = Database :: get_main_table(MAIN_SURVEY_USER_TABLE);
  84. $sql_u="Select * from $survey_user_info_table where id='$uid1'";
  85. }
  86. else{
  87. $sql_u="Select * from $user_table where user_id='$uid'";
  88. }
  89. $res = api_sql_query($sql_u,__FILE__,__LINE__);
  90. $obj=@mysql_fetch_object($res);
  91. $email=$obj->email;
  92. $rs=mysql_query("select * from $db_name.questions");
  93. $row=mysql_num_rows($rs);
  94. $page=ceil($row/4);
  95. if(isset($_GET[num])){
  96. $num=$_GET[num];
  97. if($num>$page){
  98. header("Location:test.php");
  99. exit;
  100. }
  101. }else{
  102. $num = 1;
  103. }
  104. $lower = $num*4-4;
  105. Display::display_header($tool_name);
  106. ?><center><?api_display_tool_title($surveyname);?></center><?
  107. api_display_tool_title($tool_name);
  108. if($error_message)
  109. {
  110. Display::display_error_message($error_message);
  111. }
  112. ?>
  113. <link href="../css/survey_white.css" rel="stylesheet" type="text/css">
  114. <table width="727" style="border: 1px solid" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#F6F5F5">
  115. <tr>
  116. <td width="23" height="21">&nbsp;</td>
  117. <td height="21">&nbsp;</td>
  118. <td width="20" height="21">&nbsp;</td>
  119. </tr>
  120. <tr>
  121. <td>&nbsp;</td>
  122. <td valign="top">
  123. <table width="100%" height="132" border="0" cellpadding="0" cellspacing="0" bgcolor="#F6F5F5">
  124. <form method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
  125. <!--<form method="post" action="surveytemp_white.php">-->
  126. <input type="hidden" name="uid" value="<?=$uid;?>">
  127. <input type="hidden" name="surveyid" value="<?=$surveyid;?>">
  128. <input type="hidden" name="db_name" value="<?=$db_name;?>">
  129. <input type="hidden" name="temp" value="<?=$temp;?>">
  130. <input type="hidden" name="email" value="<?=$email;?>">
  131. <input type="hidden" name="mail" value="<?=$mail;?>">
  132. <input type="hidden" name="uid1" value="<?=$uid1;?>">
  133. <input type="hidden" name="lang" value="<?=$lang;?>">
  134. <tr>
  135. <td align='left'>
  136. <?
  137. echo $intro;
  138. ?>
  139. </td>
  140. </tr>
  141. <tr><td>&nbsp;</td></tr>
  142. <tr>
  143. <td align="center">
  144. <? if($num > "1"){?>
  145. <input type="button" name="Back" value="<? if($lang=='french')echo 'Précédent'; else if($lang=='dutch')echo 'Terug'; else echo 'Back';?>" onClick="location.href('<?=$phpself?>?temp=<?=$temp?>&db_name=<?=$db_name?>&mail=<?=$mail?>&surveyid=<?=$surveyid?>&uid1=<?=$uid1?>&num=<?($num-1)?>');">
  146. <?
  147. } else{
  148. ?>
  149. <input type="button" name="Back" value="<? if($lang=='french')echo 'Précédent'; else if($lang=='dutch') echo 'Terug'; else echo 'Back';?>" onClick="location.href('template1.php?temp=<?=$temp?>&db_name=<?=$db_name?>&uid1=<?=$uid1?>&mail=<?=$mail?>&surveyid=<?=$surveyid?>');">
  150. <?
  151. }
  152. ?>
  153. <input type="submit" name="Next" value="<?if($lang=='french')echo 'Suivant'; else if($lang=='dutch')echo 'Volgende'; else echo 'Next' ;?>"></td>
  154. </tr></form>
  155. </table>
  156. </td>
  157. <td>&nbsp;</td>
  158. </tr>
  159. <tr>
  160. <td>&nbsp;</td>
  161. <td>&nbsp;</td>
  162. <td>&nbsp;</td>
  163. </tr>
  164. </table>
  165. <?php
  166. /*
  167. ==============================================================================
  168. FOOTER
  169. ==============================================================================
  170. */
  171. Display::display_footer();
  172. ?>