function if_cust_not_login_then_redirect() { //query for url set $url_set = get_server_value("url_set"); // check if logged in if (check_cust_login() === false) { if ($url_set == 1 || $url_set == 2) { $location = "login.php"; } elseif ($url_set == 3) { $location = "https://www.nayadathai.com/login.php"; } redirect($location); } elseif (get_server_value("login") != 1) { clear_cart(); if ($url_set == 1 || $url_set == 2) { $location = "login.php?action=logout"; } elseif ($url_set == 3) { $location = "https://www.nayadathai.com/login.php?action=logout"; } redirect($location); } else { return true; } }
if ($_SESSION["cust_login"] === true && $restaurant_closed == 0 && $cart_item_count !== 0) { if ($url_set == 1 || $url_set == 2) { echo '<a href="view_order.php"><img title="View your order here" class="cart_icon_full" src="_images/cart_cream2.png" /></a>'; } elseif ($url_set == 3) { echo '<a href="https://www.nayadathai.com/view_order.php"><img title="View your order here" class="cart_icon_full" src="_images/cart_cream2.png" /></a>'; } } elseif ($_SESSION["cust_login"] === true && $restaurant_closed == 0 && $cart_item_count === 0) { if ($url_set == 1 || $url_set == 2) { echo '<img title="Your order is empty" class="cart_icon_empty" src="_images/cart_cream.png" />'; } elseif ($url_set == 3) { echo '<img title="Your order is empty" class="cart_icon_empty" src="_images/cart_cream.png" />'; } } // end elseif } if ($server_login == 1 && check_cust_login() !== true) { if ($url_set == 1 || $url_set == 2) { echo '<a href="login.php"><img class="login_icon" src="_images/login.png" /></a>'; } elseif ($url_set == 3) { echo '<a href="https://www.nayadathai.com/login.php"><img class="login_icon" src="_images/login.png" /></a>'; } } // end elseif ///////////////////////////////// SHOW WAIT TIME ICON ////////////////////////////////// if ($restaurant_closed == 0 && $server_online_ordering_available != 0 && $server_login == 1) { switch ($server_wait_time) { case "20": echo '<img title="Wait time for pick-up order is 20 minutes" class="clock_icon" src="_images/clock_20.png" />'; break; case "30": echo '<img title="Wait time for pick-up order is 30 minutes" class="clock_icon" src="_images/clock_30.png" />';
} } elseif (isset($_GET["direction"])) { if (clean_input($_GET["direction"]) === "developer") { $default_direction = "developer"; $default_subject = "website"; } } } // end if GET is set // see if customer needs validation or not if (isset($_POST["submit"])) { if ($_POST["submit"] === "submit") { if (isset($_SESSION["cust_login"])) { if ($_SESSION["cust_login"] === true) { // check if logged in if (check_cust_login() === true) { $no_validation_mode = true; } } else { $no_validation_mode = false; } } else { $no_validation_mode = false; } } // end if $_POST === "submit" } // end if $_POST is set // No Validation Mode if (isset($no_validation_mode)) { if ($no_validation_mode === true) {
<!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 include "_includes/global_header_addon.php"; require_once "_includes/_functions/global_functions.php"; require_once "_includes/_functions/process_input_functions.php"; require_once "_includes/_functions/mysql_functions.php"; // setting up general variables if (get_server_value("login") == 1) { $login_available = true; } else { $login_available = false; } // check if logged in // if not, only show login button $cust_logged_in = check_cust_login(); if ($cust_logged_in !== true) { $show_login_button = true; } else { $show_login_button = false; } if (!$_GET) { $tabId = 2; $page = "app"; } else { $tabId = clean_input($_GET["tab"]); switch ($tabId) { case 0: $page = "app"; break; case 1: