dashboard_course_count ()

Shows number of active courses.

Source file: app/functions/hook-function.php

View source


Used by

Uses


Source

function dashboard_course_count()
{
    $app = \Liten\Liten::getInstance();
    try {
        $count = $app->db->course()
            ->where('course.currStatus = "A"')->_and_()
            ->where('course.endDate IS NULL')->_or_()
            ->whereLte('course.endDate','0000-00-00')
            ->count('course.courseID');

        $crseCount = '<div class="col-md-4">';
        $crseCount .= '<a href="#" class="widget-stats widget-stats-1 widget-stats-inverse">';
        $crseCount .= '<span class="glyphicons book"><i></i><span class="txt">' . _t('Active Courses') . '</span></span>';
        $crseCount .= '<div class="clearfix"></div>';
        $crseCount .= '<span class="count">' . $count . '</span>';
        $crseCount .= '</a>';
        $crseCount .= '</div>';
        echo $app->hook->apply_filter('dashboard_course_count', $crseCount);
    } catch (NotFoundException $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    } catch (ORMException $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    } catch (Exception $e) {
        Cascade::getLogger('error')->error($e->getMessage());
        _etsis_flash()->error(_etsis_flash()->notice(409));
    }
}


Changelog

  • Since: eduTrac SIS 4.0.0

User Contributed Notes

You must log in before being able to contribute a note.