34e9bb77c12531f90b724d2354f9753e7a022b43
[atutor.git] / docs / mods / _core / enrolment / admin / index.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License  */
11 /* as published by the Free Software Foundation.                                */
12 /****************************************************************/
13 // $Id$
14 define('AT_INCLUDE_PATH', '../../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
16
17 admin_authenticate(AT_ADMIN_PRIV_ENROLLMENT);
18
19 if (!isset($_REQUEST['course_id'])) {
20         $sql = "SELECT course_id FROM ".TABLE_PREFIX."courses ORDER BY title LIMIT 1";
21         $result = mysql_query($sql, $db);
22         if ($row = mysql_fetch_assoc($result)) {
23                 $course_id = intval($row['course_id']);
24         } else {
25                 require(AT_INCLUDE_PATH.'header.inc.php');              
26                 echo _AT('none_found');
27                 require(AT_INCLUDE_PATH.'footer.inc.php');
28                 exit;
29         }
30 } else {
31         $course_id = intval($_REQUEST['course_id']);
32 }
33
34
35 if (isset($system_courses[$course_id]['member_id'])) {
36
37         require(AT_INCLUDE_PATH.'../mods/_core/enrolment/html/enrollment.inc.php');
38 }
39 exit;
40 ?>