Added indicators, if callsign/dxcc is worked on band and mode
like the locator-input the callsign-input is colored in red or green the country-label is enabled with a label that tells us about worked/not wkd
这个提交包含在:
父节点
1462e4fc5e
当前提交
192a63ad4b
共有 2 个文件被更改,包括 143 次插入 和 0 次删除
|
|
@ -221,6 +221,74 @@ class Logbook extends CI_Controller {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function jsonlookupdxcc($country, $type, $band, $mode) {
|
||||||
|
|
||||||
|
$return = [
|
||||||
|
"workedBefore" => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
$CI =& get_instance();
|
||||||
|
$CI->load->model('Stations');
|
||||||
|
$station_id = $CI->Stations->find_active();
|
||||||
|
|
||||||
|
if($type == "SAT") {
|
||||||
|
$this->db->where('COL_PROP_MODE', 'SAT');
|
||||||
|
} else {
|
||||||
|
$this->db->where('COL_MODE', $mode);
|
||||||
|
$this->db->where('COL_BAND', $band);
|
||||||
|
$this->db->where('COL_PROP_MODE !=','SAT');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->where('station_id', $station_id);
|
||||||
|
$this->db->where('COL_COUNTRY', urldecode($country));
|
||||||
|
|
||||||
|
$query = $this->db->get($this->config->item('table_name'), 1, 0);
|
||||||
|
foreach ($query->result() as $workedBeforeRow)
|
||||||
|
{
|
||||||
|
$return['workedBefore'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode($return, JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function jsonlookupcallsign($callsign, $type, $band, $mode) {
|
||||||
|
|
||||||
|
$return = [
|
||||||
|
"workedBefore" => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
$CI =& get_instance();
|
||||||
|
$CI->load->model('Stations');
|
||||||
|
$station_id = $CI->Stations->find_active();
|
||||||
|
|
||||||
|
if($type == "SAT") {
|
||||||
|
$this->db->where('COL_PROP_MODE', 'SAT');
|
||||||
|
} else {
|
||||||
|
$this->db->where('COL_MODE', $mode);
|
||||||
|
$this->db->where('COL_BAND', $band);
|
||||||
|
$this->db->where('COL_PROP_MODE !=','SAT');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->where('station_id', $station_id);
|
||||||
|
$this->db->where('COL_CALL', strtoupper($callsign));
|
||||||
|
|
||||||
|
$query = $this->db->get($this->config->item('table_name'), 1, 0);
|
||||||
|
foreach ($query->result() as $workedBeforeRow)
|
||||||
|
{
|
||||||
|
$return['workedBefore'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode($return, JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Used to generate maps for displaying on /logbook/ */
|
/* Used to generate maps for displaying on /logbook/ */
|
||||||
function qso_map() {
|
function qso_map() {
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,81 @@ $(document).on('keypress',function(e) {
|
||||||
if(result.dxcc.entity != undefined) {
|
if(result.dxcc.entity != undefined) {
|
||||||
$('#country').val(convert_case(result.dxcc.entity));
|
$('#country').val(convert_case(result.dxcc.entity));
|
||||||
$('#callsign_info').text(convert_case(result.dxcc.entity));
|
$('#callsign_info').text(convert_case(result.dxcc.entity));
|
||||||
|
|
||||||
|
if($("#sat_name" ).val() != "") {
|
||||||
|
//logbook/jsonlookupgrid/io77/SAT/0/0
|
||||||
|
$.getJSON('logbook/jsonlookupcallsign/' + $("#callsign").val().toUpperCase() + '/SAT/0/0', function(result)
|
||||||
|
{
|
||||||
|
// Reset CSS values before updating
|
||||||
|
$('#callsign').removeClass("workedGrid");
|
||||||
|
$('#callsign').removeClass("newGrid");
|
||||||
|
$('#callsign').attr('title', '');
|
||||||
|
|
||||||
|
if (result.workedBefore)
|
||||||
|
{
|
||||||
|
$('#callsign').addClass("workedGrid");
|
||||||
|
$('#callsign').attr('title', 'Callsign was already worked in the past on this band and mode!');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#callsign').addClass("newGrid");
|
||||||
|
$('#callsign').attr('title', 'New Callsign!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$.getJSON('logbook/jsonlookupcallsign/' + $("#callsign").val().toUpperCase() + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result)
|
||||||
|
{
|
||||||
|
// Reset CSS values before updating
|
||||||
|
$('#callsign').removeClass("workedGrid");
|
||||||
|
$('#callsign').removeClass("newGrid");
|
||||||
|
$('#callsign').attr('title', '');
|
||||||
|
|
||||||
|
if (result.workedBefore)
|
||||||
|
{
|
||||||
|
$('#callsign').addClass("workedGrid");
|
||||||
|
$('#callsign').attr('title', 'Callsign was already worked in the past on this band and mode!');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#callsign').addClass("newGrid");
|
||||||
|
$('#callsign').attr('title', 'New Callsign!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if($("#sat_name" ).val() != "") {
|
||||||
|
//logbook/jsonlookupgrid/io77/SAT/0/0
|
||||||
|
$.getJSON('logbook/jsonlookupdxcc/' + convert_case(result.dxcc.entity) + '/SAT/0/0', function(result)
|
||||||
|
{
|
||||||
|
$('#callsign_info').attr('title', '');
|
||||||
|
|
||||||
|
if (result.workedBefore)
|
||||||
|
{
|
||||||
|
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$.getJSON('logbook/jsonlookupdxcc/' + convert_case(result.dxcc.entity) + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result)
|
||||||
|
{
|
||||||
|
// Reset CSS values before updating
|
||||||
|
$('#callsign_info').attr('title', '');
|
||||||
|
|
||||||
|
if (result.workedBefore)
|
||||||
|
{
|
||||||
|
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result.lotw_member == "active") {
|
if(result.lotw_member == "active") {
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用