<?php include_once APP_PATH.'template/darkish/header.php';?>

		<div class="content">
		
		<?php if (!PAGE_ACTIVE) { ?>
		<div class="status-failure"><?php echo $tl["errorpage"]["ep"];?></div>
		<?php } ?>
		
		<section class="topsection">
			
			<!-- Heading -->
			<h2 class="entry-title"><?php echo $PAGE_TITLE;?></h2>
			
			<div class="entry-content">
				<?php echo $PAGE_CONTENT;?>
			</div>
			
			<?php if (JAK_SHOPSEARCH) { ?>
			<nav>
			<form action="<?php echo $shopsearch;?>" method="post">
			
			<input type="text" name="search" value="" class="inputsmall" placeholder="<?php echo $tl["shop"]["m77"];?>" />
			
			<button type="submit" class="button big"><?php echo $tl["general"]["g11"];?></button>
			</form>
			</nav>
			<?php } ?>
				
		</section>
		
		<?php if ($E_CURRENCY_CHOOSE) { ?>
		<h3><?php echo $tl["shop"]["m24"];?></h3>
		<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
		
		<select name="currency">
		<?php if (isset($E_CURRENCY_CHOOSE) && is_array($E_CURRENCY_CHOOSE)) foreach($E_CURRENCY_CHOOSE as $c) { ?>
		<option value="<?php echo $c;?>"<?php if ($c == $JAK_CURRENCY) { ?> selected="selected"<?php } ?>><?php echo $c;?></option>
		<?php } ?>
		</select>
		
		<button type="submit" class="button"><?php echo $tl["general"]["g10"];?></button>
		</form>
		<?php } ?>
		
		<?php if ($JAK_SHOP_CAT) { if (isset($JAK_SHOP_CAT) && is_array($JAK_SHOP_CAT)) foreach($JAK_SHOP_CAT as $carray) { 
		
		if ($carray["catparent"] != 0)
			$catexistid[] = $carray["catparent"];
				
		} ?>
		
		<div class="section">
			<div class="c">
				<ul id="nav-shop">
				
				<li><a href="<?php echo BASE_URL;?>" name="all"><?php echo $tl["shop"]["m75"];?></a></li>
		
		<?php if (isset($JAK_SHOP_CAT) && is_array($JAK_SHOP_CAT)) foreach($JAK_SHOP_CAT as $mv) { if ($mv["catparent"] == '0') { ?>
		
		<li><a<?php if ($page == $mv["pagename"] || $page == '' && $mv["catorder"] == 1) { ?> class="active"<?php } ?> href="<?php echo $mv['parseurl'];?>" name="<?php echo $mv["varname"];?>"><?php if ($mv["catimg"]) { ?><img src="<?php echo BASE_URL.$mv["catimg"];?>" alt="navimg" /><?php } ?><?php echo $mv["name"];?></a>
		
		<?php if (is_array($catexistid) && in_array($mv['id'], $catexistid)) { ?>
		
		<div class="drop">
		<span class="top">&nbsp;</span>
		<ul>
		
		<?php if (isset($JAK_SHOP_CAT) && is_array($JAK_SHOP_CAT)) foreach($JAK_SHOP_CAT as $mz) {
		
		if ($mz["catparent"] != '0' && $mz["catparent"] == $mv["id"]) { 
		
		?>
		 
		<li><a href="<?php echo $mz['parseurl'];?>" name="<?php echo $mz["varname"];?>"><?php if ($mz["catimg"]) { ?><img src="<?php echo BASE_URL.$mz["catimg"];?>" alt="navimg" /><?php } echo $mz["name"];?></a></li>
		<?php } } ?>
		</ul>
		<span class="bottom">&nbsp;</span>
		</div>
		</li>
		<?php } else { ?>
		</li>
		
		<?php } } } ?>
		
		</ul>
		</div>
		<div class="b"></div>
		</div>
		
		<?php } ?>
		
		<div class="clear"></div>
		
		<?php if (JAK_SHOPSEARCH && $serrors) { ?>
		<div class="status-failure"><?php echo $serrors["e"].$serrors["e1"].$serrors["e2"];?></div>
		<?php } ?>
		
		<section id="shop-products">
		
		<?php if (isset($JAK_ECOMMERCE_ALL) && is_array($JAK_ECOMMERCE_ALL)) { echo '<ul id="qs-shop">'; foreach($JAK_ECOMMERCE_ALL as $v) { ?>
		
		<li data-id="id-<?php echo $v['id'];?>" data-type="<?php echo $v["catname"];?>"><article class="shop-product">
		
			<figure>
				<?php if ($v['img']) { ?>
				<a href="<?php echo BASE_URL.$v["img"];?>" class="ilightbox">
				<?php } ?>
			    <img class="product-image" src="<?php echo BASE_URL.$v["previmg"];?>" alt="product thumbnail" id="p_<?php echo $v["id"];?>" />
			    <?php if ($v['img']) { ?>
			    </a>
			    <?php } ?>
			
			
			<h2><a<?php if (JAK_PRODUCTOPEN) { echo ' class="lightbox"'; } ?> id="<?php echo $v["id"];?>" href="<?php echo $v['parseurl'];?>"><?php echo $v["title"];?></a></h2>
			
			<p><?php echo $tl["shop"]["m46"].'<strong>'.$v["instock"];?></strong> <?php if ($v["digital"]) echo $tl['shop']['m90'];?></p>
			
			<p><?php if ($v["onsale"]) { echo '<span class="onsale">'.$tl["shop"]["m31"].'</span>'; } else { echo $tl["shop"]["m"]; } echo '<span class="pprice_'.$v["id"].'">'.$v["price"].'</span>&nbsp;'.$JAK_CURRENCY;?></p>
			
			<div class="add-option">
			
			<?php if ($v['product_options']) { ?>
			<select name="product-option" id="po_<?php echo $v["id"];?>" class="product-option">
				<option value=""><?php echo $tl["shop"]["m54"];?></option>
				<?php $poptarray = explode(',', $v['product_options']); for ($i = 0; $i < count($poptarray); $i++) { 
				
					$optearray = explode('::', $poptarray[$i]);
					
					if ($_SESSION['ECOMMERCE_CURRENCY'] != JAK_CURRENCY && $optearray[1] != "0.00") {
					
						$optearray[1] = $convert->Convert($optearray[1], $_SESSION['ECOMMERCE_CURRENCY']);
					}
				
				?>
				
				<option value="<?php echo $poptarray[$i];?>"><?php echo $optearray[0]; if ($optearray[1] != "0.00") { echo ' ('.$optearray[1].'&nbsp;'.$JAK_CURRENCY.')'; }?></option>
				
				<?php } ?>
			</select>
			<input type="hidden" name="pop_<?php echo $v["id"];?>" id="pop_<?php echo $v["id"];?>" value="" />
			<?php } ?>
			
			<?php if ($v['product_options'] && $v['product_options1']) { ?>
			<select name="product-option1" id="po1_<?php echo $v["id"];?>" class="product-option1">
				<option value=""><?php echo $tl["shop"]["m54"];?></option>
				
				<?php $poptarray1 = explode(',', $v['product_options1']); for ($i = 0; $i < count($poptarray1); $i++) { 
				
					$optearray1 = explode('::', $poptarray1[$i]);
					
					if ($_SESSION['ECOMMERCE_CURRENCY'] != JAK_CURRENCY && $optearray[1] != "0.00") {
					
						$optearray1[1] = $convert->Convert($optearray1[1], $_SESSION['ECOMMERCE_CURRENCY']);
					}
				
				?>
				
				<option value="<?php echo $poptarray1[$i];?>"><?php echo $optearray1[0]; if ($optearray1[1] != "0.00") { echo ' ('.$optearray1[1].'&nbsp;'.$JAK_CURRENCY.')'; }?></option>
				
				<?php } ?>
			</select>
			<input type="hidden" name="pop1_<?php echo $v["id"];?>" id="pop1_<?php echo $v["id"];?>" value="" />
			<?php } ?>
			
			<?php if ($v['product_options'] && $v['product_options1'] && $v['product_options2']) { ?>
			<select name="product-option2" id="po2_<?php echo $v["id"];?>" class="product-option2">
				<option value=""><?php echo $tl["shop"]["m54"];?></option>
				<?php $poptarray2 = explode(',', $v['product_options2']); for ($i = 0; $i < count($poptarray2); $i++) { 
				
					$optearray2 = explode('::', $poptarray2[$i]);
					
					if ($_SESSION['ECOMMERCE_CURRENCY'] != JAK_CURRENCY && $optearray[1] != "0.00") {
					
						$optearray2[1] = $convert->Convert($optearray2[1], $_SESSION['ECOMMERCE_CURRENCY']);
					}
				
				?>
				
				<option value="<?php echo $poptarray2[$i];?>"><?php echo $optearray2[0]; if ($optearray2[1] != "0.00") { echo ' ('.$optearray2[1].'&nbsp;'.$JAK_CURRENCY.')'; }?></option>
				
				<?php } ?>
			</select>
			<input type="hidden" name="pop2_<?php echo $v["id"];?>" id="pop2_<?php echo $v["id"];?>" value="" />
			<?php } if ($v['addtocart']) { ?>
			
			<p><button class="button" onclick="addlist(<?php echo $v['id'];?>);return false;"><?php echo $tl["shop"]["m76"];?></button></p>
			
			<?php } ?>
			
			</div>
			
			</figure>
		
		</article></li>
		
		<?php } echo '</ul><div class="clear"></div>'; } else { ?>
		
			<div class="status-failure"><?php echo $tl["shop"]["m74"];?></div>
		
		<?php } ?>
		
		<?php if ($JAK_PAGINATE) { ?>
		<div class="paginate"><?php echo $JAK_PAGINATE;?></div>
		<?php } ?>
		
		</section>
		
		<div class="shopping-cart drop-here" id="shopping-cart">
		
			<div class="inside">
			
				<h3><?php echo $tl["shop"]["m26"];?></h3>
				
		            	<div class="basket-icons">
		            		
			            	<img id="scart" src="<?php echo BASE_URL;?>img/shopping_cart.png" alt="shopping cart" width="120" height="80" />
			            	
							<img src="<?php echo BASE_URL;?>img/loader.gif" alt="loading.." id="basket-loader" width="16" height="11" />
							
						</div>
							
						<div id="drag-product-info"><?php echo $tl["shop"]["m27"];?></div>
						
						<div id="item-list" class="item-list"></div>
						
						<div id="trash">
						<h3><?php echo $tl["shop"]["m28"];?></h3>
						<a href="#"><img src="<?php echo BASE_URL;?>img/trash.png" alt="shopping cart" width="74" height="80" /></a>
						</div>
						
						<div id="total">
						<p>
						<?php echo $tl["shop"]["m"];?><span id="total-amount"></span> <?php echo $JAK_CURRENCY;?>
						<a href="<?php echo $shopcheckout;?>" class="checkout block"><?php echo $tl["shop"]["m29"];?></a>
						</p>
						</div>
						
			</div>
		                
		</div>
		
		</div><!-- #content -->
		
<?php include_once APP_PATH.'template/darkish/footer.php';?>