<?php
function header_fixture()
{
    ?>
    <div class="filter-box" id="filter-box-on-pc">
        <div class="filter-row-wrap filter-date-bet">
            <div class="filter-row-date">
                <div class="llx d-flex ai-c">
                    <a class="btn-item-now active class-0"><?php esc_html_e('Hôm nay', 'sport') ?></a><a
                            class="btn-item-now class-1"><?php esc_html_e('Ngày mai', 'sport') ?></a><a
                            class="btn-item-now class-2"><?php echo date('d/m', strtotime(date('y-m-d') . ' +2 days')) ?></a><a
                            class="btn-item-now class-3"><?php echo date('d/m', strtotime(date('y-m-d') . ' +3 days')) ?></a><a
                            class="btn-item-now class-4"><?php echo date('d/m', strtotime(date('y-m-d') . ' +4 days')) ?></a><a
                            class="btn-item-now class-5"><?php echo date('d/m', strtotime(date('y-m-d') . ' +5 days')) ?></a><a
                            class="btn-item-now class-6"><?php echo date('d/m', strtotime(date('y-m-d') . ' +6 days')) ?></a>
                </div>
            </div>
        </div>
        <div class="filter-row-wrap filter-all-hot filter-second">
            <div class="all-hot-filter">
                <div class="button-df"><?php esc_html_e('Trận Hot', 'sport') ?></div><!---->
                <div class="d-flex xll-r">
                    <div class="filter-row filter-search-row filter-third">
                        <div class="filter-cup-match">
                            <div id="selectLeague" class="custom-select-02 filter-cup-match-box">
                                <div class="custom-select"><?php esc_html_e('Tất cả giải đấu', 'sport') ?></div>
                            </div>
                        </div>
                        <div class="custom-select-02 button-df mw-100 sixmix min123px filter-select-rate">
                            <div class="custom-select"><?php esc_html_e('TL Hồng Kông', 'sport') ?></div>
                        </div>
                        <div class="custom-select-02 button-df mw-100 sixmix filter-select-company">
                            <div class="custom-select six-in-one-custom-select">Sbobet</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="filter-box" id="filter-box-on-mobile">
        <div class="filter-row-wrap filter-date-bet">
            <div class="filter-row-date">
                <div class="llx d-flex ai-c">
                    <a class="btn-item-now active class-0"><?php esc_html_e('Hôm nay', 'sport') ?></a><a
                            class="btn-item-now class-1"><?php esc_html_e('Ngày mai', 'sport') ?></a><a
                            class="btn-item-now class-2"><?php echo date('d/m', strtotime(date('y-m-d') . ' +2 days')) ?></a><a
                            class="btn-item-now class-3"><?php echo date('d/m', strtotime(date('y-m-d') . ' +3 days')) ?></a><a
                            class="btn-item-now class-4"><?php echo date('d/m', strtotime(date('y-m-d') . ' +4 days')) ?></a><a
                            class="btn-item-now class-5"><?php echo date('d/m', strtotime(date('y-m-d') . ' +5 days')) ?></a><a
                            class="btn-item-now class-6"><?php echo date('d/m', strtotime(date('y-m-d') . ' +6 days')) ?></a>
                </div>
            </div>
        </div>
        <div class="filter-row-wrap filter-all-hot filter-second">
            <div class="all-hot-filter">
                <div class="button-df"><?php esc_html_e('Trận Hot', 'sport') ?></div><!---->
                <div class="d-flex xll-r">
                    <div class="filter-row filter-search-row">
                        <div class="filter-cup-match">
                            <div id="selectLeague" class="custom-select-02 filter-cup-match-box">
                                <div class="custom-select"><?php esc_html_e('Tất cả giải đấu', 'sport') ?></div>
                            </div>
                        </div>
                    </div>
                    <div class="custom-select-02 button-df mw-100 sixmix min123px filter-select-rate">
                        <div class="custom-select"><?php esc_html_e('TL Malaysia', 'sport') ?></div>
                    </div>
                    <div class="custom-select-02 button-df mw-100 sixmix filter-select-company">
                        <div class="custom-select six-in-one-custom-select">Sbobet</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php
}

