When importing only check QSO exists for that station profile

This commit is contained in:
Peter Goodhall
2019-12-04 15:16:56 +00:00
parent 81e8b51729
commit c2a389cb99
2 changed files with 8 additions and 9 deletions

View File

@@ -847,7 +847,7 @@ class Logbook_model extends CI_Model {
}
/* Used to check if the qso is already in the database */
function import_check($datetime, $callsign, $band) {
function import_check($datetime, $callsign, $band) {
$this->db->select('COL_TIME_ON, COL_CALL, COL_BAND');
$this->db->where('COL_TIME_ON >= DATE_ADD(DATE_FORMAT("'.$datetime.'", \'%Y-%m-%d %H:%i\' ), INTERVAL -15 MINUTE )');
@@ -1251,12 +1251,17 @@ class Logbook_model extends CI_Model {
$input_lotw_qslsdate = NULL;
}
if($station_id == "" || $station_id == "0") {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
}
if (isset($record['call'])){
$this->db->where('COL_CALL', $record['call']);
}
$this->db->where('COL_TIME_ON', $time_on);
$this->db->where('station_id', $station_id);
$check = $this->db->get($this->config->item('table_name'));
if ($check->num_rows() <= 0)
@@ -1418,12 +1423,6 @@ class Logbook_model extends CI_Model {
'COL_WEB' => (!empty($record['web'])) ? $record['web'] : ''
);
if($station_id == "" || $station_id == "0") {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
}
if($station_id != "0") {
$station_result = $this->db->where('station_id', $station_id)
->get('station_profile');

View File

@@ -63,7 +63,7 @@
<?php } ?>
<?php if($is_there_qsos_with_no_station_id >= 1) { ?>
<a href="<?php echo site_url('station/reassign_profile/').$row->station_id; ?>" class="btn btn-outline-secondary btn-sm" onclick="return confirm('Are you sure you want to reassign QSOs to the <?php echo $row->station_profile_name; ?> profile?');">Reassign</a>
<a href="<?php echo site_url('station/reassign_profile/').$row->station_id; ?>" class="btn btn-outline-secondary btn-sm" onclick="return confirm('Are you sure you want to reassign QSOs to the <?php echo $row->station_profile_name; ?> profile?');">Reassign</a>
<?php } ?>
</td>
<td>