<?php
//This code is copyright (c) ViciSoft SL, all rights reserved.
//The contents of this file are protected under law as the intellectual property 
//of ViciSoft SL. Any use, reproduction, disclosure or copying of any kind 
//without the express and written permission of ViciSoft SL is forbidden.
//Author: Vince Reid, vincereid@gmail.com
global $customeraccounturl,$forceloginonhttps,$minicssaction,$thesessionid;
if(@$GLOBALS['xxCkCoVC']=='') $GLOBALS['xxCkCoVC']='Please click checkout to view your cart contents.';
$GLOBALS['alreadygotadmin']=getadminsettings();
if(!@isset($GLOBALS['extension'])) $GLOBALS['extension']='.php';
if(@$GLOBALS['cartpageonhttps']&&@$GLOBALS['storeurlssl']!='') $pageurl=@$GLOBALS['storeurlssl']; else $pageurl=$GLOBALS['storeurl'];
$thesessionid=str_replace("'",'',getpost('sessionid')!=''?getpost('sessionid'):getsessionid());
if(@$minicssaction=='onelineminicart' || @$minicssaction=='minicart' || @$minicssaction==''){
	$useEuro=false;
	$mcgndtot=0;
	$totquant=0;
	$shipping=0;
	$mcdiscounts=0;
	if(@$_SESSION['xscountrytax']!='') $xscountrytax=$_SESSION['xscountrytax']; else $xscountrytax=0;
	$optPriceDiff=0;
	$mcpdtxt='';
	if(@$_POST['mode']=='checkout'){
		if(@$_POST['checktmplogin']=='x'){
			$_SESSION['clientID']=NULL; unset($_SESSION['clientID']);
		}elseif(@$_POST['checktmplogin']!=''){
			$sSQL="SELECT tmploginname FROM tmplogin WHERE tmploginid='" . escape_string(@$_POST['sessionid']) . "' AND tmploginchk='" . escape_string(@$_POST['checktmplogin']) . "'";
			$result=ect_query($sSQL) or ect_error();
			if($rs=ect_fetch_assoc($result))
				$_SESSION['clientID']=$rs['tmploginname'];
		}
	}
	$sSQL='SELECT cartID,cartProdID,cartProdName,cartProdPrice,cartQuantity,SUM(coPriceDiff) AS sumDiff FROM cart LEFT JOIN cartoptions ON cart.cartID=cartoptions.coCartID WHERE cartCompleted=0 AND ' . getsessionsql() . ' GROUP BY cartID,cartProdID,cartProdName,cartProdPrice,cartQuantity ORDER BY cartID';
	$result=ect_query($sSQL) or ect_error();
	while($rs=ect_fetch_assoc($result)){
		$optPriceDiff=0;
		$mcpdtxt.='<div class="minicartcnt">' . $rs['cartQuantity'] . ' ' . $rs['cartProdName'] . '</div>';
		if(! is_null($rs['sumDiff'])) $optPriceDiff=$rs['sumDiff'];
		$subtot=(($rs['cartProdPrice']+$optPriceDiff)*(int)$rs['cartQuantity']);
		$totquant+=(int)$rs['cartQuantity'];
		$mcgndtot+=$subtot;
	}
	ect_free_result($result);
}elseif(@$minicssaction=='minilogin' || @$minicssaction=='onelineminilogin' || @$minicssaction=='miniloginbutton'){
	if(@$GLOBALS['enableclientlogin']) displaysoftlogin();
	$pageqs='';
	foreach(@$_GET as $objQS=>$objValue)
		if(!($objQS=='mode' && ($objValue=='login' || $objValue=='logout')) && gettype($objValue)=='string') $pageqs.=($pageqs!=''?'&':'').$objQS . '=' . $objValue;
	if(@$forceloginonhttps && (@$_SERVER['HTTPS']!='on' && @$_SERVER['SERVER_PORT']!='443') && (str_replace('http:','https:',@$GLOBALS['storeurl'])!=@$GLOBALS['storeurlssl'])) $pagename=''; else $pagename=str_replace('"','',strip_tags(@$_SERVER['PHP_SELF'])).($pageqs!=''?'?'.$pageqs:'');
}
if($minicssaction=="contactform"){
	$contactformcommentsrequired=!isset($GLOBALS['contactformcommentsrequired']) || $contactformcommentsrequired;
	$loginsuccess=TRUE;
	$afcaction=7;
	$thanksmessage=@$GLOBALS['contactusthanks'];
	$errormessage='';
?>
<script>
var xxPlsEntr="<?php print jscheck($GLOBALS['xxPlsEntr'])?>";
var xxValEm="<?php print jscheck($GLOBALS['xxValEm'])?>";
function checkcontactusform(theform){
	var ob;
	if(!chkenter('cfyourname',"<?php print jscheck($GLOBALS['xxEFNam'])?>"))return false;
	if(!chkenter('cfyouremail',"<?php print jscheck($GLOBALS['xxEFEm'])?>"))return false;
	if(!ectchkemail('cfyouremail'))return false;
		for(var index=1;index<=9;index++){
			if(ob=ectById('cfcontactusparam'+index)){
				var tval='';
				fieldtype=(ob.type?ob.type:'radio');
				if(fieldtype=='text'||fieldtype=='textarea'||fieldtype=='password'){
					tval=ob.value;
					if(ectById('coureq'+index)&&!chkenter('cfcontactusparam'+index,ectById('coutxt'+index).innerHTML))return false;
				}else if(fieldtype=='select-one'){
					tval=ob[ob.selectedIndex].value;
					if(ectById('coureq'+index)&&!chkenter('cfcontactusparam'+index,ectById('coutxt'+index).innerHTML))return false;
				}else if(fieldtype=='radio'){
					for(var ii=0;ii<ob.length;ii++)if(ob[ii].checked)tval=ob[ii].value;
				}else if(fieldtype=='checkbox')
					if(ob.checked)tval=ob.value;
			}
		}
<?php	if($contactformcommentsrequired){ ?>
	if(!chkenter('cfyourcomments',"<?php print jscheck($GLOBALS['xxEFCmt'])?>"))return false;
<?php	}
		if(recaptchaenabled(2)) print 'if(!contactformcaptchaok){ alert("' . jscheck($GLOBALS['xxRecapt']) . '");return(false); }' ?>
	return true;
}
</script>
<?php
	if(getpost("posted")=="1"){
		print '<div class="contactform">' . "\n";
			print '<div class="contactformthanks">' . "\n";
				if(recaptchaenabled(2)) $loginsuccess=checkrecaptcha($loginerror);
				if($loginsuccess){
					$loginerror=$GLOBALS['xxEmExi'];
					ect_query("DELETE FROM ajaxfloodcontrol WHERE afcAction=".$afcaction." AND afcDate<'" . date('Y-m-d H:i:s',time()-(30)) . "'") or ect_error();
					$sSQL="SELECT afcID FROM ajaxfloodcontrol WHERE afcAction=".$afcaction." AND (afcIP='" . escape_string($REMOTE_ADDR) . "' OR afcSession='" . escape_string(session_id()) . "')";
					$result=ect_query($sSQL) or ect_error();
					$dofloodcontrol=ect_num_rows($result)>0;
					ect_free_result($result);
				}
				if(!$loginsuccess)
					print $errormessage=strip_tags($loginerror);
				elseif($dofloodcontrol){
					$loginsuccess=FALSE;
					print $errormessage=$GLOBALS['xxCoUsFC'];
				}elseif(checkminicssuserblock()){
					$loginsuccess=FALSE;
					print $errormessage=$multiemfblockmessage;
				}else{
					$toemail=$emailAddr;
					$yourname=strip_tags(getpost('nm'));
					$youremail=strip_tags(getpost('ye'));
					$yourcomments=strip_tags(getpost('yc'));
					if($GLOBALS['htmlemails']) $yourcomments=strreplace(array("\r","\n"),array('',"\r\n<br>"),$yourcomments);
					$theprodid=strip_tags(getpost('pid'));
					$replyto=$youremail;
					$subject=@$contactussubject==''?'Contact Us':strreplace(array('%name%','%pid%'),array($yourname,$theprodid),$contactussubject);
					$emlmessage='Name: ' . $yourname . $emlNl;
					$service='contactus';
					if(@$GLOBALS['contactusemail']!='') $toemail=$GLOBALS['contactusemail'];
					for($index=1;$index<=9;$index++){
						eval('$contactusparam=@$contactusparam'.$index.';');
						if($contactusparam!=''){
							$emlmessage.=$contactusparam . ' : ' . strip_tags(getpost('aqex'.$index)) . $emlNl;
						}
					}
					$emlmessage.=$emlNl . $yourcomments;
					if($loginsuccess){
						dosendemail($toemail,$emailAddr,$replyto,$subject,$emlmessage);
					}
					$sSQL="INSERT INTO ajaxfloodcontrol (afcAction,afcIP,afcSession,afcDate) VALUES (".$afcaction.",'" . escape_string($REMOTE_ADDR) . "','" . escape_string(session_id()) . "','" . date('Y-m-d H:i:s') . "')";
					ect_query($sSQL) or ect_error();
				}
				if($errormessage!='')
					print '<div class="ectwarning">' . $errormessage . '</div>';
				else{
					print $GLOBALS['xxMesSuc'] . ($thanksmessage!=''?'<div class="ectsfthanks">' . $thanksmessage . '</div>':'');
					print '<meta http-equiv="refresh" content="4; url=' . $GLOBALS['storeurl'] . '">';
				}
			print '</div>' . "\n";
		print '</div>' . "\n";
	}else{
		print '<form action="" method="post" onsubmit="return checkcontactusform()">' . "\n";
			writehiddenvar("minicssaction", $minicssaction);
			writehiddenvar("posted", "1");
			print '<div class="contactform">'."\n";
				print '<div class="contactformheader"><h1>' . $GLOBALS['xxContUs'] . '</h1></div>'."\n";
				print '<div class="contactformblurb">' . $GLOBALS['xxCUBlur'] . '</div>'."\n";
				print '<div class="ectsf2col"><div class="redstar">' . labeltxt($GLOBALS['xxEFNam'],'cfyourname') . '</div><div><input name="nm" class="ecttextinput" type="text" id="cfyourname" placeholder="' . placeholder($GLOBALS['xxEFNam']) . '" aria-required="true"></div></div>'."\n";
				print '<div class="ectsf2col"><div class="redstar">' . labeltxt($GLOBALS['xxEFEm'],'cfyouremail') . '</div><div><input name="ye" class="ecttextinput" type="text" id="cfyouremail" placeholder="' . placeholder($GLOBALS['xxEFEm']) . '" aria-required="true"></div></div>'."\n";
				for($index=1;$index<=9;$index++){
					eval('$contactusparam=@$GLOBALS["contactusparam'.$index.'"];');
					eval('$contactusrequired=@$GLOBALS["contactusrequired'.$index.'"];');
					eval('$contactushtml=@$GLOBALS["contactushtml'.$index.'"];');
					if($contactusparam!=''){
						print '<div class="ectsf2col couonly"><div' . ($contactusrequired?' class="redstar"':'') . '>';
						if($contactusrequired) print '<input type="hidden" id="coureq'.$index.'" value="1">';
						print '<label id="coutxt'.$index.'" for="contactusparam'.$index.'" class="ectlabel">' . $contactusparam . '</label></div><div>'."\n";
						if($contactushtml!='') print strreplace('ectfield','contactusparam'.$index,$contactushtml); else print '<input name="aqex'.$index.'" class="ecttextinput" type="text" id="contactusparam'.$index.'" placeholder="' . placeholder($contactusparam) . '"' . ($contactusrequired?' aria-required="true"':'') . '>'."\n";
						print '</div></div>'."\n";
					}
				}
				print '<div class="ectsf2col"><div class="' . ($contactformcommentsrequired?'redstar':'') . '">' . labeltxt($GLOBALS['xxEFCmt'],'cfyourcomments') . '</div><div><textarea name="yc" class="contactcomments ecttextinput" id="cfyourcomments" placeholder="' . placeholder($GLOBALS['xxEFCmt']) . '" aria-required="true"></textarea></div></div>'."\n";
				if(recaptchaenabled(2)){
					print '<div class="ectsf2col"><div></div><div id="contactformcaptcha"></div>'."\n";
					displayrecaptchajs('contactformcaptcha',TRUE,FALSE);
					print "</div>\n";
				}
				print '<div class="ectsf2col"><div>&nbsp;</div>';
				print '<div>' . imageorsubmittag('',$GLOBALS['xxSend'],'contactformsend','') . '</div></div>'."\n";
			print '</div>'."\n";
		print '</form>'."\n";
	}
}elseif(@$minicssaction=='contactus'){
	if(@$GLOBALS['usecontactus']) displaysoftlogin(); ?>
<div class="<?php print @$GLOBALS['isectshortcode']?'ectcontactbutton':'minicart'?>">
	<div class="minicartcnt"><?php print imageorbuttontag(@$GLOBALS['imgminicsscontact'],@$GLOBALS['usecontactus']?$GLOBALS['xxMCCoUs']:'DISABLED','mincart',(@$GLOBALS['usecontactus']?'display':'disabled')."ectcontact('contactus','')",TRUE) ?></div>
</div>
<?php
}elseif(@$minicssaction=='recentview'){
	if(getpost('mode')!='checkout'){
		if(@$GLOBALS['recentviewlayout']=='') $GLOBALS['recentviewlayout']='productname,productimage,category';
		$recentviewlayoutarray=explode(',',strtolower(str_replace(' ','',$GLOBALS['recentviewlayout'])));
		$sSQL='SELECT rvProdID,'.getlangid('pName',1).',pSection,rvProdURL,pStaticPage,'.getaltlang('pStaticURL',8388608).','.getlangid('sectionName',256).','.getlangid('sectionurl',2048)." FROM (recentlyviewed INNER JOIN products ON recentlyviewed.rvProdID=products.pID) INNER JOIN sections ON products.pSection=sections.sectionID WHERE rvProdID<>'".escape_string(@$prodid)."' AND " . (@$_SESSION['clientID']!='' ? 'rvCustomerID=' . escape_string(@$_SESSION['clientID']) : "(rvCustomerID=0 AND rvSessionID='".$thesessionid."')").' ORDER BY rvDate DESC';
		$result=ect_query($sSQL) or ect_error();
		if(ect_num_rows($result)>0){
			if(@$GLOBALS['recentviewlink']=='') $GLOBALS['recentviewlink']=(@$GLOBALS['seocategoryurls']?str_replace('%s','',$GLOBALS['seoprodurlpattern']):'products'.$GLOBALS['extension']).'?recentview=true'?>
		  <div class="recentview">
			<div class="recentviewheader"><img src="images/recentview.png" style="vertical-align:text-top;" alt="<?php print $GLOBALS['xxRecVie']?>">
				&nbsp;<a class="ectlink recentview" href="<?php print $GLOBALS['recentviewlink']?>"><?php print $GLOBALS['xxRecVie']?></a></div>
<?php		while($rs=ect_fetch_assoc($result)){
				$thedetailslink=getdetailsurl($rs['rvProdID'],$rs['pStaticPage'],$rs[getlangid('pName',1)],trim($rs['pStaticURL']),'',$GLOBALS['pathtohere']);
				print '<div class="recentviewline ectclearfix">';
				foreach($recentviewlayoutarray as $layoutoption){
					if($layoutoption=='productimage'){
						$sSQL="SELECT imageSrc FROM productimages WHERE imageType=0 AND imageProduct='".escape_string($rs['rvProdID'])."' ORDER BY imageNumber LIMIT 0,1";
						$result2=ect_query($sSQL) or ect_error();
						if($rs2=ect_fetch_assoc($result2)) $recentimage=$rs2['imageSrc']; else $recentimage='';
						ect_free_result($result2);
						if($recentimage!=''){ ?>
				<div class="recentviewimage">
					<a class="ectlink recentview" href="<?php print $thedetailslink?>"><img class="recentviewimage" src="<?php print $recentimage?>" alt="<?php print strip_tags($rs[getlangid("pName",1)])?>"></a>
				</div>
<?php					}
					}elseif($layoutoption=='category'){
						if(trim($rs['sectionurl'])!='')
							$recentsection=getcatid($rs['sectionurl'],$rs['sectionurl'],$GLOBALS['seoprodurlpattern']);
						else
							$recentsection=(@$GLOBALS['seocategoryurls']?'':'products'.$GLOBALS['extension'].'?cat=') . getcatid($rs['pSection'],$rs[getlangid('sectionName',256)],$GLOBALS['seoprodurlpattern']); ?>
				<div class="recentviewcategory">
					<a class="ectlink recentview" href="<?php print $recentsection?>"><?php print $rs[getlangid('sectionName',256)]?></a>
				</div>
<?php				}elseif($layoutoption=='productname'){ ?>
				<div class="recentviewname">
					<a class="ectlink recentview" href="<?php print $thedetailslink?>"><?php print $rs[getlangid('pName',1)]?></a>
				</div>
<?php				}
				}
				print '</div>';
			} ?>		
		  </div>
<?php	}
		ect_free_result($result);
	}
}elseif(@$minicssaction=='minilogin'){ ?>
<div class="minicart">
	<div class="minicartcnt">
	<img src="<?php print $GLOBALS['pathtohere']?>images/minipadlock.png" style="vertical-align:text-top;" alt="">
<?php	if(@$_SESSION['clientID']!='' && @$customeraccounturl!=''){ ?>
			&nbsp;<a class="ectlink mincart" href="<?php print $customeraccounturl?>"><?php print $GLOBALS['xxYouAcc']?></a>
<?php	}else{
            print '&nbsp;'.$GLOBALS['xxMLLIS'];
		} ?>
	</div>
<?php	if(!@$GLOBALS['enableclientlogin']){ ?> 
	<div class="minicartcnt">Client login not enabled</div>
<?php	}elseif(@$_SESSION['clientID']!=''&&@$_GET['mode']!='logout'){ ?>
	<div class="minicartcnt"><?php print $GLOBALS['xxMLLIA']?><br><?php print htmlspecials($_SESSION['clientUser'])?></div>
	<div class="minicartcnt"><?php print imageorbuttontag(@$GLOBALS['imgminicsslogout'],@$GLOBALS['xxLogout'],'ectlink mincart','dologoutaccount()',TRUE)?></div>
<?php	}else{ ?>
	<div class="minicartcnt"><?php print $GLOBALS['xxMLNLI']?></div>

	<div class="minicartcnt"><?php print imageorbuttontag(@$GLOBALS['imgminicsslogin'],@$GLOBALS['xxLogin'],'ectlink mincart',"displayloginaccount()",TRUE)?></div>
<?php	} ?>
</div>
<?php
}elseif(@$minicssaction=='miniloginbutton'){
	if(!@$GLOBALS['enableclientlogin']){
		print 'Client login not enabled';
	}elseif(@$_SESSION['clientID']!=''&&@$_GET['mode']!='logout'){
		print imageorbuttontag(@$GLOBALS['imgminicsslogout'],@$GLOBALS['xxLogout'].': '.$_SESSION['clientUser'],'miniloginbutton','dologoutaccount()',TRUE);
	}else
		print imageorbuttontag(@$GLOBALS['imgminicsslogin'],@$GLOBALS['xxLogin'],'miniloginbutton','displayloginaccount()',TRUE);
}elseif(@$minicssaction=='onelineminilogin'){
	$startlink='';
	$endlink='';
	if(@$_SESSION['clientID']!='' && @$customeraccounturl!=''){
		$startlink='<a class="ectlink mincart" href="' . @$customeraccounturl . '">';
		$endlink='</a>';
	}
?>
<div class="minicartoneline">
	<div class="minicartoneline1"><?php print $startlink?><img src="<?php print $GLOBALS['pathtohere']?>images/minipadlock.png" alt=""><?php print $endlink?></div>
<?php	if(!@$GLOBALS['enableclientlogin']){ ?>
	<div class="minicartoneline1">Client login not enabled</div>
<?php	}elseif(@$_SESSION['clientID']!=''&&@$_GET['mode']!='logout'){ ?>
	<div class="minicartoneline2"><?php print $startlink . $GLOBALS['xxMLLIA'].' '.htmlspecials($_SESSION['clientUser']) . $endlink?></div>
	<div class="minicartoneline3"><?php print imageorbuttontag(@$GLOBALS['imgminicsslogout'],@$GLOBALS['xxLogout'],'ectlink mincart','dologoutaccount()',TRUE)?></div>
<?php	}else{ ?>
	<div class="minicartoneline2"><?php print $GLOBALS['xxMLNLI']?></div>
	<div class="minicartoneline3"><?php print imageorbuttontag(@$GLOBALS['imgminicsslogin'],@$GLOBALS['xxLogin'],'ectlink mincart','displayloginaccount()',TRUE)?></div>
<?php	} ?>
</div>
<?php
}elseif(@$minicssaction=='minisignup'){
	if(@$_SESSION['MLSIGNEDUP']==TRUE || @$_POST['mode']=='mailinglistsignup'){
		print '<div class="minimailsignup">'.$GLOBALS['xxThkSub'].'</div>';
	}else{
		$therp=strip_tags(@$_SERVER['PHP_SELF'] . (@$_SERVER['QUERY_STRING'] !='' ? '?' . @$_SERVER['QUERY_STRING'] : ''));
?>
<script>/* <![CDATA[ */
function mlvalidator(frm){
	var mlsuemail=document.getElementById('mlsuname');
	if(mlsuemail.value==""){
		alert("<?php print jscheck($GLOBALS['xxPlsEntr'] . ' "' . $GLOBALS['xxName'])?>\".");
		mlsuemail.focus();
		return(false);
	}
	var mlsuemail=document.getElementById('mlsuemail');
	if(mlsuemail.value==""){
		alert("<?php print jscheck($GLOBALS['xxPlsEntr'] . ' "' . $GLOBALS['xxEmail'])?>\".");
		mlsuemail.focus();
		return(false);
	}
	var regex=/[^@]+@[^@]+\.[a-z]{2,}$/i;
	if(!regex.test(mlsuemail.value)){
		alert("<?php print jscheck($GLOBALS['xxValEm'])?>");
		mlsuemail.focus();
		return(false);
	}
	document.getElementById('mlsectgrp1').value=(document.getElementById('mlsuemail').value.split('@')[0].length);
	document.getElementById('mlsectgrp2').value=(document.getElementById('mlsuemail').value.split('@')[1].length);
	return (true);
}
/* ]]> */
</script>
<div class="minimailsignup">
	<form action="cart<?php print $GLOBALS['extension']?>" method="post" onsubmit="return mlvalidator(this)">
		<input type="hidden" name="mode" value="mailinglistsignup">
		<input type="hidden" name="mlsectgrp1" id="mlsectgrp1" value="7418">
		<input type="hidden" name="mlsectgrp2" id="mlsectgrp2" value="6429">
		<input type="hidden" name="rp" value="<?php print str_replace('&','&amp;',str_replace(array('<','"'),'',$therp))?>">
		<input type="hidden" name="posted" value="1">
		<div class="minimailcontainer">
			<label class="minimailsignup" for="mlsuname"><?php print $GLOBALS['xxName']?></label>
			<input class="ecttextinput minimailsignup" type="text" name="mlsuname" id="mlsuname" value="" maxlength="50">
		</div>
		<div class="minimailcontainer">
			<label class="minimailsignup" for="mlsuemail"><?php print $GLOBALS['xxEmail']?></label>
			<input class="ecttextinput minimailsignup" type="text" name="mlsuemail" id="mlsuemail" value="" maxlength="50">
		</div>
		<div class="minimailcontainer">
			<?php print imageorsubmit(@$imgmailformsubmit, $GLOBALS['xxSubmt'], 'minimailsignup minimailsubmit')?>
		</div>
	</form>
</div>
<?php
	}
}elseif(@$minicssaction=='onelineminicart'){
	if($mcpdtxt!=''&&@$_SESSION['discounts']!=''&&!@$GLOBALS['nopriceanywhere']) $mcdiscounts=(float)$_SESSION['discounts'];
?>
<div class="minicartoneline">
<?php	if(@$_POST['mode']=='movetocart'){ ?>  
	<div class="minicartoneline1"><?php print $GLOBALS['xxCkCoVC']?></div>
<?php	}elseif(@$_POST['mode']=='update'){ ?> 
	<div class="minicartoneline1"><?php print $GLOBALS['xxMainWn']?></div>
<?php	}else{ ?>
	<div class="minicartoneline1"><span class="ectMCquant"><?php print $totquant . '</span> ' . $GLOBALS['xxMCIIC'] ?> | </div>
	<div class="minicartoneline2"><?php print $GLOBALS['xxTotal'] . ' <span class="ectMCtot">' . FormatEuroCurrency($mcgndtot-$mcdiscounts)?></span> | </div>
<?php	} ?>
	<div class="minicartoneline3"> <img src="<?php print $GLOBALS['pathtohere']?>images/littlecart1.png" style="vertical-align:text-top;" width="16" height="16" alt=""> &nbsp;<a class="ectlink mincart" href="<?php print $pageurl?>cart<?php print $GLOBALS['extension']?>"><?php print $GLOBALS['xxMCSC']?></a></div>
</div>
<?php
}else{
	$thispage=str_replace(array('.php','/'),'',basename(@$_SERVER['REDIRECT_SCRIPT_URL']!=''?$_SERVER['REDIRECT_SCRIPT_URL']:@$_SERVER['PHP_SELF']));
?>
<div class="minicart">
	<div class="minicartcnt">
	<img src="<?php print $GLOBALS['pathtohere']?>images/littlecart1.png" style="vertical-align:text-top;" width="16" height="16" alt=""> &nbsp;<a class="ectlink mincart" href="<?php print $pageurl?>cart<?php print $GLOBALS['extension']?>"><?php print $GLOBALS['xxMCSC']?></a>
	</div>
<?php	if(@$_POST['mode']=='movetocart'){ ?>  
	<div class="minicartcnt" style="padding:30px 3px 10px"><?php print $GLOBALS['xxCkCoVC']?></div>
<?php	}elseif(@$_POST['mode']=='update'||$thispage=='cart'){ ?> 
	<div class="minicartcnt" style="padding:30px 3px 10px"><?php print $GLOBALS['xxMainWn']?></div>
<?php	}else{ ?>
	<div class="minicartcnt"><span class="ectMCquant"><?php print $totquant . '</span> ' . $GLOBALS['xxMCIIC'] ?></div>
	<div class="mcLNitems"><?php print $mcpdtxt?></div>
<?php		if($mcpdtxt!=''&&@$_SESSION['discounts']!='')$mcdiscounts=(float)$_SESSION['discounts']; ?>
	<div class="ecHidDsc minicartcnt"<?php if($mcdiscounts==0) print ' style="display:none"'?>><span class="minicartdsc"><?php print $GLOBALS['xxDscnts'] . ' <span class="mcMCdsct">' . FormatEuroCurrency($mcdiscounts)?></span></span></div>
<?php			if($mcpdtxt!='' && (string)@$_SESSION['xsshipping']!=''){
					$shipping=(float)$_SESSION['xsshipping'];
					if($shipping==0) $showshipping=' minicartdsc">'.$GLOBALS['xxFree']; else $showshipping='">'.FormatEuroCurrency($shipping); ?>
   	<div class="minicartcnt"><?php print $GLOBALS['xxMCShpE'] . ' <span class="ectMCship' . $showshipping.'</span>'?></div>
<?php		}
			if($mcpdtxt=='') $xscountrytax=0;
			if(!@$GLOBALS['nopriceanywhere']){ ?>
	<div class="minicartcnt"><?php print $GLOBALS['xxTotal'] . ' <span class="ectMCtot">' . FormatEuroCurrency(($mcgndtot+$shipping+$xscountrytax)-$mcdiscounts)?></span></div>
<?php		}
		}
		if($thispage!='cart'){ ?>
	<div class="minicartcnt"><?php print imageorbuttontag(@$GLOBALS['imgminicsslogin'],@$GLOBALS['xxMCCO'],'ectlink mincart',$pageurl . 'cart' . $GLOBALS['extension'],FALSE)?></div>
<?php	} ?>
</div>
<?php
} ?>