2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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 /****************************************************************/
15 define('AT_INCLUDE_PATH', '../include/');
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
20 require(AT_INCLUDE_PATH.'header.inc.php');
22 echo '<div style="padding-left: 30px;"><pre>';
24 echo "cpID\torder\t cID";
26 $sql = "SELECT content_id, content_parent_id, ordering, course_id FROM ".TABLE_PREFIX."content ORDER BY course_id, content_parent_id, ordering";
27 $result = mysql_query($sql, $db);
28 while ($row = mysql_fetch_assoc($result)) {
29 if ($current_course_id != $row['course_id']) {
30 echo "\n\n-- course id $row[course_id]\n\n";
31 $current_course_id = $row['course_id'];
32 unset($current_parent_id);
35 echo $row['content_parent_id'] . "\t" . $row['ordering'] . "\t" . $row['content_id'];
36 if ($current_parent_id != $row['content_parent_id']) {
37 $current_parent_id = $row['content_parent_id'];
41 if ($row['ordering'] != $ordering) {
42 echo "\t mismatch : expecting $ordering [fixed]";
43 $sql = "UPDATE ".TABLE_PREFIX."content SET ordering=$ordering WHERE content_id=$row[content_id]";
44 mysql_query($sql, $db);
45 write_to_log(AT_ADMIN_LOG_UPDATE, 'content', mysql_affected_rows($db), $sql);
55 require(AT_INCLUDE_PATH.'footer.inc.php');