diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 617b8bbc..8f290e81 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -124,6 +124,7 @@ class Logbookadvanced extends CI_Controller { 'pota' => xss_clean($this->input->post('pota')), 'wwff' => xss_clean($this->input->post('wwff')), 'qslimages' => xss_clean($this->input->post('qslimages')), + 'dupes' => xss_clean($this->input->post('dupes')), ); $qsos = []; diff --git a/application/language/bulgarian/filter_lang.php b/application/language/bulgarian/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/bulgarian/filter_lang.php +++ b/application/language/bulgarian/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/chinese_simplified/filter_lang.php b/application/language/chinese_simplified/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/chinese_simplified/filter_lang.php +++ b/application/language/chinese_simplified/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/czech/filter_lang.php b/application/language/czech/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/czech/filter_lang.php +++ b/application/language/czech/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/dutch/filter_lang.php b/application/language/dutch/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/dutch/filter_lang.php +++ b/application/language/dutch/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/english/filter_lang.php b/application/language/english/filter_lang.php index 288364a3..02876376 100644 --- a/application/language/english/filter_lang.php +++ b/application/language/english/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; @@ -153,4 +154,4 @@ $lang['filter_options_show'] = 'Show'; // $lang['gen_hamradio_wwff'] --> application/language/english/general_words_lang.php // $lang['gen_hamradio_pota'] --> application/language/english/general_words_lang.php // $lang['options_save'] --> application/language/english/options_lang.php -$lang['filter_options_close'] = 'Close'; \ No newline at end of file +$lang['filter_options_close'] = 'Close'; diff --git a/application/language/finnish/filter_lang.php b/application/language/finnish/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/finnish/filter_lang.php +++ b/application/language/finnish/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/french/filter_lang.php b/application/language/french/filter_lang.php index cea415fc..94cdce6e 100644 --- a/application/language/french/filter_lang.php +++ b/application/language/french/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Suche zurücksetzen'; diff --git a/application/language/german/filter_lang.php b/application/language/german/filter_lang.php index 416937c9..a2bd57bb 100644 --- a/application/language/german/filter_lang.php +++ b/application/language/german/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filter'; $lang['filter_actions'] = 'Aktionen'; $lang['filter_results'] = '# Resultate'; $lang['filter_search'] = 'Suche'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Karte'; $lang['filter_options'] = 'Optionen'; $lang['filter_reset'] = 'Reset'; @@ -153,4 +154,4 @@ $lang['filter_options_show'] = 'Anzeigen'; // $lang['gen_hamradio_wwff'] --> application/language/english/general_words_lang.php // $lang['gen_hamradio_pota'] --> application/language/english/general_words_lang.php // $lang['options_save'] --> application/language/english/options_lang.php -$lang['filter_options_close'] = 'Schliessen'; \ No newline at end of file +$lang['filter_options_close'] = 'Schliessen'; diff --git a/application/language/greek/filter_lang.php b/application/language/greek/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/greek/filter_lang.php +++ b/application/language/greek/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/italian/filter_lang.php b/application/language/italian/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/italian/filter_lang.php +++ b/application/language/italian/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/polish/filter_lang.php b/application/language/polish/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/polish/filter_lang.php +++ b/application/language/polish/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/russian/filter_lang.php b/application/language/russian/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/russian/filter_lang.php +++ b/application/language/russian/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/spanish/filter_lang.php b/application/language/spanish/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/spanish/filter_lang.php +++ b/application/language/spanish/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/swedish/filter_lang.php b/application/language/swedish/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/swedish/filter_lang.php +++ b/application/language/swedish/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/language/turkish/filter_lang.php b/application/language/turkish/filter_lang.php index 288364a3..23de947f 100644 --- a/application/language/turkish/filter_lang.php +++ b/application/language/turkish/filter_lang.php @@ -15,6 +15,7 @@ $lang['filter_filters'] = 'Filters'; $lang['filter_actions'] = 'Actions'; $lang['filter_results'] = '# Results'; $lang['filter_search'] = 'Search'; +$lang['filter_dupes'] = "Dupes"; $lang['filter_map'] = 'Map'; $lang['filter_options'] = 'Options'; $lang['filter_reset'] = 'Reset'; diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 20fa1a3b..eb150267 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -7,6 +7,20 @@ class Logbookadvanced_model extends CI_Model { $conditions = []; $binding = [$searchCriteria['user_id']]; + if ($searchCriteria['dupes'] !== '') { + $id_sql="select group_concat(x.qsoids separator ',') as QSO_IDs from ( + select GROUP_CONCAT(col_primary_key separator ',') as qsoids, COL_CALL, COL_MODE, COL_SUBMODE, station_callsign, COL_SAT_NAME, COL_BAND, min(col_time_on) Mintime, max(col_time_on) Maxtime from " . $this->config->item('table_name') . " + join station_profile on " . $this->config->item('table_name') . ".station_id = station_profile.station_id where station_profile.user_id=? + group by col_call, col_mode, COL_SUBMODE, STATION_CALLSIGN, col_band, COL_SAT_NAME having count(*) > 1 and timediff(maxtime, mintime) < 3000) x"; + $id_query = $this->db->query($id_sql, $searchCriteria['user_id']); + foreach ($id_query->result() as $id) { + $ids2fetch=$id->QSO_IDs; + } + if ($ids2fetch !== '') { + $conditions[] = "qsos.COL_PRIMARY_KEY in (".$ids2fetch.")"; + } + } + if ($searchCriteria['dateFrom'] !== '') { $from = DateTime::createFromFormat('d/m/Y', $searchCriteria['dateFrom']); $from = $from->format('Y-m-d'); diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index cf67e3b1..c1256f5e 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -53,6 +53,7 @@ $options = json_decode($options);
" method="post"> +
@@ -390,6 +391,7 @@ $options = json_decode($options); + diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index e386c14d..1acff398 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -283,6 +283,7 @@ $(document).ready(function () { pota: this.pota.value, wwff: this.wwff.value, qslimages: this.qslimages.value, + dupes: this.dupes.value, }, dataType: 'json', success: function (data) { @@ -502,6 +503,10 @@ $(document).ready(function () { quickSearch('pota'); }); + $('#dupeButton').click(function (event) { + dupeSearch(); + }); + $('#optionButton').click(function (event) { $('#optionButton').prop("disabled", true); $.ajax({ @@ -588,6 +593,12 @@ $(document).ready(function () { }); }); + function dupeSearch() { + $('#searchForm').trigger("reset"); + $("#dupes").val("Y"); + $('#searchForm').submit(); + } + function quickSearch(type) { var elements = $('#qsoList tbody input:checked'); var nElements = elements.length; @@ -672,6 +683,7 @@ $(document).ready(function () { }); $('#searchForm').on('reset', function(e) { + $("#dupes").val(""); setTimeout(function() { $('#searchForm').submit(); });