@section('title', __('radio.menu_item_5_sub_6')) @section('head') @endsection @php $breadcrumb = [ ['label' => __('general.header_nav_radio')], ['label' => __('radio.menu_item_5')], ['label' => __('radio.menu_item_5_sub_6')], ]; $tabs = [ 'programetes' => ['fa-bolt', __('radio.library_tab_programetes'), route('radio.library.r')], 'programas' => ['fa-microphone-lines', __('radio.library_tab_programas'), route('radio.library.r', 'programas')], 'programas-fds' => ['fa-calendar-days', __('radio.library_tab_programas_fds'), route('radio.library.r', 'programas-fds')], 'vinhetas' => ['fa-wave-square', __('radio.library_tab_vinhetas'), route('radio.library.r', 'vinhetas')], 'campanhas' => ['fa-bullseye', __('radio.library_tab_campanhas'), route('radio.library.r', 'campanhas')], ]; $current = $type ?: 'programetes'; $folder = match ($current) { 'programas' => 'Programas', 'programas-fds' => 'Programas fim de semana', 'vinhetas' => 'SISVinhetas', 'campanhas' => 'Campanhas', default => 'Programetes', }; $isAdd = in_array($current, ['vinhetas', 'campanhas'], true); $today = date('Y-m-d'); $port = str_replace('/', '-brasbar', EncryptBras($streamData->port)); $categories = []; if (!$isAdd) { $ids = $allLibrary->pluck('category')->filter()->unique()->all(); if ($ids) { $categories = DB::table('library_categories')->whereIn('id', $ids)->orderBy('name')->get()->keyBy('id'); } } // The file names follow the rules the content server expects $blockName = function ($lib, $index) use ($current) { if ($current === 'campanhas') { return $lib->name . str_pad((string) $index, 2, '0', STR_PAD_LEFT); } if (str_contains($lib->name, 'Previsão do tempo')) { $regions = [1 => 'Centro oeste', 2 => 'Nordeste', 3 => 'Norte', 4 => 'Sudeste', 5 => 'Sul']; return $lib->name . ' - ' . ($regions[$index] ?? 'Sul'); } if ($lib->id === 193) { return $lib->name . ' (' . $index . ')'; } return $lib->name . ($lib->total == 1 ? ' - ' . __('radio.library_block_complete') : ' - ' . __('radio.library_block_part', ['number' => '0' . $index])); }; @endphp @include('includes/header-novo')
@include('includes.breadcrumb') @include('includes.flash')

{{ __('radio.menu_item_5_sub_6') }}

{{ __('radio.library_page_sub') }}

@if($streamData->plan_contents == 0)

{{ __('radio.library_no_plan') }}

{{ __('radio.library_no_plan_desc') }}

@else

{{ $tabs[$current][1] }}

{{ trans_choice('radio.library_count', $allLibrary->count(), ['count' => $allLibrary->count()]) }}
@if(!$allLibrary->count())

{{ __('radio.library_empty') }}

{{ __('radio.library_lang_empty') }}

@else @if(count($categories) > 1)
{{ __('radio.library_filter_label') }}
@foreach($categories as $category) @endforeach
@endif
    @foreach($allLibrary as $lib)
  • @if($lib->img) @else @endif {{ $lib->name }} @if(!$isAdd && $lib->last_update) {{ __('radio.library_last_update') }} {{ date('d/m/Y H:i', strtotime($lib->last_update)) }} @endif @if($lib->description) {{ $lib->description }} @endif @if($current === 'campanhas' && $lib->campaign_start_date) {{ date('d/m/Y', strtotime($lib->campaign_start_date)) }} a {{ date('d/m/Y', strtotime($lib->campaign_end_date)) }} @endif @if(!$isAdd) {{ __('radio.library_col_period') }} {{ $current === 'programas-fds' ? __('radio.library_tab_programas_fds') : ($lib->period == '1' ? __('radio.weekday_mon') . ' a ' . __('radio.weekday_fri') : __('radio.weekday_mon') . ' a ' . __('radio.weekday_sat')) }} @if($lib->over_msg) {{ $lib->over_msg }} @endif @endif {{ __('radio.library_col_total') }} {{ $lib->total }} {{ Str::lower(__('radio.library_label_blocks')) }} @if($lib->average) {{ __('radio.library_col_average') }} {{ date('H:i:s', strtotime($lib->average)) }} @endif
    @if($current === 'vinhetas') @php $file = $lib->name . '.mp3'; @endphp
    {{ __('radio.library_download') }}
    @else @endif
  • @endforeach
@endif
@endif
@section('scripts') @endsection @include('includes/footer-novo')