From a2cf158a216a05ebde2a379ccd7243e0a66992bc Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Mon, 13 Jul 2015 16:30:15 -0500 Subject: [PATCH] Fix process confirm - refs #7768 --- plugin/buycourses/src/process_confirm.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/buycourses/src/process_confirm.php b/plugin/buycourses/src/process_confirm.php index db6b8043b2..f12e43e077 100644 --- a/plugin/buycourses/src/process_confirm.php +++ b/plugin/buycourses/src/process_confirm.php @@ -14,9 +14,13 @@ if ($_POST['payment_type'] == '') { header('Location:process.php'); } +$plugin = BuyCoursesPlugin::create(); + $tableBuyCourseTemporal = Database::get_main_table(TABLE_BUY_COURSE_TEMPORAL); $tableBuyCoursePaypal = Database::get_main_table(TABLE_BUY_COURSE_PAYPAL); +$buySessionTemporaryTable = Database::get_main_table(TABLE_BUY_SESSION_TEMPORARY); + if (isset($_POST['Confirm'])) { // Save the user, course and reference in a tmp table $user_id = $_SESSION['bc_user_id']; @@ -29,7 +33,7 @@ if (isset($_POST['Confirm'])) { } $sql = $_SESSION['bc_codetext'] === 'THIS_IS_A_SESSION' ? - "INSERT INTO $tableBuySessionTemporal (user_id, name, session_id, title, reference, price) + "INSERT INTO $buySessionTemporaryTable (user_id, name, session_id, title, reference, price) VALUES ('" . $user_id . "', '" . $name . "','" . $_SESSION['bc_code'] . "','" . $title . "','" . $reference . "','" . $price . "');" : "INSERT INTO $tableBuyCourseTemporal (user_id, name, course_code, title, reference, price) VALUES ('" . $user_id . "', '" . $name . "','" . $_SESSION['bc_codetext'] . "','" . $title . "','" . $reference . "','" . $price . "');";