Merge pull request #2009 from magicbug/dev

Dev 2.4
pull/2056/head 2.4
Peter Goodhall 2023-02-20 15:21:54 +00:00 zatwierdzone przez GitHub
commit 72189614ae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
47 zmienionych plików z 1738 dodań i 268 usunięć

BIN
CloudLog_logo.png 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 31 KiB

Wyświetl plik

@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
$config['app_name'] = "Cloudlog";
$config['app_version'] = "2.1";
$config['app_version'] = "2.3.3";
$config['directory'] = "logbook";
$config['callbook'] = "hamqth"; // Options are hamqth or qrz

Wyświetl plik

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 112;
$config['migration_version'] = 114;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -0,0 +1,491 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Calltester extends CI_Controller {
public function db() {
set_time_limit(3600);
// Starting clock time in seconds
$start_time = microtime(true);
$this->load->model('logbook_model');
$sql = 'select distinct col_country, col_call, col_dxcc, date(col_time_on) date from ' . $this->config->item('table_name');
$query = $this->db->query($sql);
$callarray = $query->result();
$result = array();
$i = 0;
foreach ($callarray as $call) {
$i++;
$dxcc = $this->logbook_model->dxcc_lookup($call->col_call, $call->date);
$dxcc['adif'] = (isset($dxcc['adif'])) ? $dxcc['adif'] : 0;
$dxcc['entity'] = (isset($dxcc['entity'])) ? $dxcc['entity'] : 0;
if ($call->col_dxcc != $dxcc['adif']) {
$result[] = array(
'Callsign' => $call->col_call,
'Expected country' => $call->col_country,
'Expected adif' => $call->col_dxcc,
'Result country' => ucwords(strtolower($dxcc['entity']), "- (/"),
'Result adif' => $dxcc['adif'],
);
}
}
// End clock time in seconds
$end_time = microtime(true);
// Calculate script execution time
$execution_time = ($end_time - $start_time);
echo " Execution time of script = ".$execution_time." sec <br/>";
echo $i . " calls tested. <br/>";
$count = 0;
if ($result) {
$this->array_to_table($result);
}
}
function array_to_table($table) {
echo '<style>
table {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
table td, table th {
border: 1px solid #ddd;
padding: 4px;
}
table tr:nth-child(even){background-color: #f2f2f2;}
table tr:hover {background-color: #ddd;}
table th {
padding-top: 4px;
padding-bottom: 4px;
text-align: left;
background-color: #04AA6D;
color: white;
}
</style> ';
echo '<table>';
// Table header
foreach ($table[0] as $key=>$value) {
echo "<th>".$key."</th>";
}
// Table body
foreach ($table as $value) {
echo "<tr>";
foreach ($value as $val) {
echo "<td>".$val."</td>";
}
echo "</tr>";
}
echo "</table>";
}
function csv() {
set_time_limit(3600);
// Starting clock time in seconds
$start_time = microtime(true);
$this->load->model('logbook_model');
$file = 'uploads/calls.csv';
$handle = fopen($file,"r");
$data = fgetcsv($handle,1000,","); // Skips firsts line, usually that is the header
$data = fgetcsv($handle,1000,",");
$result = array();
$i = 0;
do {
if ($data[0]) {
// COL_CALL,COL_DXCC,COL_TIME_ON
$i++;
$dxcc = $this->logbook_model->dxcc_lookup($data[0], $data[2]);
$dxcc['adif'] = (isset($dxcc['adif'])) ? $dxcc['adif'] : 0;
$dxcc['entity'] = (isset($dxcc['entity'])) ? $dxcc['entity'] : 0;
$data[1] = $data[1] == "NULL" ? 0 : $data[1];
if ($data[1] != $dxcc['adif']) {
$result[] = array(
'Callsign' => $data[0],
'Expected country' => '',
'Expected adif' => $data[1],
'Result country' => ucwords(strtolower($dxcc['entity']), "- (/"),
'Result adif' => $dxcc['adif'],
);
}
}
} while ($data = fgetcsv($handle,1000,","));
// End clock time in seconds
$end_time = microtime(true);
// Calculate script execution time
$execution_time = ($end_time - $start_time);
echo " Execution time of script = ".$execution_time." sec <br/>";
echo $i . " calls tested. <br/>";
$count = 0;
if ($result) {
$this->array_to_table($result);
}
}
/*
* Uses check_dxcc_table - written to check if that function works
*/
function csv2() {
set_time_limit(3600);
// Starting clock time in seconds
$start_time = microtime(true);
$this->load->model('logbook_model');
$file = 'uploads/calls.csv';
$handle = fopen($file,"r");
$data = fgetcsv($handle,1000,","); // Skips firsts line, usually that is the header
$data = fgetcsv($handle,1000,",");
$result = array();
$i = 0;
do {
if ($data[0]) {
// COL_CALL,COL_DXCC,COL_TIME_ON
$i++;
$dxcc = $this->logbook_model->check_dxcc_table($data[0], $data[2]);
$data[1] = $data[1] == "NULL" ? 0 : $data[1];
if ($data[1] != $dxcc[0]) {
$result[] = array(
'Callsign' => $data[0],
'Expected country' => '',
'Expected adif' => $data[1],
'Result country' => ucwords(strtolower($dxcc[1]), "- (/"),
'Result adif' => $dxcc[0],
);
}
}
} while ($data = fgetcsv($handle,1000,","));
// End clock time in seconds
$end_time = microtime(true);
// Calculate script execution time
$execution_time = ($end_time - $start_time);
echo " Execution time of script = ".$execution_time." sec <br/>";
echo $i . " calls tested. <br/>";
$count = 0;
if ($result) {
$this->array_to_table($result);
}
}
function call() {
$testarray = array();
$testarray[] = array(
'Callsign' => 'VE3EY/VP9',
'Country' => 'Bermuda',
'Adif' => 64,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'VP2MDG',
'Country' => 'Montserrat',
'Adif' => 96,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'VP2EY',
'Country' => 'Anguilla',
'Adif' => 12,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'VP2VI',
'Country' => 'British Virgin Islands.',
'Adif' => 65,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'VP2V/AA7V',
'Country' => 'British Virgin Islands',
'Adif' => 65,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'W8LR/R',
'Country' => 'United States Of America',
'Adif' => 291,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'SO1FH',
'Country' => 'Poland',
'Adif' => 269,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'KZ1H/PP',
'Country' => 'Brazil',
'Adif' => 108,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'K1KW/AM',
'Country' => 'None',
'Adif' => 0,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'K1KW/MM',
'Country' => 'None',
'Adif' => 0,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'TF/DL2NWK/P',
'Country' => 'Iceland',
'Adif' => 242,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'OZ1ALS/A',
'Country' => 'Denmark',
'Adif' => 221,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'LA1K',
'Country' => 'Norway',
'Adif' => 266,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'K1KW/M',
'Country' => 'United States Of America',
'Adif' => 291,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'TF/DL2NWK/M',
'Country' => 'Iceland',
'Adif' => 242,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'TF/DL2NWK/MM',
'Country' => 'None',
'Adif' => 0,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'TF/DL2NWK/P',
'Country' => 'Iceland',
'Adif' => 242,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => '2M0SQL/P',
'Country' => 'Scotland',
'Adif' => 279,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'FT8WW',
'Country' => 'Crozet Island',
'Adif' => 41,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'RV0AL/0/P',
'Country' => 'Asiatic Russia',
'Adif' => 15,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'OH/DJ1YFK',
'Country' => 'Finland',
'Adif' => 224,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'N6TR/7',
'Country' => 'United States Of America',
'Adif' => 291,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'KH0CW',
'Country' => 'United States Of America',
'Adif' => 291,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'R2FM/P',
'Country' => 'kaliningrad',
'Adif' => 126,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'R2FM',
'Country' => 'kaliningrad',
'Adif' => 126,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'FT5XO',
'Country' => 'Kerguelen Island',
'Adif' => 131,
'Date' => 20050320
);
$testarray[] = array(
'Callsign' => 'VP8CTR',
'Country' => 'Antarctica',
'Adif' => 13,
'Date' => 19970207
);
$testarray[] = array(
'Callsign' => 'FO0AAA',
'Country' => 'Clipperton',
'Adif' => 36,
'Date' => '20000302'
);
$testarray[] = array(
'Callsign' => 'CX/PR8KW',
'Country' => 'Uruguay',
'Adif' => 144,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'IQ3MV/LH',
'Country' => 'Italy',
'Adif' => 248,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'LA1K/QRP',
'Country' => 'Norway',
'Adif' => 266,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'LA1K/LGT',
'Country' => 'Norway',
'Adif' => 266,
'Date' => $date = date('Ymd', time())
);
$testarray[] = array(
'Callsign' => 'SM1K/LH',
'Country' => 'Sweden',
'Adif' => 284,
'Date' => $date = date('Ymd', time())
);
set_time_limit(3600);
// Starting clock time in seconds
$start_time = microtime(true);
$this->load->model('logbook_model');
$result = array();
$i = 0;
foreach ($testarray as $call) {
$i++;
$dxcc = $this->logbook_model->dxcc_lookup($call['Callsign'], $call['Date']);
$dxcc['adif'] = (isset($dxcc['adif'])) ? $dxcc['adif'] : 0;
$dxcc['entity'] = (isset($dxcc['entity'])) ? $dxcc['entity'] : 0;
if ($call['Adif'] != $dxcc['adif']) {
$result[] = array(
'Callsign' => $call['Callsign'],
'Expected country' => $call['Country'],
'Expected adif' => $call['Adif'],
'Result country' => ucwords(strtolower($dxcc['entity']), "- (/"),
'Result adif' => $dxcc['adif'],
);
}
}
// End clock time in seconds
$end_time = microtime(true);
// Calculate script execution time
$execution_time = ($end_time - $start_time);
echo " Execution time of script = ".$execution_time." sec <br/>";
echo $i . " calls tested. <br/>";
$count = 0;
if ($result) {
$this->array_to_table($result);
}
}
}

Wyświetl plik

@ -0,0 +1,59 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Continents extends CI_Controller {
public function index()
{
$this->load->model('user_model');
$this->load->model('bands');
$this->load->model('logbookadvanced_model');
$data['bands'] = $this->bands->get_worked_bands();
$data['modes'] = $this->logbookadvanced_model->get_modes();
if(!$this->user_model->authorize($this->config->item('auth_mode'))) {
if($this->user_model->validate_session()) {
$this->user_model->clear_session();
show_error('Access denied<p>Click <a href="'.site_url('user/login').'">here</a> to log in as another user', 403);
} else {
redirect('user/login');
}
}
// Render User Interface
// Set Page Title
$data['page_title'] = "Continents";
// Load Views
$this->load->view('interface_assets/header', $data);
$this->load->view('continents/index');
$this->load->view('interface_assets/footer');
}
public function get_continents() {
$searchCriteria = array(
'mode' => xss_clean($this->input->post('mode')),
'band' => xss_clean($this->input->post('band')),
);
$this->load->model('logbook_model');
$continentsstats = array();
$total_continents = $this->logbook_model->total_continents($searchCriteria);
$i = 0;
if ($total_continents) {
foreach($total_continents->result() as $qso_numbers) {
$continentsstats[$i]['cont'] = $qso_numbers->COL_CONT;
$continentsstats[$i++]['count'] = $qso_numbers->count;
}
}
header('Content-Type: application/json');
echo json_encode($continentsstats);
}
}

Wyświetl plik

@ -36,7 +36,7 @@ class Lookup extends CI_Controller {
$this->load->model('lookup_model');
$this->load->model('bands');
$data['bands'] = $this->bands->get_worked_bands();
$data['bands'] = $this->bands->get_worked_bands(xss_clean($this->input->post('type')));
$data['type'] = xss_clean($this->input->post('type'));
$data['dxcc'] = xss_clean($this->input->post('dxcc'));

Wyświetl plik

@ -873,15 +873,15 @@ class Lotw extends CI_Controller {
$contents = file_get_contents('https://lotw.arrl.org/lotw-user-activity.csv', true);
if($contents === FALSE) {
echo "something went wrong";
echo "Something went wrong with fetching the LoTW users file.";
} else {
$file = './updates/lotw_users.csv';
if(!is_file($file)){ // Some simple example content.
file_put_contents($file, $contents); // Save our content to the file.
if (file_put_contents($file, $contents) !== FALSE) { // Save our content to the file.
echo "LoTW User Data Saved.";
} else {
echo "FAILED: Could not write to LoTW users file";
}
echo "LoTW User Data Saved.";
}
}

Wyświetl plik

@ -104,6 +104,7 @@ class Statistics extends CI_Controller {
$modestats[$i++]['total'] = $this->logbook_model->total_fm();
$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');

Wyświetl plik

@ -32,8 +32,8 @@ class Timeline extends CI_Controller {
$mode = 'All';
}
if ($this->input->post('awardradio') != NULL) {
$award = $this->input->post('awardradio');
if ($this->input->post('award') != NULL) {
$award = $this->input->post('award');
}
else {
$award = 'dxcc';
@ -76,14 +76,14 @@ class Timeline extends CI_Controller {
}
public function details() {
$this->load->model('logbook_model');
$this->load->model('timeline_model');
$querystring = str_replace('"', "", $this->input->post("Querystring"));
$band = str_replace('"', "", $this->input->post("Band"));
$mode = str_replace('"', "", $this->input->post("Mode"));
$type = str_replace('"', "", $this->input->post("Type"));
$data['results'] = $this->logbook_model->timeline_qso_details($querystring, $band, $mode, $type);
$data['results'] = $this->timeline_model->timeline_qso_details($querystring, $band, $mode, $type);
switch($type) {
@ -100,6 +100,9 @@ class Timeline extends CI_Controller {
case 'waz' : $data['page_title'] = "Log View - WAZ";
$data['filter'] = "CQ zone ". $querystring;
break;
case 'vucc' : $data['page_title'] = "Log View - VUCC";
$data['filter'] = "Gridsquare ". $querystring;
break;
}
if ($band != "All") {

Wyświetl plik

@ -165,7 +165,7 @@ class Update extends CI_Controller {
public function dxcc() {
$this->update_status("Downloading file");
// give it 5 minutes...
// give it 10 minutes...
set_time_limit(600);
// Load Migration data if any.
@ -177,13 +177,21 @@ class Update extends CI_Controller {
$url = "https://cdn.clublog.org/cty.php?api=a11c3235cd74b88212ce726857056939d52372bd";
$gz = gzopen($url, 'r');
if ($gz === FALSE) {
$this->update_status("Something went wrong with fetching the cty.xml file.");
return;
}
$data = "";
while (!gzeof($gz)) {
$data .= gzgetc($gz);
}
gzclose($gz);
file_put_contents($this->make_update_path("cty.xml"), $data);
if (file_put_contents($this->make_update_path("cty.xml"), $data) === FALSE) {
$this->update_status("FAILED: Could not write to LoTW users file");
return;
}
// Clear the tables, ready for new data
$this->db->empty_table("dxcc_entities");
@ -238,6 +246,11 @@ class Update extends CI_Controller {
}
public function check_missing_continent() {
$this->load->model('logbook_model');
$this->logbook_model->check_missing_continent();
}
public function check_missing_grid($all = false){
$this->load->model('logbook_model');
$this->logbook_model->check_missing_grid_id($all);
@ -247,7 +260,7 @@ class Update extends CI_Controller {
$strFile = $this->make_update_path("clublog_scp.txt");
$url = "https://cdn.clublog.org/clublog.scp.gz";
set_time_limit(300);
$this->update_status("Downloading Club Log SCP file");
echo "Downloading Club Log SCP file...<br>";
$gz = gzopen($url, 'r');
if ($gz)
{
@ -256,21 +269,20 @@ class Update extends CI_Controller {
$data .= gzgetc($gz);
}
gzclose($gz);
file_put_contents($strFile, $data);
if (file_exists($strFile))
if (file_put_contents($strFile, $data) !== FALSE)
{
$nCount = count(file($strFile));
if ($nCount > 0)
{
$this->update_status("DONE: " . number_format($nCount) . " callsigns loaded" );
echo "DONE: " . number_format($nCount) . " callsigns loaded";
} else {
$this->update_status("FAILED: Empty file");
echo "FAILED: Empty file";
}
} else {
$this->update_status("FAILED: Could not create Club Log SCP file locally");
echo "FAILED: Could not write to Club Log SCP file";
}
} else {
$this->update_status("FAILED: Could not connect to Club Log");
echo "FAILED: Could not connect to Club Log";
}
}
@ -281,15 +293,15 @@ class Update extends CI_Controller {
$contents = file_get_contents('https://lotw.arrl.org/lotw-user-activity.csv', true);
if($contents === FALSE) {
echo "something went wrong";
echo "Something went wrong with fetching the LoTW users file.";
} else {
$file = './updates/lotw_users.csv';
if(!is_file($file)){ // Some simple example content.
file_put_contents($file, $contents); // Save our content to the file.
if (file_put_contents($file, $contents) !== FALSE) { // Save our content to the file.
echo "LoTW User Data Saved.";
} else {
echo "FAILED: Could not write to LoTW users file";
}
echo "LoTW User Data Saved.";
}
}
@ -318,10 +330,7 @@ class Update extends CI_Controller {
} else {
$file = './assets/json/dok.txt';
file_put_contents($file, $contents); // Save our content to the file.
if (file_exists($file))
{
if (file_put_contents($file, $contents) !== FALSE) { // Save our content to the file.
$nCount = count(file($file));
if ($nCount > 0)
{
@ -330,7 +339,7 @@ class Update extends CI_Controller {
echo"FAILED: Empty file";
}
} else {
echo"FAILED: Could not create dok.txt file locally";
echo"FAILED: Could not write to dok.txt file";
}
}
}
@ -343,36 +352,38 @@ class Update extends CI_Controller {
$sotafile = './assets/json/sota.txt';
if($csvfile === FALSE) {
$csvhandle = fopen($csvfile,"r");
if ($csvhandle === FALSE) {
echo "Something went wrong with fetching the SOTA file";
} else {
$csvhandle = fopen($csvfile,"r");
return;
}
$data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
$data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
$data = fgetcsv($csvhandle,1000,",");
$sotafilehandle = fopen($sotafile, 'w');
$data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
$data = fgetcsv($csvhandle,1000,","); // Skip line we are not interested in
$data = fgetcsv($csvhandle,1000,",");
$sotafilehandle = fopen($sotafile, 'w');
do {
if ($data[0]) {
fwrite($sotafilehandle, $data[0].PHP_EOL);
}
} while ($data = fgetcsv($csvhandle,1000,","));
if ($sotafilehandle === FALSE) {
echo"FAILED: Could not write to sota.txt file";
return;
}
fclose($csvhandle);
fclose($sotafilehandle);
if (file_exists($sotafile))
{
$nCount = count(file($sotafile));
if ($nCount > 0)
{
echo "DONE: " . number_format($nCount) . " SOTA's saved";
} else {
echo"FAILED: Empty file";
}
} else {
echo"FAILED: Could not create sota.txt file locally";
$$nCount = 0;
do {
if ($data[0]) {
fwrite($sotafilehandle, $data[0].PHP_EOL);
$nCount++;
}
} while ($data = fgetcsv($csvhandle,1000,","));
fclose($csvhandle);
fclose($sotafilehandle);
if ($nCount > 0)
{
echo "DONE: " . number_format($nCount) . " SOTA's saved";
} else {
echo"FAILED: Empty file";
}
}
@ -391,29 +402,35 @@ class Update extends CI_Controller {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$csv = curl_exec($ch);
curl_close($ch);
if ($csv === FALSE) {
echo "Something went wrong with fetching the WWFF file";
return;
}
$wwfffilehandle = fopen($wwfffile, 'w');
if ($wwfffilehandle === FALSE) {
echo"FAILED: Could not write to wwff.txt file";
return;
}
$data = str_getcsv($csv,"\n");
$nCount = 0;
foreach ($data as $idx => $row) {
if ($idx == 0) continue; // Skip line we are not interested in
$row = str_getcsv($row, ',');
if ($row[0]) {
fwrite($wwfffilehandle, $row[0].PHP_EOL);
$nCount++;
}
}
fclose($wwfffilehandle);
if (file_exists($wwfffile))
if ($nCount > 0)
{
$nCount = count(file($wwfffile));
if ($nCount > 0)
{
echo "DONE: " . number_format($nCount) . " WWFF's saved";
} else {
echo"FAILED: Empty file";
}
echo "DONE: " . number_format($nCount) . " WWFF's saved";
} else {
echo"FAILED: Could not create wwff.txt file locally";
echo"FAILED: Empty file";
}
}
@ -429,29 +446,34 @@ class Update extends CI_Controller {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$csv = curl_exec($ch);
curl_close($ch);
if ($csv === FALSE) {
echo "Something went wrong with fetching the POTA file";
return;
}
$potafilehandle = fopen($potafile, 'w');
if ($potafilehandle === FALSE) {
echo"FAILED: Could not write to pota.txt file";
return;
}
$data = str_getcsv($csv,"\n");
$nCount = 0;
foreach ($data as $idx => $row) {
if ($idx == 0) continue; // Skip line we are not interested in
$row = str_getcsv($row, ',');
if ($row[0]) {
fwrite($potafilehandle, $row[0].PHP_EOL);
$nCount++;
}
}
fclose($potafilehandle);
if (file_exists($potafile))
if ($nCount > 0)
{
$nCount = count(file($potafile));
if ($nCount > 0)
{
echo "DONE: " . number_format($nCount) . " POTA's saved";
} else {
echo"FAILED: Empty file";
}
echo "DONE: " . number_format($nCount) . " POTA's saved";
} else {
echo"FAILED: Could not create pota.txt file locally";
echo"FAILED: Empty file";
}
}

Wyświetl plik

@ -81,6 +81,7 @@ class User extends CI_Controller {
$data['user_column5'] = $this->input->post('user_column5');
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
$this->load->view('user/add', $data);
} else {
$this->load->view('user/add', $data);
@ -111,7 +112,8 @@ class User extends CI_Controller {
$this->input->post('user_column4'),
$this->input->post('user_column5'),
$this->input->post('user_show_profile_image'),
$this->input->post('user_previous_qsl_type'))) {
$this->input->post('user_previous_qsl_type'),
$this->input->post('user_amsat_status_upload'))) {
// Check for errors
case EUSERNAMEEXISTS:
$data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!';
@ -152,6 +154,7 @@ class User extends CI_Controller {
$data['user_column5'] = $this->input->post('user_column5');
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
$this->load->view('user/add', $data);
$this->load->view('interface_assets/footer');
}
@ -347,6 +350,12 @@ class User extends CI_Controller {
$data['user_previous_qsl_type'] = $q->user_previous_qsl_type;
}
if($this->input->post('user_amsat_status_upload')) {
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload', false);
} else {
$data['user_amsat_status_upload'] = $q->user_amsat_status_upload;
}
if($this->input->post('user_column1')) {
$data['user_column1'] = $this->input->post('user_column1', true);
} else {
@ -430,6 +439,7 @@ class User extends CI_Controller {
$data['user_column5'] = $this->input->post('user_column5');
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
$data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
$this->load->view('user/edit');
$this->load->view('interface_assets/footer');
}

Wyświetl plik

@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbook';
$lang['gen_hamradio_cq_zone'] = 'CQ Zone';
$lang['gen_hamradio_dxcc'] = 'DXCC';
$lang['gen_hamradio_continent'] = 'Continent';
$lang['gen_hamradio_usa_state'] = 'USA State';
$lang['gen_hamradio_county_reference'] = 'USA County';
$lang['gen_hamradio_iota_reference'] = 'IOTA Reference';
@ -125,3 +126,11 @@ $lang['gen_this_qso_was_confirmed_on'] = 'This QSO was confirmed on';
$lang['error_no_logbook_found'] = 'No logbooks were found. You need to define a logbook under Station Logbooks! Do it here:';
$lang['copy_to_clipboard'] = 'Copy to clipboard';
$lang['africa'] = 'Africa';
$lang['antarctica'] = 'Antarctica';
$lang['asia'] = 'Asia';
$lang['europe'] = 'Europe';
$lang['northamerica'] = 'North America';
$lang['oceania'] = 'Oceania';
$lang['southamerica'] = 'South America';

Wyświetl plik

@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbuch';
$lang['gen_hamradio_cq_zone'] = 'CQ Zone';
$lang['gen_hamradio_dxcc'] = 'DXCC';
$lang['gen_hamradio_continent'] = 'Kontinent';
$lang['gen_hamradio_usa_state'] = 'USA-Staat';
$lang['gen_hamradio_county_reference'] = 'USA County';
$lang['gen_hamradio_iota_reference'] = 'IOTA Referenznummer';
@ -124,3 +125,11 @@ $lang['gen_from_date'] = 'Ab Datum';
$lang['gen_this_qso_was_confirmed_on'] = 'Dieses QSO wurde bestätigt am';
$lang['copy_to_clipboard'] = 'In die Zwischenablage kopieren';
$lang['africa'] = 'Afrika';
$lang['antarctica'] = 'Antarktis';
$lang['asia'] = 'Asien';
$lang['europe'] = 'Europa';
$lang['northamerica'] = 'Nord-Amerika';
$lang['oceania'] = 'Ozeanien';
$lang['southamerica'] = 'Süd-Amerika';

Wyświetl plik

@ -16,7 +16,7 @@ $lang['general_word_datetime'] = 'Дата/Время';
$lang['general_word_none'] = '-';
$lang['general_word_name'] = 'Имя';
$lang['general_word_location'] = 'QTH';
$lang['general_word_comment'] = 'Коммент.';
$lang['general_word_comment'] = 'Комментарий';
$lang['general_word_general'] = 'Общее';
$lang['general_word_satellite'] = 'Спутник';
$lang['general_word_satellite_short'] = 'Спутн.';
@ -97,15 +97,18 @@ $lang['gen_hamradio_logbook'] = 'Журнал';
$lang['gen_hamradio_cq_zone'] = 'CQ Zone';
$lang['gen_hamradio_dxcc'] = 'DXCC';
$lang['gen_hamradio_continent'] = 'Континент';
$lang['gen_hamradio_usa_state'] = 'Штат США';
$lang['gen_hamradio_county_reference'] = 'Графство США';
$lang['gen_hamradio_iota_reference'] = 'IOTA справочник';
$lang['gen_hamradio_sota_reference'] = 'SOTA Справочник';
$lang['gen_hamradio_wwff_reference'] = 'WWFF справочник';
$lang['gen_hamradio_pota_reference'] = 'POTA справочник';
$lang['gen_hamradio_dok'] = 'DOK';
$lang['gen_hamradio_state'] = 'Штат';
$lang['gen_hamradio_iota'] = 'IOTA';
$lang['gen_hamradio_sota'] = 'SOTA';
$lang['gen_hamradio_pota'] = 'POTA';
$lang['gen_hamradio_gridsquare'] = 'Квадрат';
$lang['gen_hamradio_operator'] = 'Оператор';
@ -125,3 +128,11 @@ $lang['gen_this_qso_was_confirmed_on'] = 'Это QSO было подтвержд
$lang['error_no_logbook_found'] = 'Журнал не найден. Вам необходимо опрелелить журнал в разделе Журналы станций! Тут:';
$lang['copy_to_clipboard'] = 'Скопировать в буфер обмена';
$lang['africa'] = 'Африка';
$lang['antarctica'] = 'Антарктика';
$lang['asia'] = 'Азия';
$lang['europe'] = 'Европа';
$lang['northamerica'] = 'Северная Америка';
$lang['oceania'] = 'Океания';
$lang['southamerica'] = 'Южная Америка';

Wyświetl plik

@ -4,15 +4,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$lang['lotw_short'] = 'LoTW';
$lang['lotw_title'] = 'Logbook of the World';
$lang['lotw_title_available_cert'] = 'Available Certificates';
$lang['lotw_title_information'] = 'Information';
$lang['lotw_title_upload_p12_cert'] = 'Upload Logbook of the World .p12 Certificate';
$lang['lotw_title_export_p12_file_instruction'] = 'Export .p12 File Instructions';
$lang['lotw_title_adif_import'] = 'ADIF Import';
$lang['lotw_title_adif_import_options'] = 'Import Options';
$lang['lotw_title_available_cert'] = 'Имеющиеся сертификаты';
$lang['lotw_title_information'] = 'Информация';
$lang['lotw_title_upload_p12_cert'] = 'Загрузка Logbook of the World .p12 сертификата';
$lang['lotw_title_export_p12_file_instruction'] = 'Инструкции по экспорту .p12 файла';
$lang['lotw_title_adif_import'] = 'Импорт ADIF';
$lang['lotw_title_adif_import_options'] = 'Опции импорта';
$lang['lotw_beta_warning'] = 'Please be aware that LoTW Sync is BETA, see wiki for help.';
$lang['lotw_no_certs_uploaded'] = 'Вам необходимо загрузить сертификат LoTW в формате p12 для использования этих функций.';
$lang['lotw_beta_warning'] = 'Обратите внимание, что синхронизация с LoTW пока в статусе бета, подробнее в wiki.';
$lang['lotw_no_certs_uploaded'] = 'Вам необходимо загрузить сертификат LoTW в формате p12 для использования этих функций.';
$lang['lotw_date_created'] = 'Дата создания';
$lang['lotw_date_expires'] = 'Дата окончания срока действия';
@ -22,6 +22,7 @@ $lang['lotw_status'] = 'Статус';
$lang['lotw_options'] = 'Опции';
$lang['lotw_valid'] = 'Действует';
$lang['lotw_expired'] = 'Истёк';
$lang['lotw_expiring'] = 'Истекает';
$lang['lotw_not_synced'] = 'Не синхронизирован';
$lang['lotw_certificate_dxcc'] = 'Сертификат DXCC';
@ -51,3 +52,7 @@ $lang['lotw_p12_export_step_three'] = 'Кликните "Сохранить Се
$lang['lotw_p12_export_step_four'] = 'Загрузите полученный файл ниже.';
$lang['lotw_confirmed'] = 'Это QSO подтверждено на LoTW';
// LotW Expiry
$lang['lotw_cert_expiring'] = 'Как минимум, один из ваших сертификатов LoTW скоро истечёт!';
$lang['lotw_cert_expired'] = 'Один из ваших сертификатов LoTW истёк!';

Wyświetl plik

@ -14,12 +14,12 @@ class Migration_add_wwff_columns extends CI_Migration {
public function up()
{
if (!$this->db->field_exists('COL_WWFF_REF', 'TABLE_HRD_CONTACTS_V01')) {
if (!$this->db->field_exists('COL_WWFF_REF', $this->config->item('table_name'))) {
$fields = array(
'COL_WWFF_REF VARCHAR(30) DEFAULT NULL',
'COL_MY_WWFF_REF VARCHAR(50) DEFAULT NULL',
);
$this->dbforge->add_column('TABLE_HRD_CONTACTS_V01', $fields, 'COL_VUCC_GRIDS');
$this->dbforge->add_column($this->config->item('table_name'), $fields, 'COL_VUCC_GRIDS');
// Now copy over data from SIG_INFO fields and remove COL_SIG and COL_SIG_INFO only if COL_SIG is WWFF
// This cannot be reverted on downgrade to prevent overwriting of other COL_SIG information
@ -27,7 +27,7 @@ class Migration_add_wwff_columns extends CI_Migration {
$this->db->set('COL_SIG_INFO', '');
$this->db->set('COL_SIG', '');
$this->db->where('COL_SIG', 'WWFF');
$this->db->update('TABLE_HRD_CONTACTS_V01');
$this->db->update($this->config->item('table_name'));
// Add MY_WWFF_REF to station profile
$fields = array(
@ -39,8 +39,8 @@ class Migration_add_wwff_columns extends CI_Migration {
public function down()
{
$this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_WWFF_REF');
$this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_MY_WWFF_REF');
$this->dbforge->drop_column($this->config->item('table_name'), 'COL_WWFF_REF');
$this->dbforge->drop_column($this->config->item('table_name'), 'COL_MY_WWFF_REF');
$this->dbforge->drop_column('station_profile', 'station_wwff');
}
}

Wyświetl plik

@ -14,12 +14,12 @@ class Migration_add_pota_columns extends CI_Migration {
public function up()
{
if (!$this->db->field_exists('COL_POTA_REF', 'TABLE_HRD_CONTACTS_V01')) {
if (!$this->db->field_exists('COL_POTA_REF', $this->config->item('table_name'))) {
$fields = array(
'COL_POTA_REF VARCHAR(30) DEFAULT NULL',
'COL_MY_POTA_REF VARCHAR(50) DEFAULT NULL',
);
$this->dbforge->add_column('TABLE_HRD_CONTACTS_V01', $fields, 'COL_VUCC_GRIDS');
$this->dbforge->add_column($this->config->item('table_name'), $fields, 'COL_VUCC_GRIDS');
// Now copy over data from SIG_INFO fields and remove COL_SIG and COL_SIG_INFO only if COL_SIG is POTA
// This cannot be reverted on downgrade to prevent overwriting of other COL_SIG information
@ -27,7 +27,7 @@ class Migration_add_pota_columns extends CI_Migration {
$this->db->set('COL_SIG_INFO', '');
$this->db->set('COL_SIG', '');
$this->db->where('COL_SIG', 'POTA');
$this->db->update('TABLE_HRD_CONTACTS_V01');
$this->db->update($this->config->item('table_name'));
}
if (!$this->db->field_exists('station_pota', 'station_profile')) {
@ -52,11 +52,11 @@ class Migration_add_pota_columns extends CI_Migration {
public function down()
{
if ($this->db->field_exists('COL_POTA_REF', 'TABLE_HRD_CONTACTS_V01')) {
$this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_POTA_REF');
if ($this->db->field_exists('COL_POTA_REF', $this->config->item('table_name'))) {
$this->dbforge->drop_column($this->config->item('table_name'), 'COL_POTA_REF');
}
if ($this->db->field_exists('COL_MY_POTA_REF', 'TABLE_HRD_CONTACTS_V01')) {
$this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_MY_POTA_REF');
if ($this->db->field_exists('COL_MY_POTA_REF', $this->config->item('table_name'))) {
$this->dbforge->drop_column($this->config->item('table_name'), 'COL_MY_POTA_REF');
}
if ($this->db->field_exists('station_pota', 'station_profile')) {
$this->dbforge->drop_column('station_profile', 'station_pota');

Wyświetl plik

@ -0,0 +1,28 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Class Migration_amsat_status_upload_option
*
* Creates a boolean column with option to allow for activating uploading
* a status info to https://amsat.org/status
*/
class Migration_amsat_status_upload_option extends CI_Migration {
public function up()
{
if (!$this->db->field_exists('user_amsat_status_upload', 'users')) {
$fields = array(
'user_amsat_status_upload BOOLEAN DEFAULT FALSE',
);
$this->dbforge->add_column('users', $fields, 'user_column5');
}
}
public function down()
{
$this->dbforge->drop_column('users', 'user_amsat_status_upload');
}
}

Wyświetl plik

@ -0,0 +1,15 @@
<?php
// Create migration that makes the submode column in the logbook table an index
class Migration_Create_index_for_colsubmode extends CI_Migration {
public function up() {
$this->db->query("ALTER TABLE `".$this->config->item('table_name')."` ADD INDEX (`COL_SUBMODE`)");
}
public function down() {
$this->db->query("ALTER TABLE `".$this->config->item('table_name')."` DROP INDEX (`COL_SUBMODE`)");
}
}
?>

Wyświetl plik

@ -105,7 +105,7 @@ class Activators_model extends CI_Model
// Get max no of activated grids of single operator
$data = $this->db->query(
"select COUNT(DISTINCT(SUBSTR(COL_GRIDSQUARE,1,4))) AS `count` from TABLE_HRD_CONTACTS_V01 WHERE station_id in (" . $location_list . ") AND `COL_GRIDSQUARE` != '' GROUP BY `COL_CALL` ORDER BY `count` DESC LIMIT 1"
"select COUNT(DISTINCT(SUBSTR(COL_GRIDSQUARE,1,4))) AS `count` from " . $this->config->item('table_name') . " WHERE station_id in (" . $location_list . ") AND `COL_GRIDSQUARE` != '' GROUP BY `COL_CALL` ORDER BY `count` DESC LIMIT 1"
);
foreach($data->result() as $row){
$max = $row->count;

Wyświetl plik

@ -78,6 +78,19 @@ class Logbook_model extends CI_Model {
$dxcc_id = $this->input->post('dxcc_id');
}
if($this->input->post('continent') == "") {
$dxcc = $this->check_dxcc_table(strtoupper(trim($this->input->post('callsign'))), $datetime);
if (empty($dxcc[3])) {
$continent = null;
} else {
$continent = $dxcc[3];
}
} else {
$continent = $this->input->post('continent');
}
$mode = $this->get_main_mode_if_submode($this->input->post('mode'));
if ($mode == null) {
$mode = $this->input->post('mode');
@ -139,6 +152,7 @@ class Logbook_model extends CI_Model {
'COL_SAT_NAME' => strtoupper($this->input->post('sat_name')),
'COL_SAT_MODE' => strtoupper($this->input->post('sat_mode')),
'COL_COUNTRY' => $country,
'COL_CONT' => $continent,
'COL_QSLSDATE' => $qslsdate,
'COL_QSLRDATE' => $qslrdate,
'COL_QSL_SENT' => $qsl_sent,
@ -161,8 +175,8 @@ class Logbook_model extends CI_Model {
'COL_TX_PWR' => $tx_power,
'COL_STX' => $stx,
'COL_SRX' => $srx,
'COL_STX_STRING' => $stx_string,
'COL_SRX_STRING' => $srx_string,
'COL_STX_STRING' => $stx_string == null ? '' : strtoupper(trim($stx_string)),
'COL_SRX_STRING' => $srx_string == null ? '' : strtoupper(trim($srx_string)),
'COL_CONTEST_ID' => $contestid,
'COL_NR_BURSTS' => null,
'COL_NR_PINGS' => null,
@ -385,38 +399,6 @@ class Logbook_model extends CI_Model {
return $this->db->query($sql);
}
public function timeline_qso_details($querystring, $band, $mode, $type){
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
if ($band != 'All') {
if ($band == 'SAT') {
$this->db->where('col_prop_mode', $band);
} else {
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where('col_band', $band);
}
}
if ($mode != 'All') {
$this->db->where('col_mode', $mode);
}
$this->db->where_in('station_profile.station_id', $logbooks_locations_array);
switch($type) {
case 'dxcc': $this->db->where('COL_DXCC', $querystring); break;
case 'was': $this->db->where('COL_STATE', $querystring); break;
case 'iota': $this->db->where('COL_IOTA', $querystring); break;
case 'waz': $this->db->where('COL_CQZ', $querystring); break;
}
return $this->db->get($this->config->item('table_name'));
}
public function activator_details($call, $band, $leogeo){
$CI =& get_instance();
$CI->load->model('logbooks_model');
@ -478,6 +460,10 @@ class Logbook_model extends CI_Model {
$last_id = $this->db->insert_id();
if ($this->session->userdata('user_amsat_status_upload') && $data['COL_PROP_MODE'] == "SAT") {
$this->upload_amsat_status($data);
}
// No point in fetching qrz api key and qrzrealtime setting if we're skipping the export
if (!$skipexport) {
@ -576,6 +562,64 @@ class Logbook_model extends CI_Model {
return true;
}
function upload_amsat_status($data) {
$sat_name = '';
if ($data['COL_SAT_NAME'] == 'AO-7') {
if ($data['COL_BAND'] == '2m' && $data['COL_BAND_RX'] == '10m') {
$sat_name = '[A]_AO-7';
}
if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
$sat_name = '[B]_AO-7';
}
} else if ($data['COL_SAT_NAME'] == 'QO-100') {
$sat_name = 'QO-100_NB';
} else if ($data['COL_SAT_NAME'] == 'AO-92') {
if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
$sat_name = 'AO-92_U/v';
}
if ($data['COL_BAND'] == '23cm' && $data['COL_BAND_RX'] == '2m') {
$sat_name = 'AO-92_L/v';
}
} else if ($data['COL_SAT_NAME'] == 'AO-95') {
if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
$sat_name = 'AO-95_U/v';
}
if ($data['COL_BAND'] == '23cm' && $data['COL_BAND_RX'] == '2m') {
$sat_name = 'AO-95_L/v';
}
} else if ($data['COL_SAT_NAME'] == 'PO-101') {
if ($data['COL_MODE'] == 'PKT') {
$sat_name = 'PO-101[APRS]';
} else {
$sat_name = 'PO-101[FM]';
}
} else if ($data['COL_SAT_NAME'] == 'FO-118') {
if ($data['COL_BAND'] == '2m') {
if ($data['COL_MODE'] == 'FM') {
$sat_name = 'FO-118[V/u FM]';
} else if ($data['COL_MODE'] == 'SSB') {
$sat_name = 'FO-118[V/u]';
}
} else if ($data['COL_BAND'] == '15m') {
$sat_name = 'FO-118[H/u]';
}
} else if ($data['COL_SAT_NAME'] == 'ARISS' || $data['COL_SAT_NAME'] == 'ISS') {
if ($data['COL_MODE'] == 'FM') {
$sat_name = 'ISS-FM';
} else if ($data['COL_MODE'] == 'PKT') {
$sat_name = 'ISS-DATA';
}
} else {
$sat_name = $data['COL_SAT_NAME'];
}
$datearray = date_parse_from_format("Y-m-d H:i:s", $data['COL_TIME_ON']);
$url='https://amsat.org/status/submit.php?SatSubmit=yes&Confirm=yes&SatName='.$sat_name.'&SatYear='.$datearray['year'].'&SatMonth='.str_pad($datearray['month'], 2, '0', STR_PAD_LEFT).'&SatDay='.str_pad($datearray['day'], 2, '0', STR_PAD_LEFT).'&SatHour='.str_pad($datearray['hour'], 2, '0', STR_PAD_LEFT).'&SatPeriod='.(intdiv(($datearray['minute']-1), 15)).'&SatCall='.$data['COL_STATION_CALLSIGN'].'&SatReport=Heard&SatGridSquare='.$data['COL_MY_GRIDSQUARE'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
}
/* Edit QSO */
function edit() {
$qso = $this->get_qso($this->input->post('id'))->row();
@ -723,6 +767,7 @@ class Logbook_model extends CI_Model {
'COL_COMMENT' => $this->input->post('comment'),
'COL_NAME' => $this->input->post('name'),
'COL_COUNTRY' => $country,
'COL_CONT' => $this->input->post('continent'),
'COL_DXCC'=> $this->input->post('dxcc_id'),
'COL_CQZ' => $this->input->post('cqz'),
'COL_SAT_NAME' => $this->input->post('sat_name'),
@ -754,8 +799,8 @@ class Logbook_model extends CI_Model {
'COL_QTH' => $this->input->post('qth'),
'COL_PROP_MODE' => $this->input->post('prop_mode'),
'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')),
'COL_STX_STRING' => $this->input->post('stx_string'),
'COL_SRX_STRING' => $this->input->post('srx_string'),
'COL_STX_STRING' => strtoupper(trim($this->input->post('stx_string'))),
'COL_SRX_STRING' => strtoupper(trim($this->input->post('srx_string'))),
'COL_STX' => $stx_string,
'COL_SRX' => $srx_string,
'COL_CONTEST_ID' => $this->input->post('contest_name'),
@ -1547,12 +1592,52 @@ class Logbook_model extends CI_Model {
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->where('COL_SAT_NAME is not null');
$this->db->where('COL_SAT_NAME !=', '');
$this->db->order_by('count DESC');
$this->db->group_by('COL_SAT_NAME');
$query = $this->db->get($this->config->item('table_name'));
return $query;
}
/* Return total number of QSOs per continent */
function total_continents($searchCriteria) {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if (!$logbooks_locations_array) {
return null;
}
$this->db->select('COL_CONT, COUNT( * ) as count', FALSE);
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->where('COL_CONT is not null');
$this->db->where('COL_CONT !=', '');
if ($searchCriteria['mode'] !== '') {
$this->db->group_start();
$this->db->where('COL_MODE', $searchCriteria['mode']);
$this->db->or_where('COL_SUBMODE', $searchCriteria['mode']);
$this->db->group_end();
}
if ($searchCriteria['band'] !== '') {
if($searchCriteria['band'] != "SAT") {
$this->db->where('COL_BAND', $searchCriteria['band']);
$this->db->where('COL_PROP_MODE != "SAT"');
} else {
$this->db->where('COL_PROP_MODE', 'SAT');
}
}
$this->db->order_by('count DESC');
$this->db->group_by('COL_CONT');
$query = $this->db->get($this->config->item('table_name'));
return $query;
}
/* Return total number of CW QSOs */
function total_cw() {
@ -2845,7 +2930,9 @@ class Logbook_model extends CI_Model {
*/
public function check_dxcc_table($call, $date){
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
$csadditions = '/^P$|^R$|^A$|^M$/';
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`, `cont`')
->where('call', $call)
->where('(start <= ', $date)
->or_where('start is null)', NULL, false)
@ -2855,12 +2942,14 @@ class Logbook_model extends CI_Model {
if ($dxcc_exceptions->num_rows() > 0){
$row = $dxcc_exceptions->row_array();
return array($row['adif'], $row['entity'], $row['cqz']);
return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
}
if (preg_match('/(^KG4)[A-Z09]{3}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 4 or 6 char, it is USA
$call = "K";
} elseif (preg_match('/(^OH\/)|(\/OH[1-9]?$)/', $call)) { # non-Aland prefix!
$call = "OH"; # make callsign OH = finland
} elseif (preg_match('/(^CX\/)|(\/CX[1-9]?$)/', $call)) { # non-Antarctica prefix!
$call = "CX"; # make callsign CX = Uruguay
} elseif (preg_match('/(^3D2R)|(^3D2.+\/R)/', $call)) { # seems to be from Rotuma
$call = "3D2/R"; # will match with Rotuma
} elseif (preg_match('/^3D2C/', $call)) { # seems to be from Conway Reef
@ -2872,23 +2961,43 @@ class Logbook_model extends CI_Model {
} elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) {
$call = "K";
} elseif (preg_match('/\w\/\w/', $call)) {
if (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) {
$prefix = $matches[1][0];
$callsign = $matches[3][0];
$suffix = $matches[5][0];
if ($prefix) {
$prefix = substr($prefix, 0, -1); # Remove the / at the end
}
if ($suffix) {
$suffix = substr($suffix, 1); # Remove the / at the beginning
};
if (preg_match($csadditions, $suffix)) {
if ($prefix) {
$call = $prefix;
} else {
$call = $callsign;
}
} else {
$result = $this->wpx($call, 1); # use the wpx prefix instead
if ($result == '') {
$row['adif'] = 0;
$row['entity'] = 'None';
$row['cqz'] = 0;
return array($row['adif'], $row['entity'], $row['cqz']);
$row['cont'] = '';
return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
} else {
$call = $result . "AA";
}
}
}
}
$len = strlen($call);
// query the table, removing a character from the right until a match
for ($i = $len; $i > 0; $i--){
//printf("searching for %s\n", substr($call, 0, $i));
$dxcc_result = $this->db->select('`call`, `entity`, `adif`, `cqz`')
$dxcc_result = $this->db->select('`call`, `entity`, `adif`, `cqz`, `cont`')
->where('call', substr($call, 0, $i))
->where('(start <= ', $date)
->or_where("start is null)", NULL, false)
@ -2901,24 +3010,26 @@ class Logbook_model extends CI_Model {
if ($dxcc_result->num_rows() > 0){
$row = $dxcc_result->row_array();
return array($row['adif'], $row['entity'], $row['cqz']);
return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
}
}
return array("Not Found", "Not Found");
}
}
public function dxcc_lookup($call, $date){
$csadditions = '/^P$|^R$|^A$|^M$/';
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`')
->where('call', $call)
->where('(start <= CURDATE()')
->where('(start <= ', $date)
->or_where('start is null)', NULL, false)
->where('(end >= CURDATE()')
->where('(end >= ', $date)
->or_where('end is null)', NULL, false)
->get('dxcc_exceptions');
if ($dxcc_exceptions->num_rows() > 0){
$row = $dxcc_exceptions->row_array();
return $row;
@ -2928,6 +3039,8 @@ class Logbook_model extends CI_Model {
$call = "K";
} elseif (preg_match('/(^OH\/)|(\/OH[1-9]?$)/', $call)) { # non-Aland prefix!
$call = "OH"; # make callsign OH = finland
} elseif (preg_match('/(^CX\/)|(\/CX[1-9]?$)/', $call)) { # non-Antarctica prefix!
$call = "CX"; # make callsign CX = Uruguay
} elseif (preg_match('/(^3D2R)|(^3D2.+\/R)/', $call)) { # seems to be from Rotuma
$call = "3D2/R"; # will match with Rotuma
} elseif (preg_match('/^3D2C/', $call)) { # seems to be from Conway Reef
@ -2939,18 +3052,37 @@ class Logbook_model extends CI_Model {
} elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) {
$call = "K";
} elseif (preg_match('/\w\/\w/', $call)) {
$result = $this->wpx($call, 1); # use the wpx prefix instead
if ($result == '') {
$row['adif'] = 0;
$row['entity'] = 'None';
$row['cqz'] = 0;
$row['long'] = '0';
$row['lat'] = '0';
return $row;
} else {
$call = $result . "AA";
if (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) {
$prefix = $matches[1][0];
$callsign = $matches[3][0];
$suffix = $matches[5][0];
if ($prefix) {
$prefix = substr($prefix, 0, -1); # Remove the / at the end
}
if ($suffix) {
$suffix = substr($suffix, 1); # Remove the / at the beginning
};
if (preg_match($csadditions, $suffix)) {
if ($prefix) {
$call = $prefix;
} else {
$call = $callsign;
}
} else {
$result = $this->wpx($call, 1); # use the wpx prefix instead
if ($result == '') {
$row['adif'] = 0;
$row['entity'] = 'None';
$row['cqz'] = 0;
$row['long'] = '0';
$row['lat'] = '0';
return $row;
} else {
$call = $result . "AA";
}
}
}
}
$len = strlen($call);
@ -2984,8 +3116,8 @@ class Logbook_model extends CI_Model {
$b = '';
$c = '';
$lidadditions = '/^QRP|^LGT/';
$csadditions = '/^P$|^R$|^A$|^M$/';
$lidadditions = '/^QRP$|^LGT$/';
$csadditions = '/^P$|^R$|^A$|^M$|^LH$/';
$noneadditions = '/^MM$|^AM$/';
# First check if the call is in the proper format, A/B/C where A and C
@ -3180,6 +3312,16 @@ class Logbook_model extends CI_Model {
print("$count updated\n");
}
public function check_missing_continent(){
// get all records with no COL_CONT
$this->db->trans_start();
$sql = "UPDATE ".$this->config->item('table_name')." JOIN dxcc_entities ON ".$this->config->item('table_name').".col_dxcc = dxcc_entities.adif SET col_cont = dxcc_entities.cont WHERE COALESCE(".$this->config->item('table_name').".col_cont, '') = ''";
$query = $this->db->query($sql);
print($this->db->affected_rows()." updated\n");
$this->db->trans_complete();
}
public function check_missing_grid_id($all){
// get all records with no COL_GRIDSQUARE
$this->db->select("COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_TIME_OFF");

Wyświetl plik

@ -211,7 +211,10 @@ class Logbookadvanced_model extends CI_Model {
if ($mode->col_submode == null || $mode->col_submode == "") {
array_push($modes, $mode->col_mode);
} else {
array_push($modes, $mode->col_submode);
// Make sure we don't add LSB or USB as submodes in the array list
if ($mode->col_mode != "SSB") {
array_push($modes, $mode->col_submode);
}
}
}

Wyświetl plik

@ -19,13 +19,17 @@ class Lookup_model extends CI_Model{
// Populating array with worked band/mode combinations
$worked = $this->getQueryData($queryinfo, 'worked');
foreach ($worked as $w) {
$resultArray[$w->col_mode][$w->col_band] = 'W';
if(in_array($w->col_band, $queryinfo['bands'])) {
$resultArray[$w->col_mode][$w->col_band] = 'W';
}
}
// Populating array with confirmed band/mode combinations
$confirmed = $this->getQueryData($queryinfo, 'confirmed');
foreach ($confirmed as $c) {
$resultArray[$c->col_mode][$c->col_band] = 'C';
if(in_array($c->col_band, $queryinfo['bands'])) {
$resultArray[$c->col_mode][$c->col_band] = 'C';
}
}
return $resultArray;
@ -48,8 +52,8 @@ class Lookup_model extends CI_Model{
switch ($queryinfo['type']) {
case 'dxcc': $sqlquerytypestring .= " and col_dxcc = " . $queryinfo['dxcc']; break;
case 'iota': $sqlquerytypestring .= " and col_iota = '" . $queryinfo['iota'] . "'"; break;
case 'grid': $sqlquerytypestring .= " and (col_gridsquare like '%" . $fixedgrid . "%' or col_vucc_grids like '%" . $fixedgrid . "%')" ; break;
case 'cqz': $sqlquerytypestring .= " and col_cqz = " . $queryinfo['cqz']; break;
case 'vucc': $sqlquerytypestring .= " and (col_gridsquare like '%" . $fixedgrid . "%' or col_vucc_grids like '%" . $fixedgrid . "%')" ; break;
case 'cq': $sqlquerytypestring .= " and col_cqz = " . $queryinfo['cqz']; break;
case 'was': $sqlquerytypestring .= " and col_state = '" . $queryinfo['was'] . "' and COL_DXCC in ('291', '6', '110')";; break;
case 'sota': $sqlquerytypestring .= " and col_sota_ref = '" . $queryinfo['sota'] . "'"; break;
case 'wwff': $sqlquerytypestring .= " and col_sig = 'WWFF' and col_sig_info = '" . $queryinfo['wwff'] . "'"; break;

Wyświetl plik

@ -19,6 +19,7 @@ class Timeline_model extends CI_Model
case 'was': $result = $this->get_timeline_was($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
case 'iota': $result = $this->get_timeline_iota($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
case 'waz': $result = $this->get_timeline_waz($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
case 'vucc': $result = $this->get_timeline_vucc($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
}
return $result;
@ -178,5 +179,159 @@ class Timeline_model extends CI_Model
}
return $sql;
}
public function get_timeline_vucc3($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
// $sql = "select min(date(COL_TIME_ON)) date, col_gridsquare from "
$sql = "select min(date(COL_TIME_ON)) date, upper(substring(col_gridsquare, 1, 4)) gridsquare from "
.$this->config->item('table_name'). " thcv
where station_id in (" . $location_list . ")";
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
if ($mode != 'All') {
$sql .= " and col_mode ='" . $mode . "'";
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
$sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4))
order by date desc";
$query = $this->db->query($sql);
$this->vucc_shit($band, $mode, $location_list, $qsl, $lotw, $eqsl);
return $query->result();
}
public function timeline_qso_details($querystring, $band, $mode, $type){
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
if ($band != 'All') {
if ($band == 'SAT') {
$this->db->where('col_prop_mode', $band);
} else {
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where('col_band', $band);
}
}
if ($mode != 'All') {
$this->db->where('col_mode', $mode);
}
$this->db->where_in('station_profile.station_id', $logbooks_locations_array);
switch($type) {
case 'dxcc': $this->db->where('COL_DXCC', $querystring); break;
case 'was': $this->db->where('COL_STATE', $querystring); break;
case 'iota': $this->db->where('COL_IOTA', $querystring); break;
case 'waz': $this->db->where('COL_CQZ', $querystring); break;
case 'vucc': $this->db->group_start(); $this->db->like('COL_GRIDSQUARE', $querystring); $this->db->or_like('COL_VUCC_GRIDS',$querystring); $this->db->group_end();break;
}
return $this->db->get($this->config->item('table_name'));
}
public function get_timeline_vucc($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
$timeline = array();
$col_gridsquare = $this->get_gridsquare($band, $mode, $location_list, $qsl, $lotw, $eqsl);
foreach ($col_gridsquare as $grid) {
$timeline[] = array(
'gridsquare' => $grid->gridsquare,
'date' => $grid->date);
}
$col_vucc_grids = $this->get_vucc_grids($band, $mode, $location_list, $qsl, $lotw, $eqsl);
foreach ($col_vucc_grids as $gridSplit) {
$grids = explode(",", $gridSplit->gridsquare);
foreach($grids as $key) {
$grid_four = strtoupper(substr(trim($key),0,4));
if (!array_search($grid_four, array_column($timeline, 'gridsquare'))) {
$timeline[] = array(
'gridsquare' => $grid_four,
'date' => $gridSplit->date);
}
}
}
usort($timeline, function($a, $b) {
return $b['date'] <=> $a['date'];
});
return $timeline;
}
public function get_gridsquare($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
// $sql = "select min(date(COL_TIME_ON)) date, col_gridsquare from "
$sql = "select min(date(COL_TIME_ON)) date, upper(substring(col_gridsquare, 1, 4)) gridsquare from "
.$this->config->item('table_name'). " thcv
where station_id in (" . $location_list . ")";
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
if ($mode != 'All') {
$sql .= " and col_mode ='" . $mode . "'";
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
$sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4))
order by date desc";
$query = $this->db->query($sql);
return $query->result();
}
public function get_vucc_grids($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
// $sql = "select min(date(COL_TIME_ON)) date, col_gridsquare from "
$sql = "select date(COL_TIME_ON) date, upper(col_vucc_grids) gridsquare from "
.$this->config->item('table_name'). " thcv
where station_id in (" . $location_list . ")";
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
if ($mode != 'All') {
$sql .= " and col_mode ='" . $mode . "'";
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
$sql .= " and col_vucc_grids <> ''";
$query = $this->db->query($sql);
return $query->result();
}
}

Wyświetl plik

@ -122,7 +122,7 @@ class User_Model extends CI_Model {
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone,
$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup,
$user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
$user_show_profile_image, $user_previous_qsl_type) {
$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload) {
// Check that the user isn't already used
if(!$this->exists($username)) {
$data = array(
@ -149,6 +149,7 @@ class User_Model extends CI_Model {
'user_column5' => xss_clean($user_column5),
'user_show_profile_image' => xss_clean($user_show_profile_image),
'user_previous_qsl_type' => xss_clean($user_previous_qsl_type),
'user_amsat_status_upload' => xss_clean($user_amsat_status_upload),
);
// Check the password is valid
@ -203,6 +204,7 @@ class User_Model extends CI_Model {
'user_column5' => xss_clean($fields['user_column5']),
'user_show_profile_image' => xss_clean($fields['user_show_profile_image']),
'user_previous_qsl_type' => xss_clean($fields['user_previous_qsl_type']),
'user_amsat_status_upload' => xss_clean($fields['user_amsat_status_upload']),
);
// Check to see if the user is allowed to change user levels
@ -321,6 +323,7 @@ class User_Model extends CI_Model {
'user_column4' => isset($u->row()->user_column4) ? $u->row()->user_column4: 'Band',
'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country',
'user_previous_qsl_type' => isset($u->row()->user_previous_qsl_type) ? $u->row()->user_previous_qsl_type: 0,
'user_amsat_status_upload' => isset($u->row()->user_amsat_status_upload) ? $u->row()->user_amsat_status_upload: 0,
'active_station_logbook' => $u->row()->active_station_logbook,
);

Wyświetl plik

@ -34,7 +34,7 @@
<select name="station_profile" class="custom-select mb-2 mr-sm-2" style="width: 20%;">
<option value="0">Select Station Location</option>
<?php foreach ($station_profile->result() as $station) { ?>
<option value="<?php echo $station->station_id; ?>">Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
<option value="<?php echo $station->station_id; ?>" <?php if ($station->station_id == $this->stations->find_active()) { echo " selected =\"selected\""; } ?>>Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
<?php } ?>
</select>
<label class="sr-only" for="inlineFormInputName2">ADIF file</label>
@ -100,7 +100,7 @@
<select name="station_profile" class="custom-select mb-2 mr-sm-2" style="width: 20%;">
<option value="0">Select Station Location</option>
<?php foreach ($station_profile->result() as $station) { ?>
<option value="<?php echo $station->station_id; ?>">Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
<option value="<?php echo $station->station_id; ?>" <?php if ($station->station_id == $this->stations->find_active()) { echo " selected =\"selected\""; } ?>>Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
<?php } ?>
</select>
<p class="card-text">From date:</p>

Wyświetl plik

@ -0,0 +1,70 @@
<style>
#continentChart {
margin: 0 auto;
}
</style>
<div class="container statistics">
<h2>
<?php echo $page_title; ?>
</h2>
<br>
<div hidden class="tabs">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="continents-tab" data-toggle="tab" href="#continents" role="tab"
aria-controls="continents" aria-selected="true">No of QSOs</a>
</li>
</ul>
</div>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade active show" id="continents" role="tabpanel" aria-labelledby="continents-tab">
<br />
<form id="searchForm" name="searchForm" action="<?php echo base_url()."index.php/continents/get_continents";?>" method="post">
<div class="form-row">
<div class="form-group col-lg-2">
<label class="form-label" for="band">Band</label>
<select id="band" name="band" class="form-control form-control-sm">
<option value="">All</option>
<?php foreach($bands as $band){ ?>
<option value="<?php echo htmlentities($band);?>"><?php echo htmlspecialchars($band);?> </option>
<?php } ?>
</select>
</div>
<div class="form-group col-lg-2">
<label class="form-label" for="mode">Mode</label>
<select id="mode" name="mode" class="form-control form-control-sm">
<option value="">All</option>
<?php foreach($modes as $modeId => $mode){ ?>
<option value="<?php echo htmlspecialchars($mode);?>"><?php echo htmlspecialchars($mode);?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-lg-2 col-md-3 col-sm-3 col-xl-21">
<label>&nbsp;</label><br>
<button type="submit" class="btn btn-sm btn-primary" id="searchButton">Search</button>
<button type="reset" class="btn btn-sm btn-danger" id="resetButton">Reset</button>
</div>
</div>
</form>
<div style="display: flex;" id="continentContainer">
<div style="flex: 1;"><canvas id="continentChart" width="500" height="500"></canvas></div>
<div style="flex: 1;" id="continentTable">
<table style="width:100%" class="continentstable table table-sm table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
<th>#</th>
<th>Continent</th>
<th># of QSO's worked</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>

Wyświetl plik

@ -5,6 +5,26 @@
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">Cloudlog Information</div>
<div class="card-body">
<table width="100%">
<tr>
<td>Version</td>
<td><?php echo $this->config->item('app_version')."\n"; ?></td>
</tr>
<tr>
<td>Language</td>
<td><?php echo ucfirst($this->config->item('language'))."\n"; ?></td>
</tr>
<tr>
<td>Base URL</td>
<td><span id="baseUrl"><a href="<?php echo $this->config->item('base_url')?>" target="_blank"><?php echo $this->config->item('base_url'); ?></a></span> <span data-toggle="tooltip" data-original-title="<?php echo $this->lang->line('copy_to_clipboard'); ?>" onclick='copyURL("<?php echo $this->config->item('base_url'); ?>")'><i class="copy-icon fas fa-copy"></span></td>
</tr>
</table>
</div>
</div>
<div class="card">
<div class="card-header">Server Information</div>
<div class="card-body">
@ -139,13 +159,32 @@
</div>
</div>
<?php if (file_exists('.git')) { ?>
<div class="card">
<?php
$commitHash = trim(exec('git log --pretty="%H" -n1 HEAD'));
$commitDate = trim(exec('git log --pretty="%ci" -n1 HEAD'));
$branch = trim(exec('git branch --show-current'));
$tag = trim(exec('git describe --tags '.$commitHash));
$branch = '';
$remote = '';
$owner = '';
// only proceed here if git can actually be executed
if ($commitHash != "") {
$commitDate = trim(exec('git log --pretty="%ci" -n1 HEAD'));
$line = trim(exec('git log -n 1 --pretty=%D HEAD'));
$pieces = explode(', ', $line);
if (isset($pieces[1])) {
$remote = substr($pieces[1], 0, strpos($pieces[1], '/'));
$branch = substr($pieces[1], strpos($pieces[1], '/')+1);
$url = trim(exec('git remote get-url '.$remote));
if (strpos($url, 'https://github.com') !== false) {
$owner = preg_replace('/https:\/\/github\.com\/(\w+)\/Cloudlog\.git/', '$1', $url);
} else if (strpos($url, 'git@github.com') !== false) {
$owner = preg_replace('/git@github\.com:(\w+)\/Cloudlog\.git/', '$1', $url);
}
}
$tag = trim(exec('git describe --tags '.$commitHash));
}
?>
<?php if($commitHash != "") { ?>
<div class="card">
<div class="card-header">Git Information</div>
<div class="card-body">
<table width="100%">
@ -153,7 +192,13 @@
<td>Branch</td>
<td>
<?php if($branch != "") { ?>
<a target="_blank" href="https://github.com/magicbug/Cloudlog/tree/<?php echo $branch?>"><span class="badge badge-success"><?php echo $branch; ?></span></a>
<?php if($owner != "") { ?>
<a target="_blank" href="https://github.com/<?php echo $owner; ?>/Cloudlog/tree/<?php echo $branch?>">
<?php } ?>
<span class="badge badge-success"><?php echo $branch; ?></span>
<?php if($owner != "") { ?>
</a>
<?php } ?>
<?php } else { ?>
<span class="badge badge-danger">n/a</span>
<?php } ?>
@ -185,7 +230,8 @@
</div>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>

Wyświetl plik

@ -64,6 +64,12 @@ function load_was_map() {
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/statistics.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "continents") { ?>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chartjs-plugin-piechart-outlabels.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/continents.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "adif" || $this->uri->segment(1) == "qrz") { ?>
<!-- Javascript used for ADIF Import and Export Areas -->
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script>
@ -122,6 +128,24 @@ function load_was_map() {
<script src="<?php echo base_url() ;?>assets/js/sections/station_logbooks.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "debug") { ?>
<script type="text/javascript">
function copyURL(url) {
var urlField = $('#baseUrl');
navigator.clipboard.writeText(url).then(function() {
});
urlField.addClass('flash-copy')
.delay('1000').queue(function() {
urlField.removeClass('flash-copy').dequeue();
});
}
$(function () {
$('[data-toggle="tooltip"]').tooltip({'delay': { show: 500, hide: 0 }, 'placement': 'right'});
});
</script>
<?php } ?>
<?php if ($this->uri->segment(1) == "api" && $this->uri->segment(2) == "help") { ?>
<script type="text/javascript">
function copyApiKey(apiKey) {

Wyświetl plik

@ -110,6 +110,8 @@
<a class="dropdown-item" href="<?php echo site_url('timeplotter');?>" title="View time when worked"><i class="fas fa-chart-area"></i> Timeplotter</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('map/custom');?>" title="Custom Maps of QSOs"><i class="fas fa-globe-europe"></i> Custom Maps</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('continents');?>" title="Continents"><i class="fas fa-globe-europe"></i> Continents</a>
</div>
</li>

Wyświetl plik

@ -1,8 +1,8 @@
<form method="post" class="form-inline">
<select id="quicklookuptype" name="type" class="form-control custom-select">
<option value="cqz">CQ Zone</option>
<option value="cq">CQ Zone</option>
<option value="dxcc">DXCC</option>
<option value="grid">Gridsquare</option>
<option value="vucc">Gridsquare</option>
<option value="iota">IOTA</option>
<option value="sota">SOTA</option>
<option value="was">US State</option>

Wyświetl plik

@ -17,8 +17,8 @@ foreach ($result as $mode => $value) {
switch($type) {
case 'dxcc': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $dxcc).'","' . $key . '","' . $mode . '","DXCC2")\'>' . $val . '</a>'; break;
case 'iota': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $iota).'","' . $key . '","' . $mode . '","IOTA")\'>' . $val . '</a>'; break;
case 'grid': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $grid).'","' . $key . '","' . $mode . '","VUCC")\'>' . $val . '</a>'; break;
case 'cqz': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cqz).'","' . $key . '","' . $mode . '","CQZone")\'>' . $val . '</a>'; break;
case 'vucc': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $grid).'","' . $key . '","' . $mode . '","VUCC")\'>' . $val . '</a>'; break;
case 'cq': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cqz).'","' . $key . '","' . $mode . '","CQZone")\'>' . $val . '</a>'; break;
case 'was': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $was).'","' . $key . '","' . $mode . '","WAS")\'>' . $val . '</a>'; break;
case 'sota': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $sota).'","' . $key . '","' . $mode . '","SOTA")\'>' . $val . '</a>'; break;
case 'wwff': $linkinfo = '<a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wwff).'","' . $key . '","' . $mode . '","WWFF")\'>' . $val . '</a>'; break;

Wyświetl plik

@ -215,6 +215,8 @@
<input type="hidden" class="form-control" id="country" name="country" value="<?php echo $qso->COL_COUNTRY; ?>">
</div>
<div class="form-row">
<div class="form-group col-sm-6">
<label for="dxcc_id">DXCC</label>
<select class="custom-select" id="dxcc_id" name="dxcc_id" required>
@ -231,6 +233,19 @@
</select>
</div>
<div class="form-group col-sm-6">
<label for="continent"><?php echo $this->lang->line('gen_hamradio_continent'); ?></label>
<select class="custom-select" id="continent" name="continent">
<option value=""></option>
<option value="AF" <?php if($qso->COL_CONT == "AF") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('africa'); ?></option>
<option value="AN" <?php if($qso->COL_CONT == "AN") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('antarctica'); ?></option>
<option value="AS" <?php if($qso->COL_CONT == "AS") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('asia'); ?></option>
<option value="EU" <?php if($qso->COL_CONT == "EU") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('europe'); ?></option>
<option value="NA" <?php if($qso->COL_CONT == "NA") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('northamerica'); ?></option>
<option value="OC" <?php if($qso->COL_CONT == "OC") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('oceania'); ?></option>
<option value="SA" <?php if($qso->COL_CONT == "SA") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('southamerica'); ?></option>
</select>
</div>
</div>
</div>

Wyświetl plik

@ -1,6 +1,6 @@
<div class="container qso_panel">
<div class="row">
<div class="row qsopane">
<div class="col-sm-5">
<div class="card">
@ -222,6 +222,19 @@
</select>
</div>
<div class="form-group">
<label for="continent"><?php echo $this->lang->line('gen_hamradio_continent'); ?></label>
<select class="custom-select" id="continent" name="continent">
<option value=""></option>
<option value="AF"><?php echo $this->lang->line('africa'); ?></option>
<option value="AN"><?php echo $this->lang->line('antarctica'); ?></option>
<option value="AS"><?php echo $this->lang->line('asia'); ?></option>
<option value="EU"><?php echo $this->lang->line('europe'); ?></option>
<option value="NA"><?php echo $this->lang->line('northamerica'); ?></option>
<option value="OC"><?php echo $this->lang->line('oceania'); ?></option>
<option value="SA"><?php echo $this->lang->line('southamerica'); ?></option>
</select>
</div>
<div class="form-group">
<label for="cqz"><?php echo $this->lang->line('gen_hamradio_cq_zone'); ?></label>
<select class="custom-select" id="cqz" name="cqz" required>

Wyświetl plik

@ -38,39 +38,18 @@
</div>
<div class="form-group row">
<label class="col-md-1 control-label" for="radio">Award</label>
<div class="col-md-3">
<div class="form-check">
<input class="form-check-input" type="radio" name="awardradio" id="dxcc" value="dxcc" <?php if ($this->input->post('awardradio') == 'dxcc' || $this->input->method() !== 'post') echo ' checked'?>>
<label class="form-check-label" for="dxcc">
DX Century Club (DXCC)
</label>
<label class="col-md-1 control-label" for="award">Award</label>
<div class="col-md-3">
<select id="award" name="award" class="form-control custom-select">
<option value="dxcc" <?php if ($this->input->post('award') == "dxcc") echo ' selected'; ?> >DX Century Club (DXCC)</option>
<option value="was" <?php if ($this->input->post('award') == "was") echo ' selected'; ?> >Worked All States (WAS)</option>
<option value="iota" <?php if ($this->input->post('award') == "iota") echo ' selected'; ?> >Islands On The Air (IOTA)</option>
<option value="waz" <?php if ($this->input->post('award') == "waz") echo ' selected'; ?> >Worked All Zones (WAZ)</option>
<option value="vucc" <?php if ($this->input->post('award') == "vucc") echo ' selected'; ?> >VHF / UHF Century Club (VUCC)</option>
</select>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="awardradio" id="was" value="was" <?php if ($this->input->post('awardradio') == 'was') echo ' checked'?>>
<label class="form-check-label" for="was">
Worked All States (WAS)
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="awardradio" id="iota" value="iota" <?php if ($this->input->post('awardradio') == 'iota') echo ' checked'?>>
<label class="form-check-label" for="iota">
Islands On The Air (IOTA)
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="awardradio" id="waz" value="waz" <?php if ($this->input->post('awardradio') == 'waz') echo ' checked'?>>
<label class="form-check-label" for="waz">
Worked All Zones (WAZ)
</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-1 control-label">Confirmation</div>
<div class="col-md-10">
<div class="col-md-3">
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" name="qsl" value="1" id="qsl" <?php if ($this->input->post('qsl')) echo ' checked="checked"'; ?> >
<label class="form-check-label" for="qsl">QSL</label>
@ -109,11 +88,12 @@
<?php
if ($timeline_array) {
switch ($this->input->post('awardradio')) {
case 'dxcc': $result = write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
case 'was': $result = write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
case 'iota': $result = write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
case 'waz': $result = write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
switch ($this->input->post('award')) {
case 'dxcc': $result = write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
case 'was': $result = write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
case 'iota': $result = write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
case 'waz': $result = write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
case 'vucc': $result = write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
}
}
else {
@ -236,3 +216,28 @@ function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $
}
echo '</tfoot></table></div>';
}
function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $award) {
$i = count($timeline_array);
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
<td>#</td>
<td>Date</td>
<td>Gridsquare</td>
<td>Show QSOs</td>
</tr>
</thead>
<tbody>';
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line['date']);
echo '<tr>
<td>' . $i-- . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line['gridsquare'] . '</td>
<td><a href=javascript:displayTimelineContacts("' . $line['gridsquare'] . '","'. $bandselect . '","'. $modeselect . '","' . $award .'")>Show</a></td>
</tr>';
}
echo '</tfoot></table></div>';
}

Wyświetl plik

@ -30,6 +30,11 @@
<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc');?>">Check QSOs missing DXCC data</a></p>
<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc/all');?>">Re-check all QSOs in logbook</a></p>
<h5>Apply Continent Data to Logbook</h5>
<p class="card-text">
This function can be used to update QSO continent information for all QSOs in Cloudlog missing that information.
</p>
<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_continent');?>">Check QSOs missing continent data</a></p>
<style>
#dxcc_update_status{
display: None;

Wyświetl plik

@ -479,6 +479,26 @@
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md">
<div class="card">
<div class="card-header">
AMSAT Status Upload
</div>
<div class="card-body">
<div class="form-group">
<label for="amsatstatusupload">Upload status of SAT QSOs to <a href="https://www.amsat.org/status/" target="_blank">https://www.amsat.org/status/</a>.</label>
<select class="custom-select" id="amsatstatusupload" name="user_amsat_status_upload">
<option value="0"><?php echo $this->lang->line('general_word_no'); ?></option>
<option value="1"><?php echo $this->lang->line('general_word_yes'); ?></option>
</select>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<br />
@ -486,4 +506,4 @@
<br />
<br />
</form>
</div>
</div>

Wyświetl plik

@ -478,6 +478,27 @@
</div>
</div>
<br>
<div class="row">
<div class="col-md">
<div class="card">
<div class="card-header">
AMSAT Status Upload
</div>
<div class="card-body">
<div class="form-group">
<label for="amsatsatatusupload">Upload status of SAT QSOs to <a href="https://www.amsat.org/status/" target="_blank">https://www.amsat.org/status/</a>.</label>
<select class="custom-select" id="amsatstatusupload" name="user_amsat_status_upload">
<option value="1" <?php if ($user_amsat_status_upload == 1) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('general_word_yes'); ?></option>
<option value="0" <?php if ($user_amsat_status_upload == 0) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('general_word_no'); ?></option>
</select>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<br>

Wyświetl plik

@ -1,14 +1,39 @@
<div id="container" class="container mx-auto pt-5" style="max-width:400px">
<div class="row">
<div class="col-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="text-center">
<h3><i class="fa fa-lock fa-4x"></i></h3>
<h2 class="text-center">Forgot Password?</h2>
<p>You can reset your password here.</p>
<div class="panel-body">
<style>
html,
body {
height: 100%;
}
body {
display: flex;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;
}
.form-forgot {
width: 100%;
max-width: 430px;
padding: 15px;
margin: auto;
}
input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
</style>
<main class="form-forgot">
<img src="<?php echo base_url()?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;">
<div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm">
<div class="card-body">
<div class="text-center">
<h3 class="text-center">Forgot Password? <i class="fa fa-lock"></i></h3>
<p>You can reset your password here.</p>
<div class="panel-body">
<?php if(validation_errors() != ''): ?>
<div class="alert alert-danger" role="alert">
<?php echo validation_errors(); ?>
@ -16,23 +41,20 @@
<?php endif; ?>
<form id="register-form" role="form" autocomplete="off" class="form" method="post" action="<?php echo site_url('user/forgot_password'); ?>">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope color-blue"></i></span>
<input id="email" name="email" placeholder="email address" class="form-control" type="email">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope color-blue"></i></span>
<input id="email" name="email" placeholder="email address" class="form-control" type="email">
</div>
</div>
</div>
<div class="form-group">
<input name="recover-submit" class="btn btn-lg btn-primary btn-block" value="Reset Password" type="submit">
</div>
<input type="hidden" class="hide" name="token" id="token" value="">
<div class="form-group">
<input name="recover-submit" class="w-100 btn btn-primary btn-block" value="Reset Password" type="submit">
</div>
<input type="hidden" class="hide" name="token" id="token" value="">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>

Wyświetl plik

@ -1,23 +1,59 @@
<div id="container" class="container mx-auto pt-5" style="max-width:400px">
<style>
html,
body {
height: 100%;
}
<h1>Login</h1>
<?php $this->load->view('layout/messages'); ?>
body {
display: flex;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;
}
<form method="post" action="<?php echo site_url('user/login'); ?>" name="users">
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<div class="form-group">
<label for="user_name">Username</label>
<input id="user_name" type="text" name="user_name" class="form-control" value="<?php echo $this->input->post('user_name'); ?>">
</div>
<div class="form-group">
<label for="password">Password</label>
<input id="password" type="password" name="user_password" class="form-control">
</div>
<div class="form-group">
<input class="btn-info p-2 col" type="submit" value="Log in" />
</div>
</form>
.form-signin {
width: 100%;
max-width: 430px;
padding: 15px;
margin: auto;
}
<p><a href="<?php echo site_url('user/forgot_password'); ?>">Forgot your password?</a></p>
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
</div>
.form-signin input[type="password"] {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
</style>
<main class="form-signin">
<img src="<?php echo base_url()?>/CloudLog_logo.png" class="mx-auto d-block" alt="" style="width:100px;height:100px;">
<div class="my-2 bg-body rounded-0 shadow-sm card mb-2 shadow-sm">
<div class="card-body">
<h3>Login to Cloudlog</h3>
<form method="post" action="<?php echo site_url('user/login'); ?>" name="users">
<?php $this->form_validation->set_error_delimiters('', ''); ?>
<input type="hidden" name="id" value="<?php echo $this->uri->segment(3); ?>" />
<div>
<label for="floatingInput"><strong>Username<strong></label>
<input type="text" name="user_name" class="form-control" id="floatingInput" placeholder="Username"
value="<?php echo $this->input->post('user_name'); ?>">
</div>
<div>
<label for="floatingPassword"><strong>Password</strong></label>
<input type="password" name="user_password" class="form-control" id="floatingPassword"
placeholder="Password">
</div>
<div>
<p><small><a class="" href="<?php echo site_url('user/forgot_password'); ?>">Forgot your password?</a></small></p>
</div>
<?php $this->load->view('layout/messages'); ?>
<button class="w-100 btn btn-info" type="submit">Login </button>
</form>
</div>
</div>
</main>

Wyświetl plik

@ -188,6 +188,39 @@
</tr>
<?php } ?>
<?php if($row->COL_CONT != null) { ?>
<tr>
<td><?php echo $this->lang->line('gen_hamradio_continent'); ?></td>
<td>
<?php
switch($row->COL_CONT) {
case "AF":
echo $this->lang->line('africa');
break;
case "AN":
echo $this->lang->line('antarctica');
break;
case "AS":
echo $this->lang->line('asia');
break;
case "EU":
echo $this->lang->line('europe');
break;
case "NA":
echo $this->lang->line('northamerica');
break;
case "OC":
echo $this->lang->line('oceania');
break;
case "SA":
echo $this->lang->line('southamerica');
break;
}
?>
</td>
</tr>
<?php } ?>
<?php if($row->COL_CONTEST_ID != null) { ?>
<tr>
<td><?php echo $this->lang->line('contesting_contest_name'); ?></td>

Wyświetl plik

@ -412,3 +412,7 @@ div#station_logbooks_linked_table_paginate {
.dropdown-menu {
z-index: 2000;
}
.qso_panel .dxccsummary {
margin-bottom: 10px;
}

Wyświetl plik

@ -146,7 +146,7 @@ function qso_edit(id) {
labelField: 'name',
searchField: 'name',
options: [],
create: false,
create: true,
load: function(query, callback) {
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
$.ajax({
@ -174,7 +174,7 @@ function qso_edit(id) {
labelField: 'name',
searchField: 'name',
options: [],
create: false,
create: true,
load: function(query, callback) {
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
$.ajax({
@ -202,7 +202,7 @@ function qso_edit(id) {
labelField: 'name',
searchField: 'name',
options: [],
create: false,
create: true,
load: function(query, callback) {
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
$.ajax({
@ -375,13 +375,13 @@ function spawnLookupModal() {
$('#quicklookupcqz').hide();
$('#quicklookupwas').hide();
$('#quicklookuptext').hide();
} else if (type == "grid" || type == "sota" || type == "wwff") {
} else if (type == "vucc" || type == "sota" || type == "wwff") {
$('#quicklookuptext').show();
$('#quicklookupiota').hide();
$('#quicklookupdxcc').hide();
$('#quicklookupcqz').hide();
$('#quicklookupwas').hide();
} else if (type == "cqz") {
} else if (type == "cq") {
$('#quicklookupcqz').show();
$('#quicklookupiota').hide();
$('#quicklookupdxcc').hide();
@ -430,4 +430,21 @@ function getLookupResult() {
$(".ld-ext-right").prop('disabled', false);
}
});
}
}
// This function executes the call to the backend for fetching dxcc summary and inserted table below qso entry
function getDxccResult(dxcc, name) {
$.ajax({
url: base_url + 'index.php/lookup/search',
type: 'post',
data: {
type: 'dxcc',
dxcc: dxcc,
},
success: function (html) {
$('.dxccsummary').remove();
$('.qsopane').append('<div class="dxccsummary col-sm-12"><br><div class="card"><div class="card-header" data-toggle="collapse" data-target=".dxccsummarybody">DXCC Summary for '+name+'</div><div class="card-body collapse dxccsummarybody"></div></div></div>');
$('.dxccsummarybody').append(html);
}
});
}

Wyświetl plik

@ -394,8 +394,8 @@ function logQso() {
// Store contest session
localStorage.setItem("contestid", $("#contestname").val());
localStorage.setItem("exchangetype", $("#exchangetype").val());
localStorage.setItem("exchangereceived", $("#exch_rcvd").val());
localStorage.setItem("exchangesent", $("#exch_sent").val());
localStorage.setItem("exchangereceived", $("#exch_rcvd").val().toUpperCase());
localStorage.setItem("exchangesent", $("#exch_sent").val().toUpperCase());
localStorage.setItem("serialreceived", $("#exch_serial_r").val());
localStorage.setItem("serialsent", $("#exch_serial_s").val());
localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").val());

Wyświetl plik

@ -0,0 +1,157 @@
$(document).ready(function () {
// Needed for continentstable header fix, will be squished without
$("a[href='#continents']").on('shown.bs.tab', function(e) {
$(".continentstable").DataTable().columns.adjust();
});
$('#searchForm').submit(function (e) {
$('#searchButton').prop("disabled", true);
$.ajax({
url: this.action,
type: 'post',
data: {
mode: this.mode.value,
band: this.band.value,
},
dataType: 'json',
success: function (data) {
$('#searchButton').prop("disabled", false);
totalContinentQsos(data);
},
error: function (data) {
$('#searchButton').prop("disabled", false);
BootstrapDialog.alert({
title: 'ERROR',
message: 'An error ocurred while making the request',
type: BootstrapDialog.TYPE_DANGER,
closable: false,
draggable: false,
callback: function (result) {
}
});
},
});
return false;
});
$('#searchForm').submit();
});
function totalContinentQsos(data) {
// using this to change color of legend and label according to background color
var color = ifDarkModeThemeReturn('white', 'grey');
if (data.length > 0) {
$('.continentstable > tbody').empty();
$('.tabs').removeAttr('hidden');
var labels = [];
var dataQso = [];
var totalQso = Number(0);
var $myTable = $('.continentstable');
var i = 1;
// building the rows in the table
var rowElements = data.map(function (row) {
var $row = $('<tr></tr>');
var $iterator = $('<td></td>').html(i++);
var $type = $('<td></td>').html(row.cont);
var $content = $('<td></td>').html(row.count);
$row.append($iterator, $type, $content);
return $row;
});
// finally inserting the rows
$myTable.append(rowElements);
$.each(data, function () {
labels.push(this.cont);
dataQso.push(this.count);
totalQso = Number(totalQso) + Number(this.count);
});
const COLORS = ["#3366cc", "#dc3912", "#ff9900", "#109618", "#990099", "#0099c6", "#dd4477", "#66aa00", "#b82e2e", "#316395", "#994499"]
let chartStatus = Chart.getChart("continentChart"); // <canvas> id
if (chartStatus != undefined) {
chartStatus.destroy();
}
var ctx = document.getElementById("continentChart").getContext('2d');
var myChart = new Chart(ctx, {
plugins: [ChartPieChartOutlabels],
type: 'doughnut',
data: {
labels: labels,
datasets: [{
borderColor: 'rgba(54, 162, 235, 1)',
label: 'Number of QSO\'s worked',
data: dataQso,
backgroundColor: ["#3366cc", "#dc3912", "#ff9900", "#109618", "#990099", "#0099c6", "#dd4477", "#66aa00", "#b82e2e", "#316395", "#994499"],
borderWidth: 1,
labels: labels,
}]
},
options: {
layout: {
padding: 100
},
title: {
fontColor: color,
fullSize: true,
},
responsive: false,
maintainAspectRatio: true,
plugins: {
legend: {
display: false,
labels: {
boxWidth: 15,
color: color,
font: {
size: 14,
}
},
position: 'right',
align: "middle"
},
outlabels: {
backgroundColor: COLORS,
borderColor: COLORS,
borderRadius: 2, // Border radius of Label
borderWidth: 2, // Thickness of border
color: 'white',
stretch: 10,
padding: 0,
font: {
resizable: true,
minSize: 12,
maxSize: 25,
family: Chart.defaults.font.family,
size: Chart.defaults.font.size,
style: Chart.defaults.font.style,
lineHeight: Chart.defaults.font.lineHeight,
},
zoomOutPercentage: 100,
textAlign: 'start',
backgroundColor: COLORS,
}
}
}
});
// using this to change color of csv-button if dark mode is chosen
var background = $('body').css("background-color");
if (background != ('rgb(255, 255, 255)')) {
$(".buttons-csv").css("color", "white");
}
}
}

Wyświetl plik

@ -68,7 +68,7 @@ $( document ).ready(function() {
labelField: 'name',
searchField: 'name',
options: [],
create: false,
create: true,
load: function(query, callback) {
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
$.ajax({
@ -101,7 +101,7 @@ $( document ).ready(function() {
labelField: 'name',
searchField: 'name',
options: [],
create: false,
create: true,
load: function(query, callback) {
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
$.ajax({
@ -134,7 +134,7 @@ $( document ).ready(function() {
labelField: 'name',
searchField: 'name',
options: [],
create: false,
create: true,
load: function(query, callback) {
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
$.ajax({
@ -327,6 +327,7 @@ function reset_fields() {
$('#locator_info').text("");
$('#country').val("");
$('#continent').val("");
$('#lotw_info').text("");
$('#qrz_info').text("");
$('#hamqth_info').text("");
@ -368,6 +369,7 @@ function reset_fields() {
mymap.setView(pos, 12);
mymap.removeLayer(markers);
$('.callsign-suggest').hide();
$('.dxccsummary').remove();
}
$("#callsign").focusout(function() {
@ -449,6 +451,8 @@ $("#callsign").focusout(function() {
}
changebadge(result.dxcc.entity);
getDxccResult(result.dxcc.adif, convert_case(result.dxcc.entity));
}
if(result.lotw_member == "active") {
@ -534,6 +538,10 @@ $("#callsign").focusout(function() {
$('#name').val(result.callsign_name);
}
if($('#continent').val() == "") {
$('#continent').val(result.dxcc.cont);
}
if($('#qth').val() == "") {
$('#qth').val(result.callsign_qth);
}
@ -770,6 +778,7 @@ function resetDefaultQSOFields() {
$('#callsign_info').text("");
$('#locator_info').text("");
$('#country').val("");
$('#continent').val("");
$('#dxcc_id').val("");
$('#cqz').val("");
$('#name').val("");
@ -787,4 +796,5 @@ function resetDefaultQSOFields() {
$('#input_usa_state').val("");
$('#callsign-image').attr('style', 'display: none;');
$('#callsign-image-content').text("");
$('.dxccsummary').remove();
}

Wyświetl plik

@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
$config['app_name'] = "Cloudlog";
$config['app_version'] = "1.7";
$config['app_version'] = "2.3.3";
$config['directory'] = "%directory%";
$config['callbook'] = "hamqth"; // Options are hamqth or qrz