diff --git a/application/language/bulgarian/statistics_lang.php b/application/language/bulgarian/statistics_lang.php index 97a2f0b93..70bb61035 100644 --- a/application/language/bulgarian/statistics_lang.php +++ b/application/language/bulgarian/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/chinese_simplified/statistics_lang.php b/application/language/chinese_simplified/statistics_lang.php index 6e8acf079..76c298c37 100644 --- a/application/language/chinese_simplified/statistics_lang.php +++ b/application/language/chinese_simplified/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "全部"; $lang['statistics_distances_worked'] = "通联距离"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "次通联
您最远的通联是与"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "在网格"; $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "距离是"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "平均距离是"; $lang['statistics_distances_number_of_qsos'] = "QSO 数量"; $lang['statistics_distances_callsigns_worked'] = "通联的呼号(最多显示5个):"; $lang['statistics_distances_qsos_with'] = "QSO 与"; diff --git a/application/language/czech/statistics_lang.php b/application/language/czech/statistics_lang.php index f636a7d14..8ccc495d3 100644 --- a/application/language/czech/statistics_lang.php +++ b/application/language/czech/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/dutch/statistics_lang.php b/application/language/dutch/statistics_lang.php index 62bfe00dd..90d55860f 100644 --- a/application/language/dutch/statistics_lang.php +++ b/application/language/dutch/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/english/statistics_lang.php b/application/language/english/statistics_lang.php index c995c0f2a..a3576bf21 100644 --- a/application/language/english/statistics_lang.php +++ b/application/language/english/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/finnish/statistics_lang.php b/application/language/finnish/statistics_lang.php index c5b611023..c7811d6b8 100644 --- a/application/language/finnish/statistics_lang.php +++ b/application/language/finnish/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/french/statistics_lang.php b/application/language/french/statistics_lang.php index c9631523d..930bee8a7 100644 --- a/application/language/french/statistics_lang.php +++ b/application/language/french/statistics_lang.php @@ -25,10 +25,12 @@ * */ -$lang['statistics_distances_worked'] = "Nombre de QSOs par plage de distances réalisées"; -$lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts utilisés pour le graphique.
Le dernier contact réalisé est : "; -$lang['statistics_distances_part2_contacts_were_plotted_furthest'] = ", avec le locator : "; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = ", pour une distance de : "; +$lang['statistics_distances_bands_all'] = "Toutes"; +$lang['statistics_distances_worked'] = "Nombre de QSOs réalisés par plage de distance"; +$lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts utilisés pour le graphique.
Le contact le plus lointain réalisé est "; +$lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "avec le locator"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distance maximale est de"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distance moyenne est de"; $lang['statistics_distances_number_of_qsos'] = "Nombre de QSOs"; $lang['statistics_distances_callsigns_worked'] = "Indicatif(s) contacté(s) (liste de 5 max)"; $lang['statistics_distances_qsos_with'] = "QSOs avec"; diff --git a/application/language/german/statistics_lang.php b/application/language/german/statistics_lang.php index f91e0d988..aa0071b1e 100644 --- a/application/language/german/statistics_lang.php +++ b/application/language/german/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "Alle"; $lang['statistics_distances_worked'] = "Gearbeitete Entfernungen"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "Kontakte wurden dargestellt.
Der weiteste Kontakt war"; // make sure'
' stays there $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "im Planquadrat"; $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "Die Distanz betrug"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Die durchschnittliche Distanz ist"; $lang['statistics_distances_number_of_qsos'] = "Anzahl der QSOs"; $lang['statistics_distances_callsigns_worked'] = "Gearbeitete(s) Rufzeichen (max 5 werden gezeigt)"; $lang['statistics_distances_qsos_with'] = "QSOs mit"; diff --git a/application/language/greek/statistics_lang.php b/application/language/greek/statistics_lang.php index c995c0f2a..a3576bf21 100644 --- a/application/language/greek/statistics_lang.php +++ b/application/language/greek/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/italian/statistics_lang.php b/application/language/italian/statistics_lang.php index a38b91289..8c412c23a 100644 --- a/application/language/italian/statistics_lang.php +++ b/application/language/italian/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "Tutte"; $lang['statistics_distances_worked'] = "Distanze percorse"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "i contatti sono stati tracciati.
Il tuo contatto più lontano era con"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "nella griglia"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "la distanza era"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distanza era"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distanza media è"; $lang['statistics_distances_number_of_qsos'] = "Numero di QSO"; $lang['statistics_distances_callsigns_worked'] = "Nominativo(i) funzionante(i max 5 mostrati)"; $lang['statistics_distances_qsos_with'] = "QSO con"; diff --git a/application/language/polish/statistics_lang.php b/application/language/polish/statistics_lang.php index c995c0f2a..a3576bf21 100644 --- a/application/language/polish/statistics_lang.php +++ b/application/language/polish/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/russian/statistics_lang.php b/application/language/russian/statistics_lang.php index ba34b9fda..127d9f178 100644 --- a/application/language/russian/statistics_lang.php +++ b/application/language/russian/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "все"; $lang['statistics_distances_worked'] = "Сработанные дистанции"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "контакты отображены.
Наиболее дальний контакт с"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "в квадрате"; $lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "на дистанции"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Среднее расстояние составляет"; $lang['statistics_distances_number_of_qsos'] = "Количество QSO"; $lang['statistics_distances_callsigns_worked'] = "Сработанные позывные(ной) (максимально 5 показано)"; $lang['statistics_distances_qsos_with'] = "QSOs с"; diff --git a/application/language/spanish/statistics_lang.php b/application/language/spanish/statistics_lang.php index d09283824..719734ddd 100644 --- a/application/language/spanish/statistics_lang.php +++ b/application/language/spanish/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "Todas"; $lang['statistics_distances_worked'] = "Distancias Logradas"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contactos fueron dibujados.
Su contacto más lejano fue con"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "en gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "la distancia fue"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "La distancia fue"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "La distancia promedio es"; $lang['statistics_distances_number_of_qsos'] = "Número de QSOs"; $lang['statistics_distances_callsigns_worked'] = "Indicativo(s) trabajados (se muestran máximo 5)"; $lang['statistics_distances_qsos_with'] = "QSOs con"; diff --git a/application/language/swedish/statistics_lang.php b/application/language/swedish/statistics_lang.php index 054191326..66b5fc30e 100644 --- a/application/language/swedish/statistics_lang.php +++ b/application/language/swedish/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "All"; $lang['statistics_distances_worked'] = "Distances Worked"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.
Your furthest contact was with"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "the distance was"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is"; $lang['statistics_distances_number_of_qsos'] = "Number of QSOs"; $lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)"; $lang['statistics_distances_qsos_with'] = "QSOs with"; diff --git a/application/language/turkish/statistics_lang.php b/application/language/turkish/statistics_lang.php index 845318ed8..6f0681692 100644 --- a/application/language/turkish/statistics_lang.php +++ b/application/language/turkish/statistics_lang.php @@ -25,10 +25,12 @@ * */ +$lang['statistics_distances_bands_all'] = "Tüm"; $lang['statistics_distances_worked'] = "Çalışılan Mesafeler"; $lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "kişiler planlandı.
En uzak bağlantınız şununlaydı"; $lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "gridsquare'de"; -$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "mesafe şuydu"; +$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "Mesafe şuydu"; +$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "Ortalama mesafe"; $lang['statistics_distances_number_of_qsos'] = "QSO sayısı"; $lang['statistics_distances_callsigns_worked'] = "Çağrı işaretleri çalıştı (en fazla 5 tane gösterildi)"; $lang['statistics_distances_qsos_with'] = "QSO'lar ile"; diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index 3aa17c0c0..d895a0197 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -33,7 +33,7 @@ function get_distances($postdata, $measurement_base) { $this->db->where('col_sat_name', $postdata['sat']); } } - else { + elseif ($postdata['band'] != 'all') { $this->db->where('col_band', $postdata['band']); } @@ -143,7 +143,7 @@ function plot($qsoArray, $gridsquare, $measurement_base) { $dist = '20000'; } - if (!$this->valid_locator($stationgrid)) { + if (!$this->valid_locator(substr($stationgrid, 0, 6))) { header('Content-Type: application/json'); echo json_encode(array('Error' => 'Error. There is a problem with the gridsquare set in your profile!')); exit; @@ -163,12 +163,16 @@ function plot($qsoArray, $gridsquare, $measurement_base) { 'Grid' => '', 'Distance' => '', 'Qsos' => '', - 'Grids' => '' + 'Grids' => '', + 'Avg_distance' => '' ); + $avg_distance = 0; + foreach ($qsoArray as $qso) { $qrb['Qsos']++; // Counts up number of qsos $bearingdistance = $this->qra->distance($stationgrid, $qso['grid'], $measurement_base); + $avg_distance += ($bearingdistance - $avg_distance) / $qrb['Qsos']; // Calculates running average of distance if ($bearingdistance != $qso['COL_DISTANCE']) { $data = array('COL_DISTANCE' => $bearingdistance); $this->db->where('COL_PRIMARY_KEY', $qso['COL_PRIMARY_KEY']); @@ -190,6 +194,8 @@ function plot($qsoArray, $gridsquare, $measurement_base) { } } + $qrb['Avg_distance'] = round($avg_distance, 1); + $data['ok'] = 'OK'; $data['qrb'] = $qrb; $data['qsodata'] = $dataarray; diff --git a/application/views/distances/index.php b/application/views/distances/index.php index ad1f7e9c8..3313c6498 100644 --- a/application/views/distances/index.php +++ b/application/views/distances/index.php @@ -9,6 +9,7 @@ var lang_statistics_distances_part1_contacts_were_plotted_furthest = ''; var lang_statistics_distances_part2_contacts_were_plotted_furthest = ''; var lang_statistics_distances_part3_contacts_were_plotted_furthest = ''; + var lang_statistics_distances_part4_contacts_were_plotted_furthest = ''; var lang_statistics_distances_number_of_qsos = ''; var lang_gen_hamradio_distance = ''; var lang_statistics_distances_callsigns_worked = ''; @@ -18,6 +19,7 @@
- ' . $sat . ''."\n"; diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js index 56cf1e031..961bb6cb3 100644 --- a/assets/js/sections/distances.js +++ b/assets/js/sections/distances.js @@ -117,7 +117,8 @@ function distPlot(form) { $('#information').html(tmp.qrb.Qsos + " " + lang_statistics_distances_part1_contacts_were_plotted_furthest + " " + tmp.qrb.Callsign + " " + lang_statistics_distances_part2_contacts_were_plotted_furthest + " " + tmp.qrb.Grid +". " + lang_statistics_distances_part3_contacts_were_plotted_furthest + " " - + tmp.qrb.Distance + tmp.unit + "."); + + tmp.qrb.Distance + " " + tmp.unit + ". " + lang_statistics_distances_part4_contacts_were_plotted_furthest + " " + + tmp.qrb.Avg_distance + " " + tmp.unit + "."); var chart = new Highcharts.Chart(options); }