<?php
function counter($atts)
{
    extract(shortcode_atts(array(
        'text'               	=> '',
        'count'               	=> '',
        'contents'              => '',
		'type'               	=> ''
    ), $atts));
    
    $result ='';
	if($type == 'Counter-Right')
    {
		$result .= '
		<div class="tb">
			<div class="skill pull-right">'.esc_attr($count).'</div>
			<div class="tb-cell">
				<div class="text pull-left">
					<h3 class="heading">'.esc_attr($text).'</h3>
					<p>'.esc_attr($contents).'</p>
				</div>
			</div>
		</div>';
	}
	elseif($type == 'Counter-Left')
    {
        $result .= '
		<div class="tb">
			<div class="skill pull-left">'.esc_attr($count).'</div>
			<div class="tb-cell">
				<div class="text pull-right">
					<h3 class="heading">'.esc_attr($text).'</h3>
					<p>'.esc_attr($contents).'</p>
				</div>
			</div>
		</div>';
    }
    return $section_heading = force_balance_tags( $result );
}
add_shortcode( "rms-counter", "counter" );