diff --git a/application/language/bulgarian/statistics_lang.php b/application/language/bulgarian/statistics_lang.php index 97a2f0b9..70bb6103 100644 --- a/application/language/bulgarian/statistics_lang.php +++ b/application/language/bulgarian/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 6e8acf07..76c298c3 100644 --- a/application/language/chinese_simplified/statistics_lang.php +++ b/application/language/chinese_simplified/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "通联的 QSO 数量"; * */ +$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 f636a7d1..8ccc495d 100644 --- a/application/language/czech/statistics_lang.php +++ b/application/language/czech/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 62bfe00d..90d55860 100644 --- a/application/language/dutch/statistics_lang.php +++ b/application/language/dutch/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 c995c0f2..a3576bf2 100644 --- a/application/language/english/statistics_lang.php +++ b/application/language/english/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 c5b61102..c7811d6b 100644 --- a/application/language/finnish/statistics_lang.php +++ b/application/language/finnish/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 c9631523..930bee8a 100644 --- a/application/language/french/statistics_lang.php +++ b/application/language/french/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "QSOs réalisés"; * */ -$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 f91e0d98..aa0071b1 100644 --- a/application/language/german/statistics_lang.php +++ b/application/language/german/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# gearbeitete QSOs"; * */ +$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 c995c0f2..a3576bf2 100644 --- a/application/language/greek/statistics_lang.php +++ b/application/language/greek/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 a38b9128..8c412c23 100644 --- a/application/language/italian/statistics_lang.php +++ b/application/language/italian/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# di QSO effettuati"; * */ +$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 c995c0f2..a3576bf2 100644 --- a/application/language/polish/statistics_lang.php +++ b/application/language/polish/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 ba34b9fd..127d9f17 100644 --- a/application/language/russian/statistics_lang.php +++ b/application/language/russian/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# QSO проведено"; * */ +$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 d0928382..719734dd 100644 --- a/application/language/spanish/statistics_lang.php +++ b/application/language/spanish/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# de QSOs logradas"; * */ +$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 05419132..66b5fc30 100644 --- a/application/language/swedish/statistics_lang.php +++ b/application/language/swedish/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "# of QSO's worked"; * */ +$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 845318ed..6f068169 100644 --- a/application/language/turkish/statistics_lang.php +++ b/application/language/turkish/statistics_lang.php @@ -25,10 +25,12 @@ $lang['statistics_number_of_qso_worked'] = "Çalışan QSO sayısı"; * */ +$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 3aa17c0c..d895a019 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -33,7 +33,7 @@ class Distances_model extends CI_Model $this->db->where('col_sat_name', $postdata['sat']); } } - else { + elseif ($postdata['band'] != 'all') { $this->db->where('col_band', $postdata['band']); } @@ -143,7 +143,7 @@ class Distances_model extends CI_Model $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 @@ class Distances_model extends CI_Model '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 @@ class Distances_model extends CI_Model } } + $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 ad1f7e9c..3313c649 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 56cf1e03..961bb6cb 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); }