function renderDatePickerFixture($range = 7)
{
    // Lấy ngày hiện tại
    $currentDate = new DateTime();
    $currentDateFormatted = $currentDate->format('Y-n-j'); // Change here to remove leading zeros

    // Tạo mảng lưu thông tin ngày trong tuần (CN, T2, T3, ...)
    $weekDays = ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'];

    // Bắt đầu render HTML
    $output = '<ul class="timeBox-desktop">';

    // Lặp qua phạm vi từ -$range đến $range
    for ($i = -$range; $i <= $range; $i++) {
        // Tạo một đối tượng DateTime mới với múi giờ GMT+7
        $date = new DateTime('now', new DateTimeZone('Asia/Bangkok'));

        // Sử dụng clone đối tượng DateTime trước khi sửa ngày
        $dateClone = clone $date;

        // Thêm hoặc bớt $i ngày
        $dateClone->modify("$i day");

        // Lấy ngày hiện tại được định dạng (change to remove leading zeros)
        $formattedDate = $dateClone->format('Y-n-j'); // Change here to remove leading zeros

        // Lấy tên ngày trong tuần
        $dayOfWeek = $weekDays[(int)$dateClone->format('w')];

        // Lấy số ngày
        $dayNumber = $dateClone->format('j'); // Use 'j' to remove leading zeros

        // Lấy ngày hiện tại
        $currentDateFormatted = $date->format('Y-n-j'); // Change here to match the format

        // Thêm class 'li_today on' nếu là ngày hiện tại
        $activeClass = ($formattedDate === $currentDateFormatted) ? 'li_today on' : '';

        // Render HTML cho ngày
        $output .= '<li class="da_' . $formattedDate . ' ' . $activeClass . '" date="' . $formattedDate . '">';
        $output .= '<span>' . $dayOfWeek . '</span>';
        $output .= '<span>' . $dayNumber . '</span>';
        $output .= '</li>';
    }

    $output .= '</ul>';

    // Trả về HTML đã tạo
    return $output;
}

function renderDatePickerFixtureMobile($range = 7)
{
    // Lấy ngày hiện tại
    $currentDate = new DateTime();
    $currentDateFormatted = $currentDate->format('Y-m-d');

    // Tạo mảng lưu thông tin ngày trong tuần (CN, T2, T3, ...)
    $weekDays = ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'];

    // Bắt đầu render HTML
    $output = '<div class="swiper-wrapper">';

    // Lặp qua phạm vi từ -$range đến $range
    for ($i = -$range; $i <= $range; $i++) {
        // Tạo một đối tượng DateTime mới với múi giờ GMT+7
        $date = new DateTime('now', new DateTimeZone('Asia/Bangkok'));

        // Sử dụng clone đối tượng DateTime trước khi sửa ngày
        $dateClone = clone $date;

        // Thêm hoặc bớt $i ngày
        $dateClone->modify("$i day");

        // Lấy ngày hiện tại được định dạng
        $formattedDate = $dateClone->format('Y-m-d');

        // Lấy tên ngày trong tuần
        $dayOfWeek = $weekDays[(int)$dateClone->format('w')];

        // Lấy số ngày
        $dayNumber = $dateClone->format('d');

        // Lấy ngày hiện tại
        $currentDateFormatted = $date->format('Y-m-d');

        // Thêm class 'li_today on' nếu là ngày hiện tại
        $activeClass = ($formattedDate === $currentDateFormatted) ? 'li_today on' : '';

        // Render HTML cho ngày
        $output .= '<div class="swiper-slide da_' . $formattedDate . ' ' . $activeClass . ' item-pk" style="min-width: 42px!important;" date="' . $formattedDate . '">';
        $output .= '<span>' . $dayOfWeek . '</span>';
        $output .= '<span>' . $dayNumber . '</span>';
        $output .= '</div>';
    }


    $output .= '</div>';

    // Trả về HTML đã tạo
    return $output;
}

