From 4f1ba5327c367d60db1b5ac5b503d37e6b4e694e Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Sat, 7 Dec 2019 23:32:41 +0100 Subject: [PATCH 1/2] Improved Countries Breakdown by showing confirmed (by paper-QSL) and needed confirmed --- application/controllers/Dashboard.php | 1 + application/models/Logbook_model.php | 11 +++++++++++ application/views/dashboard/index.php | 9 ++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 34eee31a..6197c995 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -47,6 +47,7 @@ class Dashboard extends CI_Controller { $data['total_digi'] = $this->logbook_model->total_digi(); $data['total_countrys'] = $this->logbook_model->total_countrys(); + $data['total_countrys_confirmed'] = $this->logbook_model->total_countrys_confirmed(); $data['total_qsl_sent'] = $this->logbook_model->total_qsl_sent(); $data['total_qsl_recv'] = $this->logbook_model->total_qsl_recv(); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index de36e935..3f70c05e 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -816,6 +816,17 @@ class Logbook_model extends CI_Model { return $query->num_rows(); } + /* Return total number of countrys confirmed with paper QSL */ + function total_countrys_confirmed() { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $query = $this->db->query('SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_QSL_RCVD =\'Y\''); + + return $query->num_rows(); + } + function api_search_query($query) { $time_start = microtime(true); $results = $this->db->query($query); diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index a405c7cb..4452b60b 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -105,10 +105,17 @@ Worked + + Confirmed + + Needed - + From 024d4df0105333e0023d7bb781141fb52b6cc269 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Wed, 11 Dec 2019 22:50:21 +0100 Subject: [PATCH 2/2] added Paper/eQSL/LoTW... --- application/controllers/Dashboard.php | 4 +++- application/models/Logbook_model.php | 24 +++++++++++++++++++++++- application/views/dashboard/index.php | 12 ++++++------ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 6197c995..0c645016 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -47,7 +47,9 @@ class Dashboard extends CI_Controller { $data['total_digi'] = $this->logbook_model->total_digi(); $data['total_countrys'] = $this->logbook_model->total_countrys(); - $data['total_countrys_confirmed'] = $this->logbook_model->total_countrys_confirmed(); + $data['total_countrys_confirmed_paper'] = $this->logbook_model->total_countrys_confirmed_paper(); + $data['total_countrys_confirmed_eqsl'] = $this->logbook_model->total_countrys_confirmed_eqsl(); + $data['total_countrys_confirmed_lotw'] = $this->logbook_model->total_countrys_confirmed_lotw(); $data['total_qsl_sent'] = $this->logbook_model->total_qsl_sent(); $data['total_qsl_recv'] = $this->logbook_model->total_qsl_recv(); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 3f70c05e..7f54a20f 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -817,7 +817,7 @@ class Logbook_model extends CI_Model { } /* Return total number of countrys confirmed with paper QSL */ - function total_countrys_confirmed() { + function total_countrys_confirmed_paper() { $CI =& get_instance(); $CI->load->model('Stations'); $station_id = $CI->Stations->find_active(); @@ -827,6 +827,28 @@ class Logbook_model extends CI_Model { return $query->num_rows(); } + /* Return total number of countrys confirmed with eQSL */ + function total_countrys_confirmed_eqsl() { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $query = $this->db->query('SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_EQSL_QSL_RCVD =\'Y\''); + + return $query->num_rows(); + } + + /* Return total number of countrys confirmed with LoTW */ + function total_countrys_confirmed_lotw() { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $query = $this->db->query('SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').' WHERE station_id = '.$station_id.' AND COL_LOTW_QSL_RCVD =\'Y\''); + + return $query->num_rows(); + } + function api_search_query($query) { $time_start = microtime(true); $results = $this->db->query($query); diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 4452b60b..4362693b 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -106,16 +106,16 @@ - Confirmed - + Confirmed (paper/eQSL/LoTW) + // Needed - +