Fix undefined index errors in statistics tables

Initialize bandcalls and modecalls arrays with default zero values in Stats.php to prevent undefined index errors. Update qsotable.php and uniquetable.php views to display 0 when mode or band totals are not set.
这个提交包含在:
Peter Goodhall 2025-08-10 17:44:25 +01:00
父节点 09c45a7e3e
当前提交 43e7d9cb9d
共有 3 个文件被更改,包括 13 次插入3 次删除

查看文件

@ -88,10 +88,20 @@
}
}
// Initialize bandcalls array with all bands set to 0
foreach ($bands as $band) {
$bandcalls[$band] = 0;
}
foreach ($bandunique as $band) {
$bandcalls[$band->band] = $band->calls;
}
// Initialize modecalls array with all modes set to 0
foreach ($modes as $mode) {
$modecalls[$mode] = 0;
}
foreach ($modeunique as $mode) {
//if ($mode->col_submode == null) {
if ($mode->col_submode == null || $mode->col_submode == "") {

查看文件

@ -17,7 +17,7 @@ if ($qsoarray) {
foreach ($value as $key => $val) {
echo '<td>' . $val . '</td>';
}
echo '<th>' . $modetotal[$mode] . '</th>';
echo '<th>' . (isset($modetotal[$mode]) ? $modetotal[$mode] : 0) . '</th>';
echo '</tr>';
}
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';

查看文件

@ -17,13 +17,13 @@ if ($qsoarray) {
foreach ($value as $key => $val) {
echo '<td>' . $val . '</td>';
}
echo '<th>' . $modeunique[$mode] . '</th>';
echo '<th>' . (isset($modeunique[$mode]) ? $modeunique[$mode] : 0) . '</th>';
echo '</tr>';
}
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';
foreach($bands as $band) {
echo '<th>' . $bandunique[$band] . '</th>';
echo '<th>' . (isset($bandunique[$band]) ? $bandunique[$band] : 0) . '</th>';
}
echo '<th>' . $total->calls . '</th>';
echo '</tr></tfoot></table>';