Store distance into QSO table

这个提交包含在:
phl0 2023-06-15 16:03:24 +02:00
父节点 b1e4de55a2
当前提交 11efa6b03a
找不到此签名对应的密钥
GPG 密钥 ID: 48EA1E640798CA9A
共有 4 个文件被更改,包括 41 次插入1 次删除

查看文件

@ -128,6 +128,7 @@ class Logbook extends CI_Controller {
"dxcc" => false,
"callsign_name" => "",
"callsign_qra" => "",
"callsign_distance" => 0,
"callsign_qth" => "",
"callsign_iota" => "",
"callsign_state" => "",
@ -155,6 +156,7 @@ class Logbook extends CI_Controller {
$return['callsign_name'] = $this->logbook_model->call_name($callsign);
$return['callsign_qra'] = $this->logbook_model->call_qra($callsign);
$return['callsign_distance'] = $this->distance($return['callsign_qra'], $station_id);
$return['callsign_qth'] = $this->logbook_model->call_qth($callsign);
$return['callsign_iota'] = $this->logbook_model->call_iota($callsign);
$return['qsl_manager'] = $this->logbook_model->call_qslvia($callsign);
@ -186,6 +188,7 @@ class Logbook extends CI_Controller {
{
$return['callsign_name'] = $callbook['name'];
$return['callsign_qra'] = $callbook['gridsquare'];
$return['callsign_distance'] = $callbook['distance'];
$return['callsign_qth'] = $callbook['city'];
$return['callsign_iota'] = $callbook['iota'];
$return['callsign_state'] = $callbook['state'];
@ -979,6 +982,36 @@ class Logbook extends CI_Controller {
return "";
}
/* return distance */
function distance($locator, $station_id = null) {
$distance = 0;
$this->load->library('Qra');
if($locator != null) {
if (isset($station_id)) {
// be sure that station belongs to user
$this->load->model('Stations');
if (!$this->Stations->check_station_is_accessible($station_id)) {
return 0;
}
// get station profile
$station_profile = $this->Stations->profile_clean($station_id);
// get locator
$mylocator = $station_profile->station_gridsquare;
} else if($this->session->userdata('user_locator') != null){
$mylocator = $this->session->userdata('user_locator');
} else {
$mylocator = $this->config->item('locator');
}
$distance = $this->qra->distance($mylocator, $locator, 'K');
}
return round($distance, 0);
}
function qralatlng($qra) {
$this->load->library('Qra');
$latlng = $this->qra->qra2latlong($qra);

查看文件

@ -199,7 +199,7 @@ class Logbook_model extends CI_Model {
'COL_QTH' => $this->input->post('qth'),
'COL_PROP_MODE' => $prop_mode,
'COL_IOTA' => $this->input->post('iota_ref') == null ? '' : trim($this->input->post('iota_ref')),
'COL_DISTANCE' => "0",
'COL_DISTANCE' => $this->input->post('distance'),
'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')),
'COL_ANT_AZ' => null,
'COL_ANT_EL' => null,

查看文件

@ -142,6 +142,8 @@
</div>
</div>
<input type="hidden" name="distance" id="distance" value="0">
<div class="form-group row">
<label for="comment" class="col-sm-3 col-form-label"><?php echo lang('general_word_comment'); ?></label>
<div class="col-sm-9">

查看文件

@ -506,6 +506,11 @@ $("#callsign").focusout(function() {
$('#locator').val(result.callsign_qra);
$('#locator_info').html(result.bearing);
if (result.callsign_distance != "" && result.callsign_distance != 0)
{
document.getElementById("distance").value = result.callsign_distance;
}
if (result.callsign_qra != "")
{
if (result.workedBefore)