<?php

function renderLiveScoreHeaderResult($img_domain = '')
{
    $viewModes = [
        ['data-view' => 'asian', 'class' => 'on', 'label' => 'Asian View'],
        ['data-view' => 'euro', 'class' => '', 'label' => 'Euro View']
    ];

    $matchFilters = [
        ['data-view-match' => 'li_ShowAll', 'class' => 'on', 'label' => esc_html__('Tất cả', 'sport')],
        ['data-view-match' => 'li_FilterHot', 'class' => '', 'label' => esc_html__('Trận Hot', 'sport')]
    ];
    $hideDetail = (int)(true == get_option('Checkbox_hide_action_sp', false));
    
    ob_start();
    ?>

    <div id="tools" class="tools">
        <div class="d-flex">
            <div id="switchViewBlock" class="switch-view-btn" style="padding: 2px;">
                <?php foreach ($viewModes as $mode): ?>
                    <span data-view="<?= $mode['data-view']; ?>" class="<?= $mode['class']; ?>">
                        <?= $mode['label']; ?>
                    </span>
                <?php endforeach; ?>
            </div>
            <ul class="new-home" style="margin-left: 10px;">
                <?php foreach ($matchFilters as $filter): ?>
                    <li id="<?= $filter['data-view-match']; ?>" class="<?= $filter['class']; ?>">
                        <span><?= $filter['label']; ?></span>
                    </li>
                <?php endforeach; ?>

                <li id="li_FilterLea" class="filterLi">
                    <span id="LeaSelBtn"><?php esc_html_e('Giải đấu', 'sport') ?><img id="LeaSelBtnImg"
                                                                                      src="<?= IMGS3_PLUGINS ?>/assets/football-vn/images/icon_arrow_down.svg"
                                                                                      alt="arrow-down-icon"></span>
                </li>
                <li id="li_FilterCdi" class="filterLi">
                    <span id="CdiSelBtn"><?php esc_html_e('Tỉ Lệ', 'sport') ?><img id="CdiSelImg"
                                                                                   src="<?= IMGS3_PLUGINS ?>/assets/football-vn/images/icon_arrow_down.svg"
                                                                                   alt="arrow-down-icon"></span>
                </li>
                <li id="li_FilterTimes" class="filterLi2 xz w-140">
                    <div class="dropdown">
                        <button class="dropdown-toggle tz-name"
                                id="dropdown-toggle2"><?php esc_html_e('Theo giải đấu', 'sport') ?></button>
                        <div class="dropdown-menu" id="dropdown-menu2">
                            <div class="dropdown-menu-inner">
                                <div for="opt1" class="option active"
                                     data-filter="league"> <?php esc_html_e('Theo Giải Đấu', 'sport') ?> </div>
                                <div for="opt2" class="option"
                                     data-filter="time"> <?php esc_html_e('Theo thời gian', 'sport') ?> </div>
                            </div>
                        </div>
                    </div>
                </li>
                <?php if (!$hideDetail): ?>
                    <li id="li_FilterBet" class="filterLi2 xz d-block d-lg-none">
                        <div class="dropdown" id="CompanySelMobile">
                            <button class="dropdown-toggle" id="CompanySelMobileDropdown-toggle">Bet365</button>
                        </div>
                    </li>
                <?php endif; ?>
            </ul>
        </div>
    </div>
    <?php
    return ob_get_clean();
}

