コード例 #1
0
function create_new_bill_entry($subtotal, $tip, $amount_charged, $time_placed, $placed_by_cust_id, $payment_method, $transaction_type, $transaction_id, $auth_code, $card_type, $card_number, $card_exp_mo, $card_exp_yr, $card_name_first, $card_name_last, $payment_type, $payment_status, $transaction_mode)
{
    global $connection;
    $query = "INSERT INTO history_bill ( ";
    //$query .= "bill_id, "; // AUTO INCREMENT
    $query .= "invoice_number, ";
    $query .= "subtotal, ";
    $query .= "original_subtotal, ";
    $query .= "tax_rate, ";
    $query .= "tax, ";
    $query .= "original_tax, ";
    $query .= "tip, ";
    $query .= "original_tip, ";
    $query .= "grandtotal, ";
    $query .= "amount_charged, ";
    $query .= "original_amount_charged, ";
    $query .= "time_placed, ";
    $query .= "wait_time, ";
    $query .= "placed_by_cust_id, ";
    $query .= "payment_method, ";
    $query .= "transaction_type, ";
    $query .= "transaction_id, ";
    $query .= "auth_code, ";
    $query .= "card_type, ";
    $query .= "card_number, ";
    $query .= "card_exp_mo, ";
    $query .= "card_exp_yr, ";
    $query .= "card_name_first, ";
    $query .= "card_name_last, ";
    $query .= "payment_type, ";
    $query .= "payment_status, ";
    $query .= "transaction_mode, ";
    $query .= "entry_status";
    $query .= " ) VALUES ( ";
    /////////// SETTING UP SOME VARIABLES ///////////
    $tax_rate = get_tax_rate();
    $wait_time = get_current_wait_time();
    $entry_status = "good_standing";
    $invoice_number = generate_next_invoice_number();
    $tax = $subtotal / 100 * $tax_rate;
    $tax = number_format($tax, 2, ".", "");
    //$query .= "bill_id, "; // AUTO INCREMENT
    $query .= "'{$invoice_number}', ";
    $query .= "{$subtotal}, ";
    $query .= "{$subtotal}, ";
    $query .= "{$tax_rate}, ";
    $query .= "{$tax}, ";
    $query .= "{$tax}, ";
    $query .= "{$tip}, ";
    $query .= "{$tip}, ";
    $query .= "{$amount_charged}, ";
    $query .= "{$amount_charged}, ";
    $query .= "{$amount_charged}, ";
    $query .= "'{$time_placed}', ";
    $query .= "{$wait_time}, ";
    $query .= "{$placed_by_cust_id}, ";
    $query .= "'{$payment_method}', ";
    $query .= "'{$transaction_type}', ";
    $query .= "'{$transaction_id}', ";
    $query .= "'{$auth_code}', ";
    $query .= "'{$card_type}', ";
    $query .= "'{$card_number}', ";
    $query .= "'{$card_exp_mo}', ";
    $query .= "'{$card_exp_yr}', ";
    $query .= "'{$card_name_first}', ";
    $query .= "'{$card_name_last}', ";
    $query .= "'{$payment_type}', ";
    $query .= "'{$payment_status}', ";
    $query .= "'{$transaction_mode}', ";
    $query .= "'{$entry_status}' );";
    $result = mysqli_query($connection, $query);
    checkQuery($result);
    return $invoice_number;
}
コード例 #2
0
        <?php 
    if ($additional_wait_time != 0) {
        ?>
        	<p>You have <?php 
        echo $item_that_needs_preparation_time;
        ?>
 items that require preparation time in your order which might incur an additional <?php 
        echo $additional_wait_time;
        ?>
 minutes of wait time.</p>
            <?php 
    }
    ?>
        <p>Your order should be ready around <?php 
    date_default_timezone_set('America/Los_Angeles');
    echo date("g:i a", $time_placed + $additional_wait_time * 60 + get_current_wait_time() * 60);
    ?>
</p>
        </div>
        <br />
        <blockquote>
		<p>** In some rare circumstances, your order might be delayed up to 20 minutes. If that should happen, we truly apologize for your inconvenience.</p>

        <p>If you need to cancel your order, you can do so by calling the restaurant directly at 1 ( 562 ) 860 - 6108</p>
        <p>Please take in account that the order that has been placed for more than 15 minutes cannot be cancelled as written along with other policies in our <a href="terms.php" target="_blank">Terms of Use</a>.</p>
        </blockquote>
        <br />
		<button class="button" type="button" onclick="location.href = 'cust_settings.php';">View Order History</button>
	<?php 
} elseif ($cust_payment_method === "undefined") {
    ?>