Files
nhgooi.nl/website/resources/views/radioscheduleweek.blade.php
2020-01-06 02:36:10 +01:00

27 lines
1.2 KiB
PHP

@php($date = null)@php($now = new \DateTime("now"))
@foreach($schedule as $item)
@if(($formattedDate = Formatter::fullDate($item['starttime'], 'W d m')) != $date)
@php($date = $formattedDate)
@if($date != null) </table> @endif
<h2>{{$formattedDate}}</h2>
<table class="table table-hover">
@endif
@php($isCurrent = ($now >= $item['starttime']) && ($now <= $item['endtime']))
@php($class =( $item['program']->priority < 2 ? 'bg-primary'
:( $item['program']->nonstop || $item['program']->rerun ? 'text-muted'
:( $isCurrent ? 'bg-info active text-primary'
:( ''
)))))
<tr @if($class) class="{{$class}}" @endif>
<td class="time"><p>{{$item['starttime']->format('H:i')}} &ndash; {{$item['endtime']->format('H:i')}} uur</p></td>
<td class="title">
<p><a title="{{$item['program']->name}}" href="programma{{$item['program']->url}}">{{$item['program']->name}}
@if($isCurrent) <span class="bg-primary current-marker">Nu op NH Gooi</span> @endif
</a><p>
<p>{{Formatter::excerpt(strip_tags($item['program']->description), 200)}}</p>
</td>
</tr>
@endforeach
</table>