removeFromCart ( $section )

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

View source


Used by


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));
    }
}


Changelog

  • Since: eduTrac SIS 4.4

User Contributed Notes

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