Esempio n. 1
0
     if (isset($_POST["subscribe_checkbox"])) {
         if ($_POST["subscribe_checkbox"] == "subscribe_checkbox") {
             $subscribe_checkbox_ok = 1;
         } else {
             $subscribe_checkbox_ok = 0;
         }
     } else {
         $subscribe_checkbox_ok = 0;
     }
     // Evaluate all oks
     if ($submission_valid == 1 && $name_first_ok == 1 && $name_last_ok == 1 && $birth_day_ok === true && $birth_month_ok === true && $birth_year_ok === true && $phone_ok == 1 && $email_ok == 1 && $password1_ok == 1 && $password2_ok == 1 && $captcha_ok === true && $agree_checkbox_ok == 1) {
         // Prep for database using mysqli_real_escape_string()
         $name_first = database_prep($name_first);
         $name_last = database_prep($name_last);
         $phone = database_prep($phone);
         $email = database_prep($email);
         $hashed_password = password_hash($password1, PASSWORD_BCRYPT);
         $hashed_con_number = password_hash(mt_rand(), PASSWORD_BCRYPT);
         $hashed_con_number = substr($hashed_con_number, 7);
         create_new_customer($name_first, $name_last, 0, 0, 0, $phone, $hashed_password, $email, $hashed_con_number, $subscribe_checkbox_ok);
         send_confirmation_email($name_first, $name_last, $email, $hashed_con_number);
         if (isset($_POST)) {
             unset($_POST);
         }
         include "_connections/connection_close.php";
         $location = 'confirm_email.php?action=new&email=' . $email;
         redirect($location);
     }
 } else {
     echo "Submission error!";
     exit;
Esempio n. 2
0
 $cust_payment_method = "card";
 // indicate that the page should display charge card success section
 $cust_payment = true;
 // indicate that the page header should display success
 $time_placed = time();
 $placed_by_cust_id = get_cust_id($_SESSION["cust_email"]);
 $transaction_id = $tresponse->getTransId();
 $transaction_id = database_prep($transaction_id);
 $auth_code = $tresponse->getAuthCode();
 $card_type = $tresponse->getAccountType();
 $card_number = clean_input($cc_info_array['number']);
 $card_number = substr($card_number, -4);
 $card_name_first = clean_input($cc_info_array['name_first']);
 $card_name_first = database_prep($card_name_first);
 $card_name_last = clean_input($cc_info_array['name_last']);
 $card_name_last = database_prep($card_name_last);
 $item_that_needs_preparation_time = count_item_that_needs_time($_SESSION);
 if ($item_that_needs_preparation_time > get_server_value("additional_wait_time_treshold")) {
     $additional_wait_time = ($item_that_needs_preparation_time - get_server_value("additional_wait_time_treshold")) * get_server_value("additional_wait_time_increment");
 } else {
     $additional_wait_time = 0;
 }
 //////////////////////////////////////////////////////////////////////
 ////////////////// CREATE RECORD IN THE history_bill TABLE ///////////
 //////////////////////////////////////////////////////////////////////
 $cart_subtotal = clean_input($_SESSION["subtotal"]);
 $cart_tip = clean_input($_SESSION["cart_tip"]);
 $amount_charged = clean_input($_SESSION["Payment_Amount"]);
 $transaction_mode = $anet_sandbox_flag === true ? "test_mode" : "live_mode";
 $cust_invoice_number = create_new_bill_entry($cart_subtotal, $cart_tip, $amount_charged, $time_placed, $placed_by_cust_id, "card", "authCaptureTransaction", $transaction_id, $auth_code, $card_type, $card_number, $cc_info_array['exp_mo'], $cc_info_array['exp_yr'], $card_name_first, $card_name_last, "not_set", "not_set", $transaction_mode);
 //////////////////////////////////////////////////////////////////////