function renderLiveScoreHeaderFixture()
{
    $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')]
    ];


    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_FilterStatus" class="filterLi2 xz w-140" style="margin-right: 5px !important;">
                    <div class="dropdown">
                        <button class="dropdown-toggle tz-name"
                                id="dropdown-toggle-status"><?php esc_html_e('Hiển thị tất cả', 'sport') ?></button>
                        <div class="dropdown-menu" id="dropdown-menu-status">
                            <div class="dropdown-menu-inner">
                                <div for="opt1" class="option active"
                                     data-filter="league"><?php esc_html_e('Hiển thị tất cả', 'sport') ?></div>
                                <div for="opt2" class="option"
                                     data-filter="time"> <?php esc_html_e('Chưa đá', 'sport') ?></div>
                                <div for="opt2" class="option"
                                     data-filter="time"> <?php esc_html_e('Đang diễn ra', 'sport') ?></div>
                            </div>
                        </div>
                    </div>
                </li>
                <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_FilterTimes" class="filterLi2 xz w-140">
                    <div class="dropdown">
                        <button class="dropdown-toggle tz-name"
                                id="dropdown-toggle"><?php esc_html_e('Theo giải đấu', 'sport') ?></button>
                        <div class="dropdown-menu" id="dropdown-menu">
                            <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>
                <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>
            </ul>
        </div>
    </div>
    <?php
    return ob_get_clean();
}

function renderLiveTableHeaderLiveFixture()
{
    // 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']
    ];

    // 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' => 'Ẩn'  // 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="" colspan="100%">
            <div class="tr_upper-live-title-tr-1">
                <span class="upper-live-icon-football"></span>
                <span class="tr_upper-live-title-tr-1-titleHeader"><?php esc_html_e('Bóng đá', 'sport') ?></span>
                <span class="f11"><?php esc_html_e('Ẩn', 'sport') ?> <span
                            id="hiddencount">0</span> <?php esc_html_e('trận', 'sport') ?> [<?php esc_html_e('Hiển thị tất cả', 'sport') ?>] </span>
            </div>
        </td>
    </tr>
    <?php
    return ob_get_clean();
}

function renderHeaderLiveTableTitleFixture()
{
    $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 py-1 status-time-sched" style="width: 74px;"><?php esc_html_e('Thời gian', 'sport') ?></td>
        <td class="td-bdr"><?php esc_html_e('Đội nhà', 'sport') ?></td>
        <td class="td-bdr"><?php esc_html_e('Tỷ số', 'sport') ?></td>
        <td class="td-bdr"><?php esc_html_e('Đội khách', 'sport') ?></td>
        <td class="td-bdr" colspan="3" style="width: 237px;">
            <div style="display: flex; justify-content: center; gap: 12px;">
                <label style="display: flex; align-items: center; gap: 4px; cursor: pointer;"><input type="radio"
                                                                                                     checked=""
                                                                                                     value="1">HDP</label>
                <label style="display: flex; align-items: center; gap: 4px; cursor: pointer;"><input type="radio"
                                                                                                     value="2">
                    1X2</label>
                <label style="display: flex; align-items: center; gap: 4px; cursor: pointer;"><input type="radio"
                                                                                                     value="3"> <?php esc_html_e('Tài xỉu', 'sport') ?>
                </label>
            </div>
        </td>
        <?php if (!$hideDetail): ?>
            <td id="oddsHead" class="oddsHead" style="width: 67px;">
                <div style="display: flex; padding: 8px; justify-content: center; gap: 12px;">
                    <div class=""><?php esc_html_e('Dữ liệu', 'sport') ?></div>
                </div>
            </td>
        <?php endif; ?>
    </tr>
    <?php
    return ob_get_clean();
}