function renderLiveTableHeaderLiveResult()
{
    // Mảng các công ty cá cược
    $betCompanies = [
        ['data-bet' => '100', 'label' => 'K - Sport'],
        ['data-bet' => '1', 'label' => 'Macauslot'],
        ['data-bet' => '3', 'label' => 'Crown'],
        ['data-bet' => '4', 'label' => 'Ladbrokes'],
        ['data-bet' => '8', 'label' => 'Bet365'],
        ['data-bet' => '12', 'label' => 'Easybet'],
        ['data-bet' => '23', 'label' => '188bet'],
        ['data-bet' => '24', 'label' => '12bet'],
        ['data-bet' => '31', 'label' => 'Sbobet'],
        ['data-bet' => '42', 'label' => '18Bet']
    ];
    $hideDetail = (int)(true == get_option('Checkbox_hide_action_sp', false));
    // Mảng trạng thái các trận đấu
    $matchStatus = [
        'count' => 0,  // Thay đổi theo số lượng trận đấu hiển thị
        'label' => esc_html__('Ẩn', 'sport')  // Có thể thay đổi thành 'Hiển thị tất cả' hoặc 'Ẩn'
    ];

    ob_start();
    ?>

    <tr id="tr_upper-live-title" class="upper-live-title">
        <td class=""><span class="upper-live-icon-football"></span></td>
        <td class="upper-live-title-football rs td-bdr" colspan="5">
            <span><?php esc_html_e('Bóng đá', 'sport') ?></span>
            <span class="f11"> <?= htmlspecialchars($matchStatus['label']); ?> <span
                        id="hiddencount"><?= htmlspecialchars($matchStatus['count']); ?></span> <?php esc_html_e('trận', 'sport') ?> [<?php esc_html_e('Hiển thị tất cả', 'sport') ?>] </span>
        </td>
        <td colspan="3" class="change-colname hpd-td td-bdr">
            <span>HDP</span>
        </td>
        <td colspan="3" class="td-tx change-colname tx-td td-bdr">
            <span><?php esc_html_e('Tài xỉu', 'sport') ?></span>
        </td>
        <?php if (!$hideDetail): ?>
            <td id="oddsHead" colspan="1" class="oddsHead h2 inclfuded-ht-title table-1">
                <div class="custom-select-02" id="CompanySel">
                    <div name="dropSelect" id="dropSelect" class="custom-select">Bet365</div>
                </div>
            </td>
        <?php endif; ?>
    </tr>
    <?php
    return ob_get_clean();
}

function renderHeaderLiveTableTitleResult()
{
    $hideDetail = (int)(true == get_option('Checkbox_hide_action_sp', false));
    ob_start();
    ?>
    <tr id="tr_upper-live-titlez" class="upper-live-titlez">
        <td class="td-bdr w-32">
            <span class="allno trash-live-title remove-league-icon"></span>
        </td>
        <td class="td-bdr w-70 py-1 status-time-sched"><?php esc_html_e('Thời gian', 'sport') ?></td>
        <td class="td-bdr w-120"><?php esc_html_e('Đội nhà', 'sport') ?></td>
        <td class="td-bdr w-70"><?php esc_html_e('Tỉ số', 'sport') ?></td>
        <td class="td-tx td-bdr w-33" style="white-space: nowrap;">
            <img src="<?= IMGS3_PLUGINS ?>/assets/images/icon-golf-outline.svg" class="corner-icon light"
                 alt="corner-icon" style="margin: auto;">
            <img src="<?= IMGS3_PLUGINS ?>/assets/images/icon-golf-outline_dark.svg" class="corner-icon dark"
                 alt="corner-icon" style="margin: auto;">
        </td>
        <td class="td-bdr w-120"><?php esc_html_e('Đội khách', 'sport') ?></td>
        <td class="w-47"><?php esc_html_e('Chủ', 'sport') ?></td>
        <td class="w-47"><?php esc_html_e('Tỷ lệ', 'sport') ?></td>
        <td class="td-bdr w-47"><span><?php esc_html_e('Khách', 'sport') ?></span></td>
        <td class="w-47"><?php esc_html_e('Chủ', 'sport') ?></td>
        <td class="w-47"><?php esc_html_e('Tỷ lệ', 'sport') ?></td>
        <td class="td-bdr w-47"><span><?php esc_html_e('Khách', 'sport') ?></span></td>
        <?php if (!$hideDetail): ?>
            <td id="oddsHead" class="oddsHead w-75">
                <div style="display: flex; padding: 8px; justify-content: center; gap: 12px;">
                    <div class=""><?php esc_html_e('Thông số', 'sport') ?></div>
                </div>
            </td>
        <?php endif; ?>
    </tr>

    <?php
    return ob_get_clean();
}


