<?php
$title = $l ="Музыка-Популярные радиостанции";
$lBack = profile :: getLink($user);

$thisLink = "/audio/radio";

require (CORE."head.php");
$radio = include coreAudio . 'radioList.php';
?>
    <link type="text/css" rel="stylesheet" media="only screen" href="/template/audio/css/main.css?v=<?= filemtime(ROOT . 'template/audio/css/main.css') ?>"/>
    <div class="app-block">
    <noscript>
        <style> .ai_play:hover .i_play {
                opacity: 0;
            } </style>
    </noscript>
    <div class="pcont audioPage">
        <div class="audioPage__header">
            <div class="audioPage__tabs">
                <ul class="tabs">
                    <div class="hp_block tabs_block">
                        <ul class="tabs_list">
                            <li>
                                <a class="tab_item" href="/audio/">Популярное</a>
                            </li>
                            <li>
                                <a class="tab_item tab_item_cur" href="/audio/radio">Радио</a>
                            </li>
                        </ul>
                    </div>
                </ul>
            </div>
        </div>
        <div class="upanel">
            <div id="radio_container" class="bl_cont">
                <?php
                $limit = 10;
                $itemData = array_slice($radio, $get['_pp'], $limit, true);
                $dataCount = count($radio);
                if (count($itemData) === 0) {
                    ?>
                    <div class="service_msg_box">
                        <div class="service_msg service_msg_null">Нет ни одной радиостанции.</div>
                    </div>
                    <?
                } else {
                    if ($get['_pp'] >= $limit) {
                        ?>
                        <div class="show_next_wrap">
                            <a class="show_next" href="/audio/radio/<?= (($get['_pp'] - $limit) == 0 ? '' : 'p/' . ($get['_pp'] - $limit)) ?>">Показать предыдущие</a>
                        </div>
                        <?
                    }
                    ?>
                    <div class="audios_block audios_list radio_container">
                        <?php
                        foreach ($itemData as $key => $item) {
                            ?>
                            <div id="audio<?= $key ?>_radio" data-id="<?= $key ?>_radio"
                                 class="audioPlay audio_item ai_has_btn">
                                <div class="ai_info">
                                    <div class="ai_play" style="<?= $item['cover'] ?>"
                                         onclick="audioplayer.playPause(event, '<?= $key ?>_radio', true);">
                                        <i class="i_play">
                                        </i>
                                    </div>
                                    <div class="ai_body">
                                        <div class="ai_dur" data-dur="120">0:00</div>
                                        <div class="ai_label">
                                            <span class="ai_artist"><?= $item['name'] ?></span><span
                                                    class="dividers"></span><span
                                                    class="ai_title"></span>
                                        </div>
                                        <input type="hidden" value="<?= $item['url'] ?>">
                                    </div>
                                </div>
                                <div class="ai_controls">
                                    <table class="row_table">
                                        <tbody>
                                        <tr>
                                            <td class="aic_progress_wrap" style="display: none">
                                                <div class="aic_line">
                                                    <div class="aic_ln aic_back_line slider_loading_bar"></div>
                                                    <div class="aic_ln aic_load_line"></div>
                                                    <div class="aic_ln aic_pl_wrap">
                                                        <div class="aic_ln aic_progress_line">
                                                            <div class="aic_slider"></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                            <td class="aic_volume_wrap">
                                                <div class="aic_line" onmousedown="audioplayer.setVolume(this, event);"
                                                     onclick="cancelEvent(event);">
                                                    <div class="aic_ln aic_back_line"
                                                         onclick="cancelEvent(event);"></div>
                                                    <div class="aic_ln aic_pl_wrap" onclick="cancelEvent(event);">
                                                        <div class="aic_ln aic_progress_line"
                                                             onclick="cancelEvent(event);">
                                                            <div class="aic_slider" onclick="cancelEvent(event);"></div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <?
                        }

                        ?>
                    </div>
                    <?php
                    if ($dataCount > $limit && $dataCount > ($get['_pp'] + $limit)) {
                        ?>
                        <div class="show_more_wrap">
                            <a class="show_more" href="/audio/radio/p/<?= ($get['_pp'] + $limit) ?>">Показать ещё
                                радиостанции</a>
                        </div>
                        <?
                    }
                } ?>
            </div>
        </div>
    </div>
<?
require (CORE."foot.php");
?>