# PHP & Database code by: # Copyright 2003 by IT-Ernity High-End IT Solutions # */ //Some settings for XHTML 1.0 compatibility ini_set("session.use_trans_sid", "0"); ini_set("arg_separator.output", "&"); //Include functions, classes and configuration include("./config.php"); include("./libraries/class_db.php"); include("./libraries/class_session.php"); include("./libraries/class_mail.php"); //Make initial db connect $db = new db(); $dbh = $db->db_connect($C_db_user, $C_db_pass, $C_db_host); //Choose default db $db->db_select($C_db); //Start session handler session_start(); //Register some variables $debug = false; $mylog = array(); $errors = array(); //bestelling array moet altijd bestaan. if(!isset($_SESSION["bestelling"])) { $_SESSION["bestelling"] = array(); } if($_GET["a"] == "logout") { $_SESSION["authed"] = "no"; session_destroy(); } //taalinstellingen regelen: if(isset($_GET["lang"]) and $_GET["lang"] == "en") { $_SESSION["lg"] = "en"; $lg = "en"; } elseif (isset($_GET["lang"]) and $_GET["lang"] == "nl") { if(isset($_SESSION["lg"])) { unset($_SESSION["lg"]); } $lg = "nl"; } elseif (isset($_SESSION["lg"]) and $_SESSION["lg"] == "en") { $lg = "en"; } else { $lg = "nl"; } if($lg == "en") { include($C_inc_path."/en.php"); } else { include($C_inc_path."/nl.php"); } //nu pas functies includen ivm languagefile include("./libraries/functions.php"); //Check for submitted data or valid logged in user $logged = false; if($_SESSION["authed"] == "yes" && isset($_SESSION["uid"]) && is_numeric($_SESSION["uid"])) { //Ok, valid logged in user... $logged = true; } elseif(isset($_POST["frm_user"]) && $_POST["frm_user"] != "" && isset($_POST["frm_pass"]) && $_POST["frm_pass"] != "") { //Login data submitted, check if valid user $qry = "SELECT * FROM klant WHERE username=\"" . addslashes($_POST["frm_user"]) . "\" AND wachtwoord=\"" . md5($_POST["frm_pass"]) . "\" AND status='1'; "; $q = mysql_query($qry) or die ("error executing qry: " . $qry); if(mysql_num_rows($q) > 0) { $res = mysql_fetch_array($q); $logged = true; $_SESSION["uid"] = $res["id"]; $_SESSION["authed"] = "yes"; //Check wether the original request held an specific page/object call..if so..forward to that page if(isset($_POST["link"]) && $_POST["link"] != "") { $link_arr = unserialize(base64_decode($_POST["link"])); if(count($link_arr) > 0) { $first = true; $url = $C_full_domain . "/index.php"; while($foo = each($link_arr)) { if($first) { $sign = "?"; $first = false; } else { $sign = "&"; } $url .= $sign . $foo["key"] . "=" . $foo["value"]; } header("Location: " . $url); exit; } } } else { $logged = false; } } //check whether login is requested for page to show: if(isset($_GET["a"]) and $_GET["a"] == "bevestig") { //bestelling is bevestigd, checken of klant ingelogged is... if(!$logged) { $url = $C_full_domain . "/index.php?p=login"; if(count($_GET) > 0) { $url .= "&link=" . base64_encode(serialize($_GET)); header("Location: " . $url); exit; } } else { $url = $C_full_domain . "/index.php?p=bevestig"; header("Location: " . $url); exit; } } //Decide on called page if(isset($_GET["p"]) && $_GET["p"] != "" && array_key_exists($_GET["p"], $C_pages)){ $page = $_GET["p"]; } elseif (isset($_POST["p"]) && $_POST["p"] != "" && array_key_exists($_POST["p"], $C_pages)) { $page = $_POST["p"]; } else { $page = $C_default_page; } //Decide on menu to show (lelijk geimplementeerd omdat achteraf pas in session wordt bijgehouden) if(isset($_GET["m"]) && $_GET["m"] != ""){ $_SESSION["menu"] = $_GET["m"]; } elseif (isset($_POST["m"]) && $_POST["m"] != "") { $_SESSION["menu"] = $_POST["m"]; } elseif (!isset($_SESSION["menu"])) { $_SESSION["menu"] = get_default_menu_item($menu); } if(!(is_valid_menu($_SESSION["menu"]))) { $_SESSION["menu"] = get_default_menu_item($menu); } $_SESSION["menu"] = deepest_favorite($_SESSION["menu"]); //checkt of er een voorkeurmenu opengeklapt kan worden. $menu = $_SESSION["menu"]; //End of header php code, start HTML below ?> Welkom op de website van Eurostock
headerpic
    ".$L_msg165."\n"; //vervolgen met normale menu opbouw uit database $qry = "SELECT naam_".$lg.", id FROM menu WHERE level = 0 ORDER BY rang;"; $result = mysql_query($qry) or die ("error executing mysql query"); while($row = mysql_fetch_array($result)) { //first echo li -element echo "
  • ". $row["naam_".$lg] . "
  • \n"; //checken of $menu een subitem is van deze iteratie. if(is_sub_itemof($row["id"], $menu) or $row["id"] == $menu) { $qry = "SELECT naam_".$lg.", id FROM menu WHERE parent = " . $row["id"] . " ORDER BY rang;"; $subresult = mysql_query($qry) or die ("error executing mysql query"); while($subrow = mysql_fetch_array($subresult)) { echo "
  • ". $subrow["naam_".$lg] . "
  • \n"; if(is_sub_itemof($subrow["id"], $menu) or $subrow["id"] == $menu) { $qry = "SELECT naam_".$lg.", id FROM menu WHERE parent = " . $subrow["id"] . " ORDER BY rang;"; $subsubresult = mysql_query($qry) or die ("error executing mysql query"); while($subsubrow = mysql_fetch_array($subsubresult)) { if($subsubrow["id"] == $menu) { echo "
  • ". $subsubrow["naam_".$lg] . "
  • \n"; } else { echo "
  • ". $subsubrow["naam_".$lg] . "
  • \n"; } } } } } } ?>