get_perm_roles ()
Retrieves a list of roles from the roles table.
Return: (mixed)
Source file: app/functions/person-function.php
Used by
Uses
- app/functions/global-function.php: _etsis_flash()
Source
function get_perm_roles() { $app = \Liten\Liten::getInstance(); try { $query = $app->db->query('SELECT trim(leading "0" from id) AS roleID, roleName FROM role'); $result = $query->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); foreach ($result as $r) { echo '<option value="' . _h($r['roleID']) . '">' . _h($r['roleName']) . '</option>' . "\n"; } } catch (NotFoundException $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 (ORMException $e) { Cascade::getLogger('error')->error($e->getMessage()); _etsis_flash()->error(_etsis_flash()->notice(409)); } }
Expand full source code Collapse full source code View on Github
Changelog
- Since: eduTrac SIS 6.0.04