Skip to content

Instantly share code, notes, and snippets.

@ostearn
Last active June 11, 2017 13:51
Show Gist options
  • Save ostearn/6d3018ea6ef55580d402855adb1e0cd1 to your computer and use it in GitHub Desktop.
Save ostearn/6d3018ea6ef55580d402855adb1e0cd1 to your computer and use it in GitHub Desktop.
$all_comp_courses = $DB->get_records_sql('SELECT * FROM {course_completion_crit_compl} WHERE userid = ?', array($USER->id));
$root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
foreach ($all_comp_courses as $comp_array) {
//$this->content->text .= "Course: ".$comp_array -> course;
$this->content->text .= '<script>
var coursetile = $(\'a[href$="'.$root.'course/view.php?id='.$comp_array -> course.'"]\').siblings(".panel-body").find(".cimbox").addClass("course_complete");
</script>';
// $this->content->items[] .= "<script>$(".coursebox-content").css("color", "red");</script>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment