= \''.$start.'\' AND datetime_end <= \''.$end.'\'';
echo 'Total Listener Hours
';
//echo $query;
echo '';
if((isset($_GET['start'])) OR (isset($_GET['end']))){
echo 'Go to All Time stats
';
}
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo '
';
//echo $row['duration'] .' seconds - which is:
';
/*
$secs = $row['duration'];
$mins = $row['duration'] / 60;
$hours = floor($mins / 60);
$mins = floor($mins - (floor($hours) * 60));
if($mins < 10){
$mins = '0'.$mins;
}
$secs = $secs - (($hours * 60 * 60) + ($mins * 60));
echo $hours.' hours '.$mins.' mins '.$secs.' secs';
*/
echo '
Current Listeners: '.$listeners .'
Current Listener Duration (so far): '.strTime($current).'
Total Listener Duration: ';
$hours = ((($row['duration'] + $current) /60)/60);
$secs = ($row['duration'] + $current) - ((floor($hours)*60)*60);
$mins = $secs / 60;
echo strTime($row['duration'] + $current) . '
AKA: ' . floor($hours) .' hours and '.round($mins).' minutes
';
echo '
Average Listener Duration (Rounded - Doesn\'t include listeners who are still listening): ';
echo strTime(round($row['average']));
echo '
Max Listener Sessions: ';
echo $row['listeners'];
?>
Written by Brett Jenkins for Xtreme Radio