<?php
/*

Template Name: Menu

*/
?>

<?php get_header(); ?>
<?php $featuredImageType = get_field('background_image_type'); ?>
<?php setBgImg();  ?>

<main class="content menuPage <?php echo $featuredImageType;  ?>"> <!-- for image and paralax use headerImg otherwise bgImg -->
	<div class="breadcrumb_box"> <div class="container"><?php
echo do_shortcode( '[breadcrumb]' ); 
?></div></div>
		<section class="pageImage">
        
			<?php putRevSlider("Commonpage","279") ?>
		
		</section>
	
        
</main>
<div class="container">
            <div class="row">
                <section class="pageTitle text-center">
                    <div class="um_helper">
                    	<div class="um_middle">
                    		<h3 class="title pageTitle titleUp"><?php the_title(); ?></h3>
                    	</div>
                    </div>
                </section>
                
			
				<?php  $menu = get_field('menu'); ?>
				<?php if($menu): ?>	
								
					<section class="menuContainer hasDec mainBgColor">
					
					<?php
					  	$categories = array(); 
							foreach($menu as $menu_item){
								array_push($categories,$menu_item['category'] );	
						} 
						 $categories = array_unique($categories);
					?>
					
					<?php if(!empty($categories)): ?>
						<?php if(!$categories[0] == ''): ?>
							<ul class="orderByIsotope list-unstyled list-inline text-center">
								<li><a href="#" class="um_menu_filter all"><?php _e('All','um_lang'); ?></a></li>
								<?php foreach($categories as $cat): ?>
									<?php if($cat != ''): ?>
										<li><a href="#" class="um_menu_filter"><?php echo $cat; ?></a></li>
									<?php endif; ?>
								<?php endforeach; ?>	
							</ul>
						<?php endif; ?>	
					<?php endif; ?>	
						
				
					
					<section class="menuContent um_masonry">
						
						<?php foreach($menu as $menu_item): ?>		
								<article class="menuItem col-md-12 um_masonryItem <?php echo $menu_item['category'] ?> ">
									<a class="brandHover">
										<ul class="list-unstyled list-inline">
											<li class="menuImg">
												<?php $img = wp_get_attachment_image_src($menu_item['image'] ,'thumbnail'); ?>
												<img class="" width="80" height="80" src="<?php echo $img[0]; ?>"/>
												<div class="icon brandBgColor um_transition text-center"></div>
											</li>
											<li class="menuDetails">
												<h5 class="title titleUp"><?php echo $menu_item['name']; ?></h5>
													<p><?php echo $menu_item['atributes']; ?></p>
											</li>
											<li class="menuPriceInfo text-right">
												<h5 class="title titleUp"><?php echo $menu_item['price_text']; ?></h5>
												<p><?php echo $menu_item['price']; ?></p>
											</li>
										</ul>
									</a>
								</article>
							<?php endforeach; ?>	
						
					</section>
				
				</section>
				
            <?php endif; ?>			
								
   		 </div>
            <!--row-->
   	 </div>
<?php get_footer(); ?>