Only show and evaluate 4-char grids for hams.at

This commit is contained in:
phl0
2024-05-16 12:58:51 +02:00
parent e5fa4cecb5
commit 7037b7aabe
2 changed files with 3 additions and 3 deletions

View File

@@ -102,7 +102,7 @@ class Hamsat extends CI_Controller {
}
$decoded_json->data[$i]->mode_class = $modeclass;
for($j = 0; $j < count($decoded_json->data[$i]->grids); $j++) {
$worked = $this->logbook_model->check_if_grid_worked_in_logbook($decoded_json->data[$i]->grids[$j], null, "SAT");
$worked = $this->logbook_model->check_if_grid_worked_in_logbook(substr($decoded_json->data[$i]->grids[$j], 0, 4), null, "SAT");
if ($worked->num_rows() != 0) {
$decoded_json->data[$i]->grids_wkd[$j] = 1;
} else {

View File

@@ -107,9 +107,9 @@ function loadActivationsTable(rows, show_workable_only) {
grids = [];
for (var j=0; j < activation.grids_wkd.length; j++) {
if (activation.grids_wkd[j] == 1) {
grids.push("<span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">"+activation.grids[j]+"</span>")
grids.push("<span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">"+activation.grids[j].substring(0, 4)+"</span>")
} else {
grids.push("<span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge bg-danger\">"+activation.grids[j]+"</span>")
grids.push("<span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge bg-danger\">"+activation.grids[j].substring(0, 4)+"</span>")
}
}
data.push(grids.join(' '));