removeFromCart ( $section )
Source file: app/functions/student-function.php
Used by
Uses
- app/functions/auth-function.php: get_persondata()
- app/functions/global-function.php: _etsis_flash()
Source
function removeFromCart($section) { $app = \Liten\Liten::getInstance(); try { $cart = $app->db->stu_rgn_cart() ->where('stuID = ?', get_persondata('personID'))->_and_() ->whereGte('deleteDate', Jenssegers\Date\Date::now())->_and_() ->where('courseSecID = ?', $section); $q = $cart->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); if (count($q[0]['stuID']) > 0) { return true; } } 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)); } }
Expand full source code Collapse full source code View on Github
Changelog
- Since: eduTrac SIS 4.4