mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Fixed table info when linking locations to container
This commit is contained in:
@@ -415,6 +415,7 @@ class Stationsetup extends CI_Controller {
|
||||
// If no link exists, create
|
||||
$this->stationsetup_model->create_logbook_location_link($containerid, $locationid);
|
||||
$data['success']=1;
|
||||
$data['locationdata'] = $this->stationsetup_model->locationInfo($locationid)->result();
|
||||
} else {
|
||||
$data['success']=0;
|
||||
$data['flashdata']='Error';
|
||||
|
||||
@@ -147,6 +147,15 @@ class Stationsetup_model extends CI_Model {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function locationInfo($id) {
|
||||
$userid = $this->session->userdata('user_id'); // Fallback to session-uid, if userid is omitted
|
||||
$this->db->select('station_profile.station_profile_name, station_profile.station_callsign, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end');
|
||||
$this->db->where('user_id', $userid);
|
||||
$this->db->where('station_id', $id);
|
||||
$this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left outer');
|
||||
return $this->db->get('station_profile');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -530,12 +530,13 @@ function linkLocations() {
|
||||
success: function(data) {
|
||||
jdata=JSON.parse(data);
|
||||
if (jdata.success == 1) {
|
||||
console.log(jdata);
|
||||
$("#StationLocationSelect").find('[value="'+ locationid +'"]').remove();
|
||||
// add to table
|
||||
$('#station_logbooks_linked_table').append($('<tr id="locationid_'+locationid+'">')
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append(locationarray[0]))
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append(locationarray[2]))
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append(locationarray[4].slice(0, -1)))
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append(jdata.locationdata[0].station_profile_name))
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append(jdata.locationdata[0].station_callsign))
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append(jdata.locationdata[0].station_country+(jdata.locationdata[0].dxcc_end == null ? '' : ' <span class="badge bg-danger">Deleted DXCC</span>')))
|
||||
.append($('<td style="text-align: center; vertical-align: middle;">').append('<button class="btn btn-sm btn-danger" onclick="unLinkLocations('+containerid+','+locationid+');"><i class="fas fa-unlink"></i></button>'))
|
||||
)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user