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.
这个提交包含在:
父节点
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) {
|
foreach ($bandunique as $band) {
|
||||||
$bandcalls[$band->band] = $band->calls;
|
$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) {
|
foreach ($modeunique as $mode) {
|
||||||
//if ($mode->col_submode == null) {
|
//if ($mode->col_submode == null) {
|
||||||
if ($mode->col_submode == null || $mode->col_submode == "") {
|
if ($mode->col_submode == null || $mode->col_submode == "") {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ if ($qsoarray) {
|
||||||
foreach ($value as $key => $val) {
|
foreach ($value as $key => $val) {
|
||||||
echo '<td>' . $val . '</td>';
|
echo '<td>' . $val . '</td>';
|
||||||
}
|
}
|
||||||
echo '<th>' . $modetotal[$mode] . '</th>';
|
echo '<th>' . (isset($modetotal[$mode]) ? $modetotal[$mode] : 0) . '</th>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';
|
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ if ($qsoarray) {
|
||||||
foreach ($value as $key => $val) {
|
foreach ($value as $key => $val) {
|
||||||
echo '<td>' . $val . '</td>';
|
echo '<td>' . $val . '</td>';
|
||||||
}
|
}
|
||||||
echo '<th>' . $modeunique[$mode] . '</th>';
|
echo '<th>' . (isset($modeunique[$mode]) ? $modeunique[$mode] : 0) . '</th>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';
|
echo '</tbody><tfoot><tr><th>'.lang('statistics_total').'</th>';
|
||||||
|
|
||||||
foreach($bands as $band) {
|
foreach($bands as $band) {
|
||||||
echo '<th>' . $bandunique[$band] . '</th>';
|
echo '<th>' . (isset($bandunique[$band]) ? $bandunique[$band] : 0) . '</th>';
|
||||||
}
|
}
|
||||||
echo '<th>' . $total->calls . '</th>';
|
echo '<th>' . $total->calls . '</th>';
|
||||||
echo '</tr></tfoot></table>';
|
echo '</tr></tfoot></table>';
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用