Displays under the callsign whether persons an lotw user or not

pull/296/head^2
Peter Goodhall 2019-06-16 16:37:26 +01:00
rodzic 33151391e2
commit 5db81d6089
5 zmienionych plików z 30 dodań i 5 usunięć

Wyświetl plik

@ -58,6 +58,11 @@ class Logbook extends CI_Controller {
$this->load->model('user_model');
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
$this->load->model('lotw_user');
$lotw_member = $this->lotw_user->check($callsign);
$this->load->model('logbook_model');
$return = [
@ -67,7 +72,8 @@ class Logbook extends CI_Controller {
"callsign_qth" => "",
"callsign_iota" => "",
"bearing" => "",
"workedBefore" => false
"workedBefore" => false,
"lotw_member" => $lotw_member,
];
$return['dxcc'] = $this->dxcheck($callsign);
@ -91,6 +97,7 @@ class Logbook extends CI_Controller {
return;
}
if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null)
{
// Lookup using QRZ
@ -131,6 +138,7 @@ class Logbook extends CI_Controller {
$return['bearing'] = $this->bearing($return['callsign_qra']);
echo json_encode($return, JSON_PRETTY_PRINT);
return;
}

Wyświetl plik

@ -324,6 +324,9 @@ class Lotw extends CI_Controller {
*/
function lotw_usercheck($callsign) {
$this->load->model('lotw_user');
$lotw_user_result = $this->lotw_user->check($callsign);
}

Wyświetl plik

@ -20,9 +20,18 @@ class Lotw_user extends CI_Model {
'upload_date' => $date
);
$this->db->insert('lotw_userlist', $data);
}
function check($callsign) {
$this->db->where('callsign', $callsign);
$query = $this->db->get('lotw_userlist');
if ($query->num_rows() > 0) {
return "active";
} else {
return "not found";
}
}
}
?>

Wyświetl plik

@ -203,6 +203,7 @@ $(document).ready(function(){
$('#callsign_info').text("");
$('#locator_info').text("");
$('#country').val("");
$('#lotw_info').text("");
$('#dxcc_id').val("");
$('#cqz').val("");
$('#name').val("");
@ -223,9 +224,13 @@ $(document).ready(function(){
/* Find and populate DXCC */
$.getJSON('logbook/json/' + $(this).val(), function(result)
{
//$('#country').val(result);
//$('#country').val(result); lotw_info
$('#country').val(convert_case(result.dxcc.entity));
$('#callsign_info').text(convert_case(result.dxcc.entity));
if(result.lotw_member == "active") {
$('#lotw_info').text("LoTW");
}
$('#dxcc_id').val(result.dxcc.adif);
$('#cqz').val(result.dxcc.cqz);

Wyświetl plik

@ -60,7 +60,7 @@
<div class="form-group">
<label for="callsign">Callsign</label>
<input type="text" class="form-control" id="callsign" name="callsign" required>
<small id="callsign_info" class="badge badge-primary"></small>
<small id="callsign_info" class="badge badge-secondary"></small> <small id="lotw_info" class="badge badge-light"></small>
</div>