mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added a page for QSL statistics, just numbers
This commit is contained in:
@@ -20,21 +20,21 @@ class Statistics extends CI_Controller {
|
||||
} else {
|
||||
redirect('user/login');
|
||||
}
|
||||
}
|
||||
}
|
||||
// Render User Interface
|
||||
|
||||
// Set Page Title
|
||||
$data['page_title'] = __("Statistics");
|
||||
$data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true);
|
||||
|
||||
|
||||
// Load Views
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('statistics/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
|
||||
function custom() {
|
||||
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) {
|
||||
if($this->user_model->validate_session()) {
|
||||
@@ -44,12 +44,12 @@ class Statistics extends CI_Controller {
|
||||
redirect('user/login');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$data['page_title'] = __("Custom Statistics");
|
||||
$data['modes'] = $this->logbook_model->get_modes();
|
||||
|
||||
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
@@ -65,16 +65,16 @@ class Statistics extends CI_Controller {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
$this->load->model('stats');
|
||||
|
||||
|
||||
$data['result'] = $this->stats->result();
|
||||
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('statistics/custom_result');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function get_year() {
|
||||
@@ -84,7 +84,7 @@ class Statistics extends CI_Controller {
|
||||
$totals_year = $this->logbook_model->totals_year();
|
||||
|
||||
$yearstats = array();
|
||||
|
||||
|
||||
$i = 0;
|
||||
if ($totals_year) {
|
||||
foreach($totals_year->result() as $qso_numbers) {
|
||||
@@ -92,7 +92,7 @@ class Statistics extends CI_Controller {
|
||||
$yearstats[$i++]['total'] = $qso_numbers->total;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($yearstats);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class Statistics extends CI_Controller {
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$modestats = array();
|
||||
|
||||
|
||||
$i = 0;
|
||||
$modestats[$i]['mode'] = 'ssb';
|
||||
$modestats[$i++]['total'] = $this->logbook_model->total_ssb();
|
||||
@@ -112,7 +112,7 @@ class Statistics extends CI_Controller {
|
||||
$modestats[$i]['mode'] = 'digi';
|
||||
$modestats[$i]['total'] = $this->logbook_model->total_digi();
|
||||
usort($modestats, fn($a, $b) => $b['total'] <=> $a['total']);
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
echo json_encode($modestats);
|
||||
@@ -124,9 +124,9 @@ class Statistics extends CI_Controller {
|
||||
$bandstats = array();
|
||||
|
||||
$total_bands = $this->logbook_model->total_bands();
|
||||
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
if ($total_bands) {
|
||||
foreach($total_bands->result() as $qso_numbers) {
|
||||
$bandstats[$i]['band'] = $qso_numbers->band;
|
||||
@@ -145,7 +145,7 @@ class Statistics extends CI_Controller {
|
||||
|
||||
$total_sat = $this->logbook_model->total_sat();
|
||||
$i = 0;
|
||||
|
||||
|
||||
if ($total_sat) {
|
||||
foreach($total_sat->result() as $qso_numbers) {
|
||||
$satstats[$i]['sat'] = $qso_numbers->COL_SAT_NAME;
|
||||
@@ -212,4 +212,24 @@ class Statistics extends CI_Controller {
|
||||
|
||||
$this->load->view('statistics/qsotable', $total_qsos);
|
||||
}
|
||||
|
||||
public function qslstats() {
|
||||
$this->load->model('stats');
|
||||
|
||||
$totalqsos = array();
|
||||
|
||||
$result = $this->stats->total_qsls();
|
||||
$total_qsos['qsoarray'] = $result['qsoView'];
|
||||
$total_qsos['qsosatarray'] = $result['qsoSatView'];
|
||||
$total_qsos['bands'] = $this->stats->get_bands();
|
||||
$total_qsos['sats'] = $this->stats->get_sats();
|
||||
|
||||
// Set Page Title
|
||||
$data['page_title'] = __("QSL Statistics");
|
||||
|
||||
// Load Views
|
||||
$this->load->view('interface_assets/header');
|
||||
$this->load->view('statistics/qsltable', $total_qsos);
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user