echo ""; "; echo "

Bird Stats for Larkspur, CO

"; // Display top species echo "
"; echo "
"; echo "

Top Species

"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; // Modified column name echo ""; echo ""; if (isset($top_species['species']) && is_array($top_species['species'])) { foreach ($top_species['species'] as $species) { echo ""; echo ""; echo ""; // Assuming 'latestDetectionAt' is a part of the species array and formatted as ISO8601 datetime if (isset($species['latestDetectionAt'])) { $latest_detection_time = strtotime($species['latestDetectionAt']); $latest_detection_date = date('m/d', $latest_detection_time); if ($today == date('Y-m-d', $latest_detection_time)) { $latest_detection_date = 'Today'; } elseif ($latest_detection_time >= strtotime('-5 days')) { $latest_detection_date = date('l', $latest_detection_time); } echo ""; // Modified column value } else { echo ""; } echo ""; echo ""; } } echo "
Common NameTotal DetectionsLast HeardImage
" . $species['commonName'] . "" . $species['detections']['total'] . "" . date('g:i a, ', $latest_detection_time) . $latest_detection_date . "No detection time availableImage of " . $species[
"; echo "
"; // Close table-container echo "
"; // Close top-species // Display latest detections echo "
"; echo "
"; echo "

Latest Detections

"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // New column for play button echo ""; if (isset($detections['detections']) && is_array($detections['detections'])) { foreach ($detections['detections'] as $detection) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
SpeciesDetection TimeConfidenceListen!
" . $detection['species']['commonName'] . "" . date('g:i a, m/d', strtotime($detection['timestamp'])) . "" . $detection['confidence'] . ""; if (isset($detection['soundscape']['url'])) { echo "Play"; } else { echo "fixThis"; } echo "
"; echo "
"; // Close table-container echo "
"; // Close latest-detections echo ""; echo "
"; // Close table-container echo "
"; // Close data-section echo ""; // Close weather-stats-container ?> ```