diff --git a/main/cron/finddoc.php b/main/cron/finddoc.php new file mode 100644 index 0000000000..b68752f6e4 --- /dev/null +++ b/main/cron/finddoc.php @@ -0,0 +1,28 @@ +"; +} +$courses_list = CourseManager::get_courses_list(); +foreach ($courses_list as $course) { + //echo '
'.print_r($course['db_name'],1).''; + $title = Database::escape_string($_GET['doc']); + $td = Database::get_course_table(TABLE_DOCUMENT,$course['db_name']); + $sql = "SELECT id, path FROM $td WHERE path LIKE '%$title%' or title LIKE '%$title%'"; + $res = Database::query($sql); + if (Database::num_rows($res)>0) { + while ($row = Database::fetch_array($res)) { + echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."