diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index ba6f6817..5608b17d 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -782,43 +782,7 @@ $(document).ready(function(){ uri->segment(1) == "dayswithqso") { ?> - + uri->segment(1) == "distances") { ?> @@ -826,111 +790,7 @@ $(document).ready(function(){ - + uri->segment(2) == "import") { ?> @@ -946,100 +806,51 @@ $(document).ready(function(){ uri->segment(1) == "qrz") { ?> - + - + } + }); + } + uri->segment(2) == "dxcc") { ?> diff --git a/assets/js/sections/dayswithqso.js b/assets/js/sections/dayswithqso.js new file mode 100644 index 00000000..361d5ec0 --- /dev/null +++ b/assets/js/sections/dayswithqso.js @@ -0,0 +1,34 @@ +$.ajax({ + url: base_url+'index.php/dayswithqso/get_days', + success: function(data) { + var labels = []; + var dataDxcc = []; + $.each(data, function(){ + labels.push(this.Year); + dataDxcc.push(this.Days); + }); + var ctx = document.getElementById("myChartDiff").getContext('2d'); + var myChart = new Chart(ctx, { + type: 'bar', + data: { + labels: labels, + datasets: [{ + label: 'Days with QSOs', + data: dataDxcc, + backgroundColor: 'rgba(54, 162, 235, 0.2)', + borderColor: 'rgba(54, 162, 235, 1)', + borderWidth: 2 + }] + }, + options: { + scales: { + yAxes: [{ + ticks: { + beginAtZero:true + } + }] + }, + } + }); + } +}); diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js new file mode 100644 index 00000000..95e409b8 --- /dev/null +++ b/assets/js/sections/distances.js @@ -0,0 +1,101 @@ +$('#distplot_bands').change(function(){ + var band = $("#distplot_bands option:selected").text(); + if (band != "SAT") { + $("#distplot_sats").prop('disabled', true); + } else { + $("#distplot_sats").prop('disabled', false); + } +}); + +function distPlot(form) { + $(".alert").remove(); + var baseURL= ""; + $.ajax({ + url: base_url+'index.php/distances/get_distances', + type: 'post', + data: {'band': form.distplot_bands.value, + 'sat': form.distplot_sats.value}, + success: function(tmp) { + if (tmp.ok == 'OK') { + if (!($('#information').length > 0)) + $("#distances_div").append('
'); + var options = { + chart: { + type: 'column', + zoomType: 'xy', + renderTo: 'graphcontainer' + }, + title: { + text: 'Distance Distribution' + }, + xAxis: { + categories: [], + crosshair: true, + type: "category", + min:0, + max:100 + + }, + yAxis: { + title: { + text: '# QSOs' + } + }, + navigator: { + enabled: true, + xAxis: { + labels: { + formatter: function() { + return this.value * '50' + ' ' + tmp.unit; + } + } + } + }, + rangeSelector: { + selected: 1 + }, + tooltip: { + formatter: function () { + if(this.point) { + return "Distance: " + options.xAxis.categories[this.point.x] + + "
Callsign(s) worked (max 5 shown): " + myComments[this.point.x] + + "
Number of QSOs: " + series.data[this.point.x] + ""; + } + } + }, + series: [] + }; + var myComments=[]; + + var series = { + data: [], + showInNavigator: true + }; + + $.each(tmp.qsodata, function(){ + myComments.push(this.calls); + options.xAxis.categories.push(this.dist); + series.name = 'Number of QSOs'; + series.data.push(this.count); + + }); + + options.series.push(series); + + $('#information').html(tmp.qrb.Qsoes + " contacts were plotted.
Your furthest contact was with " + tmp.qrb.Callsign + + " in gridsquare "+ tmp.qrb.Grid + +"; the distance was " + +tmp.qrb.Distance + tmp.unit +"."); + + var chart = new Highcharts.Chart(options); + } + else { + if (($('#information').length > 0)) { + $("#information").remove(); + $("#graphcontainer").remove(); + } + $("#distances_div").append(''); + } + } + }); +} diff --git a/assets/js/sections/qrzlogbook.js b/assets/js/sections/qrzlogbook.js new file mode 100644 index 00000000..01702f30 --- /dev/null +++ b/assets/js/sections/qrzlogbook.js @@ -0,0 +1,47 @@ +function ExportQrz(station_id) { + if ($(".alert").length > 0) { + $(".alert").remove(); + } + if ($(".errormessages").length > 0) { + $(".errormessages").remove(); + } + $(".ld-ext-right").addClass('running'); + $(".ld-ext-right").prop('disabled', true); + + $.ajax({ + url: base_url + 'index.php/qrz/upload_station', + type: 'post', + data: {'station_id': station_id}, + success: function (data) { + $(".ld-ext-right").removeClass('running'); + $(".ld-ext-right").prop('disabled', false); + if (data.status == 'OK') { + $.each(data.info, function(index, value){ + $('#modcount'+value.station_id).html(value.modcount); + $('#notcount'+value.station_id).html(value.notcount); + $('#totcount'+value.station_id).html(value.totcount); + }); + $(".card-body").append(''); + } + else { + $(".card-body").append(''); + } + + if (data.errormessages.length > 0) { + $(".card-body").append('' + + '

\n' + + ' \n' + + '

\n' + + '
\n' + + '
\n' + + '
\n' + + '
'); + $.each(data.errormessages, function(index, value) { + $(".errors").append('
  • ' + value); + }); + } + } + }); +}