function fetchdataFixture($maxBetCount = 10, $leagues, $nations)
{
    $hideDetail = (int)(true == get_option('Checkbox_hide_action_sp', false));
    $timestamp = time();
    $dateNow = new DateTime();
    $url_api_fixture = DB_DOMAIN . '/ajax/get-odds-fixture?date=' . $dateNow->format('Y-m-d') . '&order=time&timezone=7&companyid=8&lang=vn';
    $urlCountry = DB_DOMAIN . '/ajax/league-ajax';
    $responseCountry = wp_remote_get($urlCountry, [
        'headers' => [
            'Referer' => home_url(),
        ],
        'timeout' => 60,
        'sslverify' => false,
        'curl' => [
            CURLOPT_SSL_VERIFYPEER => 0,
        ],
    ]);
    $bodyCountry = wp_remote_retrieve_body($responseCountry);
    $dataCountry = json_decode($bodyCountry, true);
    $resLeagues = $dataCountry['league'] ?? [];

    $leaguesL = array_filter(explode(',', $leagues ?? $_GET['leagues'] ?? ""));
    $nationsL = array_filter(explode(',', $nations ?? $_GET['nations'] ?? ""));
    $filterL = [];
    if (count($leaguesL) > 0) {
        $filterL = $leaguesL;
    }
    if (count($nationsL) > 0) {
        foreach ($resLeagues as $l) {

            if (in_array($l['idCountry'], $nationsL)) {
                $filterL[] = $l['sclassID'];
            }
        }
    }
    $leagues_fixture = bongdako_fetch_and_merge_data_faked2($url_api_fixture);
    $betMatchCount = 0;
    if (isset($leagues_fixture) && is_array($leagues_fixture)) {

        foreach ($leagues_fixture as $key => $league_item):

            $league_id = isset($league_item['sclassID']) && $league_item['sclassID'] ? $league_item['sclassID'] : '';
            if ($filterL && !in_array($league_id, $filterL)) {
                continue;
            }
            $league_name = isset($league_item['name']) && $league_item['name'] ? $league_item['name'] : '';
            $league_flag_url = $league_item['logo'] ? IMGS3 . $league_item['logo'] : IMGS3 . '/assets/upload/football/team/images/teamicon.png';
            ?>

            <tr id="ln_<?php echo $league_id; ?>"
                class="Leaguestitle fbHead league-title-head-row league-title-head-mobile" name="Leaguestitle">
                <td class="league-title league-title-ht-title t" colspan="100%" 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 abc"><?php echo $league_name; ?></span>
                    </div><!---->
                    <div class="df1" style="position: relative;">
                        <div class="df1-number hide">8</div>
                        <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):

            $matchitem = $item['matchData'];

            $odd = $item['odds'];

            $MatchState = $matchitem['MatchState'];

            $match_id = $matchitem['ScheduleID'];

            $date = new DateTime('now', new DateTimeZone('Asia/Ho_Chi_Minh'));
            $timeNow = $date->getTimestamp();


            $matchTime = isset($matchitem['matchTime2']) && $matchitem['matchTime2'] ? $matchitem['matchTime2'] : $matchitem['matchTime'];

            $logoHome = IMGS3 . $matchitem['HomeImage'];
            $nameHome = $matchitem['homeTeam'];

            $logoAway = IMGS3 . $matchitem['GuestImage'];
            $nameAway = $matchitem['guestTeam'];

            $hdpHome = $odd['HDP']['UpOdds_Real'] ?? '-';
            $hdp = $odd['HDP']['Goal_Real'] ?? '-';
            $hdpAway = $odd['HDP']['DownOdds_Real'] ?? '-';

            $txOdd = $odd['ou']['Goal'] ?? '-';
            $txOddOver = $odd['ou']['UpOdds'] ?? '-';
            $txOddUnder = $odd['ou']['DownOdds'] ?? '-';

            $euHome = $odd['1x2']['UpOdds_Real'] ?? '-';
            $euDraw = $odd['1x2']['Goal_Real'] ?? '-';
            $euAway = $odd['1x2']['DownOdds_Real'] ?? '-';


            // Format thời gian trận đấu
            $datetime = new DateTime($matchTime, 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'); ?>
            <tr data-v-fbc4c9e1="" id="tr1_<?php echo $match_id; ?>MatchOpen" class="tds fst new-home-tr"
                style="position: relative;">
                <td data-v-fbc4c9e1="" class="black-down" bgcolor="#993300" title="193"
                    style="color: rgb(255, 255, 255); display: none;"></td>
                <td data-v-fbc4c9e1="" name="timeData" class="time handpoint status-time-sched"
                    id="mt_<?php echo $match_id; ?>" width="50">
                    <div data-v-fbc4c9e1="" class="no-text-in" style="position: relative;"></div>
                    <span data-v-fbc4c9e1="" id="got_<?php echo $match_id; ?>">
                        <p data-v-fbc4c9e1=""><?php echo $match_time_formatted ?></p>
                    </span>
                </td>
                <td data-v-fbc4c9e1="" id="tvLink_<?php echo $match_id; ?>" class="tvLinkBtn" width="30">
                    <div data-v-fbc4c9e1="" id="stime_<?php echo $match_id; ?>"><span data-v-fbc4c9e1=""
                                                                                      id="got_<?php echo $match_id; ?>"></span>
                    </div>
                </td>
                <td data-v-fbc4c9e1="" class="name1" id="ht_<?php echo $match_id; ?>"
                    style="text-align: right; position: relative;">
                    <span data-v-fbc4c9e1="" class="hdpstar" style="display: inline;"></span>
                    <div data-v-fbc4c9e1="" class="team-box tleft">
                        <a data-v-fbc4c9e1="" data-team-name="<?php echo $nameHome; ?>" id="3181"
                           rel="nofollow noindex">
                            <span data-v-fbc4c9e1=""
                                  class="Home_OrderEn order-en"> <?php echo !empty($matchitem['Home_OrderEn']) ? '[' . $matchitem['Home_OrderEn'] . ']' : ''; ?> </span>
                            <span data-v-fbc4c9e1="" class="homeTeam"><?php echo $nameHome; ?></span>
                        </a><!---->
                        <p data-v-fbc4c9e1="" class="team-more-info">
                            <span data-v-fbc4c9e1="" id="horder_3181" class="team-hg"></span><!----><!---->
                        </p>
                    </div>
                    <span data-v-fbc4c9e1=""
                          class="Home_OrderEn order-en order-mobile"> <?php echo !empty($matchitem['Home_OrderEn']) ? '[' . $matchitem['Home_OrderEn'] . ']' : ''; ?> </span>
                </td>
                <td data-v-fbc4c9e1="" class="blue handpoint score-color"
                    style="font-weight: 600; font-size: 14px; width: 56px;"> Vs
                </td>
                <td data-v-fbc4c9e1="" class="name2" id="gt_<?php echo $match_id; ?>"
                    style="text-align: left; position: relative;">
                    <div data-v-fbc4c9e1="" class="team-box name2">
                        <!----><a data-v-fbc4c9e1="" data-team-name="<?php echo $nameAway; ?>" id="31169"
                                  rel="nofollow noindex"><span data-v-fbc4c9e1=""
                                                               class="guestTeam"><?php echo $nameAway; ?></span><span
                                    data-v-fbc4c9e1=""
                                    class="Guest_OrderEn order-en"> <?php echo !empty($matchitem['Guest_OrderEn']) ? '[' . $matchitem['Guest_OrderEn'] . ']' : ''; ?> </span></a>
                        <p data-v-fbc4c9e1="" class="team-more-info">
                            <!----><!----><span data-v-fbc4c9e1="" id="horder_31169" class="team-hg"></span>
                        </p>
                    </div>
                    <span data-v-fbc4c9e1=""
                          class="Guest_OrderEn order-en order-mobile"> <?php echo !empty($matchitem['Guest_OrderEn']) ? '[' . $matchitem['Guest_OrderEn'] . ']' : ''; ?> </span>
                </td>
                <td data-v-fbc4c9e1="" class="d-none"><span data-v-fbc4c9e1="" id="cr_<?php echo $match_id; ?>"
                                                            class="conner_span 555">12-1</span></td>
                <td data-v-fbc4c9e1="" class="d-none"></td>
                <td data-v-fbc4c9e1="" class="oddstd c6 _HPD_" width="50">
                    <p data-v-fbc4c9e1="" class="odds1 odds-hdp odds-bg odds-normal"><?php echo $hdpHome ?: '-' ?></p>
                </td>
                <td data-v-fbc4c9e1="" class="oddstd c7 _HPD_" width="50">
                    <p data-v-fbc4c9e1=""
                       class="odds-up odds1 odds-hdp odds-bg odds-normal"><?php echo $euDraw ?: '-' ?></p>
                </td>
                <td data-v-fbc4c9e1="" class="oddstd c8 _HPD_" width="50">
                    <p data-v-fbc4c9e1=""
                       class="odds-down odds1 odds-hdp odds-bg odds-normal"><?php echo $txOddOver ?: '-' ?></p>
                </td>
                <?php if (!$hideDetail): ?>
                    <!----><!---->
                    <td data-v-fbc4c9e1="" colspan="1" class="be-change-ht-title toolimg 2-0 action-table"><span
                                data-v-fbc4c9e1="" id="detail_icon_<?php echo $match_id; ?>" class="Detail-icon r0"
                                style="margin: auto;"></span></td>
                <?php endif ?>
            </tr>
            <?php
            $betMatchCount++;
            if ($betMatchCount == $maxBetCount) {
                break;
            }
            ?>
        <?php endforeach; ?>

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

        <?php endforeach; ?>


    <?php }
}