2018-03-19 01:31:43 +00:00
<?php $this -> layout ( 'main' , [ 'title' => __ ( 'Station Center' ), 'manual' => true ]) ?>
2015-05-22 09:13:52 +00:00
2017-09-24 11:29:19 +00:00
<?php
2018-08-04 22:05:14 +00:00
/** @var \App\Assets $assets */
2017-09-24 11:29:19 +00:00
$assets
->load('highcharts')
->load('highcharts_theme_'.$customization->getTheme());
?>
2015-05-22 09:13:52 +00:00
2018-01-09 09:53:48 +00:00
< script type = "text/javascript" nonce = " <? = $assets -> getCspNonce () ?> " >
2016-09-12 17:46:47 +00:00
$(function () {
Highcharts.setOptions({
global: {
timezoneOffset: <? = \App\Timezone :: getOffsetMinutes () ?> ,
useUTC: false
}
});
2015-05-22 09:13:52 +00:00
});
< / script >
2016-05-13 01:52:34 +00:00
< div class = "row" >
< div class = "col-sm-12" >
2017-11-08 18:11:09 +00:00
< section class = "card" role = "region" >
2016-05-13 01:52:34 +00:00
< div class = "card-header ch-alt" >
2018-03-19 01:31:43 +00:00
< h2 > <? = __ ( 'Station Statistics' ) ?> </ h2 >
2016-05-13 01:52:34 +00:00
< / div >
2018-01-13 12:45:16 +00:00
< div role = "tabpanel" >
2017-06-20 04:44:24 +00:00
< ul class = "tab-nav" role = "tablist" >
2018-03-19 01:31:43 +00:00
< li class = "p-l-10 active" >< a role = "tab" data-toggle = "tab" aria-expanded = "true" aria-controls = "listeners-by-day" href = "#listeners-by-day" > <? = __ ( 'Listeners by Day' ) ?> </ a ></ li >
< li >< a role = "tab" data-toggle = "tab" aria-controls = "listeners-by-hour" href = "#listeners-by-hour" > <? = __ ( 'Listeners by Hour' ) ?> </ a ></ li >
< li >< a role = "tab" data-toggle = "tab" aria-controls = "listeners-by-day-of-week" href = "#listeners-by-day-of-week" > <? = __ ( 'Listeners by Day of Week' ) ?> </ a ></ li >
2017-06-20 04:44:24 +00:00
< / ul >
2015-05-22 09:13:52 +00:00
2017-06-20 04:44:24 +00:00
< div class = "tab-content" >
2018-01-13 12:45:16 +00:00
< div class = "tab-pane card-body card-padding active" id = "listeners-by-day" role = "tabpanel" >
2018-02-01 11:49:40 +00:00
<? = $this -> fetch ( 'stations/index/index-dailystats' , [
'daily_ranges' => $daily_ranges,
'hourly_averages' => $hourly_averages,
'daily_averages' => $daily_averages
]) ?>
2017-06-20 04:44:24 +00:00
< / div >
2018-01-13 12:45:16 +00:00
< div class = "tab-pane card-padding" id = "listeners-by-hour" role = "tabpanel" >
2018-02-01 11:49:40 +00:00
<? = $this -> fetch ( 'stations/index/index-hourlystats' , [
'averages_by_hour' => $averages_by_hour,
]) ?>
2017-06-20 04:44:24 +00:00
< / div >
2018-01-13 12:45:16 +00:00
< div class = "tab-pane card-padding" id = "listeners-by-day-of-week" role = "tabpanel" >
2018-02-01 11:49:40 +00:00
<? = $this -> fetch ( 'stations/index/index-dayofweek' , [
'day_of_week_stats' => $day_of_week_stats,
]) ?>
2017-06-20 04:44:24 +00:00
< / div >
< / div >
2016-05-13 01:52:34 +00:00
< / div >
2017-11-08 18:11:09 +00:00
< / section >
2015-05-22 09:13:52 +00:00
< / div >
2016-05-13 01:52:34 +00:00
< / div >
2015-05-22 09:13:52 +00:00
2016-05-13 01:52:34 +00:00
< div class = "row" >
< div class = "col-sm-6" >
2017-11-08 18:11:09 +00:00
< section class = "card" role = "region" >
2016-05-13 01:52:34 +00:00
< div class = "card-header ch-alt" >
2018-03-19 01:31:43 +00:00
< h2 >< i class = "zmdi zmdi-thumb-up" ></ i > <? = __ ( 'Best Performing Songs' ) ?> < small > <? = __ ( 'in the last 48 hours' ) ?> </ small ></ h2 >
2016-05-13 01:52:34 +00:00
< / div >
< div class = "table-responsive" >
2016-05-16 02:34:53 +00:00
< table class = "table table-striped table-condensed table-nopadding" >
2016-05-13 01:52:34 +00:00
< colgroup >
< col width = "20%" >
< col width = "80%" >
< / colgroup >
2016-05-16 02:34:53 +00:00
< thead >
< tr >
2018-03-19 01:31:43 +00:00
< th > <? = __ ( 'Change' ) ?> </ th >
< th > <? = __ ( 'Song' ) ?> </ th >
2016-05-16 02:34:53 +00:00
< / tr >
< / thead >
2016-05-13 01:52:34 +00:00
< tbody >
2016-09-17 22:48:40 +00:00
<?php foreach ( $best_performing_songs as $song_row ) : ?>
2016-05-13 01:52:34 +00:00
< tr >
2016-05-17 03:37:38 +00:00
< td class = "text-center text-success" >
2016-05-16 02:34:53 +00:00
< i class = "zmdi zmdi-thumb-up" ></ i > <? = abs ( $song_row [ 'stat_delta' ]) ?> < br >
< small > <? = $song_row [ 'stat_start' ] ?> to <? = $song_row [ 'stat_end' ] ?>
< / td >
2016-05-13 01:52:34 +00:00
< td >
2016-09-17 22:48:40 +00:00
<?php if ( $song_row [ 'song' ][ 'title' ]) : ?>
2016-05-17 03:37:38 +00:00
< b > <? = $song_row [ 'song' ][ 'title' ] ?> </ b >< br >
<? = $song_row [ 'song' ][ 'artist' ] ?>
2016-09-17 22:48:40 +00:00
<?php else : ?>
2016-05-17 03:37:38 +00:00
<? = $song_row [ 'song' ][ 'text' ] ?>
2016-09-17 22:48:40 +00:00
<?php endif ; ?>
2016-05-13 01:52:34 +00:00
< / td >
< / tr >
2016-09-17 22:48:40 +00:00
<?php endforeach ; ?>
2016-05-13 01:52:34 +00:00
< / tbody >
< / table >
< / div >
2017-11-08 18:11:09 +00:00
< / section >
2016-05-13 01:52:34 +00:00
< / div >
< div class = "col-sm-6" >
2017-11-08 18:11:09 +00:00
< section class = "card" role = "region" >
2016-05-13 01:52:34 +00:00
< div class = "card-header ch-alt" >
2018-03-19 01:31:43 +00:00
< h2 >< i class = "zmdi zmdi-thumb-down" ></ i > <? = __ ( 'Worst Performing Songs' ) ?> < small > <? = __ ( 'in the last 48 hours' ) ?> </ small ></ h2 >
2016-05-13 01:52:34 +00:00
< / div >
< div class = "table-responsive" >
2016-05-16 02:34:53 +00:00
< table class = "table table-striped table-condensed table-nopadding" >
2016-05-13 01:52:34 +00:00
< colgroup >
< col width = "20%" >
< col width = "80%" >
< / colgroup >
2016-05-16 02:34:53 +00:00
< thead >
< tr >
2018-03-19 01:31:43 +00:00
< th > <? = __ ( 'Change' ) ?> </ th >
< th > <? = __ ( 'Song' ) ?> </ th >
2016-05-16 02:34:53 +00:00
< / tr >
< / thead >
2016-05-13 01:52:34 +00:00
< tbody >
2016-09-17 22:48:40 +00:00
<?php foreach ( $worst_performing_songs as $song_row ) : ?>
2016-05-13 01:52:34 +00:00
< tr >
2016-05-17 03:37:38 +00:00
< td class = "text-center text-danger" >
2016-05-16 02:34:53 +00:00
< i class = "zmdi zmdi-thumb-down" ></ i > <? = abs ( $song_row [ 'stat_delta' ]) ?> < br >
< small > <? = $song_row [ 'stat_start' ] ?> to <? = $song_row [ 'stat_end' ] ?>
< / td >
2016-05-13 01:52:34 +00:00
< td >
2016-09-17 22:48:40 +00:00
<?php if ( $song_row [ 'song' ][ 'title' ]) : ?>
2016-05-17 03:37:38 +00:00
< b > <? = $song_row [ 'song' ][ 'title' ] ?> </ b >< br >
<? = $song_row [ 'song' ][ 'artist' ] ?>
2016-09-17 22:48:40 +00:00
<?php else : ?>
2016-05-17 03:37:38 +00:00
<? = $song_row [ 'song' ][ 'text' ] ?>
2016-09-17 22:48:40 +00:00
<?php endif ; ?>
2016-05-13 01:52:34 +00:00
< / td >
< / tr >
2016-09-17 22:48:40 +00:00
<?php endforeach ; ?>
2016-05-13 01:52:34 +00:00
< / tbody >
< / table >
< / div >
2017-11-08 18:11:09 +00:00
< / section >
2015-05-22 09:13:52 +00:00
< / div >
2016-05-13 01:52:34 +00:00
< / div >
2015-05-22 09:13:52 +00:00
2016-05-13 01:52:34 +00:00
< div class = "row" >
< div class = "col-sm-12" >
2017-11-08 18:11:09 +00:00
< section class = "card" role = "region" >
2016-05-13 01:52:34 +00:00
< div class = "card-header ch-alt" >
2018-03-19 01:31:43 +00:00
< h2 > <? = __ ( 'Most Played Songs' ) ?> < small > <? = __ ( 'in the last month' ) ?> </ small ></ h2 >
2016-05-13 01:52:34 +00:00
< / div >
< div class = "table-responsive" >
2016-05-16 02:34:53 +00:00
< table class = "table table-striped table-condensed table-nopadding" >
2016-05-13 01:52:34 +00:00
< colgroup >
2016-05-16 02:34:53 +00:00
< col width = "10%" >
< col width = "90%" >
2016-05-13 01:52:34 +00:00
< / colgroup >
2016-05-16 02:34:53 +00:00
< thead >
< tr >
2018-03-19 01:31:43 +00:00
< th > <? = __ ( 'Plays' ) ?> </ th >
< th > <? = __ ( 'Song' ) ?> </ th >
2016-05-16 02:34:53 +00:00
< / tr >
< / thead >
2016-05-13 01:52:34 +00:00
< tbody >
2016-09-17 22:48:40 +00:00
<?php foreach ( $song_totals [ 'played' ] as $song_row ) : ?>
2016-05-13 01:52:34 +00:00
< tr >
2016-05-16 02:34:53 +00:00
< td class = "text-center" > <? = $song_row [ 'records' ] ?> </ td >
2016-05-13 01:52:34 +00:00
< td >
2016-09-17 22:48:40 +00:00
<?php if ( $song_row [ 'song' ][ 'title' ]) : ?>
2016-05-13 01:52:34 +00:00
< b > <? = $song_row [ 'song' ][ 'title' ] ?> </ b >< br >
<? = $song_row [ 'song' ][ 'artist' ] ?>
2016-09-17 22:48:40 +00:00
<?php else : ?>
2016-05-13 01:52:34 +00:00
<? = $song_row [ 'song' ][ 'text' ] ?>
2016-09-17 22:48:40 +00:00
<?php endif ; ?>
2016-05-13 01:52:34 +00:00
< / td >
< / tr >
2016-09-17 22:48:40 +00:00
<?php endforeach ; ?>
2016-05-13 01:52:34 +00:00
< / tbody >
< / table >
< / div >
2017-11-08 18:11:09 +00:00
< / section >
2015-05-22 09:13:52 +00:00
< / div >
2018-08-04 22:05:14 +00:00
< / div >