예제 #1
0
        }
        require_once $mod_dir . '/orders.php';
        break;
    case 'seller':
        if (!$rights->isAllowed($mod, 'seller')) {
            break;
        }
        require_once $mod_dir . '/seller.php';
        break;
    default:
        if ($login->currentUser() !== false) {
            // Pay bar button was pressed
            if (isset($_POST['PayBarFormSubmitted'])) {
                submitOrderToDB(true);
            }
            // Pay with credit
            if (isset($_POST['CreditUserId'])) {
                $order = getOrderFromSession();
                $result = $credit->pay($order['price'], (int) $_POST['CreditUserId'], $login->currentUserId(), "'" . $lang->get('catering') . "'");
                if ($result) {
                    submitOrderToDB(true);
                } else {
                    $notify->add($lang->get('catering'), $lang->get('not_enough_credit'));
                }
            }
        }
        $smarty->assign('categories', getCategories());
        $smarty->assign('show_cart', $login->currentUser() !== false);
        $smarty->assign('path', $template_dir . '/overview.tpl');
        break;
}
예제 #2
0
<?php

$lang->addModSpecificLocalization('catering');
$smarty->assign('lang', $lang->getAll());
$index = (int) $_GET['index'];
$quantity = (int) $_GET['quantity'];
require_once 'mod/default/catering/catering.function.php';
updateOrderQuantityInSession($index, $quantity);
$smarty->assign('cart', getOrderFromSession());
$smarty->assign('submit_order', $lang->get('submit_order'));
$smarty->display('../mod/default/catering/cart.tpl');