Check also grids found at callbook

这个提交包含在:
int2001 2023-09-12 13:05:58 +00:00
父节点 b21f85106c
当前提交 7ac08b78f9
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B
共有 2 个文件被更改,包括 67 次插入1 次删除

查看文件

@ -153,6 +153,7 @@ class Logbook extends CI_Controller {
$return['callsign_state'] = $this->nval($callbook['state'] ?? '', $this->logbook_model->call_state($callsign));
$return['callsign_us_county'] = $this->nval($callbook['us_county'] ?? '', $this->logbook_model->call_us_county($callsign));
$return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode);
$return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $type, $band, $mode);
if ($this->session->userdata('user_show_profile_image')) {
if (isset($callbook)) {
@ -181,7 +182,70 @@ class Logbook extends CI_Controller {
return (($val2 ?? "") === "" ? ($val1 ?? "") : ($val2 ?? ""));
}
function worked_grid_before($gridsquare, $type, $band, $mode)
function confirmed_grid_before($gridsquare, $type, $band, $mode) {
if (strlen($gridsquare) < 4)
return false;
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$user_gridmap_confirmation = $this->session->userdata('user_gridmap_confirmation');
if(!empty($logbooks_locations_array)) {
$extrawhere='';
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'";
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) {
if ($extrawhere!='') {
$extrawhere.=" OR";
}
$extrawhere.=" COL_LOTW_QSL_RCVD='Y'";
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
if ($extrawhere!='') {
$extrawherei.=" OR";
}
$extrawhere.=" COL_EQSL_QSL_RCVD='Y'";
}
if($type == "SAT") {
$this->db->where('COL_PROP_MODE', 'SAT');
if ($extrawhere != '') {
$this->db->where('('.$extrawhere.')');
} else {
$this->db->where("1=0");
}
} else {
$CI->load->model('logbook_model');
$this->db->where('COL_MODE', $CI->logbook_model->get_main_mode_from_mode($mode));
$this->db->where('COL_BAND', $band);
$this->db->where('COL_PROP_MODE !=','SAT');
if ($extrawhere != '') {
$this->db->where('('.$extrawhere.')');
} else {
$this->db->where("1=0");
}
}
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($gridsquare, 0, 4));
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc");
$this->db->limit(1);
$query = $this->db->get($this->config->item('table_name'));
foreach ($query->result() as $workedBeforeRow) {
return true;
}
}
return false;
}
function worked_grid_before($gridsquare, $type, $band, $mode)
{
if (strlen($gridsquare) < 4)
return false;

查看文件

@ -967,8 +967,10 @@ function resetDefaultQSOFields() {
$('#iota_ref').val("");
$('#sota_ref').val("");
$("#locator").removeClass("workedGrid");
$("#locator").removeClass("confirmedGrid");
$("#locator").removeClass("newGrid");
$("#callsign").removeClass("workedGrid");
$("#callsign").removeClass("confirmedGrid");
$("#callsign").removeClass("newGrid");
$('#callsign_info').removeClass("badge-secondary");
$('#callsign_info').removeClass("badge-success");