mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge remote-tracking branch 'upstream/dev' into locations_quickswitch
This commit is contained in:
@@ -42,6 +42,9 @@ Wavelog-support can be reached by creating an issue here at github. If you've an
|
||||
|
||||
## Contributing
|
||||
|
||||
Special thanks to our contributors, who are part of Wavelog by improving code!
|
||||
@abarrau, @dg0tm
|
||||
|
||||
If you would like to contribute in any way to Wavelog, it is most appreciated. This has been developed in free time, help coding new features or writing documentation is always useful.
|
||||
|
||||
Please note that Wavelog was built using [Codeigniter](https://www.codeigniter.com/docs) version 3 and uses Bootstrap 5 for the user CSS framework documentation is available for this when building components.
|
||||
|
||||
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
||||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 179;
|
||||
$config['migration_version'] = 180;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
85
application/controllers/Cfdexport.php
Normal file
85
application/controllers/Cfdexport.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|
||||
Provides outputted cfd files for use with Google Map services
|
||||
All maps are stored within /cfd in the root directory
|
||||
|
||||
*/
|
||||
|
||||
class Cfdexport extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('modes');
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('bands');
|
||||
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = "CFD Export";
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('cfd/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('dxcc');
|
||||
|
||||
// Parameters
|
||||
$fromdate = xss_clean($this->input->post('from'));
|
||||
$todate = xss_clean($this->input->post('to'));
|
||||
|
||||
$this->load->library('frequency');
|
||||
// Get QSOs with Valid QRAs
|
||||
$qsos = $this->logbook_model->cfd_get_all_qsos($fromdate, $todate);
|
||||
$output=strtoupper($this->session->userdata('user_callsign'))."\n";
|
||||
$output.='--------------------------------------------------------------
|
||||
MostWanted 1.42 - Overview Confirmed Entities
|
||||
(M=Mixed C=CW F=Fone R=Rest)
|
||||
==============================================================
|
||||
|
||||
Entity \ MHz: ALL 1.8 3.5 7 10 14 18 21 24 28 50
|
||||
-------------------------------------------------------------------------------------------------------'."\n";
|
||||
|
||||
$dxcc_list=[]; // Prepare Array
|
||||
foreach ($qsos->result() as $row) { // Loop through entities which are cnfmd
|
||||
$nominal=$this->frequency->defaultFrequencies[$row->band]['NOMINAL'];
|
||||
$dxcc_list[$row->prefix]['name']=$row->name;
|
||||
if ($row->cnfmd >=1) { $dxcc_list[$row->prefix][$nominal][$row->mode]=$row->mode; }
|
||||
}
|
||||
$dxccs=$this->dxcc->list_current('prefix');
|
||||
foreach ($dxccs->result() as $dxcc) { // Loop through ALL active entities
|
||||
$vals=$dxcc_list[$dxcc->prefix] ?? []; // Set current Entity
|
||||
$output .= str_pad($dxcc->prefix,6," ")." ".str_pad(substr($dxcc->name,0,30),30,".")." ";
|
||||
$allm=0;
|
||||
$allc=0;
|
||||
$allf=0;
|
||||
$allr=0;
|
||||
$bandachievements='';
|
||||
foreach ($this->frequency->defaultFrequencies as $band => $attribs) { // Loop through Bands
|
||||
if (($attribs['NOMINAL'] <= 50) && ($attribs['NOMINAL'] != 5)) { // Check Every Band for cnfm state
|
||||
if ($vals[$attribs['NOMINAL']] ?? '' != '') { $bandachievements .= 'M'; $allm++; } else { $bandachievements .= '-'; }
|
||||
if ($vals[$attribs['NOMINAL']]['C'] ?? '' == 'C') { $bandachievements .= 'C'; $allc++; } else { $bandachievements .= '-'; }
|
||||
if ($vals[$attribs['NOMINAL']]['F'] ?? '' == 'F') { $bandachievements .= 'F'; $allf++; } else { $bandachievements .= '-'; }
|
||||
if ($vals[$attribs['NOMINAL']]['R'] ?? '' == 'R') { $bandachievements .= 'R'; $allr++; } else { $bandachievements .= '-'; }
|
||||
$bandachievements .= ' ';
|
||||
}
|
||||
}
|
||||
// Prepeare ALL Column
|
||||
if ($allm >0) { $output.='M'; } else { $output.='-'; }
|
||||
if ($allc >0) { $output.='C'; } else { $output.='-'; }
|
||||
if ($allf >0) { $output.='F'; } else { $output.='-'; }
|
||||
if ($allr >0) { $output.='R'; } else { $output.='-'; }
|
||||
$output .= ' '.$bandachievements."\n";
|
||||
}
|
||||
|
||||
header("Content-Disposition: attachment; filename=\"".strtoupper($this->session->userdata('user_callsign')).".CFD\"");
|
||||
echo $output;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "国家";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "在日志中未发现任何竞赛";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "没有找到该台站位置的竞赛";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Adresse - Pays";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "Aucun concours trouvé dans votre journal de trafic";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "Aucun concours trouvé pour cet emplacement de station!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Addresse Land";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "Es wurden keine Contests in deinem Log gefunden.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "Für diesen Stationsstandort wurden keine vorhandenen Contests gefunden!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Адрес (страна)";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "В вашем логе конест-сессий не найдено.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "Для этого расположения станции контест-сессии не найдены!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Dirección - País";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No se encontraron concursos en tu registro.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "¡No se encontraron concursos para esta localización de estación!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -72,4 +72,5 @@ $lang['export_cabrillo_address_country'] = "Address Country";
|
||||
$lang['export_cabrillo_no_contests_in_log'] = "No contests were found in your log.";
|
||||
$lang['export_cabrillo_no_contests_for_stationlocation'] = "No contests were found for this station location!";
|
||||
|
||||
$lang['export_cfd_description'] = "Export of CFD-File for DARC-Toplist (See <a href=\"https://toplist.darc.de\" target=\"_new\">https://toplist.darc.de</a>)";
|
||||
|
||||
|
||||
@@ -5,87 +5,108 @@ class Frequency {
|
||||
'160m'=>array(
|
||||
'SSB'=>"1900000",
|
||||
'DATA'=>"1838000",
|
||||
'CW'=>"1830000"),
|
||||
'CW'=>"1830000",
|
||||
'NOMINAL'=>"1.8"),
|
||||
'80m'=>array(
|
||||
'SSB'=>"3700000",
|
||||
'DATA'=>"3583000",
|
||||
"CW"=>"3550000"),
|
||||
"CW"=>"3550000",
|
||||
"NOMINAL"=>"3.5"),
|
||||
'60m'=>array(
|
||||
'SSB'=>"5330000",
|
||||
'DATA'=>"5330000",
|
||||
"CW"=>"5260000"),
|
||||
"CW"=>"5260000",
|
||||
"NOMINAL"=>"5"),
|
||||
'40m'=>array(
|
||||
'SSB'=>"7100000",
|
||||
'DATA'=>"7040000",
|
||||
'CW'=>"7020000"),
|
||||
'CW'=>"7020000",
|
||||
'NOMINAL'=>"7"),
|
||||
'30m'=>array(
|
||||
'SSB'=>"10120000",
|
||||
'DATA'=>"10145000",
|
||||
'CW'=>"10120000"),
|
||||
'CW'=>"10120000",
|
||||
'NOMINAL'=>"10"),
|
||||
'20m'=>array(
|
||||
'SSB'=>"14200000",
|
||||
'DATA'=>"14080000",
|
||||
'CW'=>"14020000"),
|
||||
'CW'=>"14020000",
|
||||
'NOMINAL'=>"14"),
|
||||
'17m'=>array(
|
||||
'SSB'=>"18130000",
|
||||
'DATA'=>"18105000",
|
||||
'CW'=>"18080000"),
|
||||
'CW'=>"18080000",
|
||||
'NOMINAL'=>"18"),
|
||||
'15m'=>array(
|
||||
'SSB'=>"21300000",
|
||||
'DATA'=>"21080000",
|
||||
'CW'=>"21020000"),
|
||||
'CW'=>"21020000",
|
||||
'NOMINAL'=>"21"),
|
||||
'12m'=>array(
|
||||
'SSB'=>"24950000",
|
||||
'DATA'=>"24925000",
|
||||
'CW'=>"24900000"),
|
||||
'CW'=>"24900000",
|
||||
'NOMINAL'=>"24"),
|
||||
'10m'=>array(
|
||||
'SSB'=>"28300000",
|
||||
'DATA'=>"28120000",
|
||||
'CW'=>"28050000"),
|
||||
'CW'=>"28050000",
|
||||
'NOMINAL'=>"28"),
|
||||
'6m'=>array(
|
||||
'SSB'=>"50150000",
|
||||
'DATA'=>"50230000",
|
||||
'CW'=>"50090000"),
|
||||
'CW'=>"50090000",
|
||||
'NOMINAL'=>"50"),
|
||||
'4m'=>array(
|
||||
'SSB'=>"70200000",
|
||||
'DATA'=>"70200000",
|
||||
'CW'=>"70200000"),
|
||||
'CW'=>"70200000",
|
||||
'NOMINAL'=>"70"),
|
||||
'2m'=>array(
|
||||
'SSB'=>"144300000",
|
||||
'DATA'=>"144370000",
|
||||
'CW'=>"144050000"),
|
||||
'CW'=>"144050000",
|
||||
'NOMINAL'=>"144"),
|
||||
'1.25m'=>array(
|
||||
'SSB'=>"222100000",
|
||||
'DATA'=>"222100000",
|
||||
'CW'=>"222100000"),
|
||||
'CW'=>"222100000",
|
||||
'NOMINAL'=>"222"),
|
||||
'70cm'=>array(
|
||||
'SSB'=>"432200000",
|
||||
'DATA'=>"432088000",
|
||||
'CW'=>"432050000"),
|
||||
'CW'=>"432050000",
|
||||
'NOMINAL'=>"433"),
|
||||
'33cm'=>array(
|
||||
'SSB'=>"902100000",
|
||||
'DATA'=>"902100000",
|
||||
'CW'=>"902100000"),
|
||||
'CW'=>"902100000",
|
||||
'NOMINAL'=>"902"),
|
||||
'23cm'=>array(
|
||||
'SSB'=>"1296000000",
|
||||
'DATA'=>"1296138000",
|
||||
'CW'=>"129600000"),
|
||||
'CW'=>"129600000",
|
||||
'NOMINAL'=>"1296"),
|
||||
'13cm'=>array(
|
||||
'SSB'=>"2320800000",
|
||||
'DATA'=>"2320800000",
|
||||
'CW'=>"2320800000"),
|
||||
'CW'=>"2320800000",
|
||||
'NOMINAL'=>"2400"),
|
||||
'9cm'=>array(
|
||||
'SSB'=>"3410000000",
|
||||
'DATA'=>"3410000000",
|
||||
'CW'=>"3400000000"),
|
||||
'CW'=>"3400000000",
|
||||
'NOMINAL'=>"3400"),
|
||||
'6cm'=>array(
|
||||
'SSB'=>"5670000000",
|
||||
'DATA'=>"5670000000",
|
||||
'CW'=>"5670000000"),
|
||||
'CW'=>"5670000000",
|
||||
'NOMINAL'=>"5670"),
|
||||
'3cm'=>array(
|
||||
'SSB'=>"10225000000",
|
||||
'DATA'=>"10225000000",
|
||||
'CW'=>"10225000000")
|
||||
'CW'=>"10225000000",
|
||||
'NOMINAL'=>"10225")
|
||||
);
|
||||
|
||||
/* Class to convert band and mode into a frequency in a format based on the specifications of the database table */
|
||||
|
||||
36
application/migrations/180_tag_1_1.php
Normal file
36
application/migrations/180_tag_1_1.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
Tag Wavelog as Version 1.1
|
||||
*/
|
||||
|
||||
class Migration_tag_1_1 extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
|
||||
// Tag Wavelog New Version
|
||||
$this->db->where('option_name', 'version');
|
||||
$this->db->update('options', array('option_value' => '1.1'));
|
||||
|
||||
// Trigger Version Info Dialog
|
||||
$this->db->where('option_type', 'version_dialog');
|
||||
$this->db->where('option_name', 'confirmed');
|
||||
$this->db->update('user_options', array('option_value' => 'false'));
|
||||
|
||||
// Also set Version Dialog to "both" if only custom text is applied
|
||||
$this->db->where('option_name', 'version_dialog');
|
||||
$this->db->where('option_value', 'custom_text');
|
||||
$this->db->update('options', array('option_value' => 'both'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->db->where('option_name', 'version');
|
||||
$this->db->update('options', array('option_value' => '1.0'));
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,10 @@
|
||||
class DXCC extends CI_Model {
|
||||
|
||||
/**
|
||||
* Function: mostactive
|
||||
* Information: Returns the most active band
|
||||
**/
|
||||
function info($callsign)
|
||||
{
|
||||
* Function: mostactive
|
||||
* Information: Returns the most active band
|
||||
**/
|
||||
function info($callsign) {
|
||||
$exceptions = $this->db->query('
|
||||
SELECT *
|
||||
FROM `dxcc_exceptions`
|
||||
@@ -15,11 +14,9 @@ class DXCC extends CI_Model {
|
||||
LIMIT 1
|
||||
');
|
||||
|
||||
if ($exceptions->num_rows() > 0)
|
||||
{
|
||||
if ($exceptions->num_rows() > 0) {
|
||||
return $exceptions;
|
||||
} else {
|
||||
|
||||
$query = $this->db->query('
|
||||
SELECT *
|
||||
FROM dxcc_entities
|
||||
@@ -32,10 +29,10 @@ class DXCC extends CI_Model {
|
||||
}
|
||||
}
|
||||
|
||||
function search(){
|
||||
print_r($this->input->get());
|
||||
return;
|
||||
}
|
||||
function search(){
|
||||
print_r($this->input->get());
|
||||
return;
|
||||
}
|
||||
|
||||
function empty_table($table) {
|
||||
$this->db->empty_table($table);
|
||||
@@ -52,9 +49,14 @@ class DXCC extends CI_Model {
|
||||
/*
|
||||
* Fetches a list of all current dxcc's (non-deleted)
|
||||
*/
|
||||
function list_current() {
|
||||
function list_current($orderer = 'name') {
|
||||
$this->db->where('end', null);
|
||||
$this->db->order_by('name', 'ASC');
|
||||
|
||||
if ($orderer == 'name') {
|
||||
$this->db->order_by('name', 'ASC');
|
||||
} elseif ($orderer == 'prefix') {
|
||||
$this->db->order_by('prefix', 'ASC');
|
||||
}
|
||||
return $this->db->get('dxcc_entities');
|
||||
}
|
||||
|
||||
@@ -132,8 +134,7 @@ class DXCC extends CI_Model {
|
||||
|
||||
if (isset($dxccMatrix)) {
|
||||
return $dxccMatrix;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -173,39 +174,32 @@ class DXCC extends CI_Model {
|
||||
select col_dxcc from ".$this->config->item('table_name')." thcv
|
||||
where station_id in (" . $location_list .
|
||||
") and col_dxcc > 0";
|
||||
|
||||
$sql .= $this->addBandToQuery($band);
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||
}
|
||||
|
||||
$sql .= " group by col_dxcc
|
||||
) x on dxcc_entities.adif = x.col_dxcc";;
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and dxcc_entities.end is null";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function addBandToQuery($band) {
|
||||
$sql = '';
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||
} else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and col_band ='" . $band . "'";
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
$sql = '';
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||
} else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and col_band ='" . $band . "'";
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function fetchDxcc($postdata) {
|
||||
$CI =& get_instance();
|
||||
@@ -219,7 +213,7 @@ class DXCC extends CI_Model {
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = "select adif, prefix, name, date(end) Enddate, date(start) Startdate, lat, `long`
|
||||
from dxcc_entities";
|
||||
from dxcc_entities";
|
||||
|
||||
if ($postdata['notworked'] == NULL) {
|
||||
$sql .= " join (select col_dxcc from " . $this->config->item('table_name') . " where station_id in (" . $location_list . ") and col_dxcc > 0";
|
||||
@@ -227,8 +221,7 @@ class DXCC extends CI_Model {
|
||||
if ($postdata['band'] != 'All') {
|
||||
if ($postdata['band'] == 'SAT') {
|
||||
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and col_band ='" . $postdata['band'] . "'";
|
||||
}
|
||||
@@ -257,12 +250,11 @@ class DXCC extends CI_Model {
|
||||
|
||||
function getDxccWorked($location_list, $postdata) {
|
||||
$sql = "SELECT adif as dxcc FROM dxcc_entities
|
||||
join (
|
||||
select col_dxcc
|
||||
from ".$this->config->item('table_name')." thcv
|
||||
where station_id in (" . $location_list .
|
||||
") and col_dxcc > 0";
|
||||
|
||||
join (
|
||||
select col_dxcc
|
||||
from ".$this->config->item('table_name')." thcv
|
||||
where station_id in (" . $location_list .
|
||||
") and col_dxcc > 0";
|
||||
$sql .= $this->addBandToQuery($postdata['band']);
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
@@ -270,7 +262,6 @@ class DXCC extends CI_Model {
|
||||
}
|
||||
|
||||
$sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc and col_dxcc > 0";
|
||||
|
||||
$sql .= $this->addBandToQuery($postdata['band']);
|
||||
|
||||
if ($postdata['mode'] != 'All') {
|
||||
@@ -278,31 +269,27 @@ class DXCC extends CI_Model {
|
||||
}
|
||||
|
||||
$sql .= $this->addQslToQuery($postdata);
|
||||
|
||||
$sql .= ')';
|
||||
|
||||
$sql .= " group by col_dxcc
|
||||
) ll on dxcc_entities.adif = ll.col_dxcc
|
||||
where 1=1";
|
||||
) ll on dxcc_entities.adif = ll.col_dxcc
|
||||
where 1=1";
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and dxcc_entities.end is null";
|
||||
}
|
||||
|
||||
$sql .= $this->addContinentsToQuery($postdata);
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getDxccConfirmed($location_list, $postdata) {
|
||||
$sql = "SELECT adif as dxcc FROM dxcc_entities
|
||||
join (
|
||||
select col_dxcc
|
||||
from ".$this->config->item('table_name')." thcv
|
||||
where station_id in (". $location_list .
|
||||
") and col_dxcc > 0";
|
||||
join (
|
||||
select col_dxcc
|
||||
from ".$this->config->item('table_name')." thcv
|
||||
where station_id in (". $location_list .
|
||||
") and col_dxcc > 0";
|
||||
|
||||
$sql .= $this->addBandToQuery($postdata['band']);
|
||||
|
||||
@@ -313,8 +300,8 @@ class DXCC extends CI_Model {
|
||||
$sql .= $this->addQslToQuery($postdata);
|
||||
|
||||
$sql .= " group by col_dxcc
|
||||
) ll on dxcc_entities.adif = ll.col_dxcc
|
||||
where 1=1";
|
||||
) ll on dxcc_entities.adif = ll.col_dxcc
|
||||
where 1=1";
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and dxcc_entities.end is null";
|
||||
@@ -394,8 +381,7 @@ class DXCC extends CI_Model {
|
||||
/*
|
||||
* Function gets worked and confirmed summary on each band on the active stationprofile
|
||||
*/
|
||||
function get_dxcc_summary($bands, $postdata)
|
||||
{
|
||||
function get_dxcc_summary($bands, $postdata) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
@@ -422,8 +408,7 @@ class DXCC extends CI_Model {
|
||||
return $dxccSummary;
|
||||
}
|
||||
|
||||
function getSummaryByBand($band, $postdata, $location_list)
|
||||
{
|
||||
function getSummaryByBand($band, $postdata, $location_list) {
|
||||
$sql = "SELECT count(distinct thcv.col_dxcc) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= " join dxcc_entities d on thcv.col_dxcc = d.adif";
|
||||
|
||||
@@ -435,11 +420,11 @@ class DXCC extends CI_Model {
|
||||
$this->load->model('bands');
|
||||
|
||||
$bandslots = $this->bands->get_worked_bands('dxcc');
|
||||
|
||||
|
||||
$bandslots_list = "'".implode("','",$bandslots)."'";
|
||||
|
||||
|
||||
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
|
||||
" and thcv.col_prop_mode !='SAT'";
|
||||
" and thcv.col_prop_mode !='SAT'";
|
||||
} else {
|
||||
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||
@@ -460,8 +445,7 @@ class DXCC extends CI_Model {
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getSummaryByBandConfirmed($band, $postdata, $location_list)
|
||||
{
|
||||
function getSummaryByBandConfirmed($band, $postdata, $location_list) {
|
||||
$sql = "SELECT count(distinct thcv.col_dxcc) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||
$sql .= " join dxcc_entities d on thcv.col_dxcc = d.adif";
|
||||
|
||||
@@ -473,11 +457,11 @@ class DXCC extends CI_Model {
|
||||
$this->load->model('bands');
|
||||
|
||||
$bandslots = $this->bands->get_worked_bands('dxcc');
|
||||
|
||||
|
||||
$bandslots_list = "'".implode("','",$bandslots)."'";
|
||||
|
||||
|
||||
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
|
||||
" and thcv.col_prop_mode !='SAT'";
|
||||
" and thcv.col_prop_mode !='SAT'";
|
||||
} else {
|
||||
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||
@@ -489,7 +473,7 @@ class DXCC extends CI_Model {
|
||||
|
||||
$sql .= $this->addQslToQuery($postdata);
|
||||
|
||||
|
||||
|
||||
if ($postdata['includedeleted'] == NULL) {
|
||||
$sql .= " and d.end is null";
|
||||
}
|
||||
@@ -501,8 +485,7 @@ class DXCC extends CI_Model {
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function lookup_country($country)
|
||||
{
|
||||
function lookup_country($country) {
|
||||
$query = $this->db->query('
|
||||
SELECT *
|
||||
FROM dxcc_entities
|
||||
|
||||
@@ -2121,6 +2121,57 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
|
||||
return $query;
|
||||
}
|
||||
|
||||
function cfd_get_all_qsos($fromdate, $todate) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
// If date is set, we add it to the where-statement
|
||||
if ($fromdate ?? ''!= "") {
|
||||
$from=" AND date(q.COL_TIME_ON) >= '".$fromdate."'";
|
||||
} else {
|
||||
$from="";
|
||||
}
|
||||
if ($todate ?? '' != "") {
|
||||
$till=" AND date(q.COL_TIME_ON) <= '".$todate."'";
|
||||
} else {
|
||||
$till='';
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql="SELECT
|
||||
dx.prefix,dx.name,
|
||||
CASE
|
||||
WHEN q.col_mode = 'CW' THEN 'C'
|
||||
WHEN mo.qrgmode = 'DATA' THEN 'R'
|
||||
WHEN mo.qrgmode = 'SSB' THEN 'F'
|
||||
ELSE mo.qrgmode
|
||||
END AS mode,q.col_band as band,
|
||||
COUNT(1) as cnfmd
|
||||
FROM ".$this->config->item('table_name')." q
|
||||
INNER JOIN
|
||||
dxcc_entities dx ON (dx.adif = q.COL_DXCC)
|
||||
INNER JOIN
|
||||
adif_modes mo ON (mo.mode = q.COL_MODE)
|
||||
inner join bands b on (b.band=q.COL_BAND)
|
||||
WHERE
|
||||
(q.COL_QSL_RCVD = 'Y'
|
||||
OR q.COL_LOTW_QSL_RCVD = 'Y'
|
||||
OR q.COL_EQSL_QSL_RCVD = 'Y')
|
||||
AND q.station_id in (".$location_list.")
|
||||
AND (b.bandgroup='hf' or b.band = '6m') ".($from ?? '')." ".($till ?? '')."
|
||||
GROUP BY dx.prefix,dx.name , CASE
|
||||
WHEN q.col_mode = 'CW' THEN 'C'
|
||||
WHEN mo.qrgmode = 'DATA' THEN 'R'
|
||||
WHEN mo.qrgmode = 'SSB' THEN 'F'
|
||||
ELSE mo.qrgmode
|
||||
END,q.COL_BAND order by dx.prefix asc, q.col_band desc";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
function totals_year() {
|
||||
|
||||
$this->load->model('logbooks_model');
|
||||
|
||||
29
application/views/cfd/index.php
Normal file
29
application/views/cfd/index.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="container">
|
||||
<br>
|
||||
<h2>CFD</h2>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<?php echo lang('export_cfd_description'); ?>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<form class="form" action="<?php echo site_url('cfdexport/export'); ?>" method="post" enctype="multipart/form-data">
|
||||
<div class="row">
|
||||
<div class="mb-3 col-md-3">
|
||||
<label for="from"><?php echo lang('gen_from_date') . ": " ?></label>
|
||||
<input name="from" id="from" type="date" class="form-control w-auto">
|
||||
</div>
|
||||
|
||||
<div class="mb-3 col-md-3">
|
||||
<label for="to"><?php echo lang('gen_to_date') . ": " ?></label>
|
||||
<input name="to" id="to" type="date" class="form-control w-auto">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<button type="submit" class="btn btn-primary mb-2" value="Export"><?php echo lang('general_word_export'); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -339,6 +339,8 @@
|
||||
<li><a class="dropdown-item" href="<?php echo site_url('csv'); ?>" title="SOTA CSV Export"><i class="fas fa-sync"></i> <?php echo lang('menu_sota_csv_export'); ?></a></li>
|
||||
|
||||
<li><a class="dropdown-item" href="<?php echo site_url('cabrillo'); ?>" title="Cabrillo Export"><i class="fas fa-sync"></i> <?php echo lang('menu_cabrillo_export'); ?></a></li>
|
||||
|
||||
<li><a class="dropdown-item" href="<?php echo site_url('cfdexport'); ?>" title="CFD Export"><i class="fas fa-sync"></i> CFD Export</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -432,4 +434,4 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user