Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homepage/views.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ function update_species_list($filename, $species, $add) {
if($_GET['view'] == "Kiosk"){$kiosk = true;include('todays_detections.php');}
if($_GET['view'] == "Species Stats"){include('stats.php');}
if($_GET['view'] == "Weekly Report" || $_GET['view'] == "Report" || $_GET['view'] == "Reports"){include('scripts/reports.php');}
if($_GET['view'] == "Insights"){include('insights.php');}
if($_GET['view'] == "Insights"){include('scripts/insights.php');}
if($_GET['view'] == "Analytics"){include('scripts/analytics.php');}
if($_GET['view'] == "Species"){include('scripts/species.php');}
if($_GET['view'] == "Daily Charts"){include('history.php');}
Expand Down
2 changes: 1 addition & 1 deletion scripts/insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
$wind_impact = $unified_wind;
$ideal_res = $db->query("SELECT d.Com_Name, ROUND(AVG(w.Temp), 1) as avg_temp, ROUND(MIN(w.Temp), 1) as min_temp, ROUND(MAX(w.Temp), 1) as max_temp, COUNT(*) as cnt FROM detections d INNER JOIN weather w ON d.Date = w.Date AND CAST(substr(d.Time, 1, 2) AS INTEGER) = w.Hour GROUP BY d.Sci_Name HAVING cnt >= 5 ORDER BY cnt DESC");
while($row = $ideal_res->fetchArray(SQLITE3_ASSOC)) { $species_ideal[] = $row; }
$trend_res = $db->query("SELECT d.Date, COUNT(*) as det_count, ROUND(AVG(w.Temp), 1) as avg_temp FROM detections d LEFT JOIN weather w ON d.Date = w.Date AND CAST(substr(d.Time, 1, 2) AS INTEGER) = w.Hour WHERE d.Date >= '$one_month_ago' GROUP BY d.Date ORDER BY d.Date ASC");
$trend_res = $db->query("SELECT d.Date, COUNT(*) as det_count, ROUND((SELECT AVG(w2.Temp) FROM weather w2 WHERE w2.Date = d.Date), 1) as avg_temp FROM detections d WHERE d.Date >= '$one_month_ago' GROUP BY d.Date ORDER BY d.Date ASC");
while($row = $trend_res->fetchArray(SQLITE3_ASSOC)) { $temp_vs_detections[] = $row; }
$temp_trend_labels = json_encode(array_map(function($r) { return date('M j', strtotime($r['Date'])); }, $temp_vs_detections));
$temp_trend_temps = json_encode(array_map(function($r) { return $r['avg_temp']; }, $temp_vs_detections));
Expand Down
9 changes: 9 additions & 0 deletions scripts/species.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@
.stats-table { width: 100%; font-size: 0.85rem; }
.stats-table tr td:first-child { color: var(--text-muted); padding-bottom: 4px; }
.stats-table tr td:last-child { text-align: right; font-weight: 600; color: var(--text-primary); padding-bottom: 4px; }
.species-card-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.species-card-links .mrd-link-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; text-decoration: none; color: var(--text-muted); background: var(--bg-input, #f1f5f9); border: 1px solid var(--border); transition: background 0.2s, color 0.2s; }
.species-card-links .mrd-link-pill img { width: 12px; height: 12px; }
.species-card-links .mrd-link-pill:hover { background: var(--accent); color: white; }

</style>

Expand Down Expand Up @@ -304,6 +308,11 @@
<tr><td>Confidence:</td><td><?php echo round($bird['MaxConf'] * 100, 1); ?>%</td></tr>
<tr><td>First:</td><td><?php echo date('n/j/Y', strtotime($bird['FirstDate'])); ?></td></tr>
</table>
<?php $info = get_info_url($sci_name); ?>
<div class="species-card-links">
<a href="<?php echo $info['URL']; ?>" target="_blank" class="mrd-link-pill"><img src="images/info.png"> <?php echo $info['TITLE']; ?></a>
<a href="https://wikipedia.org/wiki/<?php echo urlencode($sci_name); ?>" target="_blank" class="mrd-link-pill"><img src="images/wiki.png"> Wikipedia</a>
</div>
</div>
</div>
<?php endforeach; ?>
Expand Down