if (sizeof($nonFreeLessons) > 0) { $currentUser->addLessons($nonFreeLessons, array_fill(0, sizeof($nonFreeLessons), 'student'), false); } if (sizeof($nonFreeCourses) > 0) { $currentUser->addCourses($nonFreeCourses, array_fill(0, sizeof($nonFreeCourses), 'student'), false); } $message = _ADMINISTRATORCONFIRMENROLLED; $fields = array("amount" => $totalPrice, "timestamp" => time(), "method" => "manual", "status" => "completed", "users_LOGIN" => $currentUser->user['login'], "lessons" => $nonFreeLessons, "courses" => $nonFreeCourses); $payment = payments::create($fields); } if ($coupon) { $coupon->useCoupon($currentUser, $payment, array('lessons' => $nonFreeLessons, 'courses' => $nonFreeCourses)); } } } cart::storeCart($cart); if (basename($_SERVER['PHP_SELF']) == 'index.php') { eF_redirect($_SESSION['s_type'] . "page.php?ctg=lessons&message=" . rawurlencode($message) . "&message_type=success"); } else { eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=lessons&message=" . rawurlencode($message) . "&message_type=success"); } } catch (Exception $e) { handleNormalFlowExceptions($e); } } $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty); $form->accept($renderer); $smarty->assign('T_CHECKOUT_FORM', $renderer->toArray()); } else { //$smarty -> display("includes/catalog.tpl"); }