示例#1
0
<?php

$lang->addModSpecificLocalization('catering');
$smarty->assign('lang', $lang->getAll());
require_once 'mod/default/catering/catering.function.php';
submitOrderToDB();
$smarty->assign('cart', null);
$smarty->assign('msg', $lang->get('order_submit_done'));
$smarty->display('../mod/default/catering/cart.tpl');
示例#2
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;
}