[QSO] Fixed issue with bearing lookups with VUCC Grids

pull/1407/head
Peter Goodhall 2022-02-18 13:46:16 +00:00
rodzic be8771de2e
commit bfe1b38c86
3 zmienionych plików z 23 dodań i 5 usunięć

Wyświetl plik

@ -29,6 +29,7 @@ class QSO extends CI_Controller {
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$data['active_station_profile'] = $this->stations->find_active();
$data['notice'] = false;
$data['stations'] = $this->stations->all_of_user();
$data['radios'] = $this->cat->radios();

Wyświetl plik

@ -129,6 +129,12 @@ function get_bearing($lat1, $lon1, $lat2, $lon2) {
}
function qra2latlong($strQRA) {
if (strpos($strQRA, ',') !== false) {
$gridsquareArray = explode(',', $strQRA);
$strQRA = $gridsquareArray[0];
}
if (strlen($strQRA) %2 == 0) {
$strQRA = strtoupper($strQRA);
if (strlen($strQRA) == 4) $strQRA .= "MM";

Wyświetl plik

@ -813,17 +813,28 @@ $(document).on('keypress',function(e) {
<?php if ($this->uri->segment(1) == "qso") { ?>
<script src="<?php echo base_url() ;?>assets/js/sections/qso.js"></script>
<?php
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$active_station_info = $station_profile->row();
if (strpos($active_station_info->station_gridsquare, ',') !== false) {
$gridsquareArray = explode(',', $active_station_info->station_gridsquare);
$user_gridsquare = $gridsquareArray[0];
} else {
$user_gridsquare = $active_station_info->station_gridsquare;
}
?>
<script>
var markers = L.layerGroup();
var pos = [51.505, -0.09];
var mymap = L.map('qsomap').setView(pos, 12);
<?php
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$active_station_info = $station_profile->row();
if ($active_station_info->station_gridsquare != "") { ?>
$.getJSON('logbook/qralatlngjson/<?php echo $active_station_info->station_gridsquare; ?>', function(result) {
$.getJSON('logbook/qralatlngjson/<?php echo $user_gridsquare; ?>', function(result) {
mymap.panTo([result[0], result[1]]);
pos = result;
})