etsis_clas_rule ( int $stuID, string $level )

Student classification.

Return: (string)

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

View source


Parameters

$stuID

(int) (Required) Unique student ID.

$level

(string) (Required) Student academic level.


Used by

Uses


Source

function etsis_clas_rule($stuID, $level)
{
    $app = \Liten\Liten::getInstance();
    try {
        $node = Node::table('clvr')->where('level', '=', $level)->findAll();
        foreach ($node as $clvr) {
            $rlde = get_rule_by_code(_escape($clvr->rule));
            try {
                $clas = $app->db->v_scrd()
                    ->_join('stal', 'v_scrd.stuID = stal.stuID AND v_scrd.acadLevel = stal.acadLevelCode')
                    ->where('v_scrd.stuID = ?', $stuID)->_and_()
                    ->where('v_scrd.acadLevel = ?', _h($clvr->level))->_and_()
                    ->where("$rlde->rule")->_and_()
                    ->where('stal.endDate IS NULL')->_or_()
                    ->whereLte('stal.endDate','0000-00-00')
                    ->count('v_scrd.stuID');
                if ($clas > 0) {
                    return _escape($clvr->value);
                }
            } 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));
            }
        }
    } catch (NodeQException $e) {
        Cascade::getLogger('error')->error(sprintf('NODEQSTATE[%s]: %s', $e->getCode(), $e->getMessage()));
    } catch (Exception $e) {
        Cascade::getLogger('error')->error(sprintf('NODEQSTATE[%s]: %s', $e->getCode(), $e->getMessage()));
    }
}

Changelog

  • Since: eduTrac SIS 6.3.0

User Contributed Notes

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