Ejemplo n.º 1
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
date_default_timezone_set('America/Los_Angeles');
include "_includes/global_header_addon.php";
require_once "_includes/_functions/process_input_functions.php";
require_once "_includes/_functions/global_functions.php";
require_once "_includes/_functions/mysql_functions.php";
// check if logged in
if_cust_not_login_then_redirect();
// check if there's any order /// if not, redirect to order page
$cart_max_item = get_cart_max_item();
$var_count = 1;
$item_count = 0;
while ($var_count <= $cart_max_item) {
    if (!empty($_SESSION["item_{$var_count}"])) {
        $item_count++;
    }
    // end if
    $var_count++;
}
// end while loop
if ($item_count === 0) {
    $location = "order.php?tab=2";
    redirect($location);
}
// query for url set
$url_set = get_server_value("url_set");
/////////////////////////// setting up general variables ////////////////////////////////
// check what kind of payment is accepted at the moment
Ejemplo n.º 2
0
        if ($var_count > $cart_max_item) {
            $max_item_reached = 1;
            echo '<script>alert("Maximum item in one session is ' . $cart_max_item . '");</script>';
            break;
        }
        if (empty($_SESSION["item_{$var_count}"])) {
            // construct item array
            $item = array();
            $item["cart_item_id"] = $cart_item_id;
            $item["cart_item_quantity"] = $cart_item_quantity;
            // dump into session variable
            $_SESSION["item_{$var_count}"] = $item;
            // release "item" variable
            unset($item);
            $value_that_needs_dumping = 0;
            // check if customer is logged in or not
            if (if_cust_not_login_then_redirect() === true) {
                if ($url_set == 1 || $url_set == 2) {
                    $location = "order.php?tab={$tabId}";
                } elseif ($url_set == 3) {
                    $location = "https://www.nayadathai.com/order.php?tab={$tabId}";
                }
                redirect("{$location}");
            }
        } else {
            $var_count++;
        }
    }
    // end while loop
}
// end if $_GET is set