diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index a32553769..88d748a8e 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -899,13 +899,12 @@ class Logbookadvanced extends CI_Controller { $type = $this->input->post('type', true); $this->load->model('logbookadvanced_model'); + $data['result'] = $this->logbookadvanced_model->runCheckDb($type); if ($type == 'checkstate') { - $data['result'] = $this->logbookadvanced_model->runCheckDb($type); - $this->load->view('logbookadvanced/checkresult', $data); + $this->load->view('logbookadvanced/statecheckresult', $data); } else { - $result = $this->logbookadvanced_model->runCheckDb($type); - header("Content-Type: application/json"); - echo json_encode($result); + $data['type'] = $type; + $this->load->view('logbookadvanced/checkresult', $data); } } diff --git a/application/views/logbookadvanced/checkresult.php b/application/views/logbookadvanced/checkresult.php index 512bcfb4f..f105fe2dd 100644 --- a/application/views/logbookadvanced/checkresult.php +++ b/application/views/logbookadvanced/checkresult.php @@ -1,45 +1,46 @@ - 0): ?> -
= __("QSOs with missing state and gridsquares with 6 or more characters found for the following DXCC's:"); ?>
+ -| = __("Prefix"); ?> | -= __("DXCC"); ?> | -= __("QSOs"); ?> | -= __("Action"); ?> | -
|---|---|---|---|
| prefix; ?> | -- | - | - - - | -
= __("No QSOs were found where state information can be fixed."); ?>
-= __("QSOs with missing state and gridsquares with 6 or more characters found for the following DXCC's:"); ?>
+ +| = __("Prefix"); ?> | += __("DXCC"); ?> | += __("QSOs"); ?> | += __("Action"); ?> | +
|---|---|---|---|
| prefix; ?> | ++ | + | + + + | +
= __("No QSOs were found where state information can be fixed."); ?>
+QSO to update found: ' + (response[0].count) + '
'; - $('.result').html(resultHtml); + $('.result').html(response); }, error: function(xhr, status, error) { - $('#checkUpdateDistancesBtn').prop('disabled', false).text('= __("Check") ?>'); + $('#checkUpdateDistancesBtn').prop("disabled", false).removeClass("running"); $('#closeButton').prop('disabled', false); - let errorMsg = '= __("Error checking distance information") ?>'; + let errorMsg = 'Error checking distance information'; if (xhr.responseJSON && xhr.responseJSON.message) { errorMsg += ': ' + xhr.responseJSON.message; } BootstrapDialog.alert({ - title: '= __("Error") ?>', + title: 'Error', message: errorMsg, type: BootstrapDialog.TYPE_DANGER }); @@ -2070,7 +2066,6 @@ function saveOptions() { $('#checkMissingDxccsBtn').prop("disabled", true).addClass("running"); $('#closeButton').prop("disabled", true); - $.ajax({ url: base_url + 'index.php/logbookadvanced/checkDb', data: { @@ -2080,23 +2075,19 @@ function saveOptions() { success: function(response) { $('#checkMissingDxccsBtn').prop("disabled", false).removeClass("running"); $('#closeButton').prop("disabled", false); - // Create a nice display for the results - let resultHtml = 'QSOs without DXCC information found: ' + (response[0].count) + '
'; - - $('.result').html(resultHtml); + $('.result').html(response); }, error: function(xhr, status, error) { $('#checkMissingDxccsBtn').prop('disabled', false).text('= __("Check") ?>'); $('#closeButton').prop('disabled', false); - let errorMsg = '= __("Error checking distance information") ?>'; + let errorMsg = 'Error checking DXCC information'; if (xhr.responseJSON && xhr.responseJSON.message) { errorMsg += ': ' + xhr.responseJSON.message; } BootstrapDialog.alert({ - title: '= __("Error") ?>', + title: 'Error', message: errorMsg, type: BootstrapDialog.TYPE_DANGER }); @@ -2117,23 +2108,19 @@ function saveOptions() { success: function(response) { $('#checkFixContinentBtn').prop("disabled", false).removeClass("running"); $('#closeButton').prop("disabled", false); - // Create a nice display for the results - let resultHtml = 'QSOs with missing or invalid continent information found: ' + (response[0].count) + '
'; - - $('.result').html(resultHtml); + $('.result').html(response); }, error: function(xhr, status, error) { $('#checkFixContinentBtn').prop('disabled', false).text('= __("Check") ?>'); $('#closeButton').prop('disabled', false); - let errorMsg = '= __("Error checking distance information") ?>'; + let errorMsg = 'Error checking continent information'; if (xhr.responseJSON && xhr.responseJSON.message) { errorMsg += ': ' + xhr.responseJSON.message; } BootstrapDialog.alert({ - title: '= __("Error") ?>', + title: 'Error', message: errorMsg, type: BootstrapDialog.TYPE_DANGER }); @@ -2161,13 +2148,13 @@ function saveOptions() { $('#checkFixStateBtn').prop('disabled', false).text('= __("Check") ?>'); $('#closeButton').prop('disabled', false); - let errorMsg = '= __("Error checking distance information") ?>'; + let errorMsg = 'Error checking state information'; if (xhr.responseJSON && xhr.responseJSON.message) { errorMsg += ': ' + xhr.responseJSON.message; } BootstrapDialog.alert({ - title: '= __("Error") ?>', + title: 'Error', message: errorMsg, type: BootstrapDialog.TYPE_DANGER }); @@ -2188,11 +2175,7 @@ function saveOptions() { success: function(response) { $('#checkFixCqZonesBtn').prop("disabled", false).removeClass("running"); $('#closeButton').prop("disabled", false); - // Create a nice display for the results - let resultHtml = 'QSOs with missing CQ zone information found: ' + (response[0].count) + '
'; - - $('.result').html(resultHtml); + $('.result').html(response); }, error: function(xhr, status, error) { $('#checkFixCqZonesBtn').prop('disabled', false).text('= __("Check") ?>'); @@ -2204,7 +2187,7 @@ function saveOptions() { } BootstrapDialog.alert({ - title: '= __("Error") ?>', + title: 'Error', message: errorMsg, type: BootstrapDialog.TYPE_DANGER }); @@ -2225,11 +2208,7 @@ function saveOptions() { success: function(response) { $('#checkFixItuZonesBtn').prop("disabled", false).removeClass("running"); $('#closeButton').prop("disabled", false); - // Create a nice display for the results - let resultHtml = 'QSOs with missing ITU zone information found: ' + (response[0].count) + '
'; - - $('.result').html(resultHtml); + $('.result').html(response); }, error: function(xhr, status, error) { $('#checkFixItuZonesBtn').prop('disabled', false).text('= __("Check") ?>'); @@ -2241,7 +2220,7 @@ function saveOptions() { } BootstrapDialog.alert({ - title: '= __("Error") ?>', + title: 'Error', message: errorMsg, type: BootstrapDialog.TYPE_DANGER });