kopia lustrzana https://github.com/magicbug/Cloudlog
Merge pull request #662 from AndreasK79/dashboard_needed_dxcc_fix
Fixed a couple of bugs in countries breakdown on dashboard.pull/666/head
commit
166789e57d
|
@ -50,10 +50,10 @@ class Dashboard extends CI_Controller {
|
|||
$data['month_qsos'] = $this->logbook_model->month_qsos();
|
||||
$data['year_qsos'] = $this->logbook_model->year_qsos();
|
||||
|
||||
$data['total_countrys'] = $this->logbook_model->total_countrys();
|
||||
$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_countries'] = $this->logbook_model->total_countries();
|
||||
$data['total_countries_confirmed_paper'] = $this->logbook_model->total_countries_confirmed_paper();
|
||||
$data['total_countries_confirmed_eqsl'] = $this->logbook_model->total_countries_confirmed_eqsl();
|
||||
$data['total_countries_confirmed_lotw'] = $this->logbook_model->total_countries_confirmed_lotw();
|
||||
|
||||
$data['total_qsl_sent'] = $this->logbook_model->total_qsl_sent();
|
||||
$data['total_qsl_recv'] = $this->logbook_model->total_qsl_recv();
|
||||
|
@ -63,6 +63,13 @@ class Dashboard extends CI_Controller {
|
|||
|
||||
$data['page_title'] = "Dashboard";
|
||||
|
||||
$this->load->model('dxcc');
|
||||
$dxcc = $this->dxcc->list_current();
|
||||
|
||||
$current = $this->logbook_model->total_countries_current();
|
||||
|
||||
$data['total_countries_needed'] = count($dxcc->result()) - $current;
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('dashboard/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
|
|
|
@ -168,11 +168,23 @@ class DXCC extends CI_Model {
|
|||
$this->db->empty_table($table);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fethes a list of all dxcc's, both current and deleted
|
||||
*/
|
||||
function list() {
|
||||
$this->db->order_by('name', 'ASC');
|
||||
return $this->db->get('dxcc_entities');
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetches a list of all current dxcc's (non-deleted)
|
||||
*/
|
||||
function list_current() {
|
||||
$this->db->where('end', null);
|
||||
$this->db->order_by('name', 'ASC');
|
||||
return $this->db->get('dxcc_entities');
|
||||
}
|
||||
|
||||
function get_dxcc_array($dxccArray, $bands, $postdata) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
|
|
|
@ -1226,46 +1226,84 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
}
|
||||
|
||||
/* Return total number of countrys worked */
|
||||
function total_countrys() {
|
||||
/* Return total number of countries worked */
|
||||
function total_countries() {
|
||||
$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 COL_COUNTRY != "Invalid" AND station_id = '.$station_id.'');
|
||||
$sql = 'SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').'
|
||||
WHERE COL_COUNTRY != "Invalid"
|
||||
AND col_dxcc > 0
|
||||
AND station_id = '.$station_id ;
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
/* Return total number of countrys confirmed with paper QSL */
|
||||
function total_countrys_confirmed_paper() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
/* Return total number of countries worked */
|
||||
function total_countries_current() {
|
||||
$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 COL_COUNTRY != "Invalid" AND station_id = '.$station_id.' AND COL_QSL_RCVD =\'Y\'');
|
||||
$sql = 'SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').' thcv
|
||||
join dxcc_entities on thcv.col_dxcc = dxcc_entities.adif
|
||||
WHERE COL_COUNTRY != "Invalid"
|
||||
AND dxcc_entities.end is null
|
||||
AND station_id = '.$station_id;
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
/* Return total number of countrys confirmed with eQSL */
|
||||
function total_countrys_confirmed_eqsl() {
|
||||
/* Return total number of countries confirmed with paper QSL */
|
||||
function total_countries_confirmed_paper() {
|
||||
$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 COL_COUNTRY != "Invalid" AND station_id = '.$station_id.' AND COL_EQSL_QSL_RCVD =\'Y\'');
|
||||
$sql = 'SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').'
|
||||
WHERE COL_COUNTRY != "Invalid"
|
||||
AND COL_DXCC > 0
|
||||
AND station_id = '.$station_id.' AND COL_QSL_RCVD =\'Y\'';
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
/* Return total number of countrys confirmed with LoTW */
|
||||
function total_countrys_confirmed_lotw() {
|
||||
/* Return total number of countries confirmed with eQSL */
|
||||
function total_countries_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 COL_COUNTRY != "Invalid" AND station_id = '.$station_id.' AND COL_LOTW_QSL_RCVD =\'Y\'');
|
||||
$sql = 'SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').'
|
||||
WHERE COL_COUNTRY != "Invalid"
|
||||
AND COL_DXCC > 0
|
||||
AND station_id = '.$station_id.' AND COL_EQSL_QSL_RCVD =\'Y\'';
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
||||
/* Return total number of countries confirmed with LoTW */
|
||||
function total_countries_confirmed_lotw() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('Stations');
|
||||
$station_id = $CI->Stations->find_active();
|
||||
|
||||
$sql = 'SELECT DISTINCT (COL_COUNTRY) FROM '.$this->config->item('table_name').'
|
||||
WHERE COL_COUNTRY != "Invalid"
|
||||
AND COL_DXCC > 0
|
||||
AND station_id = '.$station_id.'
|
||||
AND COL_LOTW_QSL_RCVD =\'Y\'';
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->num_rows();
|
||||
}
|
||||
|
|
|
@ -119,20 +119,20 @@
|
|||
|
||||
<tr>
|
||||
<td><?php echo $this->lang->line('general_word_worked'); ?></td>
|
||||
<td><?php echo $total_countrys; ?></td>
|
||||
<td><?php echo $total_countries; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#" onclick="return false" data-original-title="QSL Cards / eQSL / LoTW" data-toggle="tooltip"><?php echo $this->lang->line('general_word_confirmed'); ?></a></td>
|
||||
<td>
|
||||
<?php echo $total_countrys_confirmed_paper; ?> /
|
||||
<?php echo $total_countrys_confirmed_eqsl; ?> /
|
||||
<?php echo $total_countrys_confirmed_lotw; ?>
|
||||
<?php echo $total_countries_confirmed_paper; ?> /
|
||||
<?php echo $total_countries_confirmed_eqsl; ?> /
|
||||
<?php echo $total_countries_confirmed_lotw; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $this->lang->line('general_word_needed'); ?></td>
|
||||
<td><?php $dxcc = 340 - $total_countrys; echo $dxcc; ?></td>
|
||||
<td><?php echo $total_countries_needed; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<tr class="titles">
|
||||
<td>Date</td>
|
||||
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<tr class="titles">
|
||||
<td>Date</td>
|
||||
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
|
||||
|
|
Ładowanie…
Reference in New Issue