template_check.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. $langFile='survey';
  3. $cidReset=true;
  4. require_once ('../inc/global.inc.php');
  5. //api_protect_admin_script();
  6. require_once (api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
  7. require_once (api_get_path(CONFIGURATION_PATH) ."/add_course.conf.php");
  8. require_once (api_get_path(LIBRARY_PATH)."/add_course.lib.inc.php");
  9. require_once (api_get_path(LIBRARY_PATH)."/course.lib.php");
  10. require (api_get_path(LIBRARY_PATH)."/groupmanager.lib.php");
  11. require_once (api_get_path(LIBRARY_PATH)."/surveymanager.lib.php");
  12. require_once (api_get_path(LIBRARY_PATH)."/usermanager.lib.php");
  13. $un = $_REQUEST['un'];
  14. $survey_user_info_table = Database :: get_main_table(MAIN_SURVEY_USER_TABLE);
  15. $sql="SELECT * FROM $survey_user_info_table WHERE user_number = '$un'";
  16. $result=api_sql_query($sql);
  17. $obj=mysql_fetch_object($result);
  18. $info_id=$obj->id;
  19. $surveyid=$obj->survey_id;
  20. $db_name=$obj->db_name;
  21. $new_mail=$obj->email;
  22. $sql_temp = "SELECT * FROM $db_name.survey WHERE survey_id='$surveyid'";
  23. $res_temp = api_sql_query($sql_temp, __FILE__, __LINE__);
  24. $obj_temp=@mysql_fetch_object($res_temp);
  25. $template=$obj_temp->template;
  26. switch($template){
  27. case template1:
  28. header("location:template1.php?temp=$template&surveyid=$surveyid&mail=$new_mail&db_name=$db_name");
  29. break;
  30. case template2:
  31. header("location:template2.php?temp=$template&surveyid=$surveyid&mail=$new_mail&db_name=$db_name");
  32. break;
  33. case template3:
  34. header("location:template3.php?temp=$template&surveyid=$surveyid&mail=$new_mail&db_name=$db_name");
  35. break;
  36. case template4:
  37. header("location:template4.php?temp=$template&surveyid=$surveyid&mail=$new_mail&db_name=$db_name");
  38. break;
  39. case template5:
  40. header("location:template5.php?temp=$template&surveyid=$surveyid&mail=$new_mail&db_name=$db_name");
  41. break;
  42. }
  43. ?>