kopia lustrzana https://github.com/magicbug/Cloudlog
Displays under the callsign whether persons an lotw user or not
rodzic
33151391e2
commit
5db81d6089
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue