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

    <!-- Search Domain -->
	
    <?php if(of_get_option('show_services')){ ?>
	
    <?php if(of_get_option('show_service_one')){ ?>
	
    <div class="central_title top">
	
        <h2 <?php echo colors('h2');?> ><?php echo strtoupper(of_get_option('service_one_title'));?></h2>
		
        <span <?php echo colors('h1s');?> >~ <?php echo of_get_option('service_one_desc');?> ~</span>
		
    </div>
	
    <?php 
        for($i=1; $i<=of_get_option('service_one_num'); $i++){
        if($i==1){echo '<div class="row-fluid">';}
    ?>
	
    <div class="span6">
		  
        <div class="features">
			
            <div class="row-fluid">
			  
                <div class="span3">
				
                    <img src="<?php echo of_get_option('service_one_img'.$i);?>" class="animated bounceInLeft" alt="">
				  
                </div>
				
                <div class="span9">
				
                    <h3 <?php echo colors('h3');?> ><?php echo of_get_option('service_one_title'.$i);?></h3>
				  
                    <span <?php echo colors('h1s');?> ><i><?php echo of_get_option('service_one_detail'.$i);?></i></span>
				  
                    <p <?php echo colors('p');?> ><?php echo insert_br(of_get_option('service_one_desc'.$i));?></p>
				  
                </div>

             </div>

        </div>
			
    </div>
		  
    <?php 
        if($i%2==0){ 
            echo '</div>';
            if($i+1<=of_get_option('service_one_num')){
                echo '<div class="row-fluid top">';
            }
        }elseif($i==of_get_option('service_one_num')){
            echo '</div>';
        }
        }
    ?>
	
    <!-- Link Two -->
      
    <!-- end features -->    
      
    <?php }?>
	  
    <?php if(of_get_option('show_service_two')){ ?>
	  
    <div class="central_title top">
	  
        <h2 <?php echo colors('h2');?> ><?php echo strtoupper(of_get_option('service_two_title'));?></h2>
		
        <span <?php echo colors('h1s');?> >~ <?php echo of_get_option('service_two_desc');?> ~</span>
		
    </div>

    <!-- features -->
		
        <?php
        $args=array(
                'post_type' => 'std_serv',
                'post_status' => 'publish',
                'posts_per_page' => -1,
            );
            $my_query = null;
            $my_query = new WP_Query($args);
            $std_serv = array();
            
            while ($my_query->have_posts()) {
                $my_query->the_post();
                $std_serv[] = array(
                    'title' => get_the_title(),
                    'icon' => get_field('stdicon'),
                    'subtitle' => get_field('subtitle'),
                    'description' => get_field('description'),
                    'btn_title' => get_field('btn_title'),
                    'btn_link' => get_field('btn_link')
                );
            }
        $c = 0;
    
        $i = 0;
		$stdserv_count = 0;
        foreach($std_serv as $key){
		    $i++;
            if(of_get_option('service_two_serv'.$i) == '1'){
                $stdserv_count++;
            }
        }
		$i = 0;
        foreach($std_serv as $key){
		    $i++;
             if(of_get_option('service_two_serv'.$i) == '1'){
             $c++;
                if($c==1){echo '<div class="row-fluid">';}
        ?>
        
        <div class="span4">
          
            <div class="features option_two">
            
                <div class="icon">
              
                    <?php echo $key['icon'];?>
                
                </div>
              
                <h3 <?php echo colors('h3');?> ><?php echo $key['title'];?></h3>
              
                <span <?php echo colors('h1s');?> ><i><?php echo $key['subtitle'];?></i></span>
              
                <p <?php echo colors('p');?> ><?php echo $key['description'];?></p>
              
                <a <?php echo colors('a');?>  href="<?php echo $key['btn_link'];?>" class="botton"><?php echo $key['btn_title'];?></a>
              
            </div>
            
        </div>
          
        <?php 
                if($c%3==0){ 
                echo '</div>';
                if($c+1<=$stdserv_count){
                    echo '<div class="row-fluid">';
                }
                }elseif($c==$stdserv_count){
                    echo '</div>';
                }
            }    
        }
        ?>
	
    <?php }?>
      
    <div class="clearfix"></div>
	  
    <?php if(of_get_option('show_service_three')){ ?>
	
    <div class="central_title top">
	
        <h2 <?php echo colors('h2');?> ><?php echo strtoupper(of_get_option('service_three_title'));?></h2>
		
        <span <?php echo colors('h1s');?> >~ <?php echo insert_br(of_get_option('service_three_desc'));?> ~</span>
		
    </div>
	
    <!-- More services -->
	
    <div class="row-fluid">
	
        <div class="table">
	  
            <!-- First Item -->
		
            <?php
        $args=array(
                'post_type' => 'serv',
                'post_status' => 'publish',
                'posts_per_page' => -1,
            );
            $my_query = null;
            $my_query = new WP_Query($args);
            $serv = array();
            
            while ($my_query->have_posts()) {
                $my_query->the_post();
                $serv[] = array(
                    'title' => get_the_title(),
                    'icon' => get_field('srvicon'),
                    'price' => get_field('price'),
                    'title1' => get_field('title'),
                    'subtitle' => get_field('subtitle'),
                    'description' => get_field('description')
                );
            }
        $c = 0;
		
		$i = 0;
        foreach($serv as $key){
            $i++;		
             if(of_get_option('service_three_serv'.$i) == '1'){
                 $c++;
        ?>
		
            <ul class="item">
		 
                <li class="row-fluid">
		  
                    <ul class="description_item">
			
                        <li class="span3 title">
			  
                            <div class="icon_items">
				
                                <?php echo $key['icon'];?>
				  
                            </div>
				
                            <h4 <?php echo colors('h4');?> ><?php echo $key['title'];?></h4>
				 
                            <h3 <?php echo colors('h3');?> >$<?php echo $key['price'];?></h3>
				
                        </li>
			  
                        <li class="span9 info_item">
			  
                        <h4 <?php echo colors('h4');?> ><?php echo $key['title1'];?></h4> <span <?php echo colors('h1s');?> ><i><?php echo $key['subtitle'];?></i></span>
                
				        <p <?php echo colors('p');?> ><?php echo $key['description'];?></p>               
              
			        </li>
			  
                </ul>
			
            </li>
		  
        </ul>
		
        <!-- First Item -->
		
        <?php 
            }
        }
        ?>
      
    </div>
	  
    </div>
    
	<?php }?>
	</div>
	
    <!-- More services-->
	
    <?php } get_footer(); ?>