function extractLeagueDefault($leagues_result = [], $leagues_param = null, $nations_param = null){
    if (isset($nations_param)) {  
        $nation = isset($nations_param) ? sanitize_text_field($nations_param) : '';

        $nation_array = !empty($nation) ? explode(',', $nation) : [];

        $nation_array = array_map('absint', $nation_array);


        $filtered_array = array_filter($leagues_result, function($item) use ($nation_array) {
            return in_array($item['nationId'], $nation_array);
        });

        return $filtered_array;
        
    } elseif(isset($leagues_param)) {
        $league = isset($leagues_param) ? sanitize_text_field($leagues_param) : '';

        $league_array = !empty($league) ? explode(',', $league) : [];

        $league_array = array_map('absint', $league_array);


        $filtered_array = array_filter($leagues_result, function($item) use ($league_array) {
            return in_array($item['league_id'], $league_array);
        });

        return $filtered_array;
    } elseif (isset($_GET['nation'])) {  
        $nation = isset($_GET['nation']) ? sanitize_text_field($_GET['nation']) : '';

        $nation_array = !empty($nation) ? explode(',', $nation) : [];

        $nation_array = array_map('absint', $nation_array);


        $filtered_array = array_filter($leagues_result, function($item) use ($nation_array) {
            return in_array($item['nationId'], $nation_array);
        });

        return $filtered_array;
        
    } elseif(isset($_GET['league'])) {
        $league = isset($_GET['league']) ? sanitize_text_field($_GET['league']) : '';

        $league_array = !empty($league) ? explode(',', $league) : [];

        $league_array = array_map('absint', $league_array);


        $filtered_array = array_filter($leagues_result, function($item) use ($league_array) {
            return in_array($item['league_id'], $league_array);
        });

        return $filtered_array;
    } else return $leagues_result;
}


