<!DOCTYPE html>
<?
session_start();
include('config.php');
include('functions.php');
if($xml = simplexml_load_file('http://api.napiarfolyam.hu/?valuta=eur&bank=cib')){
	$eur = objectsIntoArray($xml);
	$_SESSION['eur'] = $eur['valuta']['item']['eladas'];
}
if($_GET['task'] == 'kosar_torles'){
	unset($_SESSION['kosar_tomb']);
	unset($_SESSION['rend_szamlalo']);
	unset($_SESSION['sum_price']);
	unset($_SESSION['sum_db']);
	unset($_SESSION['sum_db_posta']);
	session_destroy();
	header('Location:index.php');
}
?>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="hu" />
<meta name="Keywords" content="webshop, rendelés, order, bolt, online " />
<meta name="description" content="NEMESHAZI Photo-Shop" />
<meta name="Designer" content="SH-MEDIA" />
<meta name="Author" content="SH-MEDIA" />
<meta name="Robots" content="index,follow" />
<meta property="og:type" content="website"/>
<meta property="og:title" content="NEMESHAZI Phoso-Shop"/>
<meta http-equiv="content-language" content="HU" />
<link href='https://fonts.googleapis.com/css?family=Handlee' rel='stylesheet' type='text/css'>
<link href="css/webshop.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/responsivemultimenu.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="css/jquery-ui-slider-pips.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui.structure.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui.theme.css" />
<link rel="stylesheet" href="colorbox-master/example2/colorbox.css" />
<script type="text/javascript" src="js/gen_validatorv31.js"></script>
<script type="text/javascript" src="js/jquery-ui-slider-pips.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>
<script src="colorbox-master/jquery.colorbox.js"></script>
<title>NEMESHAZI Photo-Shop</title>
<script type="text/javascript">
function kat_show(a){
	window.location="?fo_kat="+a;
}
function init(){
	$("#kosar").empty().html('Load basker...');
	var url = "kosar.php";	
	$("#kosar").load(url);
}
function order (){ 
	if($('#db').val() == 'v') { alert('Choose number of piece!'); return false; }
	if($('#anyag').val() == 'v') { alert('Choose type of material!'); return false; }
	var url = encodeURI("kosar.php?id="+$('#id').val()+"&meret="+$('#width').html()+","+$('#height').html()+"&db="+$('#db').val()+"&anyag="+$('#anyag').val()+"&ar="+$('#ar_tetel').val().replace(/^[^0-9]+/, ''));
	$('#kosar').load(url);
}

function ar_kalk(){	
	if($('#anyag').val() == 'v') { return false; }
	else if($('#anyag').val() == 'Digital'){
		$('#db').val('1')
		$('#materialSelector').css('display','none')	
	} else {
		$('#materialSelector').css('display','block')
	}
	if($('#db').val() == 'v') { return false; }
	if($('#anyag').val() != 'Digital' && $('#widthSelector').val() == 'Choose'){ 
		return false
	
	}
	var url = encodeURI('ar_kalk.php?db='+$('#db').val()+'&anyag='+$('#anyag').val()+'&meret='+$('#width').html()+','+$('#height').html());
	$.get(url, function(data){	
		if (data.indexOf("x") >= 0){
			$('#kosarba_rak').css('display','none');
			$('#ft').html('');
			$('#ft_eur').html('');
			$('#ar_prod').html('');
			$('#ar_prod_eur').html();
			$('#ar_tetel').val('');
			alert('SOLD OUT!');
		} else {	
			$('#kosarba_rak').css('display','block');
			$('#ft').html(' HUF + VAT');
			$('#ft_eur').html(' EUR + VAT');
			$('#ar_tetel').val(data);
			$('#ar_prod').html(data);
			eur = Math.round(parseInt(data) / parseInt($('#eurMain').val()));
			$('#ar_prod_eur').html(eur);
		}
    });
}
$(document).ready(function(){
	$(".group1").colorbox({rel:'group1'});
});
</script>
</head>
<body onload="init()">
<input type="hidden" id="eurMain" value="<?=$_SESSION['eur']?>" />
<div style="position:fixed !important; top:0px; left:0px; background:#CCC; font-size:13px; padding:5px; border-bottom-right-radius:10px; opacity:.7; box-shadow:3px 3px 3px #666;">
	<div id="kosar" style="float:left; margin:0px 30px 0px 0px;"></div>            
	<div class="kosar_reszletes" style="float:left;">        
		<a href="?task=kosar_tartalma" target="_self">Basket</a> | <a href="?task=kosar_torles" target="_self">Clear basket</a>        
	</div>
</div>
<div class="container">
	<div class="header">
		<a href="http://<? echo $_SERVER['HTTP_HOST']; ?>">
        	<div class="logo">
            	Peter Nemeshazi Photo Shop
            </div>
        </a>
    	<div class="clr"></div>
        <? include('menu_show_horizontal.php'); ?>
        <div class="clr"></div> 
	</div>
  	<div class="content">
    	<?
		if(!@isset($_GET['task'])){
   		
			include('main.php');
		
		} elseif($_GET['task'] == 'showprod'){
   		
			include('show_prod.php'); 
		
		} elseif($_GET['task'] == 'kosar_tartalma'){
		
			include('kosar_tartalma.php');
		
		} elseif($_GET['task'] == 'rendel'){
		
			include('rendel.php');
		
		} elseif($_GET['task'] == 'bank_kartya_vissza'){
		
			include('w/back.php');
		
		}?>
  	</div>
  	<div style="clear:both;"></div>
</div>
<div>
	<ul class="list_rules">
      	<li><a href="mailto:info@nemeshazi.com" target="_blank">If you have any problems, don't hesitate to contact us by e-mail or phone.</a></li>
      	<li><a href="vasarlasi_feltetelek.html" rel="lytebox" data-title="" data-lyte-options="group:product" >Terms and conditions</a></li>
    </ul>
</div>
<div class="clr"></div>
<div class="footer">
	<p>&copy; <a href="mailto:info@nemeshazi.com">Peter Nemeshazi Photo Shop</a></p>
</div>
</body>
</html>