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
15 define('AT_INCLUDE_PATH', '../../../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 require(AT_INCLUDE_PATH.'../mods/_core/themes/lib/themes.inc.php');
\r
18 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
\r
20 if (isset($_POST['delete'], $_POST['auto_enroll_id'])) {
\r
21 header('Location: auto_enroll_delete.php?auto_enroll_id='.$_POST['auto_enroll_id']);
\r
23 } else if (isset($_POST['edit'], $_POST['auto_enroll_id'])) {
\r
24 header('Location: auto_enroll_edit.php?auto_enroll_id='.$_POST['auto_enroll_id']);
\r
26 } else if (!empty($_POST)) {
\r
27 $msg->addError('NO_ITEM_SELECTED');
\r
30 require(AT_INCLUDE_PATH.'header.inc.php');
\r
33 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
34 <table summary="" class="data" rules="cols" align="center" style="width: 95%;">
\r
38 <th scope="col"> </th>
\r
39 <th scope="col"><?php echo _AT('name'); ?></th>
\r
40 <th scope="col"><?php echo _AT('courses'); ?></th>
\r
41 <th scope="col"><?php echo _AT('url'); ?></th>
\r
47 <div class="row buttons">
\r
48 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
\r
55 $sql = "SELECT * FROM ".TABLE_PREFIX."auto_enroll ae ORDER BY name";
\r
56 $result = mysql_query($sql, $db) or die(mysql_error());
\r
58 if ($row = mysql_fetch_assoc($result)): ?>
\r
62 $sql_courses = "SELECT c.title FROM ". TABLE_PREFIX."auto_enroll_courses aec, " .
\r
63 TABLE_PREFIX ."courses c
\r
64 WHERE aec.auto_enroll_id = ". $row["auto_enroll_id"] . "
\r
65 AND aec.course_id = c.course_id
\r
68 $result_courses = mysql_query($sql_courses, $db) or die(mysql_error());
\r
70 while ($row_courses = mysql_fetch_assoc($result_courses))
\r
71 $courses .= $row_courses["title"] . "<br>";
\r
73 <tr onmousedown="document.form['m<?php echo $row['auto_enroll_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['auto_enroll_id']; ?>">
\r
74 <td width="10"><input type="radio" name="auto_enroll_id" value="<?php echo $row['auto_enroll_id']; ?>" id="m<?php echo $row['auto_enroll_id']; ?>" /></td>
\r
75 <td><label for="m<?php echo $row['auto_enroll_id']; ?>"><?php if ($row['name']=="") echo _AT('na'); else echo $row['name']; ?></label></td>
\r
76 <td><?php echo $courses; ?></td>
\r
77 <td nowrap><?php echo $_base_href. "registration.php?en_id=". $row['associate_string']; ?></td>
\r
79 <?php } while ($row = mysql_fetch_assoc($result)); ?>
\r
82 <td colspan="4"><?php echo _AT('none_found'); ?></td>
\r
91 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>