<?php

$rating_value = 1;

$content = '<link rel="stylesheet" href="/app/plugins/ftm-geo-target/dist/css/default.css" />';

$content .= '<div id="" class="ftm-gt--wrapper">
        <div class="ftm-td--header"></div>
        <div class="ftm-td--body-wrapper">
            <div class="ftm-td-body-header">
                <div class="active" data-tab="tab1">';

                if("[TABLE_TITTLE| ]" !== " "){
                    $title = "[TABLE_TITTLE| ]";
                    $content .= $title;    
                }

    $content .='</div>
            </div>
            <div class="ftm-td--sites">
                <div id="tab1" class="ftm-td--sites-1 active ">';

                    [SITES-REPEATER]
                    
        if(is_numeric([SITE_RATING])){
            $site_rating = ('[SITE_RATING]' != '' ? [SITE_RATING] : $rating_value );
            $rating_value = $site_rating;
        }
        
        //Calculate the rating in percentage
        $rating_value = ($rating_value * 100) / 5;

        $content .= '<div class="ftm-td-site">
                        <a href="[PLAY_NOW_LINK]" rel="noopener noreferrer nofollow"> </a>
                        <div class="ftm-td-site--rank">#[COUNT]</div>
                        <div class="ftm-td-site--logo">
                            <img decoding="async" src="[SITE_LOGO]" alt="[SITE_NAME]">
                        </div>
                        <div class="ftm-td-site--free-trial">
                            [WLCOME_BONUS]
                        </div>
                        <div class="ftm-td-site--rating">
                            <div class="ftm-td-site--rating-image">
                                <img decoding="async" src="[RATING_IMAGE]" width="110" height="85">
                            </div>
                            <div class="ftm-td-site--rating-star">
                                <div class="rating-star--over" style="width: '. $rating_value .'%"></div>
                                <div class="rating-star--under"></div>
                            </div>
                        </div>
                        <div class="ftm-td-site--link-wrapper">
                            <a href="[PLAY_NOW_LINK]" rel="noopener noreferrer nofollow" class="ftm-td-site--visit">[PLAY_NOW_TEXT]</a>
                            <a href="[VISIT_URL]" class="ftm-td-site--visit-review">[VISIT_TEXT]</a>
                        </div>
                        <div class="ftm-td-site--pros">
                            [PROS_LIST]
                        </div>
                        <div class="ftm-td-site--cons">
                            [CONS_LIST]
                        </div>
                        <div class="ftm-td-site--memberships">
                            <p>Key Facts</p>
                            <div class="ftm-td-site--membership-details">
                                [KEY_FACTS_TEXT]
                            </div>
                        </div>
                    </div>';

                    [/SITES-REPEATER]
                    
    $content .= '</div>
                <div class="ftm-td--footer">
                    <a href="/reviews/">See All</a>
                </div>
            </div>
        </div>
    </div>';


return $content;
?>
