mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Fix possible Clublog-Errors
This commit is contained in:
@@ -289,7 +289,6 @@ class Clublog_model extends CI_Model
|
||||
function mark_all_qsos_notsent($station_id) {
|
||||
$data = array(
|
||||
'COL_CLUBLOG_QSO_UPLOAD_DATE' => null,
|
||||
'COL_CLUBLOG_QSO_UPLOAD_STATUS' => "M",
|
||||
'COL_CLUBLOG_QSO_UPLOAD_STATUS' => "N",
|
||||
);
|
||||
|
||||
@@ -342,8 +341,22 @@ class Clublog_model extends CI_Model
|
||||
}
|
||||
|
||||
function disable_sync4call($call, $stations) {
|
||||
$sql = "update station_profile set clublogignore=1 where station_callsign=? and station_id in (" . $stations . ")";
|
||||
$query = $this->db->query($sql, $call);
|
||||
if (empty($stations) || trim($stations) === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$station_ids = array_filter(explode(",", $stations), function($id) {
|
||||
return trim($id) !== '';
|
||||
});
|
||||
|
||||
if (empty($station_ids)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$placeholders = implode(',', array_fill(0, count($station_ids), '?'));
|
||||
$sql = "UPDATE station_profile SET clublogignore=1 WHERE station_callsign=? AND station_id IN (" . $placeholders . ")";
|
||||
$bindings = array_merge([$call], $station_ids);
|
||||
$query = $this->db->query($sql, $bindings);
|
||||
}
|
||||
|
||||
function all_enabled($userid) {
|
||||
|
||||
@@ -4520,7 +4520,18 @@ class Logbook_model extends CI_Model {
|
||||
|
||||
function clublog_update($datetime, $callsign, $band, $qsl_status, $station_callsign, $station_ids) {
|
||||
|
||||
$logbooks_locations_array = explode(",", $station_ids);
|
||||
if (empty($station_ids) || trim($station_ids) === '') {
|
||||
return "No station IDs provided";
|
||||
}
|
||||
|
||||
$logbooks_locations_array = array_filter(explode(",", $station_ids), function($id) {
|
||||
return trim($id) !== '';
|
||||
});
|
||||
|
||||
if (empty($logbooks_locations_array)) {
|
||||
return "No valid station IDs";
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'COL_CLUBLOG_QSO_DOWNLOAD_DATE' => date('Y-m-d'),
|
||||
'COL_CLUBLOG_QSO_DOWNLOAD_STATUS' => $qsl_status,
|
||||
|
||||
Reference in New Issue
Block a user