<?php
global $no_elements;
?>
<section id="testimonials" class="section_wrap testimonials_section os-animation" data-os-animation="fadeInUp" data-os-animation-delay="0s">
    <div class="section_padding col-md-6 col-sm-8">
         <?php
            if(get_theme_mod('homepage_testimoial_title', 'yes')) {
           	 ?>
           	 <h3 class="section_heading">
			 	<span><?php echo get_theme_mod('homepage_testimoial_title', 'What People Say about us') ?></span>
             </h3>
            <?php
            }
             /*if(get_theme_mod('homepage_testimoial_text')) {
		   	 ?>
           	 <p><?php echo get_theme_mod('homepage_testimoial_text'); ?></p>
            <?php
            } */
           ?>
   	<div class="module_slider_wrapper">
       <div class="testimonials_slider module_slider_single_item module_slider">
	     <?php
				for ($i = 1; $i<=$no_elements; $i++) { 
			 		    $testimonial_image = "homepage_testimoial_image".$i; 
						$testimonial_client = "homepage_testimoial_client".$i; 
						$testimonial_text = "homepage_testimoial_text".$i; 
					 	
						$testimonial_image = get_theme_mod($testimonial_image, image('client.jpg'));
						$testimonial_client = get_theme_mod($testimonial_client, 'Client');
						$testimonial_text = get_theme_mod($testimonial_text, 'Sample Text');
					 
                    if($testimonial_client): ?>
                    
                        <div class="testimonial_item">
                       		<?php if(isset($testimonial_text)): ?>
                            	<p><?php echo $testimonial_text; ?></p>
							<?php endif ;?>
                            
                            <div class="text-left">
                                <?php
                                if (isset($testimonial_image)) {
                                   $image = get_resized_image_from_url($testimonial_image, 'testimonials'); ?>
                              
            	            	<img alt="<?php echo $testimonial_client; ?>" src="<?php echo $image[0]; ?>" width="<?php echo $image[1]; ?>" height="<?php echo $image[2]; ?>" />						            
                                     
                                <?php
                                }
                                ?>
                                <?php if(isset($testimonial_client)): ?>
                                <div class="testimonials_border">
                                    <h4><?php echo $testimonial_client; ?></h4>
                                </div>
                                <?php endif; ?> 
                            </div>
                        </div>
                
                    <?php
						endif;  // if
			        }
                    ?>
        </div>
     </div>   
    </div> 
    <div class="image_section right-image col-md-6 col-sm-4" style="background-image:url(<?php echo get_theme_mod('homepage_testimonial_image', image('testimonial.jpg')); ?>);">
    </div>

    <div class="clearfix"></div>
</section>