Merge pull request #219 from int2001/eqsl_mark_sent

Set only eQSLs from user as sent!
This commit is contained in:
Joerg (DJ7NT)
2024-03-13 12:51:18 +01:00
committed by GitHub

View File

@@ -8,6 +8,15 @@ class Eqslmethods_model extends CI_Model {
'COL_EQSL_QSLSDATE' => date('Y-m-d')." 00:00:00",
);
$userid=$this->session->userdata('user_id');
if ($userid ?? '' != '') {
$stations = $this->get_all_user_locations($userid);
$logbooks_locations_array = array();
foreach ($stations->result() as $row) {
array_push($logbooks_locations_array, $row->station_id);
}
if (count($logbooks_locations_array)>0) {
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->group_start();
$this->db->where('COL_EQSL_QSL_SENT', 'N');
$this->db->or_where('COL_EQSL_QSL_SENT', 'R');
@@ -17,6 +26,8 @@ class Eqslmethods_model extends CI_Model {
$this->db->update($this->config->item('table_name'), $data);
}
}
}
function get_eqsl_users() {
$this->db->select('user_eqsl_name, user_eqsl_password, user_id');