<!-- <?=filenamecomment(__FILE__)?> -->

<div id="footersocial" class="footercol clearfix colthree" >

    <h4><img src="/_custom/images/ico_testimonial.png" /><a href="<?=getTestisPageUrl()?>">Testimonials</a></h4>
	
	<div class="testimonial">
	<?php
		$args = array(
			'post_type'        => 'testimonial',
			'orderby'			 => 'rand',
			'posts_per_page'	 => 1
		);
		$testis = get_posts( $args );
		$testis_id = $testis[0]->ID;
		$testis_post = get_post( $testis_id );
		//$testis_content = $testis->post_content;
		
		//print_r( $testis_post );
		
		global $emuTheme;
		$oTestimonial = $emuTheme->getClass('emuTestimonial', array(null, $testis_post));
		$oContact = $oTestimonial->getContact();
		
		//print_r( $oTestimonial );
	?>
		<p>
        	<span class="testimonial-content"><?= $oTestimonial->postContentRaw; ?></span>
			<?php /*?><span class="testimonial-author"><?=areturn(getTestisPageUrl(),getStarsImg(5))?><?= $oContact->firstName . ' ' . $oContact->lastName; ?></span><?php */?>
			<span class="testimonial-author"><?= $oContact->firstName . ' ' . $oContact->lastName; ?></span>
       </p>
	</div>

 <?php //echo getTestiRatings(array('starslink'=>getperma(getThemeOption('testimonialFormPageSlug'))))?>
 
 		  <?php
			$testis = get_posts( array( 'post_type' => 'testimonial','posts_per_page' => -1 ) );//d($testis);
			
			$testis_count = count( $testis );
		  ?>
		  <a href="<?= getperma(getThemeOption('testimonialFormPageSlug')) ?>"><img src="/_custom/images/stars_orange_4.5.png" /><span id="countreviews" class="ratingsaggregatetext">Based on <?= $testis_count ?> reviews</span></a>

</div> <!-- div class='colthree' -->   

