| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | $('#distplot_bands').change(function(){ | 
					
						
							|  |  |  | 	var band = $("#distplot_bands option:selected").text(); | 
					
						
							|  |  |  | 	if (band != "SAT") { | 
					
						
							|  |  |  | 		$("#distplot_sats").prop('disabled', true); | 
					
						
							| 
									
										
										
										
											2024-11-17 23:31:27 +08:00
										 |  |  | 		$("#distplot_sats, #distplot_sats_lbl").hide(); | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 	} else { | 
					
						
							|  |  |  | 		$("#distplot_sats").prop('disabled', false); | 
					
						
							| 
									
										
										
										
											2024-11-17 23:31:27 +08:00
										 |  |  | 		$("#distplot_sats, #distplot_sats_lbl").show(); | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function distPlot(form) { | 
					
						
							|  |  |  | 	$(".alert").remove(); | 
					
						
							|  |  |  | 	var baseURL= "<?php echo base_url();?>"; | 
					
						
							|  |  |  | 	$.ajax({ | 
					
						
							|  |  |  | 		url: base_url+'index.php/distances/get_distances', | 
					
						
							|  |  |  | 		type: 'post', | 
					
						
							|  |  |  | 		data: {'band': form.distplot_bands.value, | 
					
						
							| 
									
										
										
										
											2024-09-03 06:03:06 +08:00
										 |  |  | 			'sat': form.distplot_sats.value, | 
					
						
							|  |  |  | 			'mode': form.distplot_modes.value, | 
					
						
							| 
									
										
										
										
											2024-11-17 23:31:27 +08:00
										 |  |  | 			'pwr': form.distplot_powers.value, | 
					
						
							|  |  |  | 			'propag': form.distplot_propag.value | 
					
						
							|  |  |  | 		}, | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 		success: function(tmp) { | 
					
						
							|  |  |  | 			if (tmp.ok == 'OK') { | 
					
						
							|  |  |  | 				if (!($('#information').length > 0)) | 
					
						
							|  |  |  | 					$("#distances_div").append('<div id="information"></div><div id="graphcontainer" style="height: 600px; margin: 0 auto"></div>'); | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 				var color = ifDarkModeThemeReturn('white', 'grey'); | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 				var options = { | 
					
						
							|  |  |  | 					chart: { | 
					
						
							|  |  |  | 						type: 'column', | 
					
						
							|  |  |  | 						zoomType: 'xy', | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 						renderTo: 'graphcontainer', | 
					
						
							|  |  |  | 						backgroundColor: getBodyBackground() | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 					}, | 
					
						
							|  |  |  | 					title: { | 
					
						
							| 
									
										
										
										
											2023-11-06 02:32:15 +08:00
										 |  |  | 						text: lang_statistics_distances_worked, | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 						style: { | 
					
						
							|  |  |  | 							color: color | 
					
						
							|  |  |  | 						} | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 					}, | 
					
						
							|  |  |  | 					xAxis: { | 
					
						
							|  |  |  | 						categories: [], | 
					
						
							|  |  |  | 						crosshair: true, | 
					
						
							|  |  |  | 						type: "category", | 
					
						
							|  |  |  | 						min:0, | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 						max:100, | 
					
						
							|  |  |  | 						labels: { | 
					
						
							|  |  |  | 							style: { | 
					
						
							|  |  |  | 								color: color | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 						} | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 					}, | 
					
						
							|  |  |  | 					yAxis: { | 
					
						
							|  |  |  | 						title: { | 
					
						
							| 
									
										
										
										
											2023-11-06 02:32:15 +08:00
										 |  |  | 							text: lang_statistics_distances_number_of_qsos, | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 							style: { | 
					
						
							|  |  |  | 								color: color | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 						}, | 
					
						
							|  |  |  | 						labels: { | 
					
						
							|  |  |  | 							style: { | 
					
						
							|  |  |  | 								color: color | 
					
						
							|  |  |  | 							} | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 						} | 
					
						
							|  |  |  | 					}, | 
					
						
							|  |  |  | 					navigator: { | 
					
						
							|  |  |  | 						enabled: true, | 
					
						
							|  |  |  | 						xAxis: { | 
					
						
							|  |  |  | 							labels: { | 
					
						
							|  |  |  | 								formatter: function() { | 
					
						
							|  |  |  | 									return this.value * '50' + ' ' + tmp.unit; | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 								}, | 
					
						
							|  |  |  | 								style: { | 
					
						
							|  |  |  | 									color: color | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 								} | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					}, | 
					
						
							|  |  |  | 					rangeSelector: { | 
					
						
							|  |  |  | 						selected: 1 | 
					
						
							|  |  |  | 					}, | 
					
						
							|  |  |  | 					tooltip: { | 
					
						
							|  |  |  | 						formatter: function () { | 
					
						
							|  |  |  | 							if(this.point) { | 
					
						
							| 
									
										
										
										
											2023-11-06 02:32:15 +08:00
										 |  |  | 								return lang_gen_hamradio_distance + ": " + options.xAxis.categories[this.point.x] + | 
					
						
							|  |  |  | 									"<br />" + lang_statistics_distances_callsigns_worked + ": " + myComments[this.point.x] + | 
					
						
							|  |  |  | 									"<br />" + lang_statistics_distances_number_of_qsos + ": <strong>" + series.data[this.point.x] + "</strong>"; | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 							} | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					}, | 
					
						
							| 
									
										
										
										
											2021-09-11 00:53:24 +08:00
										 |  |  | 					legend: { | 
					
						
							|  |  |  | 						itemStyle: { | 
					
						
							|  |  |  | 							color: color | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					}, | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 					series: [] | 
					
						
							|  |  |  | 				}; | 
					
						
							|  |  |  | 				var myComments=[]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				var series = { | 
					
						
							|  |  |  | 					data: [], | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 					showInNavigator: true, | 
					
						
							|  |  |  | 					point: { | 
					
						
							|  |  |  | 						events: { | 
					
						
							|  |  |  | 							click: function () { | 
					
						
							|  |  |  | 								getDistanceQsos(this.category); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 							} | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					} | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 				}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				$.each(tmp.qsodata, function(){ | 
					
						
							|  |  |  | 					myComments.push(this.calls); | 
					
						
							|  |  |  | 					options.xAxis.categories.push(this.dist); | 
					
						
							| 
									
										
										
										
											2023-11-06 02:32:15 +08:00
										 |  |  | 					series.name = lang_statistics_distances_number_of_qsos; | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 					series.data.push(this.count); | 
					
						
							|  |  |  | 				}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				options.series.push(series); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-06 02:32:15 +08:00
										 |  |  | 				$('#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 + " " | 
					
						
							| 
									
										
										
										
											2024-06-17 01:40:24 +08:00
										 |  |  | 					+ tmp.qrb.Distance + " " + tmp.unit + ". " + lang_statistics_distances_part4_contacts_were_plotted_furthest + " " | 
					
						
							|  |  |  | 					+ tmp.qrb.Avg_distance + " " + tmp.unit + "."); | 
					
						
							| 
									
										
										
										
											2021-03-10 01:20:27 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 				var chart = new Highcharts.Chart(options); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			else { | 
					
						
							|  |  |  | 				if (($('#information').length > 0)) { | 
					
						
							|  |  |  | 					$("#information").remove(); | 
					
						
							|  |  |  | 					$("#graphcontainer").remove(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				$("#distances_div").append('<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>' + tmp.Error + '</div>'); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | function getDistanceQsos(distance) { | 
					
						
							|  |  |  | 	// alert('Category: ' + distance);
 | 
					
						
							|  |  |  | 	$.ajax({ | 
					
						
							|  |  |  | 		url: base_url + 'index.php/distances/getDistanceQsos', | 
					
						
							|  |  |  | 		type: 'post', | 
					
						
							|  |  |  | 		data: { | 
					
						
							|  |  |  | 			'distance': distance, | 
					
						
							|  |  |  | 			'band': $("#distplot_bands").val(), | 
					
						
							|  |  |  | 			'sat' : $("#distplot_sats").val(), | 
					
						
							| 
									
										
										
										
											2024-09-03 06:03:06 +08:00
										 |  |  | 			'mode': $("#distplot_modes").val(), | 
					
						
							|  |  |  | 			'pwr': $("#distplot_powers").val(), | 
					
						
							| 
									
										
										
										
											2024-11-17 23:31:27 +08:00
										 |  |  | 			'propag': $("#distplot_propag").val(), | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 		}, | 
					
						
							|  |  |  | 		success: function (html) { | 
					
						
							|  |  |  | 			BootstrapDialog.show({ | 
					
						
							| 
									
										
										
										
											2023-10-08 14:55:45 +08:00
										 |  |  | 				title: lang_general_word_qso_data, | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 				size: BootstrapDialog.SIZE_WIDE, | 
					
						
							|  |  |  | 				cssClass: 'qso-dialog', | 
					
						
							|  |  |  | 				nl2br: false, | 
					
						
							|  |  |  | 				message: html, | 
					
						
							|  |  |  | 				onshown: function(dialog) { | 
					
						
							| 
									
										
										
										
											2023-11-26 17:00:47 +08:00
										 |  |  | 				   $('[data-bs-toggle="tooltip"]').tooltip(); | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 				   $('.contacttable').DataTable({ | 
					
						
							|  |  |  | 						"pageLength": 25, | 
					
						
							|  |  |  | 						responsive: false, | 
					
						
							|  |  |  | 						ordering: false, | 
					
						
							|  |  |  | 						"scrollY":        "550px", | 
					
						
							|  |  |  | 						"scrollCollapse": true, | 
					
						
							|  |  |  | 						"paging":         false, | 
					
						
							|  |  |  | 						"scrollX": true, | 
					
						
							| 
									
										
										
										
											2024-01-04 11:03:11 +08:00
										 |  |  | 						"language": { | 
					
						
							| 
									
										
										
										
											2024-01-04 11:18:20 +08:00
										 |  |  | 							url: getDataTablesLanguageUrl(), | 
					
						
							| 
									
										
										
										
											2024-01-04 11:03:11 +08:00
										 |  |  | 						}, | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 						dom: 'Bfrtip', | 
					
						
							|  |  |  | 						buttons: [ | 
					
						
							|  |  |  | 							'csv' | 
					
						
							|  |  |  | 						] | 
					
						
							|  |  |  | 					}); | 
					
						
							| 
									
										
										
										
											2023-12-22 18:15:00 +08:00
										 |  |  |                     $('.table-responsive .dropdown-toggle').off('mouseenter').on('mouseenter', function () { | 
					
						
							|  |  |  |                         showQsoActionsMenu($(this).closest('.dropdown')); | 
					
						
							|  |  |  |                     }); | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 				}, | 
					
						
							|  |  |  | 				buttons: [{ | 
					
						
							| 
									
										
										
										
											2023-11-06 02:32:15 +08:00
										 |  |  | 					label: lang_admin_close, | 
					
						
							| 
									
										
										
										
											2023-07-17 00:10:11 +08:00
										 |  |  | 					action: function (dialogItself) { | 
					
						
							|  |  |  | 						dialogItself.close(); | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				}] | 
					
						
							|  |  |  | 			}); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	}); | 
					
						
							|  |  |  | } |