<?php
//=================================================================
// KOOBI R7 - CMS - PORTALSOFTWARE(c) DREAM4(r) 
// HTTP://WWW.DREAM4.DE
//=================================================================
// ACHTUNG!
// DIESER PROGRAMMCODE IST URHERRECHTLICH GESCHUETZT
// DIE URHEBERRECHTE LIEGEN BEI DEN JEWEILIGEN AUTOREN.
// AENDERUNGEN IN DIESER DATEI ERFOLGEN AUF EIGENE GEFAHR!
// ES IST NICHT GESTATTET, DEN COPYRIGHTHINWEIS ZU AENDERN ODER ZU
// ENTFERNEN. NUR WENN SIE EINE COPYRIGHTHINWEIS-ENTFERNUNG BESTELLT
// HABEN, DUERFEN SIE DIESEN ENTFERNEN.
//================================================================
// BEI FRAGEN WENDEN SIE SICH BITTE AN: KONTAKT@DREAM4.DE
//=================================================================
if(!defined('START_PATH')) exit;
if(VERSION != 'PRO') 
{
	refer("index.php");
	exit;
}

if(!get_active('shop') || @!file_exists(BASE_DIR . '/class/Class.Shop.php'))
{
	 not_active();
} else {
	if(!permission('shop'))
	{
		noperm();
	} else {
		$_SESSION['shop_visit'] = 1;
		$_REQUEST['action'] = (isset($_REQUEST['action']) && !empty($_REQUEST['action'])) ? $_REQUEST['action'] : 'start';
		$_REQUEST['cid'] = (isset($_REQUEST['cid']) && !empty($_REQUEST['cid'])) ? eregi_replace('[^0-9]', '', $_REQUEST['cid']) : '0';
		$_REQUEST['limit'] = (isset($_REQUEST['limit']) && !empty($_REQUEST['limit'])) ? eregi_replace('[^0-9]', '', $_REQUEST['limit']) : '';
		$_REQUEST['parent'] = (isset($_REQUEST['parent']) && !empty($_REQUEST['parent'])) ? eregi_replace('[^0-9]', '', $_REQUEST['parent']) : '0';
		$_REQUEST['navop'] = (isset($_REQUEST['navop']) && !empty($_REQUEST['navop'])) ? eregi_replace('[^0-9]', '', $_REQUEST['navop']) : '0';
		$_REQUEST['shop_q'] = (isset($_REQUEST['shop_q']) && !empty($_REQUEST['shop_q'])) ? eregi_replace('[^ #.A-Za-zÀ-ÖØ-öø-ÿ0-9-]', '', $_REQUEST['shop_q']) : '';
		$_REQUEST['man'] = (isset($_REQUEST['man']) && !empty($_REQUEST['man'])) ? eregi_replace('[^0-9]', '', $_REQUEST['man']) : '0';
		$_REQUEST['payment_id'] = (isset($_REQUEST['payment_id']) && !empty($_REQUEST['payment_id'])) ? eregi_replace('[^0-9]', '', $_REQUEST['payment_id']) : '';
		
		
	
		if($Shop->noNettoDisplay($_SESSION['user_country']))
		{
			$GLOBALS['tmpl']->assign('hide_vat_details', 1);
		}
		
		switch($_REQUEST['action'])
		{
			case 'quicksearch':
				$Shop->AjQuickSearch($_REQUEST['q']);
			break;
			
			case 'start':
				$Shop->shopStart();
			break;
			
			case 'showproducts':
				$Shop->browseShop();
			break;
			
			case 'showproduct':
				$Shop->displayProduct();
			break;
			
			case 'to_cart':
				$Shop->addToCart();
			break;
			
			case 'to_wishlist':
				$Shop->addToCart(1);
			break;
			
			case 'showseenproducts':
				$Shop->listAllSeenProducts('showall');
			break;
			
			case 'showbasket':
				$Shop->showBasket();
			break;
			
			
			case 'mylist':
				$Shop->showMyList();
			break;
			
			case 'delitem':
				$Shop->deleteItem($_REQUEST['product_id']);
			break;
			
			case 'delitem_mylist':
				$Shop->deleteItem($_REQUEST['product_id'],1);
			break;
			
			case 'new_list':
				$Shop->newList();
			break;
			
			case 'shoporder':
				$Shop->shopOrder();
			break;
			
			case 'myorders':
				$Shop->myOrders();
			break;
			
			case 'shippingcost':
				$Shop->shippingCosts();
			break;
			
			case 'mydownloads':
				$Shop->myDownloads();
			break;
			
			case 'dataprotect':
				$Shop->shopInfpage('dataprotect');
			break;
			
			case 'agb':
				$Shop->shopInfpage('agb');
			break;
			
			case 'payment_info':
				$Shop->paymentInfo($_REQUEST['id']);
			break;
			
			case 'thankyou_paypal':
			break;
			
			case 'delbasket':
				$Shop->unsetShopSessions();
				header('Location:index.php?p=shop&action=showbasket');
				exit;
			break;
		}
	}
}
?>