dokeos-admin
[ class tree: dokeos-admin ] [ index: dokeos-admin ] [ all elements ]

Source for file course_information.php

Documentation is available at course_information.php

  1. <?php
  2. // $Id: course_information.php 12903 2007-08-29 14:04:04Z elixir_julian $
  3. /*
  4. ==============================================================================
  5.     Dokeos - elearning and course management software
  6.  
  7.     Copyright (c) 2004 Dokeos S.A.
  8.     Copyright (c) 2003 Ghent University (UGent)
  9.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  10.     Copyright (c) Olivier Brouckaert
  11.  
  12.     For a full list of contributors, see "credits.txt".
  13.     The full license can be read in "license.txt".
  14.  
  15.     This program is free software; you can redistribute it and/or
  16.     modify it under the terms of the GNU General Public License
  17.     as published by the Free Software Foundation; either version 2
  18.     of the License, or (at your option) any later version.
  19.  
  20.     See the GNU General Public License for more details.
  21.  
  22.     Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  23. ==============================================================================
  24. */
  25. /**
  26. ============================================================================== 
  27.     @author Bart Mollet
  28. *    @package dokeos.admin
  29. ============================================================================== 
  30. */
  31. /*
  32. ==============================================================================
  33.         INIT SECTION
  34. ==============================================================================
  35. */
  36.  
  37. // name of the language file that needs to be included 
  38. $language_file 'admin';
  39. $cidReset true;
  40. require ('../inc/global.inc.php');
  41. require_once(api_get_path(LIBRARY_PATH).'sortabletable.class.php');
  42. $this_section=SECTION_PLATFORM_ADMIN;
  43.  
  44. /**
  45.  * 
  46.  */
  47. function get_course_usage($course_code)
  48. {
  49.     $sql "SELECT * FROM $table WHERE code='".$course_code."'";
  50.     $res api_sql_query($sql,__FILE__,__LINE__);
  51.     $course mysql_fetch_object($res);
  52.     // Learnpaths
  53.     $table Database :: get_course_table(TABLE_LP_MAIN$course->db_name);
  54.     $usage[array (get_lang(ucfirst(TOOL_LEARNPATH))Database::count_rows($table));
  55.     // Forums
  56.     $table Database :: get_course_table(TABLE_FORUM$course->db_name);
  57.     $usage[array (get_lang('Forums')Database::count_rows($table));
  58.     // Quizzes
  59.     $table Database :: get_course_table(TABLE_QUIZ_TEST$course->db_name);
  60.     $usage[array (get_lang(ucfirst(TOOL_QUIZ))Database::count_rows($table));
  61.     // Documents
  62.     $table Database :: get_course_table(TABLE_DOCUMENT$course->db_name);
  63.     $usage[array (get_lang(ucfirst(TOOL_DOCUMENT))Database::count_rows($table));
  64.     // Groups
  65.     $table Database :: get_course_table(TABLE_GROUP$course->db_name);
  66.     $usage[array (get_lang(ucfirst(TOOL_GROUP))Database::count_rows($table));
  67.     // Calendar
  68.     $table Database :: get_course_table(TABLE_AGENDA$course->db_name);
  69.     $usage[array (get_lang(ucfirst(TOOL_CALENDAR_EVENT))Database::count_rows($table));
  70.     // Link
  71.     $table Database::get_course_table(TABLE_LINK$course->db_name);
  72.     $usage[array(get_lang(ucfirst(TOOL_LINK))Database::count_rows($table));
  73.     // Announcements
  74.     $table Database::get_course_table(TABLE_ANNOUNCEMENT$course->db_name);
  75.     $usage[array(get_lang(ucfirst(TOOL_ANNOUNCEMENT))Database::count_rows($table));
  76.     return $usage;
  77. }
  78. /*****************************************************************/
  79. if (!isset ($_GET['code']))
  80. {
  81.     api_not_allowed();
  82. }
  83. $interbreadcrumb[array ("url" => 'index.php'"name" => get_lang('PlatformAdmin'));
  84. $interbreadcrumb[array ("url" => 'course_list.php'"name" => get_lang('Courses'));
  85. $table_course Database :: get_main_table(TABLE_MAIN_COURSE);
  86. $code $_GET['code'];
  87. $sql "SELECT * FROM $table_course WHERE code = '".$code."'";
  88. $res api_sql_query($sql,__FILE__,__LINE__);
  89. $course mysql_fetch_object($res);
  90. $tool_name $course->title.' ('.$course->code.')';
  91. Display::display_header($tool_name);
  92. //api_display_tool_title($tool_name);
  93. ?>
  94. <p>
  95. <a href="<?php echo api_get_path(WEB_COURSE_PATH).$course->directory?>"><img src="../img/course_home.gif" border="0" /> <?php echo api_get_path(WEB_COURSE_PATH).$course->directory?></a>
  96. <br/>
  97. <?php
  98. ifget_setting('server_type'== 'test')
  99. {
  100.     ?>
  101.     <a href="course_create_content.php?course_code=<?php echo $course->code ?>"><?php echo get_lang('AddDummyContentToCourse'?></a>
  102.     <?php
  103. }
  104. ?>
  105. </p>
  106. <?php
  107.  
  108. echo '<h4>'.get_lang('CourseUsage').'</h4>';
  109. echo '<blockquote>';
  110. $table new SortableTableFromArray(get_course_usage($course->code),0,20,'usage_table');
  111. $table->set_additional_parameters(array ('code' => $_GET['code']));
  112. $table->set_other_tables(array('user_table','class_table'));
  113. $table->set_header(0,get_lang('Tool')true);
  114. $table->set_header(1,get_lang('NumberOfItems')true);
  115. $table->display();
  116. echo '</blockquote>';
  117. /**
  118.  * Show all users subscribed in this course
  119.  */
  120. echo '<h4>'.get_lang('Users').'</h4>';
  121. echo '<blockquote>';
  122. $table_course_user Database :: get_main_table(TABLE_MAIN_COURSE_USER);
  123. $table_user Database :: get_main_table(TABLE_MAIN_USER);
  124. $sql 'SELECT *,cu.status as course_status FROM '.$table_course_user.' cu, '.$table_user." u WHERE cu.user_id = u.user_id AND cu.course_code = '".$code."' ";
  125. $res api_sql_query($sql,__FILE__,__LINE__);
  126. if (mysql_num_rows($res0)
  127. {
  128.     $users array ();
  129.     while ($obj mysql_fetch_object($res))
  130.     {
  131.         $user array ();
  132.         $user[$obj->official_code;
  133.         $user[$obj->firstname;
  134.         $user[$obj->lastname;
  135.         $user[Display :: encrypted_mailto_link($obj->email$obj->email);
  136.         $user[$obj->course_status == get_lang('Student'get_lang('Teacher');
  137.         $user['<a href="user_information.php?user_id='.$obj->user_id.'"><img src="../img/synthese_view.gif" border="0" /></a>';
  138.         $users[$user;
  139.     }
  140.     $table new SortableTableFromArray($users,0,20,'user_table');
  141.     $table->set_additional_parameters(array ('code' => $_GET['code']));
  142.     $table->set_other_tables(array('usage_table','class_table'));
  143.     $table->set_header(0,get_lang('OfficialCode')true);
  144.     $table->set_header(1,get_lang('FirstName')true);
  145.     $table->set_header(2,get_lang('LastName')true);
  146.     $table->set_header(3,get_lang('Email')true);
  147.     $table->set_header(4,get_lang('Status')true);
  148.     $table->set_header(5,''false);
  149.     $table->display();
  150. }
  151. else
  152. {
  153.     echo get_lang('NoUsersInCourse');
  154. }
  155. echo '</blockquote>';
  156. /**
  157.  * Show all classes subscribed in this course
  158.  */
  159. $table_course_class Database :: get_main_table(TABLE_MAIN_COURSE_CLASS);
  160. $table_class Database :: get_main_table(TABLE_MAIN_CLASS);
  161. $sql 'SELECT * FROM '.$table_course_class.' cc, '.$table_class.' c WHERE cc.class_id = c.id AND cc.course_code = '."'".$_GET['code']."'";
  162. $res api_sql_query($sql,__FILE__,__LINE__);
  163. if (mysql_num_rows($res0)
  164. {
  165.     $data array ();
  166.     while ($class mysql_fetch_object($res))
  167.     {
  168.         $row array ();
  169.         $row[$class->name;
  170.         $row['<a href="class_information.php?id='.$class->id.'"><img src="../img/synthese_view.gif" border="0" /></a>';
  171.         $data[$row;
  172.     }
  173.     echo '<p><b>'.get_lang('AdminClasses').'</b></p>';
  174.     echo '<blockquote>';
  175.     $table new SortableTableFromArray($data,0,20,'class_table');
  176.     $table->set_additional_parameters(array ('code' => $_GET['code']));
  177.     $table->set_other_tables(array('usage_table','user_table'));
  178.     $table->set_header(0,get_lang('Title'));
  179.     $table->set_header(1,'');
  180.     $table->display();
  181.     echo '</blockquote>';
  182. }
  183. else
  184. {
  185.     echo '<p>'.get_lang('NoClassesForThisCourse').'</p>';
  186. }
  187. /*
  188. ==============================================================================
  189.         FOOTER 
  190. ==============================================================================
  191. */ 
  192. ?>

Documentation generated on Thu, 12 Jun 2008 13:15:53 -0500 by phpDocumentor 1.4.1