create_survey.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. // $Id: course_add.php,v 1.10 2005/05/30 11:46:48 bmol Exp $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004 Dokeos S.A.
  7. Copyright (c) 2003 University of Ghent (UGent)
  8. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9. Copyright (c) Olivier Brouckaert
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  18. ==============================================================================
  19. */
  20. /**
  21. ==============================================================================
  22. * @package dokeos.admin
  23. ==============================================================================
  24. */
  25. /*
  26. ==============================================================================
  27. INIT SECTION
  28. ==============================================================================
  29. */
  30. $langFile = 'admin';
  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)."/surveymanager.lib.php");
  37. //$table_category = Database :: get_main_table(MAIN_CATEGORY_TABLE);
  38. $table_survey = Database :: get_main_table(MAIN_SURVEY_IFA_TABLE);
  39. $table_course = Database::get_main_table(MAIN_COURSE_TABLE);
  40. $tool_name = get_lang('a_survey');
  41. $interbredcrump[] = array ("url" => "index.php", "name" => get_lang('AdministrationTools'));
  42. $coursePathWeb = api_get_path(WEB_COURSE_PATH);
  43. $coursePathSys = api_get_path(SYS_COURSE_PATH);
  44. //define("NEW_SURVEY", 1);
  45. //define("EXISTING_SURVEY", 2);
  46. $newsurvey = '0';
  47. //$existingsurvey = '1';
  48. /*
  49. if ($_POST['action'] == 'add_survey')
  50. {
  51. $sql = "SELECT * FROM $table_survey WHERE id='".intval($_POST['id'])."'";
  52. $res = api_sql_query($sql,__FILE__,__LINE__);
  53. $id = mysql_fetch_object($res);
  54. $code = trim(strtoupper(stripslashes($_POST['code'])));
  55. //$author_name = $_POST['author'];
  56. //$title = $_POST['title'];
  57. //$language = trim(stripslashes($_POST['lang']));
  58. //$datefrom = $_POST['datefrom'];
  59. //$datetill = $_POST['datetill'];
  60. if (empty ($code))
  61. $error_message = get_lang('PleaseEnterSurveyCode');
  62. }
  63. */
  64. if ($_POST['action'] == 'add_survey')
  65. {
  66. $survey = $_POST['survey'];
  67. //$existingsurvey = trim(stripslashes($_POST['existingsurvey']));
  68. if ($survey==0)
  69. {
  70. header("location:create_new_survey.php");
  71. exit;
  72. }
  73. else
  74. {
  75. header("location:create_ex_survey.php");
  76. exit;
  77. }
  78. }
  79. Display::display_header($tool_name);
  80. api_display_tool_title($tool_name);
  81. ?>
  82. <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  83. <input type="hidden" name="action" value="add_survey"/>
  84. <table>
  85. <tr>
  86. <td valign="top"></td>
  87. <td>
  88. <input class="checkbox" checked type="radio" name="survey" id="new_survey" value="<?php echo $newsurvey ?>"> <label for="visibility_open_world"><?php echo get_lang("Newsurvey") ?></label>
  89. <br/>
  90. <input class="checkbox" type="radio" name="survey" id="Existing_survey" value="<?php echo $existingsurvey ?>" > <label for="visibility_open_platform"><?php echo get_lang("Existingsurvey") ?></label><?php SurveyManager::select_survey_list();?>
  91. </td></tr>
  92. <tr>
  93. <td></td>
  94. <td></td>
  95. </tr>
  96. <tr>
  97. <td></td>
  98. </tr>
  99. <tr>
  100. <td>&nbsp;</td>
  101. <td><input type="submit" value="<?php echo get_lang('Ok'); ?>"></td>
  102. </tr>
  103. </table>
  104. </form>
  105. <?php
  106. /*
  107. ==============================================================================
  108. FOOTER
  109. ==============================================================================
  110. */
  111. Display :: display_footer();
  112. ?>