2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /************************************************************************/
\r
13 // $Id: auto_enroll_list_courses.php 7208 2008-01-09 16:07:24Z cindy $
\r
15 // Lists all courses to auto enroll
\r
16 if (isset($_REQUEST["en_id"]) && $_REQUEST["en_id"] <> "")
\r
18 $associate_string = $_REQUEST["en_id"];
\r
21 $cats[0] = _AT('cats_uncategorized');
\r
23 $sql = "SELECT cat_id, cat_name FROM ".TABLE_PREFIX."course_cats";
\r
24 $result = mysql_query($sql,$db);
\r
25 while($row = mysql_fetch_array($result)) {
\r
26 $cats[$row['cat_id']] = $row['cat_name'];
\r
29 $sql_courses = "SELECT aec.auto_enroll_courses_id auto_enroll_courses_id,
\r
33 FROM " . TABLE_PREFIX."auto_enroll a, " .
\r
34 TABLE_PREFIX."auto_enroll_courses aec, " .
\r
35 TABLE_PREFIX ."courses c
\r
36 where a.associate_string='".$associate_string ."'
\r
37 and a.auto_enroll_id = aec.auto_enroll_id
\r
38 and aec.course_id = c.course_id";
\r
40 $result_courses = mysql_query($sql_courses, $db) or die(mysql_error());
\r
42 if (mysql_num_rows($result_courses) > 0)
\r
47 <legend><?php echo _AT('course_to_auto_enroll'); ?></legend>
\r
48 <?php echo $table_title; ?>
\r
51 <table summary="" class="data" rules="cols" align="left" style="width: 100%;">
\r
55 <th scope="col"><?php echo _AT('title'); ?></th>
\r
56 <th scope="col"><?php echo _AT('category'); ?></th>
\r
62 if ($row_courses = mysql_fetch_assoc($result_courses)):
\r
66 <td><label for="m<?php echo $row_courses['auto_enroll_courses_id']; ?>"><?php echo $row_courses['title']; ?></label></td>
\r
67 <td><?php echo $cats[$row_courses['cat_id']]; ?></td>
\r
69 <?php } while ($row_courses = mysql_fetch_assoc($result_courses)); ?>
\r
72 <td colspan="3"><?php echo _AT('none_found'); ?></td>
\r