Fix process confirm - refs #7768

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent 6d66b3a093
commit a2cf158a21
  1. 6
      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 . "');";

Loading…
Cancel
Save