course_description.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php // $Id: course_description.php 2009-08-26 14:12:48 darkvela $
  2. /* For licensing terms, see /dokeos_license.txt */
  3. /**
  4. ==============================================================================
  5. * This script lists the course description in Ajax.
  6. * This script is for all users in general.
  7. *
  8. * @author Ronny Velasquez
  9. * @package dokeos.auth
  10. ==============================================================================
  11. */
  12. /*
  13. ==============================================================================
  14. INIT SECTION
  15. ==============================================================================
  16. */
  17. // Name of the language file that needs to be included.
  18. $language_file = array ('course_description');
  19. require_once '../inc/global.inc.php';
  20. require_once api_get_path(LIBRARY_PATH).'course.lib.php';
  21. require_once api_get_path(INCLUDE_PATH).'reduced_header.inc.php' ;
  22. /*
  23. ==============================================================================
  24. MAIN CODE
  25. ==============================================================================
  26. */
  27. function show_course_description() {
  28. // Get the name of the database course.
  29. $database_course = CourseManager::get_name_database_course($_GET['code']);
  30. $tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION, $database_course);
  31. $sql = "SELECT * FROM $tbl_course_description WHERE session_id=0 ORDER BY id";
  32. $result = Database::query($sql, __FILE__, __LINE__);
  33. while ($description = Database::fetch_object($result)) {
  34. $descriptions[$description->id] = $description;
  35. }
  36. // Function that displays the details of the course description in html.
  37. return CourseManager::get_details_course_description_html($descriptions, api_get_system_encoding(), false);
  38. }
  39. echo show_course_description();