dashboard_student_count ()

Shows number of active students.

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

View source


Used by

Uses


Source

function dashboard_student_count()
{
    $app = \Liten\Liten::getInstance();
    try {
        $stu = $app->db->student()
            ->select('COUNT(student.stuID) as count')
            ->_join('sacp', 'student.stuID = sacp.stuID')
            ->where('student.status = "A"')->_and_()
            ->where('sacp.currStatus = "A"');
        $q = $stu->find(function ($data) {
            $array = [];
            foreach ($data as $d) {
                $array[] = $d;
            }
            return $array;
        });
        $a = [];
        foreach ($q as $r) {
            $a[] = $r;
        }
        $stuCount = '<div class="col-md-4">';
        $stuCount .= '<a href="#" class="widget-stats widget-stats-1 widget-stats-inverse">';
        $stuCount .= '<span class="glyphicons group"><i></i><span class="txt">' . _t('Active Students') . '</span></span>';
        $stuCount .= '<div class="clearfix"></div>';
        $stuCount .= '<span class="count">' . $r['count'] . '</span>';
        $stuCount .= '</a>';
        $stuCount .= '</div>';
        echo $app->hook->apply_filter('dashboard_student_count', $stuCount);
    } 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.