<?php echo $this->render('module/header.phtml'); ?>

<div class="conBox">
<div class="container widthDiv">
	<div class="row categoryStrap">
		<div class="col-xs-12">
			<?php 
				if( $this->idCategory > 0 ){
					$Lib_Category = new Lib_Category();
					$dataCategoryParent = $Lib_Category->parentListO($this->idCategory,3);
					echo "<a href='".@$this->url(array('controller' => 'category', 'action' => 'index'), 'default', true)."'><i class='fa fa-home'></i></a> >> ";
					foreach($dataCategoryParent as $k => $v):
						echo "<a href='".@$this->url(array('controller' => 'category', 'action' => 'index', 'id' => $v['category_id']), 'default', true)."'>".@Lib_Lang::consta(category_name_.$v['category_id']).'</a> >> ';
					endforeach;
				}
			?>
		</div>
	</div>
	
	<div class="row">
		<div class="col-xs-12">
		<table width="100%">
		<tr>
			<td width="70%">
				<h3><?php echo @Lib_Lang::consta(product_name_.$this->rowProduct['product_id']); ?> <small>(<?php echo @Lib_Lang::consta(product_status_status_.$this->rowProduct['product_shop_status']); ?>)</small></h3>
				
			</td>
			<td width="30%">
				<div id="shopProduct" style="text-align:right;">
				
				

	<div class="priceConf"><?php echo number_format($this->rowProduct['product_price']*$this->rabat_5, 2, ',', ' '); ?> zł</div>
	<div class="amountConf">


<script type="text/javascript" language="javascript">
	
	

	$(document).ready(function () {
	
		$('#minus').click(function(){
			var i = parseInt($('#amount').val()) - 1;
			if( i > 0 ) $('#amount').val(i);
		});
	
		$('#plus').click(function(){
			var i = parseInt($('#amount').val()) + 1;
			if( i < 11 ) $('#amount').val(i);
		});
		
		
		$('#addProduct').click(function(){
			$("#shopInfo").load("<?php echo $this->url(array('controller' => 'shop', 'action' => 'shopinfo'), 'default', true); ?>",{operation: 'addproduct', idProduct: <?php echo$this->idProduct; ?>, amount: parseInt($('#amount').val())},function(){});
		});
	
	});

</script>		

		<button id="minus">-</button>
		<input id="amount" style="width:30px;text-align:center;" value="1" disabled="disabled" />
		<button id="plus">+</button>
	</div>
	<div class="addConf"><button id="addProduct">DODAJ</button></div>				
				
				
				
				
				
				
				</div>
			</td>
		</tr>
		</table>
		</div>
		<div class="col-xs-12">
		
		
		
		
		
		
		
		
			<div class="configuratorBox">			
				
				
				<div class="configuratorDiv">
				
					<?php echo @Lib_Lang::consta(product_description_.$this->rowProduct['product_id']); ?>
				
				</div>
				
				
			</div>
			
			
			
			
			
			
			
			
			
			
			
			
			
			<div class="productBox">
			
			
			
			

<script type="text/javascript" language="javascript">
$(document).ready(function () {

});
</script>


<div class="productPhotoConfiguratorBox">
<?php
	$imgmain = '';
	for( $i = 8; $i >= 1; $i-- ){
	
		/*
		if( $i == 1 ) $ti = '';
		else $ti = '_'.$i;
		*/
		$ti = '_'.$i;

		if( $this->rowProduct['product_image'.$ti] ){
			$imgmain = $this->rowProduct['product_image'.$ti];
		}
	}
?>  
<?php if( $imgmain != '' ){ ?>
	<div class="productPhoto"> <img src="<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$imgmain; ?>.jpeg" class="placeholder" style="width:400px;margin:0 auto;" /></div>
<?php } ?>   
					
					
<?php
	for( $i = 1; $i <= 8; $i++ ){
	
	/*
	if( $i == 1 ) $ti = '';
	else $ti = '_'.$i;
	*/
	
	$ti = '_'.$i;
?>					
	<?php if( $this->rowProduct['product_image'.$ti] ){ ?>
		<a href="<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$this->rowProduct['product_image'.$ti];?>.jpeg" data-lightbox="zdjecia">
			<img src="<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$this->rowProduct['product_image'.$ti];?>_w100.jpeg" alt="Thumbnail">
		</a>
	<?php } ?>   
<?php 
	}
?>     




				</div>
			
			
			<?php /*
<?php if( $this->rowProduct['product_image_2'] ){ ?>

<script type="text/javascript" language="javascript">
	
$(document).ready(function () {

	$('.productPhoto').hover(function(){
		$(this).css("background-image", "url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$this->rowProduct['product_image_2']; ?>.jpeg')");  
	},
	function(){
		$(this).css("background-image", "url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$this->rowProduct['product_image']; ?>.jpeg')"); 	
	});

});

</script>

<?php } ?>
			
				<div class="productPhotoConfiguratorBox">
				<?php if( $this->rowProduct['product_image'] ){ ?>
					<a href="<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$this->rowProduct['product_image']; ?>.jpeg" data-lightbox="image-1" data-title="<?php echo @Lib_Lang::consta(product_description_.$this->rowProduct['product_id']); ?>"><div class="productPhoto" style="background-image: url('<?php echo $this->escape($this->baseUrl); ?>/public/uploads/product/<?php echo$this->rowProduct['product_image']; ?>.jpeg');"></div></a>
				<?php } ?>
				</div>
            */ ?>                    
				
			</div>
		
		
		</div>
	</div>
</div>
</div>

<?php echo $this->render('module/footer.phtml'); ?>