function fetchdataResult($number_match, $leagues_param = null, $nations_param = null)
{
    $hideDetail = (int)(true == get_option('Checkbox_hide_action_sp', false));
    $timestamp = time();
    $url_api_result = DB_DOMAIN . '/gf/data/finish/bf_th1.js?' . $timestamp;
    $leagues_result = bongdako_fetch_and_merge_data_faked($url_api_result);

   
    $leagues_result = extractLeagueDefault($leagues_result, $leagues_param, $nations_param);
    if (isset($leagues_result) && is_array($leagues_result)) {

        ?>
        <?php
        $betMatchCount = 0;
        $maxBetCount = $number_match;
        ?>
        <?php foreach ($leagues_result as $league_item): ; ?>
            <?php
            $league_id = isset($league_item['league_id']) && $league_item['league_id'] ? $league_item['league_id'] : '';
            $league_name = isset($league_item['leagueName']) && $league_item['leagueName'] ? $league_item['leagueName'] : '';
            $league_flag_url = DB_DOMAIN . $league_item['leagueFlag'];
            ?>

            <tr id="ln_<?php echo $league_id; ?>"
                class="Leaguestitle fbHead league-title-head-row league-title-head-mobile" name="Leaguestitle">
                <td>
                    <div class="add-div">
                        <i class="icon iconfont add-info-l icon-font-collect-off l0 favL favL_<?php echo $league_id; ?>"></i>
                    </div>
                </td>
                <td class="league-title league-title-ht-title t" colspan="<?php echo $hideDetail ? 10 :11; ?>" style="line-height: 28px;">
                    <div class="l1" style="width: fit-content;">
                        <img class="cImg lazy flag-img" src="<?php echo $league_flag_url; ?>"
                             alt="<?php echo $league_name; ?>" style="display: inline;">
                        <span class="fbsclass football-team-name"><?php echo $league_name; ?></span>
                    </div>
                </td>
                <td class="df-wrapper df-wrapper-league-item df-wrapper-favorite-item">
                    <div class="df1" style="position: relative;">
                        <div class="hidden-info-match">
                            <span>
                                <div class="swt hide-tmp"></div>
                            </span>
                        </div>
                    </div>
                </td>
            </tr>
            <?php
            $dataMatch = $league_item['matches'];
            ?>
            <?php foreach ($dataMatch as $item): ; ?>
                <?php
                $match_id = isset($item['matchId']) && $item['matchId'] ? $item['matchId'] : 2607038;
                $match_time = isset($item['startTime']) && $item['startTime'] ? $item['startTime'] : '0';
                $home_team_name = isset($item['teams']['home']) && $item['teams']['home'] ? $item['teams']['home'] : 'Cagliari';
                $away_team_name = isset($item['teams']['away']) && $item['teams']['away'] ? $item['teams']['away'] : 'Inter Milan';
                $home_team_logo = IMGS3_PLUGINS .'/assets/images/home_1.svg';
                $away_team_logo = IMGS3_PLUGINS .'/assets/images/away_1.svg';
                $home_score = isset($item['score']['home']) ? $item['score']['home'] : null;
                $away_score = isset($item['score']['away']) ? $item['score']['away'] : null;
                $home_rank = isset($item['rank']['home']) && $item['rank']['home'] ? $item['rank']['home'] : 18;
                $away_rank = isset($item['rank']['away']) && $item['rank']['away'] ? $item['rank']['away'] : 3;
                $home_red_card = isset($item['red_card']['home']) && $item['red_card']['home'] ? $item['red_card']['home'] : '';
                $away_red_card = isset($item['red_card']['away']) && $item['red_card']['away'] ? $item['red_card']['away'] : '';
                $home_yellow_card = isset($item['yellow_card']['home']) && $item['yellow_card']['home'] ? $item['yellow_card']['home'] : '';
                $away_yellow_card = isset($item['yellow_card']['away']) && $item['yellow_card']['away'] ? $item['yellow_card']['away'] : '';
                $home_corners = isset($item['corner']['home']) ? $item['corner']['home'] : '';
                $away_corners = isset($item['corner']['away']) ? $item['corner']['away'] : '';

                // Format thời gian trận đấu
                $datetime = new DateTime($match_time, new DateTimeZone('UTC')); // Assuming input time is in UTC
                $datetime->setTimezone(new DateTimeZone('Asia/Bangkok')); // Set timezone to GMT+7
                $match_time_formatted = $datetime->format('H:i');

                $odd_home = number_format(rand(1, 20) / 10, 2); // Giá trị "Chủ"
                $odd_draw = number_format(rand(1, 20) / 10, 2); // Giá trị "Hòa"
                $odd_away = number_format(rand(1, 20) / 10, 2); // Giá trị "Khách"
                $odd_over = number_format(rand(1, 20) / 10, 2); // Giá trị "Trên"
                $odd_equal = number_format(rand(1, 20) / 10, 2); // Giá trị "Tỷ lệ"
                $odd_under = number_format(rand(1, 20) / 10, 2); // Giá trị "Dưới"
                ; ?>

                <tr id="tr1_<?php echo $match_id; ?>MatchOpen"
                    class="tds fst new-home-tr tds fst new-home-tr new-home-tr-match-result"
                    style="position: relative;">
                    <td height="30" width="34">
                        <div class="add-div">
                            <i class="icon iconfont favM add-info icon-font-collect-off"></i>
                        </div>
                    </td>
                    <td name="timeData" class="time handpoint status-time-sched" width="50"
                        data-time="<?php echo $match_time; ?>">
                        <span><?php echo $match_time_formatted; ?></span>
                    </td>
                    <td id="ht_<?php echo $match_id; ?>" style="text-align: center; position: relative;">
                        <div class="team-box tleft">
                            <a data-team-name="<?php echo $home_team_name; ?>"><?php echo $home_team_name; ?></a>
                            <!-- <img class="logoTeam" src="<?php echo $home_team_logo; ?>" alt="<?php echo $home_team_name; ?>" style="width: 14px; height: 14px;"> -->
                            <p class="team-more-info">
                                <span class="team-hg">[<?php echo $home_rank; ?>]</span><?php if (!empty($home_yellow_card) && $home_yellow_card > 0) : ?>
                                    <span><span class="yellowcard"><?php echo $home_yellow_card; ?></span>
                                    </span><?php endif; ?><?php if (!empty($home_red_card) && $home_red_card > 0) : ?><a
                                        id="redcard2_4469"><span class="redcard"><?php echo $home_red_card; ?></span>
                                    </a><?php endif; ?>
                            </p>
                        </div>
                    </td>
                    <td class="blue handpoint score-color">
                        <b class="scored-s match-finished"><?php echo $home_score; ?>-<?php echo $away_score; ?></b>
                    </td>
                    <td class="ht-title">
                        <div style="min-width: 33px;">
                            <div class="score-detail pointer">
                                <div class="secont-half text-center w-100-i"
                                     style="color: rgb(255, 128, 0);"><?php echo $home_corners; ?>
                                    -<?php echo $away_corners; ?></div>
                            </div>
                        </div>
                    </td>
                    <td id="gt_<?php echo $match_id; ?>" style="text-align: center; position: relative;">
                        <div class="team-box">
                            <!-- <img class="logoTeam" src="<?php echo $away_team_logo; ?>" alt="<?php echo $away_team_name; ?>" style="width: 14px; height: 14px;"> -->
                            <a data-team-name="<?php echo $away_team_name; ?>"><?php echo $away_team_name; ?></a>
                            <p class="team-more-info">
                                <?php if (!empty($away_red_card) && $away_red_card > 0) : ?><a id="redcard2_4469"><span
                                            class="redcard"><?php echo $away_red_card; ?></span>
                                    </a><?php endif; ?><?php if (!empty($away_yellow_card) && $away_yellow_card > 0) : ?>
                                    <span><span class="yellowcard"><?php echo $away_yellow_card; ?></span>
                                    </span><?php endif; ?><span class="team-hg">[<?php echo $away_rank; ?>]</span>
                            </p>
                        </div>
                    </td>
                    <td class="oddstd c6" width="50">
                        <p data-before-content="Chủ"
                           class="odds1 odds-hdp odds-bg odds-normal"><?php echo $odd_home; ?></p>
                    </td>
                    <td class="oddstd c7" width="50">
                        <p data-before-content="Hòa"
                           class="odds1 odds-hdp odds-bg odds-normal"><?php echo $odd_draw; ?></p>
                    </td>
                    <td class="oddstd c8" width="50">
                        <p data-before-content="Khách"
                           class="odds1 odds-hdp odds-bg odds-normal"><?php echo $odd_away; ?></p>
                    </td>
                    <td class="oddstd td-tx c9" width="50">
                        <p data-before-content="Chủ"
                           class="odds1 odds-hdp odds-bg odds-normal"><?php echo $odd_over; ?></p>
                    </td>
                    <td class="oddstd td-tx c10" width="50">
                        <p data-before-content="Hòa"
                           class="odds1 odds-hdp odds-bg odds-normal"><?php echo $odd_equal; ?></p>
                    </td>
                    <td class="oddstd td-tx c11" width="50">
                        <p data-before-content="Khách"
                           class="odds1 odds-hdp odds-bg odds-normal"><?php echo $odd_under; ?></p>
                    </td>
                    <?php if (!$hideDetail): ?>
                        <td colspan="1" class="be-change-ht-title toolimg action-table action-table-pc">
                            <span class="Detail-icon r0"></span>
                        </td>
                    <?php endif; ?>
                </tr>

                <?php
                $betMatchCount++;
                if ($betMatchCount == $maxBetCount) {
                    break;
                }
                ?>
            <?php endforeach; ?>

            <?php
            if ($betMatchCount == $maxBetCount) {
                break;
            }
            ?>
        <?php endforeach; ?>

    <?php }
}

