<?php
    $GLOBALS['img']='unlimited';
    get_header();
    the_post();
?>

<?php if(of_get_option('show_server_unl')){?>

<div class="container top">
  
    <?php if(of_get_option('show_unl_plans')){?>
    
        <?php
        $args=array(
            'post_type' => 'plan',
            'post_status' => 'publish',
            'posts_per_page' => -1,
        );
        $my_query = null;
        $my_query = new WP_Query($args);
        $plan = array();
        
        while ($my_query->have_posts()) {
            $my_query->the_post();
            $plan[] = array(
                'title' => get_the_title(),
                'subtitle' => get_field('subtitle'),
                'price' => get_field('price'),
                'freq' => get_field('frequency'),
                'options' => get_field('options'),
                'category' => get_field('categoria'),
                'btn_title' => get_field('btn_title'),
                'btn_link' => get_field('btn_link')
            );
        }
        $c = 0;
        $planes_count = 0;
        foreach($plan as $key){
            if($key['category'] == of_get_option('unlim_plan')){
                $planes_count++;    
            }
        }
        foreach($plan as $key){
             if($key['category'] == of_get_option('unlim_plan')){
             $c++;
              //  if(of_get_option('price_first_plan'.$c) == 1 ){
              if($c==1){echo '<div class="row-fluid top">';}
     
     ?>
    
        <div class="span3">
      
            <!-- Item table -->
        
            <div class="item_table option_pricing">
        
                <div class="head_table">
          
                    <div class="head_title">    
            
                        <h1 <?php echo colors('h1');?> ><?php echo $key['title'];?></h1>
              
                        <span <?php echo colors('h1s');?> ><?php echo $key['subtitle'];?></span>
              
                    </div>
            
                    <h2 <?php echo colors('h2');?> ><?php echo $key['price'];?><span <?php echo colors('h1s');?> > $/ <?php echo $key['freq'];?></span></h2>                        
            
                </div>

                <ul class="items">
          
                    <?php foreach($key['options'] as $data){?>
          
                    <li><?php echo $data['icon'];?> <?php echo $data['descripotion'];?></li>
            
                    <?php }?>
                            
                </ul> 

                <a <?php echo colors('a');?>  href="<?php echo $key['btn_link'];?>" class="botton"><?php echo $key['btn_title'];?></a>  

            </div>
        
            <!-- End Item table -->
        
        </div>
      
        <?php 
                    if($c%4==0){ 
                    echo '</div>';
                    if($c+1<=$planes_count){
                        echo '<div class="row-fluid top">';
                    }
                    }elseif($c==$planes_count){
                        echo '</div>';
                    }
                }
            }
        ?>
	
    <?php }?>
    
    </div>
   
</div>
   
<!-- end main Container-->
  
<!-- central_title -->
	
    <?php if(of_get_option('show_unl_work')){?>
	
    <div class="central_title top">
	
        <h2 <?php echo colors('h2');?> ><?php echo of_get_option('unl_work_title');?></h2>
		
        <span <?php echo colors('h1s');?> >~ <?php echo of_get_option('unl_work_detail');?> ~</span>
		
    </div>
	
    <!-- central_title -->

    <!-- Leadership -->
    
    <?php 
        for($i=1; $i<=of_get_option('unl_work_num'); $i++){
        if($i==1){echo '<div class="row-fluid">';}
    ?>
	
    <div class="span2">
	  
        <div class="about_team">
		
            <img src="<?php echo of_get_option('unl_work_img'.$i);?>" alt="" title="<?php echo of_get_option('unl_work_name'.$i);?>">    
		  
            <h3 <?php echo colors('h3');?> ><?php echo of_get_option('unl_work_name'.$i);?></h3>
		  
            <span <?php echo colors('h1s');?> ><i><?php echo of_get_option('unl_work_ocupation'.$i);?></i></span>
		  
        </div>

    </div>
	  
    <?php 
        if($i%6==0){ 
            echo '</div>';
            if($i+1<=of_get_option('unl_work_num')){
                echo '<div class="row-fluid top">';
            }
        }elseif($i==of_get_option('unl_work_num')){
            echo '</div>';
        }
        }
    ?>  
	
    <!-- Leadership -->
	
    <?php }?>
	
    </div>
   
</div>
   
<!-- end main Container-->
  
<?php }?>

<?php get_footer(); ?>