<?php
/*===============================
Shortocde tz-section-video
===============================*/

function tzinteriart_service_v2($atts) {
    $tzinteriart_image = $tzinteriart_number = $tzinteriart_title = $tzinteriart_des = $tzinteriart_readmore_text = $tzinteriart_readmore_link = $tzinteriart_option = '';
    extract(shortcode_atts(array(
        'tzinteriart_image'             => '',
        'tzinteriart_number'            => '',
        'tzinteriart_title'             => '',
        'tzinteriart_des'               => '',
        'tzinteriart_readmore_text'     => '',
        'tzinteriart_readmore_link'     => '',
        'tzinteriart_option'            => '1',
    ),$atts));
    ob_start();

    $tzinteriart_img_id = preg_replace( '/[^\d]/', '', $tzinteriart_image);
    $tzinteriart_width_img ='';
    $tzinteriart_height_img ='';
    $tzinteriart_images_info = wp_get_attachment_image_src($tzinteriart_img_id, $size='large');
    if(isset($tzinteriart_images_info) && !empty($tzinteriart_images_info)){
        $tzinteriart_url_img = $tzinteriart_images_info[0];
        $tzinteriart_width_img = $tzinteriart_images_info[1];
        $tzinteriart_height_img = $tzinteriart_images_info[2];
    }

    if($tzinteriart_option == '1'){
        $tzinteriart_class = 'service_left';
    } else (
    $tzinteriart_class = 'service_right'
    );

    ?>
    <div class="tzElement_Service-v2">
        <div class="tzService_Wrap <?php echo esc_html($tzinteriart_class); ?>">
            <div class="tzService_image col-md-5">
                <img src="<?php echo esc_url($tzinteriart_url_img);?>" width="<?php echo esc_attr($tzinteriart_width_img)?>" height="<?php echo esc_attr($tzinteriart_height_img)?>" alt="<?php echo esc_attr($tzinteriart_title);?>">
            </div>
            <div class="tzService_Info col-md-7">
                <div class="tzService_Info_Box">
                    <p class="tzService_v2_number"><?php echo esc_html($tzinteriart_number);?></p>
                    <h3 class="tzService_v2_title"><?php echo esc_html($tzinteriart_title);?></h3>
                    <p class="tzService_v2_des"><?php echo esc_html($tzinteriart_des);?></p>
                    <a href="<?php echo esc_url($tzinteriart_readmore_link);?>" class="tzService-v2-readmore"><?php  echo esc_html($tzinteriart_readmore_text);?></a>
                </div>
            </div>
        </div>
    </div>
    <?php
    return ob_get_clean();
}
add_shortcode('tz-service-v2','tzinteriart_service_v2');
?>