function renderMatchItemResult($data)
{
    $league_id = isset($data['league_id']) && $data['league_id'] ? $data['league_id'] : '5';
    $league_name = isset($data['league']) && $data['league'] ? $data['league'] : 'VĐQG Ý';
    $league_flag_url = DB_DOMAIN . $data['flag'];
    $match_id = isset($data['matchId']) && $data['matchId'] ? $data['matchId'] : 2607038;
    $match_time = isset($data['startTime']) && $data['startTime'] ? $data['startTime'] : '2024-12-28 17:00:00';
    $home_team_name = isset($data['teams']['home']) && $data['teams']['home'] ? $data['teams']['home'] : 'Cagliari';
    $away_team_name = isset($data['teams']['away']) && $data['teams']['away'] ? $data['teams']['away'] : 'Inter Milan';
    $home_team_logo = IMGS3_PLUGINS .'/assets/images/home_1.svg';
    $away_team_logo = IMGS3_PLUGINS .'/assets/images/away_1.svg';
    $home_score = isset($data['score']['home']) ? $data['score']['home'] : null;
    $away_score = isset($data['score']['away']) ? $data['score']['away'] : null;
    $home_rank = isset($data['rank']['home']) && $data['rank']['home'] ? $data['rank']['home'] : 18;
    $away_rank = isset($data['rank']['away']) && $data['rank']['away'] ? $data['rank']['away'] : 3;
    $home_yellow_card = isset($data['yellow_card']['home']) && $data['yellow_card']['home'] ? $data['yellow_card']['home'] : 0;
    $away_yellow_card = isset($data['yellow_card']['away']) && $data['yellow_card']['away'] ? $data['yellow_card']['away'] : 0;
    $home_corners = isset($data['corner']['home']) ? $data['corner']['home'] : 5;
    $away_corners = isset($data['corner']['away']) ? $data['corner']['away'] : 7;

    // Format thời gian trận đấu
    $match_time_formatted = date('H:i', strtotime($match_time));
    $odd_home = number_format(rand(1, 20) / 10, 2); // Giá trị "Chủ"
    $odd_draw = number_format(rand(1, 20) / 10, 2); // Giá trị "Hòa"
    $odd_away = number_format(rand(1, 20) / 10, 2); // Giá trị "Khách"
    $odd_over = number_format(rand(1, 20) / 10, 2); // Giá trị "Trên"
    $odd_equal = number_format(rand(1, 20) / 10, 2); // Giá trị "Tỷ lệ"
    $odd_under = number_format(rand(1, 20) / 10, 2); // Giá trị "Dưới"

    return '<tr id="ln_' . $league_id . '" class="Leaguestitle fbHead league-title-head-row league-title-head-mobile" name="Leaguestitle">
            <td>
                <div class="add-div">
                    <i class="icon iconfont add-info-l icon-font-collect-off l0 favL favL_' . $league_id . '"></i>
                </div>
            </td>
            <td class="league-title league-title-ht-title t" colspan="11" style="line-height: 28px;">
                <div class="l1" style="width: fit-content;">
                    <img class="cImg lazy flag-img" src="' . $league_flag_url . '" alt="' . $league_name . '" style="display: inline;">
                    <span class="fbsclass football-team-name">' . $league_name . '</span>
                </div>
            </td>
            <td class="df-wrapper df-wrapper-league-item df-wrapper-favorite-item">
                <div class="df1" style="position: relative;">
                    <div class="hidden-info-match">
                        <span>
                            <div class="swt hide-tmp"></div>
                        </span>
                    </div>
                </div>
            </td>
        </tr>
        <tr id="tr1_' . $match_id . 'MatchOpen" class="tds fst new-home-tr tds fst new-home-tr new-home-tr-match-result" style="position: relative;">
            <td height="30" width="34">  
                <div class="add-div">
                    <i class="icon iconfont favM add-info icon-font-collect-off"></i>
                </div>
            </td>
            <td name="timeData" class="time handpoint status-time-sched" width="50" data-time="' . $match_time . '">
                <span>' . $match_time_formatted . '</span>
            </td>
            <td id="ht_' . $match_id . '" style="text-align: center; position: relative;">
                <div class="team-box tleft">
                    <a data-team-name="' . $home_team_name . '">' . $home_team_name . '</a>
                    <p class="team-more-info">
                        <span class="team-hg">[' . $home_rank . ']</span><span><span class="yellowcard">' . $home_yellow_card . '</span></span>
                    </p>
                </div>
            </td>
            <td class="blue handpoint score-color">
                <b class="scored-s match-finished">' . $home_score . '-' . $away_score . '</b>
            </td>
            <td class="ht-title">
                <div style="min-width: 33px;">
                    <div class="score-detail pointer">
                        <div class="secont-half text-center w-100-i" style="color: rgb(255, 128, 0);">' . $home_corners . '-' . $away_corners . '</div>
                    </div>
                </div>
            </td>
            <td id="gt_' . $match_id . '" style="text-align: center; position: relative;">
                <div class="team-box">
                    <a data-team-name="' . $away_team_name . '">' . $away_team_name . '</a>
                    <p class="team-more-info">
                        <span><span class="yellowcard">' . $away_yellow_card . '</span></span><span class="team-hg">[' . $away_rank . ']</span>
                    </p>
                </div>
            </td>
            <td class="oddstd c6" width="50">
                <p data-before-content="Chủ" class="odds1 odds-hdp odds-bg odds-normal">' . $odd_home . '</p>
            </td>
            <td class="oddstd c7" width="50">
                <p data-before-content="Hòa" class="odds1 odds-hdp odds-bg odds-normal">' . $odd_draw . '</p>
            </td>
            <td class="oddstd c8" width="50">
                <p data-before-content="Khách" class="odds1 odds-hdp odds-bg odds-normal">' . $odd_away . '</p>
            </td>
            <td class="oddstd td-tx c9" width="50">
                <p data-before-content="Chủ" class="odds1 odds-hdp odds-bg odds-normal">' . $odd_over . '</p>
            </td>
            <td class="oddstd td-tx c10" width="50">
                <p data-before-content="Hòa" class="odds1 odds-hdp odds-bg odds-normal">' . $odd_equal . '</p>
            </td>
            <td class="oddstd td-tx c11" width="50">
                <p data-before-content="Khách" class="odds1 odds-hdp odds-bg odds-normal">' . $odd_under . '</p>
            </td>
            <td colspan="1" class="be-change-ht-title toolimg action-table action-table-pc">
                <span class="Detail-icon r0"></span>
            </td>
        </tr>';
}