<?php
//  Copyright (c) 2004-2005 randshop
//  http://www.randshop.com
//
//  Unter Lizenz von randshop
//	
//	Letzte Bearbeitung: 25.01.2005

    include_once("../../conf/config.inc.php");
    include_once(DATEIPFAD . 'includes/functions.zahlungsschnittstellen.inc.php');

	session_start();
	
	// Hauptkonfigurationsdatei
	include_once(DATEIPFAD . "conf/db.inc.php");
	include_once(DATEIPFAD . "includes/shopinitialize.inc.php");
	if(KUNDENGRUPPEN) {
		include_once(DATEIPFAD . "includes/functions.mod.kundengruppen.inc.php");
	} else {
		include_once(DATEIPFAD . "includes/functions.kundengruppen.inc.php");
	}
	include_once(DATEIPFAD . "includes/functions.artikel.inc.php");
	include_once(DATEIPFAD . "includes/functions.rabattstaffeln.inc.php");
	include_once(DATEIPFAD . "includes/functions.versandart.inc.php");
	include_once(DATEIPFAD . "includes/functions.zahlungsart.inc.php");
	include_once(DATEIPFAD . "includes/functions.kunden.inc.php");
	include_once(DATEIPFAD . "includes/functions.mail.inc.php");
	include_once(DATEIPFAD . "includes/functions.shopeinstellung.inc.php");
	include_once(DATEIPFAD . "includes/functions.warenkorb.inc.php");
	include_once(DATEIPFAD . "includes/functions.land.inc.php");
	include_once(DATEIPFAD . "includes/functions.waehrung.inc.php");
	include_once(DATEIPFAD . "includes/functions.kategorie.inc.php");
    include_once(DATEIPFAD . "includes/functions.bonitaetspruefung.inc.php");
    
    if(RECHNUNGSWESEN) {
		include_once(DATEIPFAD . "includes/functions.mod.bestellungen.inc.php");
	} else {
		include_once(DATEIPFAD . "includes/functions.bestellungen.inc.php");
	}
	if(ARTIKELDOWNLOAD) {
		include_once(DATEIPFAD . "includes/functions.mod.download.inc.php");
	}
	if (GUTSCHEINAKTIONEN) {
		include_once(DATEIPFAD . "includes/functions.mod.gutscheinaktionen.inc.php");
	}
	include_once(DATEIPFAD . "includes/functions.global.inc.php");
	//include_once(DATEIPFAD . "includes/session_register.inc.php");
	include_once(DATEIPFAD . "includes/crypt.inc.php");

	// Spracheninclude
	if (@fopen(DATEIPFAD . "includes/language/langu_" . $_SESSION["languageisocode"] . ".inc.php",r)) {
		include_once(DATEIPFAD . "includes/language/langu_" . $_SESSION["languageisocode"] . ".inc.php");
	} else {
		include_once(DATEIPFAD . "includes/language/langu_de.inc.php");
	}	

    include_once(DATEIPFAD . 'includes/functions.zahlungsschnittstellen.inc.php');

    // Header
    include_once(DATEIPFAD . "includes/header.inc.php");

	$ShopeinstellungenObject = GetShopeinstellungDetail();

	// ********************************************************************************
	// ** Aktionen auswerten
	// ********************************************************************************

	// Nicht angemeldet
	if ($_SESSION["com"] == "false" && $_SESSION["gast_mail"] == "") {
		header("Location: " . URLPFAD_NOSSL . "themes/user/index.php?sourceid=8&location=warenkorb");
		exit;
	}

	// 1. Auswahl der Zahlungsart
	if (($_SESSION["com"] == "true" || $_SESSION["gast_mail"] != "") && (($FormAction == "s0") || (!$FormAction))) {
		include_once(DATEIPFAD . "themes/bestellen/zahlungsart.inc.php");
	}


	// 2. Auswahl der Versandart
	if (($_SESSION["com"] == "true" || $_SESSION["gast_mail"] != "") && ($FormAction == "s1")) {
		include_once(DATEIPFAD . "themes/bestellen/versandart.inc.php");
	}

	// 3. Bestelluebersicht anzeigen
	if (($_SESSION["com"] == "true" || $_SESSION["gast_mail"] != "") && ($FormAction == "s2")) {
		include_once(DATEIPFAD . "themes/bestellen/bestellvorgang.inc.php");
	}

	// 4. Bestellung abwicklen
	if (($_SESSION["com"] == "true" || $_SESSION["gast_mail"] != "") && ($FormAction == "s3")) {
		include_once(DATEIPFAD . "themes/bestellen/bestellabwicklung.inc.php");
	}

	// Anzeige der Versandartstaffel
	if (($_SESSION["com"] == "true" || $_SESSION["gast_mail"] != "") && ($FormAction == "versandart_anzeigen")) {
		include_once(DATEIPFAD . "themes/bestellen/versandart_anzeigen.inc.php");
	}

	// Letzte globale Zusammenfassung z.B. fuer Warenkorbanzeige, bevor das Template geladen wird.
	include_once(DATEIPFAD . "includes/footer.inc.php");

	// Template
    if($mobilestyle) {
        include_once(DATEIPFAD . "templates/" . $rowTemp->name . "/mobile/layout_checkout.phtml");
    } else {
        include_once(DATEIPFAD . "templates/" . $rowTemp->name . "/website/checkout_index.tpl");
    }
	

	
	@mysql_close($db);


//if(!$action) {
//	$contentFile = DATEIPFAD . "templates/" . $rowTemp->name . "/website/kein_inhalt.tpl";
//}
	
	
?>
