Ejemplo n.º 1
0
<?php 
require_once "_includes/topBar.php";
?>
<div id=wrapper>
<?php 
include "_includes/mainNav.php";
?>
  <h1 class="title">Check Out</h1>
  <?php 
if (count_item_that_needs_time($_SESSION) > get_server_value("additional_wait_time_treshold")) {
    ?>
  	<p class="notice">You have <?php 
    echo count_item_that_needs_time($_SESSION);
    ?>
 items that require preparation time in your order.<br />This might incur an additinal <?php 
    echo (count_item_that_needs_time($_SESSION) - get_server_value("additional_wait_time_treshold")) * get_server_value("additional_wait_time_increment");
    ?>
 minutes to process.</p>
  <?php 
}
?>
  
<?php 
// ============================= Kick them off if the restaurant is closed :D ==============================
if ($restaurant_closed === 1 || $restaurant_closed === 2) {
    // Unset all orders left in the cart after the restaurant is closed
    clear_cart();
    if ($restaurant_closed === 1) {
        echo '<p class="notice">We\'re sorry but it has already passed the last call</p>';
    } elseif ($restaurant_closed === 2) {
        echo '<p class="notice">We\'re sorry but the restaurant is closed</p>';
Ejemplo n.º 2
0
 // 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);
 //////////////////////////////////////////////////////////////////////
 //////////// CREATE RECORD IN THE history_order TABLE TOO ////////////