比较提交

..

2 提交

作者 SHA1 备注 提交日期
copilot-swe-agent[bot]
9f6def38da Fix QRZ lookup fallback and persistent connection issues
Co-authored-by: magicbug <84308+magicbug@users.noreply.github.com>
2025-07-30 15:36:50 +00:00
copilot-swe-agent[bot]
5b00d420c3 Initial plan 2025-07-30 15:25:07 +00:00
共有 141 个文件被更改,包括 13711 次插入5519 次删除

查看文件

@ -24,16 +24,5 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install xml \
&& a2enmod rewrite
# Copy script.sh and make it executable
COPY script.sh /usr/local/bin/startup.sh
RUN sed -i 's/\r$//' /usr/local/bin/startup.sh && chmod +x /usr/local/bin/startup.sh
# Configure PHP for larger file uploads (30MB)
RUN echo "upload_max_filesize = 30M" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "post_max_size = 35M" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "memory_limit = 64M" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "max_execution_time = 300" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "max_input_time = 300" >> /usr/local/etc/php/conf.d/uploads.ini
# Expose port 80
EXPOSE 80

查看文件

@ -4,9 +4,5 @@ FROM mariadb:latest
# Add the install.sql file to the docker image
ADD install/assets/install.sql /docker-entrypoint-initdb.d
# Create a healthcheck script that uses mariadb-admin
RUN echo '#!/bin/bash\nmariadb-admin ping -h "localhost" --silent' > /usr/local/bin/healthcheck.sh \
&& chmod +x /usr/local/bin/healthcheck.sh
# Expose port 3306
EXPOSE 3306

查看文件

@ -198,9 +198,6 @@ case 'finnish':
case 'russian':
$config['language'] = $lang;
break;
case 'portuguese':
$config['language'] = $lang;
break;
case 'english':
$config['language'] = $lang;
break;

查看文件

@ -83,7 +83,7 @@ $db['default'] = array(
// The following values can probably stay the same.
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => TRUE,
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',

查看文件

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 210;
$config['migration_version'] = 203;
/*
|--------------------------------------------------------------------------

查看文件

@ -1,7 +1,6 @@
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class adif extends CI_Controller
{
class adif extends CI_Controller {
/* Controls ADIF Import/Export Functions */
@ -11,15 +10,21 @@ class adif extends CI_Controller
$this->load->helper(array('form', 'url'));
$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');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}
public function test() {
if(validateADIFDate('20120228') == true){
echo "valid date";
} else {
echo "date incorrect";
}
}
/* Shows Export Views */
public function export()
{
public function export() {
$data['page_title'] = "ADIF Export";
@ -70,8 +75,7 @@ class adif extends CI_Controller
$this->load->view('adif/data/exportsat', $data);
}
public function export_custom()
{
public function export_custom() {
// Set memory limit to unlimited to allow heavy usage
ini_set('memory_limit', '-1');
@ -80,10 +84,10 @@ class adif extends CI_Controller
$station_id = $this->security->xss_clean($this->input->post('station_profile'));
// Used for exporting QSOs not previously exported to LoTW
if ($this->input->post('exportLotw') == 1) {
$exportLotw = true;
} else {
$exportLotw = false;
if ($this->input->post('exportLotw') == 1) {
$exportLotw = true;
} else {
$exportLotw = false;
}
$data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id, $exportLotw);
@ -93,28 +97,29 @@ class adif extends CI_Controller
if ($this->input->post('markLotw') == 1) {
foreach ($data['qsos']->result() as $qso) {
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
}
}
}
foreach ($data['qsos']->result() as $qso)
{
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
}
}
}
public function mark_lotw()
{
// Set memory limit to unlimited to allow heavy usage
ini_set('memory_limit', '-1');
public function mark_lotw() {
// Set memory limit to unlimited to allow heavy usage
ini_set('memory_limit', '-1');
$station_id = $this->security->xss_clean($this->input->post('station_profile'));
$this->load->model('adif_data');
$this->load->model('adif_data');
$data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id);
$data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id);
foreach ($data['qsos']->result() as $qso) {
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
}
foreach ($data['qsos']->result() as $qso)
{
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
}
$this->load->view('adif/mark_lotw', $data);
}
$this->load->view('adif/mark_lotw', $data);
}
public function export_lotw()
{
@ -127,21 +132,21 @@ class adif extends CI_Controller
$this->load->view('adif/data/exportall', $data);
foreach ($data['qsos']->result() as $qso) {
foreach ($data['qsos']->result() as $qso)
{
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
}
}
public function index()
{
public function index() {
$this->load->model('stations');
$data['page_title'] = "ADIF Import / Export";
$data['max_upload'] = ini_get('upload_max_filesize');
$data['station_profile'] = $this->stations->all_of_user();
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$data['active_station_info'] = $station_profile->row();
@ -150,14 +155,13 @@ class adif extends CI_Controller
$this->load->view('interface_assets/footer');
}
public function import()
{
public function import() {
$this->load->model('stations');
$data['station_profile'] = $this->stations->all_of_user();
log_message("debug", "Started ADIF Import");
log_message("debug","Started ADIF Import");
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$active_station_id = $this->stations->find_active();
$station_profile = $this->stations->profile($active_station_id);
$data['active_station_info'] = $station_profile->row();
@ -169,7 +173,7 @@ class adif extends CI_Controller
$this->load->library('upload', $config);
if (! $this->upload->do_upload()) {
if ( ! $this->upload->do_upload()) {
$data['error'] = $this->upload->display_errors();
$data['max_upload'] = ini_get('upload_max_filesize');
@ -187,38 +191,39 @@ class adif extends CI_Controller
$this->load->library('adif_parser');
$this->adif_parser->load_from_file('./uploads/' . $data['upload_data']['file_name']);
unlink('./uploads/' . $data['upload_data']['file_name']);
$data['upload_data'] = ''; // free memory
$this->adif_parser->load_from_file('./uploads/'.$data['upload_data']['file_name']);
unlink('./uploads/'.$data['upload_data']['file_name']);
$data['upload_data']=''; // free memory
$this->adif_parser->initialize();
$custom_errors = "";
$alladif = [];
while ($record = $this->adif_parser->get_record()) {
if (count($record) == 0) {
$alladif=[];
while($record = $this->adif_parser->get_record())
{
if(count($record) == 0) {
break;
};
array_push($alladif, $record);
array_push($alladif,$record);
};
$record = ''; // free memory
$custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'), $this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
$record=''; // free memory
$custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
} else {
$custom_errors = 'Station Profile not valid for User';
$custom_errors='Station Profile not valid for User';
}
$data['adif_errors'] = $custom_errors;
$data['skip_dupes'] = $this->input->post('skipDuplicate');
log_message("debug", "Finished ADIF Import");
log_message("debug","Finished ADIF Import");
$data['page_title'] = "ADIF Imported";
$this->load->view('interface_assets/header', $data);
$this->load->view('adif/import_success');
$this->load->view('interface_assets/footer');
}
}
public function dcl()
{
public function dcl() {
$this->load->model('stations');
$data['station_profile'] = $this->stations->all_of_user();
@ -230,7 +235,7 @@ class adif extends CI_Controller
$this->load->library('upload', $config);
if (! $this->upload->do_upload()) {
if ( ! $this->upload->do_upload()) {
$data['error'] = $this->upload->display_errors();
$data['max_upload'] = ini_get('upload_max_filesize');
@ -248,33 +253,34 @@ class adif extends CI_Controller
$this->load->library('adif_parser');
$this->adif_parser->load_from_file('./uploads/' . $data['upload_data']['file_name']);
$this->adif_parser->load_from_file('./uploads/'.$data['upload_data']['file_name']);
$this->adif_parser->initialize();
$error_count = array(0, 0, 0);
$custom_errors = "";
while ($record = $this->adif_parser->get_record()) {
if (count($record) == 0) {
while($record = $this->adif_parser->get_record())
{
if(count($record) == 0) {
break;
};
$dok_result = $this->logbook_model->update_dok($record, $this->input->post('ignoreAmbiguous'), $this->input->post('onlyConfirmed'), $this->input->post('overwriteDok'));
if (!empty($dok_result)) {
switch ($dok_result[0]) {
case 0:
$error_count[0]++;
break;
case 1:
$custom_errors .= $dok_result[1];
$error_count[1]++;
break;
case 2:
$custom_errors .= $dok_result[1];
$error_count[2]++;
case 0:
$error_count[0]++;
break;
case 1:
$custom_errors .= $dok_result[1];
$error_count[1]++;
break;
case 2:
$custom_errors .= $dok_result[1];
$error_count[2]++;
}
}
};
unlink('./uploads/' . $data['upload_data']['file_name']);
unlink('./uploads/'.$data['upload_data']['file_name']);
$data['dcl_error_count'] = $error_count;
$data['dcl_errors'] = $custom_errors;
$data['page_title'] = "DCL Data Imported";
@ -282,7 +288,7 @@ class adif extends CI_Controller
$this->load->view('adif/dcl_success');
$this->load->view('interface_assets/footer');
}
}
}
}
/* End of file adif.php */

查看文件

@ -1,7 +1,6 @@
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class API extends CI_Controller
{
class API extends CI_Controller {
// Do absolutely nothing
function index()
@ -15,7 +14,7 @@ class API extends CI_Controller
// Check if users logged in
if ($this->user_model->validate_session() == 0) {
if($this->user_model->validate_session() == 0) {
// user is not logged in
redirect('user/login');
}
@ -32,13 +31,12 @@ class API extends CI_Controller
}
function edit($key)
{
function edit($key) {
$this->load->model('user_model');
// Check if users logged in
if ($this->user_model->validate_session() == 0) {
if($this->user_model->validate_session() == 0) {
// user is not logged in
redirect('user/login');
}
@ -47,37 +45,40 @@ class API extends CI_Controller
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->load->library('form_validation');
$this->form_validation->set_rules('api_desc', 'API Description', 'required');
$this->form_validation->set_rules('api_key', 'API Key is required do not change this field', 'required');
$this->form_validation->set_rules('api_desc', 'API Description', 'required');
$this->form_validation->set_rules('api_key', 'API Key is required do not change this field', 'required');
$data['api_info'] = $this->api_model->key_description($key);
$data['api_info'] = $this->api_model->key_description($key);
if ($this->form_validation->run() == FALSE) {
$data['page_title'] = "Edit API Description";
if ($this->form_validation->run() == FALSE)
{
$data['page_title'] = "Edit API Description";
$this->load->view('interface_assets/header', $data);
$this->load->view('api/description');
$this->load->view('interface_assets/footer');
} else {
}
else
{
// Success!
$this->api_model->update_key_description($this->input->post('api_key'), $this->input->post('api_desc'));
$this->session->set_flashdata('notice', 'API Key <b>' . $this->input->post('api_key') . "</b> description has been updated.");
$this->session->set_flashdata('notice', 'API Key <b>'.$this->input->post('api_key')."</b> description has been updated.");
redirect('api/help');
}
}
function generate($rights)
{
function generate($rights) {
$this->load->model('user_model');
// Check if users logged in
if ($this->user_model->validate_session() == 0) {
if($this->user_model->validate_session() == 0) {
// user is not logged in
redirect('user/login');
}
@ -90,13 +91,12 @@ class API extends CI_Controller
redirect('api/help');
}
function delete($key)
{
function delete($key) {
$this->load->model('user_model');
// Check if users logged in
if ($this->user_model->validate_session() == 0) {
if($this->user_model->validate_session() == 0) {
// user is not logged in
redirect('user/login');
}
@ -106,33 +106,31 @@ class API extends CI_Controller
$this->api_model->delete_key($key);
$this->session->set_flashdata('notice', 'API Key <b>' . $key . "</b> has been deleted");
$this->session->set_flashdata('notice', 'API Key <b>'.$key."</b> has been deleted");
redirect('api/help');
}
// Example of authing
function auth($key)
{
function auth($key) {
$this->load->model('api_model');
header("Content-type: text/xml");
if ($this->api_model->access($key) == "No Key Found" || $this->api_model->access($key) == "Key Disabled") {
header("Content-type: text/xml");
if($this->api_model->access($key) == "No Key Found" || $this->api_model->access($key) == "Key Disabled") {
echo "<auth>";
echo "<message>Key Invalid - either not found or disabled</message>";
echo "</auth>";
} else {
echo "<auth>";
echo "<status>Valid</status>";
echo "<rights>" . $this->api_model->access($key) . "</rights>";
echo "<rights>".$this->api_model->access($key)."</rights>";
echo "</auth>";
}
}
function check_auth($key)
{
function check_auth($key) {
$this->load->model('api_model');
header("Content-type: text/xml");
if ($this->api_model->access($key) == "No Key Found" || $this->api_model->access($key) == "Key Disabled") {
header("Content-type: text/xml");
if($this->api_model->access($key) == "No Key Found" || $this->api_model->access($key) == "Key Disabled") {
// set the content type as json
header("Content-type: application/json");
@ -152,24 +150,23 @@ class API extends CI_Controller
}
}
function station_info($key)
{
function station_info($key) {
$this->load->model('api_model');
$this->load->model('stations');
header("Content-type: application/json");
if (substr($this->api_model->access($key), 0, 1) == 'r') { /* Checkpermission for _r_eading */
if(substr($this->api_model->access($key),0,1) == 'r') { /* Checkpermission for _r_eading */
$this->api_model->update_last_used($key);
$userid = $this->api_model->key_userid($key);
$station_ids = array();
$stations = $this->stations->all_of_user($userid);
foreach ($stations->result() as $row) {
$result['station_id'] = $row->station_id;
$result['station_profile_name'] = $row->station_profile_name;
$result['station_gridsquare'] = $row->station_gridsquare;
$result['station_callsign'] = $row->station_callsign;;
$result['station_active'] = $row->station_active;
array_push($station_ids, $result);
}
$station_ids = array();
$stations=$this->stations->all_of_user($userid);
foreach ($stations->result() as $row) {
$result['station_id']=$row->station_id;
$result['station_profile_name']=$row->station_profile_name;
$result['station_gridsquare']=$row->station_gridsquare;
$result['station_callsign']=$row->station_callsign;;
$result['station_active']=$row->station_active;
array_push($station_ids, $result);
}
echo json_encode($station_ids);
} else {
http_response_code(401);
@ -178,13 +175,12 @@ class API extends CI_Controller
}
/*
/*
*
* Function: QSO
* Task: allows passing of ADIF data to Cloudlog
*/
function qso()
{
function qso() {
header('Content-type: application/json');
$this->load->model('api_model');
@ -198,29 +194,29 @@ class API extends CI_Controller
$obj = json_decode(file_get_contents("php://input"), true);
if ($obj === NULL) {
// Decoding not valid try simple www-x-form-urlencoded
$objTmp = file_get_contents("php://input");
parse_str($objTmp, $obj);
if ($obj === NULL) {
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
die();
}
$objTmp = file_get_contents("php://input");
parse_str($objTmp, $obj);
if ($obj === NULL) {
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
die();
}
}
if (!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
die();
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
die();
}
$userid = $this->api_model->key_userid($obj['key']);
if (!isset($obj['station_profile_id']) || $this->stations->check_station_against_user($obj['station_profile_id'], $userid) == false) {
if(!isset($obj['station_profile_id']) || $this->stations->check_station_against_user($obj['station_profile_id'], $userid) == false) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "station id does not belong to the API key owner."]);
die();
}
if ($obj['type'] == "adif" && $obj['string'] != "") {
if($obj['type'] == "adif" && $obj['string'] != "") {
// Load the logbook model for adding QSO records
$this->load->model('logbook_model');
@ -231,20 +227,22 @@ class API extends CI_Controller
$this->adif_parser->feed($obj['string']);
// Create QSO Record
while ($record = $this->adif_parser->get_record()) {
if (count($record) == 0) {
while($record = $this->adif_parser->get_record())
{
if(count($record) == 0)
{
break;
};
if (isset($obj['station_profile_id'])) {
if (isset($record['station_callsign']) && $this->stations->check_station_against_callsign($obj['station_profile_id'], $record['station_callsign']) == false) {
if(isset($obj['station_profile_id'])) {
if(isset($record['station_callsign']) && $this->stations->check_station_against_callsign($obj['station_profile_id'], $record['station_callsign']) == false) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "station callsign does not match station callsign in station profile."]);
die();
}
if (!(isset($record['call'])) || (trim($record['call']) == '')) {
if(!(isset($record['call'])) || (trim($record['call']) == '')) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "QSO Call is empty."]);
die();
@ -254,21 +252,23 @@ class API extends CI_Controller
$msg = $this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, NULL, false, false, true);
if ($msg == "") {
if ( $msg == "" ) {
$return_count++;
} else {
$return_msg[] = $msg;
}
}
};
http_response_code(201);
echo json_encode(['status' => 'created', 'type' => $obj['type'], 'string' => $obj['string'], 'imported_count' => $return_count, 'messages' => $return_msg]);
echo json_encode(['status' => 'created', 'type' => $obj['type'], 'string' => $obj['string'], 'imported_count' => $return_count, 'messages' => $return_msg ]);
}
}
// API function to check if a callsign is in the logbook already
function logbook_check_callsign()
{
function logbook_check_callsign() {
header('Content-type: application/json');
$this->load->model('api_model');
@ -276,29 +276,29 @@ class API extends CI_Controller
// Decode JSON and store
$obj = json_decode(file_get_contents("php://input"), true);
if ($obj === NULL) {
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
return;
}
if (!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
return;
}
if (!isset($obj['logbook_public_slug']) || !isset($obj['callsign'])) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing fields"]);
if(!isset($obj['logbook_public_slug']) || !isset($obj['callsign'])) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing fields"]);
return;
}
if ($obj['logbook_public_slug'] != "" && $obj['callsign'] != "") {
if($obj['logbook_public_slug'] != "" && $obj['callsign'] != "") {
$logbook_slug = $obj['logbook_public_slug'];
$callsign = $obj['callsign'];
// If $obj['band'] exists
if (isset($obj['band'])) {
if(isset($obj['band'])) {
$band = $obj['band'];
} else {
$band = null;
@ -306,12 +306,13 @@ class API extends CI_Controller
$this->load->model('logbooks_model');
if ($this->logbooks_model->public_slug_exists($logbook_slug)) {
if($this->logbooks_model->public_slug_exists($logbook_slug)) {
$logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($logbook_slug);
if ($logbook_id != false) {
if($logbook_id != false)
{
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
if (!$logbooks_locations_array) {
// Logbook not found
http_response_code(404);
@ -321,7 +322,7 @@ class API extends CI_Controller
} else {
// Logbook not found
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => $logbook_slug . " has no associated station locations"]);
echo json_encode(['status' => 'failed', 'reason' => $logbook_slug." has no associated station locations"]);
die();
}
// Search Logbook for callsign
@ -330,7 +331,8 @@ class API extends CI_Controller
$result = $this->logbook_model->check_if_callsign_worked_in_logbook($callsign, $logbooks_locations_array, $band);
http_response_code(201);
if ($result > 0) {
if($result > 0)
{
echo json_encode(['callsign' => $callsign, 'result' => 'Found']);
} else {
echo json_encode(['callsign' => $callsign, 'result' => 'Not Found']);
@ -341,12 +343,13 @@ class API extends CI_Controller
echo json_encode(['status' => 'failed', 'reason' => "logbook not found"]);
die();
}
}
}
// API function to check if a grid is in the logbook already
function logbook_check_grid()
{
function logbook_check_grid() {
header('Content-type: application/json');
$this->load->model('api_model');
@ -354,27 +357,27 @@ class API extends CI_Controller
// Decode JSON and store
$obj = json_decode(file_get_contents("php://input"), true);
if ($obj === NULL) {
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]);
}
if (!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
}
if (!isset($obj['logbook_public_slug']) || !isset($obj['grid'])) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing fields"]);
if(!isset($obj['logbook_public_slug']) || !isset($obj['grid'])) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing fields"]);
return;
}
if ($obj['logbook_public_slug'] != "" && $obj['grid'] != "") {
if($obj['logbook_public_slug'] != "" && $obj['grid'] != "") {
$logbook_slug = $obj['logbook_public_slug'];
$grid = $obj['grid'];
// If $obj['band'] exists
if (isset($obj['band'])) {
if(isset($obj['band'])) {
$band = $obj['band'];
} else {
$band = null;
@ -382,12 +385,13 @@ class API extends CI_Controller
$this->load->model('logbooks_model');
if ($this->logbooks_model->public_slug_exists($logbook_slug)) {
if($this->logbooks_model->public_slug_exists($logbook_slug)) {
$logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($logbook_slug);
if ($logbook_id != false) {
if($logbook_id != false)
{
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
if (!$logbooks_locations_array) {
// Logbook not found
http_response_code(404);
@ -397,7 +401,7 @@ class API extends CI_Controller
} else {
// Logbook not found
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => $logbook_slug . " has no associated station locations"]);
echo json_encode(['status' => 'failed', 'reason' => $logbook_slug." has no associated station locations"]);
die();
}
// Search Logbook for callsign
@ -406,7 +410,8 @@ class API extends CI_Controller
$result = $this->logbook_model->check_if_grid_worked_in_logbook($grid, $logbooks_locations_array, $band);
http_response_code(201);
if ($result > 0) {
if($result > 0)
{
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Found']);
} else {
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Not Found']);
@ -417,7 +422,9 @@ class API extends CI_Controller
echo json_encode(['status' => 'failed', 'reason' => "logbook not found"]);
die();
}
}
}
@ -480,16 +487,16 @@ class API extends CI_Controller
return;
}
if (!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
return;
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
return;
}
if (!isset($obj['logbook_public_slug']) || !isset($obj['callsign'])) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing fields"]);
return;
if(!isset($obj['logbook_public_slug']) || !isset($obj['callsign'])) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing fields"]);
return;
}
// Load models
@ -516,9 +523,10 @@ class API extends CI_Controller
]
];
if ($this->logbooks_model->public_slug_exists($logbook_slug)) {
if($this->logbooks_model->public_slug_exists($logbook_slug)) {
$logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($logbook_slug);
if ($logbook_id != false) {
if($logbook_id != false)
{
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
@ -531,7 +539,7 @@ class API extends CI_Controller
} else {
// Logbook not found
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => $logbook_slug . " has no associated station locations"]);
echo json_encode(['status' => 'failed', 'reason' => $logbook_slug." has no associated station locations"]);
die();
}
@ -596,8 +604,7 @@ class API extends CI_Controller
/* ENDPOINT for Rig Control */
function radio()
{
function radio() {
header('Content-type: application/json');
$this->load->model('api_model');
@ -611,7 +618,7 @@ class API extends CI_Controller
// Decode JSON and store
$obj = json_decode(file_get_contents("php://input"), true);
if (!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
die();
@ -629,6 +636,7 @@ class API extends CI_Controller
$arr = array('status' => 'success');
echo json_encode($arr);
}
/*
@ -637,8 +645,7 @@ class API extends CI_Controller
*
*/
function statistics($key = null)
{
function statistics($key = null) {
header('Content-type: application/json');
$this->load->model('logbook_model');
@ -649,10 +656,10 @@ class API extends CI_Controller
http_response_code(201);
echo json_encode(['Today' => $data['todays_qsos'], 'total_qsos' => $data['total_qsos'], 'month_qsos' => $data['month_qsos'], 'year_qsos' => $data['year_qsos']]);
}
function lookup()
{
function lookup() {
// start benchmarking
$this->output->enable_profiler(TRUE);
/*
@ -672,9 +679,7 @@ class API extends CI_Controller
// Make sure users logged in
$this->load->model('user_model');
if (!$this->user_model->authorize($this->config->item('auth_mode'))) {
return;
}
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
$this->load->model("logbook_model");
@ -706,9 +711,9 @@ class API extends CI_Controller
* Handle POST data being sent to check lookups
*
*/
$raw_input = json_decode(file_get_contents("php://input"), true);
$raw_input = json_decode(file_get_contents("php://input"), true);
$lookup_callsign = strtoupper($raw_input['callsign']);
$lookup_callsign = strtoupper($raw_input['callsign']);
/*
@ -716,7 +721,7 @@ class API extends CI_Controller
* Handle Callsign field
*
*/
$return['callsign'] = $lookup_callsign;
$return['callsign'] = $lookup_callsign;
/*
*
@ -724,63 +729,65 @@ class API extends CI_Controller
*
*/
$callsign_dxcc_lookup = $this->logbook_model->dxcc_lookup($lookup_callsign, $date);
$callsign_dxcc_lookup = $this->logbook_model->dxcc_lookup($lookup_callsign, $date);
$last_slash_pos = strrpos($lookup_callsign, '/');
$last_slash_pos = strrpos($lookup_callsign, '/');
if (isset($last_slash_pos) && $last_slash_pos > 4) {
$suffix_slash = $last_slash_pos === false ? $lookup_callsign : substr($lookup_callsign, $last_slash_pos + 1);
switch ($suffix_slash) {
case "P":
$suffix_slash_item = "Portable";
break;
case "M":
$suffix_slash_item = "Mobile";
case "MM":
$suffix_slash_item = "Maritime Mobile";
break;
default:
// If its not one of the above suffix slashes its likely dxcc
$ans2 = $this->logbook_model->dxcc_lookup($suffix_slash, $date);
$suffix_slash_item = null;
if(isset($last_slash_pos) && $last_slash_pos > 4) {
$suffix_slash = $last_slash_pos === false ? $lookup_callsign : substr($lookup_callsign, $last_slash_pos + 1);
switch ($suffix_slash) {
case "P":
$suffix_slash_item = "Portable";
break;
case "M":
$suffix_slash_item = "Mobile";
case "MM":
$suffix_slash_item = "Maritime Mobile";
break;
default:
// If its not one of the above suffix slashes its likely dxcc
$ans2 = $this->logbook_model->dxcc_lookup($suffix_slash, $date);
$suffix_slash_item = null;
}
$return['suffix_slash'] = $suffix_slash_item;
}
$return['suffix_slash'] = $suffix_slash_item;
}
// If the final slash is a DXCC then find it!
if (isset($ans2['call'])) {
$return['dxcc'] = $ans2['entity'];
$return['dxcc_lat'] = $ans2['lat'];
$return['dxcc_long'] = $ans2['long'];
$return['dxcc_cqz'] = $ans2['cqz'];
} else {
$return['dxcc'] = $callsign_dxcc_lookup['entity'];
$return['dxcc_lat'] = $callsign_dxcc_lookup['lat'];
$return['dxcc_long'] = $callsign_dxcc_lookup['long'];
$return['dxcc_cqz'] = $callsign_dxcc_lookup['cqz'];
}
// If the final slash is a DXCC then find it!
if (isset($ans2['call'])) {
$return['dxcc'] = $ans2['entity'];
$return['dxcc_lat'] = $ans2['lat'];
$return['dxcc_long'] = $ans2['long'];
$return['dxcc_cqz'] = $ans2['cqz'];
} else {
$return['dxcc'] = $callsign_dxcc_lookup['entity'];
$return['dxcc_lat'] = $callsign_dxcc_lookup['lat'];
$return['dxcc_long'] = $callsign_dxcc_lookup['long'];
$return['dxcc_cqz'] = $callsign_dxcc_lookup['cqz'];
}
/*
*
* Pool any local data we have for a callsign
*
*/
$call_lookup_results = $this->logbook_model->call_lookup_result($lookup_callsign);
$call_lookup_results = $this->logbook_model->call_lookup_result($lookup_callsign);
if ($call_lookup_results != null) {
$return['name'] = $call_lookup_results->COL_NAME;
$return['gridsquare'] = $call_lookup_results->COL_GRIDSQUARE;
$return['location'] = $call_lookup_results->COL_QTH;
$return['iota_ref'] = $call_lookup_results->COL_IOTA;
$return['qsl_manager'] = $call_lookup_results->COL_QSL_VIA;
$return['state'] = $call_lookup_results->COL_STATE;
$return['us_county'] = $call_lookup_results->COL_CNTY;
if($call_lookup_results != null)
{
$return['name'] = $call_lookup_results->COL_NAME;
$return['gridsquare'] = $call_lookup_results->COL_GRIDSQUARE;
$return['location'] = $call_lookup_results->COL_QTH;
$return['iota_ref'] = $call_lookup_results->COL_IOTA;
$return['qsl_manager'] = $call_lookup_results->COL_QSL_VIA;
$return['state'] = $call_lookup_results->COL_STATE;
$return['us_county'] = $call_lookup_results->COL_CNTY;
if ($return['gridsquare'] != "") {
$return['latlng'] = $this->qralatlng($return['gridsquare']);
}
if ($return['gridsquare'] != "") {
$return['latlng'] = $this->qralatlng($return['gridsquare']);
}
}
/*
@ -802,147 +809,9 @@ class API extends CI_Controller
$this->output->enable_profiler(FALSE);
}
function qralatlng($qra)
{
function qralatlng($qra) {
$this->load->library('Qra');
$latlng = $this->qra->qra2latlong($qra);
return $latlng;
}
/**
* API endpoint to get recent QSOs from a public logbook
*
* @api GET /api/recent_qsos/{public_slug}/{limit}
*
* @param string public_slug Required. Public slug identifier for the logbook
* @param int limit Optional. Number of QSOs to return (default: 10, max: 50)
*
* @return json Returns JSON array with recent QSO data or error message
*
* @throws 404 Not Found - Logbook not found or empty logbook
* @throws 400 Bad Request - Invalid limit parameter
*
* @example
* Request: GET /api/recent_qsos/my-public-logbook/5
*
* Response:
* {
* "qsos": [
* {
* "date": "2024-01-15",
* "time": "14:30",
* "callsign": "W1AW",
* "mode": "SSB",
* "band": "20M",
* "rst_sent": "59",
* "rst_rcvd": "59"
* }
* ],
* "count": 1,
* "logbook_slug": "my-public-logbook"
* }
*/
function recent_qsos($public_slug = null, $limit = 10)
{
header('Content-type: application/json');
// Validate and sanitize $limit
if (!is_numeric($limit)) {
$limit = 10; // Default to 10 if not numeric
} else {
$limit = intval($limit);
if ($limit < 1) {
$limit = 1; // Minimum limit of 1
} elseif ($limit > 50) {
$limit = 50; // Maximum limit of 50
}
}
if ($public_slug == null) {
http_response_code(400);
echo json_encode(['status' => 'failed', 'reason' => 'missing public_slug parameter']);
return;
}
$this->load->model('logbooks_model');
$this->load->model('logbook_model');
if ($this->logbooks_model->public_slug_exists($public_slug)) {
$logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($public_slug);
if ($logbook_id != false) {
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
if (!$logbooks_locations_array) {
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => 'Empty Logbook']);
return;
}
// Get recent QSOs using existing method
$recent_qsos_query = $this->logbook_model->get_last_qsos($limit, $logbooks_locations_array);
if ($recent_qsos_query == null) {
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => 'No QSOs found']);
return;
}
// Format the data for JSON response
$qsos = array();
foreach ($recent_qsos_query->result() as $row) {
$qso = array(
'date' => date('Y-m-d', strtotime($row->COL_TIME_ON)),
'time' => date('H:i', strtotime($row->COL_TIME_ON)),
'callsign' => strtoupper($row->COL_CALL),
'mode' => $row->COL_SUBMODE ? $row->COL_SUBMODE : $row->COL_MODE,
'band' => $row->COL_SAT_NAME ? $row->COL_SAT_NAME : $row->COL_BAND,
'rst_sent' => $row->COL_RST_SENT,
'rst_rcvd' => $row->COL_RST_RCVD
);
// Add optional fields if they exist
if ($row->COL_STX_STRING) {
$qso['stx_string'] = $row->COL_STX_STRING;
}
if ($row->COL_SRX_STRING) {
$qso['srx_string'] = $row->COL_SRX_STRING;
}
if ($row->COL_GRIDSQUARE) {
$qso['gridsquare'] = $row->COL_GRIDSQUARE;
}
if ($row->COL_QTH) {
$qso['qth'] = $row->COL_QTH;
}
if ($row->COL_NAME) {
$qso['name'] = $row->COL_NAME;
}
$dxcc = $this->logbook_model->check_dxcc_table(strtoupper(trim(strtoupper($row->COL_CALL))), $row->COL_TIME_ON);
if (empty($dxcc[0])) {
$dxcc_id = null;
} else {
$qso['country'] = $dxcc[1];
$qso['lat'] = $dxcc[4];
$qso['long'] = $dxcc[5];
}
$qsos[] = $qso;
}
http_response_code(200);
echo json_encode([
'qsos' => $qsos,
'count' => count($qsos),
'logbook_slug' => $public_slug
], JSON_PRETTY_PRINT);
} else {
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => $public_slug . ' has no associated station locations']);
}
} else {
http_response_code(404);
echo json_encode(['status' => 'failed', 'reason' => 'logbook not found']);
}
}
}

查看文件

@ -22,49 +22,18 @@ class Components extends CI_Controller {
$data['user_hamsat_key']='';
}
$url = 'https://hams.at/api/alerts/upcoming';
// Initialize error state
$data['error'] = false;
$data['error_message'] = '';
try {
if ($data['user_hamsat_key'] ?? '' != '') {
$options = array(
'http' => array(
'method' => 'GET',
'header' => "Authorization: Bearer ".$data['user_hamsat_key']."\r\n",
'timeout' => 10 // Add timeout to prevent long hangs
)
);
$context = stream_context_create($options);
$json = @file_get_contents($url, false, $context);
} else {
$json = @file_get_contents($url, false, stream_context_create(array(
'http' => array('timeout' => 10)
)));
}
// Check if the request failed
if ($json === false) {
$data['error'] = true;
$data['error_message'] = 'Unable to connect to hams.at service. Please check your internet connection or try again later.';
$data['rovedata'] = null;
} else {
$decoded_data = json_decode($json, true);
if ($decoded_data === null && json_last_error() !== JSON_ERROR_NONE) {
$data['error'] = true;
$data['error_message'] = 'Invalid response received from hams.at service. Please try again later.';
$data['rovedata'] = null;
} else {
$data['rovedata'] = $decoded_data;
}
}
} catch (Exception $e) {
$data['error'] = true;
$data['error_message'] = 'An error occurred while fetching satellite data. Please try again later.';
$data['rovedata'] = null;
if ($data['user_hamsat_key'] ?? '' != '') {
$options = array(
'http' => array(
'method' => 'GET',
'header' => "Authorization: Bearer ".$data['user_hamsat_key']."\r\n"
)
);
$context = stream_context_create($options);
$json = file_get_contents($url, false, $context);
} else {
$json = file_get_contents($url);
}
$hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'workable'))->result();
if (count($hkey_opt)>0) {
$data['user_hamsat_workable_only'] = $hkey_opt[0]->option_value;
@ -73,6 +42,7 @@ class Components extends CI_Controller {
}
$this->load->model('stations');
$data['rovedata'] = json_decode($json, true);
$data['gridsquare'] = strtoupper($this->stations->find_gridsquare());
// load view

查看文件

@ -3,16 +3,6 @@
class Dashboard extends CI_Controller
{
public function __construct()
{
parent::__construct();
// Load common models that are used across multiple methods
$this->load->model('user_model');
$this->load->model('logbook_model');
$this->load->model('logbooks_model');
}
public function index()
{
// If environment is set to development then show the debug toolbar
@ -23,6 +13,10 @@ class Dashboard extends CI_Controller
// Load language files
$this->lang->load('lotw');
// Database connections
$this->load->model('logbook_model');
$this->load->model('user_model');
// LoTW infos
$this->load->model('LotwCert');
@ -37,6 +31,7 @@ class Dashboard extends CI_Controller
redirect('user/login');
}
$this->load->model('logbooks_model');
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
/*
@ -68,11 +63,9 @@ class Dashboard extends CI_Controller
$this->load->model('stations');
$this->load->model('setup_model');
// Use consolidated setup counts instead of 3 separate queries
$setup_counts = $this->setup_model->getAllSetupCounts();
$data['countryCount'] = $setup_counts['country_count'];
$data['logbookCount'] = $setup_counts['logbook_count'];
$data['locationCount'] = $setup_counts['location_count'];
$data['countryCount'] = $this->setup_model->getCountryCount();
$data['logbookCount'] = $this->setup_model->getLogbookCount();
$data['locationCount'] = $this->setup_model->getLocationCount();
$data['current_active'] = $this->stations->find_active();
@ -92,21 +85,19 @@ class Dashboard extends CI_Controller
$data['radio_status'] = $this->cat->recent_status();
// Store info - Use consolidated query for QSO statistics
$qso_stats = $this->logbook_model->get_qso_statistics_consolidated($logbooks_locations_array);
$data['todays_qsos'] = $qso_stats['todays_qsos'];
$data['total_qsos'] = $qso_stats['total_qsos'];
$data['month_qsos'] = $qso_stats['month_qsos'];
$data['year_qsos'] = $qso_stats['year_qsos'];
// Store info
$data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array);
$data['total_qsos'] = $this->logbook_model->total_qsos($logbooks_locations_array);
$data['month_qsos'] = $this->logbook_model->month_qsos($logbooks_locations_array);
$data['year_qsos'] = $this->logbook_model->year_qsos($logbooks_locations_array);
// Use consolidated countries statistics instead of separate queries
$countries_stats = $this->logbook_model->get_countries_statistics_consolidated($logbooks_locations_array);
$data['total_countries'] = $countries_stats['Countries_Worked'];
$data['total_countries_confirmed_paper'] = $countries_stats['Countries_Worked_QSL'];
$data['total_countries_confirmed_eqsl'] = $countries_stats['Countries_Worked_EQSL'];
$data['total_countries_confirmed_lotw'] = $countries_stats['Countries_Worked_LOTW'];
$current_countries = $countries_stats['Countries_Current'];
// Load Countries Breakdown data into array
$CountriesBreakdown = $this->logbook_model->total_countries_confirmed($logbooks_locations_array);
$data['total_countries'] = $CountriesBreakdown['Countries_Worked'];
$data['total_countries_confirmed_paper'] = $CountriesBreakdown['Countries_Worked_QSL'];
$data['total_countries_confirmed_eqsl'] = $CountriesBreakdown['Countries_Worked_EQSL'];
$data['total_countries_confirmed_lotw'] = $CountriesBreakdown['Countries_Worked_LOTW'];
$data['dashboard_upcoming_dx_card'] = false;
$data['dashboard_qslcard_card'] = false;
@ -116,23 +107,53 @@ class Dashboard extends CI_Controller
$dashboard_options = $this->user_options_model->get_options('dashboard')->result();
// Optimize options processing - convert to associative array for O(1) lookup
$options_map = array();
foreach ($dashboard_options as $item) {
$options_map[$item->option_name][$item->option_key] = $item->option_value;
}
$option_name = $item->option_name;
$option_key = $item->option_key;
$option_value = $item->option_value;
if ($option_name == 'dashboard_upcoming_dx_card' && $option_key == 'enabled') {
if($option_value == 'true') {
$data['dashboard_upcoming_dx_card'] = true;
} else {
$data['dashboard_upcoming_dx_card'] = false;
}
}
// Quick lookups instead of nested loops
$data['dashboard_upcoming_dx_card'] = isset($options_map['dashboard_upcoming_dx_card']['enabled']) && $options_map['dashboard_upcoming_dx_card']['enabled'] == 'true';
$data['dashboard_qslcard_card'] = isset($options_map['dashboard_qslcards_card']['enabled']) && $options_map['dashboard_qslcards_card']['enabled'] == 'true';
$data['dashboard_eqslcard_card'] = isset($options_map['dashboard_eqslcards_card']['enabled']) && $options_map['dashboard_eqslcards_card']['enabled'] == 'true';
$data['dashboard_lotw_card'] = isset($options_map['dashboard_lotw_card']['enabled']) && $options_map['dashboard_lotw_card']['enabled'] == 'true';
$data['dashboard_vuccgrids_card'] = isset($options_map['dashboard_vuccgrids_card']['enabled']) && $options_map['dashboard_vuccgrids_card']['enabled'] == 'true';
if ($option_name == 'dashboard_qslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_qslcard_card'] = true;
} else {
$data['dashboard_qslcard_card'] = false;
}
}
// Only load VUCC data if the card is actually enabled
if ($data['dashboard_vuccgrids_card']) {
$data['vucc'] = $this->vucc->fetchVuccSummary();
$data['vuccSAT'] = $this->vucc->fetchVuccSummary('SAT');
if ($option_name == 'dashboard_eqslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_eqslcard_card'] = true;
} else {
$data['dashboard_eqslcard_card'] = false;
}
}
if ($option_name == 'dashboard_lotw_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_lotw_card'] = true;
} else {
$data['dashboard_lotw_card'] = false;
}
}
if ($option_name == 'dashboard_vuccgrids_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_vuccgrids_card'] = true;
$data['vucc'] = $this->vucc->fetchVuccSummary();
$data['vuccSAT'] = $this->vucc->fetchVuccSummary('SAT');
} else {
$data['dashboard_vuccgrids_card'] = false;
}
}
}
@ -164,10 +185,12 @@ class Dashboard extends CI_Controller
$data['page_title'] = "Dashboard";
// Optimize DXCC calculation - get count directly instead of loading all records
$this->load->model('dxcc');
$total_dxcc_count = $this->dxcc->get_total_dxcc_count();
$data['total_countries_needed'] = $total_dxcc_count - $current_countries;
$dxcc = $this->dxcc->list_current();
$current = $this->logbook_model->total_countries_current($logbooks_locations_array);
$data['total_countries_needed'] = count($dxcc->result()) - $current;
$this->load->view('interface_assets/header', $data);
$this->load->view('dashboard/index');
@ -176,23 +199,30 @@ class Dashboard extends CI_Controller
}
public function todays_qso_component() {
$this->load->model('user_model');
if ($this->user_model->validate_session() == 0) {
// User is not logged in
return;
} else {
$this->load->model('logbook_model');
$this->load->model('logbooks_model');
}
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
// Use consolidated query instead of individual todays_qsos call
$qso_stats = $this->logbook_model->get_qso_statistics_consolidated($logbooks_locations_array);
$data['todays_qsos'] = $qso_stats['todays_qsos'];
$data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array);
$this->load->view('components/dashboard_todays_qsos', $data);
}
public function logbook_display_component() {
$this->load->model('user_model');
if ($this->user_model->validate_session() == 0) {
// User is not logged in
return;
} else {
$this->load->model('logbook_model');
$this->load->model('logbooks_model');
}
// Get Logbook Locations

查看文件

@ -826,72 +826,18 @@ class Logbook extends CI_Controller
$html .= "</div>";
return $html;
} else {
// if session data callbook_type is qrz
if ($this->session->userdata('callbook_type') == "QRZ") {
// Lookup using QRZ
$this->load->library('qrz');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
if (empty($callsign['callsign']['callsign'])) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
}
// Use the loadCallBook method from the model which handles fallback logic
$this->load->model('logbook_model');
$callsign['callsign'] = $this->logbook_model->loadCallBook($id, $this->config->item('use_fullname'));
if (!empty($callsign['callsign'])) {
if (isset($callsign['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']);
$callsign['callsign']['dxcc_name'] = $entity['name'];
}
} elseif ($this->session->userdata('callbook_type') == "HamQTH") {
// Load the HamQTH library
$this->load->library('hamqth');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}
$callsign['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
// If HamQTH session has expired, start a new session and retry the search.
if ($callsign['callsign']['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
}
if (isset($data['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
$callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'], 0, 4)), 0, $this->session->userdata('user_default_band'));
}
if (isset($callsign['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']);
$callsign['callsign']['dxcc_name'] = $entity['name'];
}
if (isset($callsign['callsign']['error'])) {
$callsign['error'] = $callsign['callsign']['error'];
}
} else {
// No callbook type set, return error message
$callsign['error'] = 'Online callbook not configured. Go to <a href="' . site_url('user/edit/' . $this->session->userdata('user_id')) . '" class="alert-link">Account Settings</a> and select either QRZ or HamQTH in the "Callbook" section.';
// No callbook type set, return error message with better guidance
$callsign['error'] = 'Online callbook not configured. You can configure QRZ or HamQTH credentials either in <a href="' . site_url('user/edit/' . $this->session->userdata('user_id')) . '" class="alert-link">Account Settings</a> or in the config.php file.';
}
if (isset($callsign['callsign']['gridsquare'])) {
@ -943,70 +889,18 @@ class Logbook extends CI_Controller
$this->load->view('view_log/partial/log_ajax.php', $data);
} else {
// if session data callbook_type is qrz
if ($this->session->userdata('callbook_type') == "QRZ") {
// Lookup using QRZ
$this->load->library('qrz');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
if (empty($data['callsign']['callsign'])) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
}
// Use the loadCallBook method from the model which handles fallback logic
$this->load->model('logbook_model');
$data['callsign'] = $this->logbook_model->loadCallBook($fixedid, $this->config->item('use_fullname'));
if (!empty($data['callsign'])) {
if (isset($data['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($data['callsign']['dxcc']);
$data['callsign']['dxcc_name'] = $entity['name'];
}
if (isset($data['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'], 0, 4)), 0, $this->session->userdata('user_default_band'));
}
} elseif ($this->session->userdata('callbook_type') == "HamQTH") {
// Load the HamQTH library
$this->load->library('hamqth');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}
$data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key'));
// If HamQTH session has expired, start a new session and retry the search.
if ($data['callsign']['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key'));
}
if (isset($data['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'], 0, 4)), 0, $this->session->userdata('user_default_band'));
}
if (isset($data['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($data['callsign']['dxcc']);
$data['callsign']['dxcc_name'] = $entity['name'];
}
if (isset($data['callsign']['error'])) {
$data['error'] = $data['callsign']['error'];
}

查看文件

@ -131,18 +131,8 @@ class Logbooks extends CI_Controller {
public function save_publicsearch() {
$this->load->model('logbooks_model');
// Handle checkbox - if not checked, it won't be sent, so default to 0
$public_search = $this->input->post('public_search') ? 1 : 0;
$returndata = $this->logbooks_model->save_public_search($public_search, $this->input->post('logbook_id'));
echo "<div class=\"alert alert-success\" role=\"alert\">Public Search Settings Saved</div>";
}
public function save_publicradiostatus() {
$this->load->model('logbooks_model');
// Handle checkbox - if not checked, it won't be sent, so default to 0
$public_radio_status = $this->input->post('public_radio_status') ? 1 : 0;
$returndata = $this->logbooks_model->save_public_radio_status($public_radio_status, $this->input->post('logbook_id'));
echo "<div class=\"alert alert-success\" role=\"alert\">Public Radio Status Settings Saved</div>";
$returndata = $this->logbooks_model->save_public_search($this->input->post('public_search'), $this->input->post('logbook_id'));
echo "<div class=\"alert alert-success\" role=\"alert\">Public Search Settings Saved</div>";
}
public function save_publicslug() {

查看文件

@ -378,31 +378,6 @@ class Lotw extends CI_Controller {
redirect('/lotw/');
}
/*
|--------------------------------------------------------------------------
| Function: toggle_archive_cert
|--------------------------------------------------------------------------
|
| Toggles the archive status of a LoTW certificate
|
*/
public function toggle_archive_cert($cert_id) {
$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('LotwCert');
$result = $this->LotwCert->toggle_archive_certificate($this->session->userdata('user_id'), $cert_id);
if($result['archived']) {
$this->session->set_flashdata('Success', 'Certificate Archived.');
} else {
$this->session->set_flashdata('Success', 'Certificate Unarchived.');
}
redirect('/lotw/');
}
/*
|--------------------------------------------------------------------------
@ -1177,19 +1152,19 @@ class Lotw extends CI_Controller {
}
case "JT65":
if ($submode == "JT65A") {
return "JT65";
return "JT65A";
break;
} elseif ($submode == "JT65B") {
return "JT65";
return "JT65B";
break;
} elseif ($submode == "JT65B2") {
return "JT65";
return "JT65B2";
break;
} elseif ($submode == "JT65C") {
return "JT65";
return "JT65C";
break;
} elseif ($submode == "JT65C2") {
return "JT65";
return "JT65C2";
break;
} else {
return "JT65";
@ -1197,25 +1172,25 @@ class Lotw extends CI_Controller {
}
case "JT4":
if ($submode == "JT4A") {
return "JT4";
return "JT4A";
break;
} elseif ($submode == "JT4B") {
return "JT4";
return "JT4B";
break;
} elseif ($submode == "JT4C") {
return "JT4";
return "JT4C";
break;
} elseif ($submode == "JT4D") {
return "JT4";
return "JT4D";
break;
} elseif ($submode == "JT4E") {
return "JT4";
return "JT4E";
break;
} elseif ($submode == "JT4F") {
return "JT4";
return "JT4F";
break;
} elseif ($submode == "JT4G") {
return "JT4";
return "JT4G";
break;
} else {
return "JT4";
@ -1223,55 +1198,55 @@ class Lotw extends CI_Controller {
}
case "JT9":
if ($submode == "JT9-1") {
return "JT9";
return "JT9-1";
break;
} elseif ($submode == "JT9-10") {
return "JT9";
return "JT9-10";
break;
} elseif ($submode == "JT9-2") {
return "JT9";
return "JT9-2";
break;
} elseif ($submode == "JT9-30") {
return "JT9";
return "JT9-30";
break;
} elseif ($submode == "JT9-5") {
return "JT9";
return "JT9-5";
break;
} elseif ($submode == "JT9A") {
return "JT9";
return "JT9A";
break;
} elseif ($submode == "JT9B") {
return "JT9";
return "JT9B";
break;
} elseif ($submode == "JT9C") {
return "JT9";
return "JT9C";
break;
} elseif ($submode == "JT9D") {
return "JT9";
return "JT9D";
break;
} elseif ($submode == "JT9E") {
return "JT9";
return "JT9E";
break;
} elseif ($submode == "JT9E FAST") {
return "JT9";
return "JT9E FAST";
break;
} elseif ($submode == "JT9F") {
return "JT9";
return "JT9F";
break;
} elseif ($submode == "JT9F FAST") {
return "JT9";
return "JT9F FAST";
break;
} elseif ($submode == "JT9G") {
return "JT9G";
break;
} elseif ($submode == "JT9G FAST") {
return "JT9";
return "JT9G FAST";
break;
} elseif ($submode == "JT9H") {
return "JT9";
return "JT9H";
break;
} elseif ($submode == "JT9H FAST") {
return "JT9";
return "JT9H FAST";
break;
} else {
return "JT9";
@ -1279,19 +1254,19 @@ class Lotw extends CI_Controller {
}
case "QRA64":
if ($submode == "QRA64A") {
return "QRA64";
return "QRA64A";
break;
} elseif ($submode == "QRA64B") {
return "QRA64";
return "QRA64B";
break;
} elseif ($submode == "QRA64C") {
return "QRA64";
return "QRA64C";
break;
} elseif ($submode == "QRA64D") {
return "QRA64";
return "QRA64D";
break;
} elseif ($submode == "QRA64E") {
return "QRA64";
return "QRA64E";
break;
} else {
return "QRA64";
@ -1299,10 +1274,10 @@ class Lotw extends CI_Controller {
}
case "ISCAT":
if ($submode == "ISCAT-A") {
return "ISCAT";
return "ISCAT-A";
break;
} elseif ($submode == "ISCAT-B") {
return "ISCAT";
return "ISCAT-B";
break;
} else {
return "ISCAT";
@ -1310,25 +1285,25 @@ class Lotw extends CI_Controller {
}
case "OLIVIA":
if ($submode == "OLIVIA 16/1000") {
return "OLIVIA";
return "OLIVIA 16/1000";
break;
} elseif ($submode == "OLIVIA 16/500") {
return "OLIVIA";
return "OLIVIA 16/500";
break;
} elseif ($submode == "OLIVIA 32/1000") {
return "OLIVIA";
return "OLIVIA 32/1000";
break;
} elseif ($submode == "OLIVIA 4/125") {
return "OLIVIA";
return "OLIVIA 4/125";
break;
} elseif ($submode == "OLIVIA 4/250") {
return "OLIVIA";
return "OLIVIA 4/250";
break;
} elseif ($submode == "OLIVIA 8/250") {
return "OLIVIA";
return "OLIVIA 8/250";
break;
} elseif ($submode == "OLIVIA 8/500") {
return "OLIVIA";
return "OLIVIA 8/500";
break;
} else {
return "OLIVIA";
@ -1336,10 +1311,10 @@ class Lotw extends CI_Controller {
}
case "OPERA":
if ($submode == "OPERA-BEACON") {
return "OPERA";
return "OPERA-BEACON";
break;
} elseif ($submode == "OPERA-QSO") {
return "OPERA";
return "OPERA-QSO";
break;
} else {
return "OPERA";
@ -1347,13 +1322,13 @@ class Lotw extends CI_Controller {
}
case "ROS":
if ($submode == "ROS-EME") {
return "ROS";
return "ROS-EME";
break;
} elseif ($submode == "ROS-HF") {
return "ROS";
return "ROS-HF";
break;
} elseif ($submode == "ROS-MF") {
return "ROS";
return "ROS-MF";
break;
} else {
return "ROS";
@ -1361,19 +1336,19 @@ class Lotw extends CI_Controller {
}
case "HELL":
if ($submode == "FMHELL") {
return "HELL";
return "FMHELL";
break;
} elseif ($submode == "FSKHELL") {
return "HELL";
return "FSKHELL";
break;
} elseif ($submode == "HELL80") {
return "HELL";
return "HELL80";
break;
} elseif ($submode == "HFSK") {
return "HFSK";
break;
} elseif ($submode == "PSKHELL") {
return "HELL";
return "PSKHELL";
break;
} else {
return "HELL";
@ -1381,10 +1356,10 @@ class Lotw extends CI_Controller {
}
case "DOMINO":
if ($submode == "DOMINOEX") {
return "DOMINO";
return "DOMINOEX";
break;
} elseif ($submode == "DOMINOF") {
return "DOMINO";
return "DOMINOF";
break;
} else {
return "DOMINO";
@ -1392,10 +1367,10 @@ class Lotw extends CI_Controller {
}
case "CHIP":
if ($submode == "CHIP128") {
return "CHIP";
return "CHIP128";
break;
} elseif ($submode == "CHIP64") {
return "CHIP";
return "CHIP64";
break;
} else {
return "CHIP";
@ -1417,7 +1392,7 @@ class Lotw extends CI_Controller {
}
case "PAX":
if ($submode == "PAX2") {
return "PAX";
return "PAX2";
break;
} else {
return "PAX";
@ -1444,10 +1419,10 @@ class Lotw extends CI_Controller {
}
case "SSB":
if ($submode == "LSB") {
return "SSB";
return "LSB";
break;
} elseif ($submode == "USB") {
return "SSB";
return "USB";
break;
} else {
return "SSB";
@ -1455,7 +1430,7 @@ class Lotw extends CI_Controller {
}
case "RTTY":
if ($submode == "ASCI") {
return "RTTY";
return "ASCI";
break;
} else {
return "RTTY";
@ -1463,7 +1438,7 @@ class Lotw extends CI_Controller {
}
case "CW":
if ($submode == "PCW") {
return "CW";
return "PCW";
break;
} else {
return "CW";

查看文件

@ -1,58 +0,0 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Mostworked extends CI_Controller {
function __construct()
{
parent::__construct();
$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'); }
// Load language files
$this->lang->load('most_worked');
}
public function index()
{
// Check if users logged in
if ($this->user_model->validate_session() == 0) {
// user is not logged in
redirect('user/login');
}
$this->load->model('mostworked_model');
$this->load->model('logbooks_model');
// Get filter parameters
$filters = array(
'band' => $this->input->post('band') ?: 'all',
'mode' => $this->input->post('mode') ?: 'all',
'satellite' => $this->input->post('satellite') ?: 'all',
'fromdate' => $this->input->post('fromdate') ?: '',
'todate' => $this->input->post('todate') ?: '',
'min_qsos' => $this->input->post('min_qsos') ?: 5
);
// Get active station logbook
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if (!$logbooks_locations_array) {
$data['mostworked_callsigns'] = array();
} else {
$data['mostworked_callsigns'] = $this->mostworked_model->get_most_worked_callsigns($filters);
}
// Get filter dropdown data
$data['bands'] = $this->mostworked_model->get_bands();
$data['modes'] = $this->mostworked_model->get_modes();
$data['satellites'] = $this->mostworked_model->get_satellites();
$data['filters'] = $filters;
$data['page_title'] = "Most Worked Callsigns";
$this->load->view('interface_assets/header', $data);
$this->load->view('mostworked/index', $data);
$this->load->view('interface_assets/footer');
}
}

查看文件

@ -83,42 +83,44 @@ class Options extends CI_Controller {
}
else
{
// Track if any updates were successful
$any_update_successful = FALSE;
// Update theme choice within the options system
$theme_update_status = $this->optionslib->update('theme', $this->input->post('theme'), 'yes');
// If theme update is complete set a flashsession with a success note
if($theme_update_status == TRUE) {
$any_update_successful = TRUE;
$this->session->set_flashdata('success', $this->lang->line('options_theme_changed_to').$this->input->post('theme'));
}
// Update global search choice within the options system
// Update theme choice within the options system
$search_update_status = $this->optionslib->update('global_search', $this->input->post('globalSearch'));
// If theme update is complete set a flashsession with a success note
if($search_update_status == TRUE) {
$any_update_successful = TRUE;
$this->session->set_flashdata('success', $this->lang->line('options_global_search_changed_to').$this->input->post('globalSearch'));
}
// Update dashboard banner within the options system
$dasboard_banner_update_status = $this->optionslib->update('dashboard_banner', $this->input->post('dashboardBanner'), 'yes');
// If dashboard banner update is complete set a flashsession with a success note
if($dasboard_banner_update_status == TRUE) {
$any_update_successful = TRUE;
$this->session->set_flashdata('success', $this->lang->line('options_dashboard_banner_changed_to').$this->input->post('dashboardBanner'));
}
// Update dashboard map within the options system
$dashboard_map_update_status = $this->optionslib->update('dashboard_map', $this->input->post('dashboardMap'), 'yes');
// If dashboard map update is complete set a flashsession with a success note
if($dashboard_map_update_status == TRUE) {
$any_update_successful = TRUE;
$this->session->set_flashdata('success', $this->lang->line('options_dashboard_map_changed_to').$this->input->post('dashboardMap'));
}
// Update logbook map within the options system
$logbook_map_update_status = $this->optionslib->update('logbook_map', $this->input->post('logbookMap'), 'yes');
if($logbook_map_update_status == TRUE) {
$any_update_successful = TRUE;
}
// If any update was successful, show a single success message
if($any_update_successful == TRUE) {
$this->session->set_flashdata('success', $this->lang->line('options_appearance_settings_saved'));
// If logbook map update is complete set a flashsession with a success note
if($logbook_map_update_status == TRUE) {
$this->session->set_flashdata('success', $this->lang->line('options_logbook_map_changed_to').$this->input->post('logbookMap'));
}
// Update Lang choice within the options system

查看文件

@ -324,7 +324,7 @@ class Qrz extends CI_Controller {
// Return the structured error array here too for consistency
return ['status' => 'error', 'message' => $error_message];
}
$url = 'https://logbook.qrz.com/api'; // Correct URL
$url = 'http://logbook.qrz.com/api'; // Correct URL
$post_data['KEY'] = $qrz_api_key; // Correct parameter
$post_data['ACTION'] = 'FETCH'; // Correct parameter
@ -336,35 +336,11 @@ class Qrz extends CI_Controller {
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); // Okay
curl_setopt( $ch, CURLOPT_HEADER, 0); // Correct - don't need response headers
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); // Correct - get response as string
curl_setopt( $ch, CURLOPT_TIMEOUT, 300); // 5 minute timeout
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 30); // 30 second connection timeout
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_BUFFERSIZE, 128000);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
$content = curl_exec($ch); // Get raw content
$curl_error = curl_error($ch); // Check for cURL errors
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); // Get HTTP response code
curl_close($ch);
if ($curl_error) { // Check for cURL level errors first
$error_message = "QRZ download cURL error: " . $curl_error;
log_message('error', $error_message . ' API Key used: ' . $qrz_api_key);
return ['status' => 'error', 'message' => $error_message];
}
if ($http_code !== 200) {
$error_message = "QRZ download HTTP error: HTTP " . $http_code;
log_message('error', $error_message . ' API Key used: ' . $qrz_api_key);
return ['status' => 'error', 'message' => $error_message];
}
if ($content === false || $content === '') { // Check if curl_exec failed or returned empty
$error_message = "QRZ download failed: No content received from QRZ.com.";
log_message('error', $error_message . ' API Key used: ' . $qrz_api_key);
return ['status' => 'error', 'message' => $error_message];
}
// Find the start of the ADIF data after "ADIF="
$adif_start_pos = strpos($content, 'ADIF=');
if ($adif_start_pos !== false) {
@ -412,6 +388,18 @@ class Qrz extends CI_Controller {
$content = substr($content, 0, $truncate_pos);
}
if ($curl_error) { // Check for cURL level errors first
$error_message = "QRZ download cURL error: " . $curl_error;
log_message('error', $error_message . ' API Key used: ' . $qrz_api_key);
return ['status' => 'error', 'message' => $error_message];
}
if ($content === false || $content === '') { // Check if curl_exec failed or returned empty
$error_message = "QRZ download failed: No content received from QRZ.com.";
log_message('error', $error_message . ' API Key used: ' . $qrz_api_key);
return ['status' => 'error', 'message' => $error_message];
}
// Check for QRZ API specific error messages
if (strpos($content, 'STATUS=FAIL') !== false || strpos($content, 'STATUS=AUTH') !== false) {
// Extract reason if possible, otherwise use full content
@ -458,7 +446,7 @@ class Qrz extends CI_Controller {
$config['qrz_rcvd_mark'] = 'Y';
ini_set('memory_limit', '-1');
set_time_limit(1800); // 30 minutes max execution time instead of unlimited
set_time_limit(0);
$this->load->library('adif_parser');
@ -487,24 +475,8 @@ class Qrz extends CI_Controller {
$batch_data = [];
$batch_size = 500; // Process 500 records at a time
$record_count = 0; // Initialize record counter
$max_records = 50000; // Safety limit to prevent runaway processing
$start_time = time(); // Track processing time
$max_processing_time = 1200; // 20 minutes max for processing
while ($record = $this->adif_parser->get_record()) {
$record_count++; // Increment counter for each record read
// Safety checks to prevent runaway processing
if ($record_count > $max_records) {
log_message('error', 'QRZ download: Exceeded maximum record limit of ' . $max_records . ' records. Processing stopped.');
break;
}
if ((time() - $start_time) > $max_processing_time) {
log_message('error', 'QRZ download: Exceeded maximum processing time of ' . $max_processing_time . ' seconds. Processing stopped at record ' . $record_count . '.');
break;
}
if ((!(isset($record['app_qrzlog_qsldate']))) || (!(isset($record['qso_date'])))) {
continue;
}
@ -537,12 +509,6 @@ class Qrz extends CI_Controller {
if (count($batch_data) >= $batch_size) {
$table .= $this->logbook_model->process_qrz_batch($batch_data);
$batch_data = []; // Reset batch
// Log progress every 1000 records to help monitor long-running processes
if ($record_count % 1000 == 0) {
$elapsed_time = time() - $start_time;
log_message('info', 'QRZ download progress: ' . $record_count . ' records processed in ' . $elapsed_time . ' seconds.');
}
}
}
@ -551,10 +517,6 @@ class Qrz extends CI_Controller {
$table .= $this->logbook_model->process_qrz_batch($batch_data);
}
// Log successful completion with statistics
$processing_time = time() - $start_time;
log_message('info', 'QRZ download completed successfully. Processed ' . $record_count . ' records in ' . $processing_time . ' seconds.');
if ($table != "") {
$data['tableheaders'] = $tableheaders;
$data['table'] = $table;

查看文件

@ -40,13 +40,6 @@ class QSO extends CI_Controller {
$data['bands'] = $this->bands->get_user_bands_for_qso_entry();
$data['user_default_band'] = $this->session->userdata('user_default_band');
$data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true);
// Set user's preferred date format
if($this->session->userdata('user_date_format')) {
$data['user_date_format'] = $this->session->userdata('user_date_format');
} else {
$data['user_date_format'] = $this->config->item('qso_date_format');
}
$this->load->library('form_validation');

查看文件

@ -83,8 +83,6 @@ class Station extends CI_Controller {
$this->load->view('station_profile/edit');
$this->load->view('interface_assets/footer');
} else {
// Get all the posted data from the form and save it to log file
if ($this->stations->edit() !== false) {
// [eQSL default msg] ADD to user options (option_type='eqsl_default_qslmsg'; option_name='key_station_id'; option_key=station_id; option_value=value) //
$eqsl_default_qslmsg = xss_clean($this->input->post('eqsl_default_qslmsg', true));

查看文件

@ -219,16 +219,6 @@ class Update extends CI_Controller {
$this->update_status("DONE");
}
public function get_status() {
$status_file = $this->make_update_path("status.html");
if (file_exists($status_file)) {
$content = file_get_contents($status_file);
echo $content;
} else {
echo "No status available";
}
}
public function update_status($done=""){
if ($done != "Downloading file"){
@ -244,16 +234,7 @@ class Update extends CI_Controller {
$html = $done."....<br/>";
}
$status_file = $this->make_update_path("status.html");
if (file_put_contents($status_file, $html) === FALSE) {
log_message('error', 'Failed to write status file: ' . $status_file);
// Try to create the directory if it doesn't exist
$dir = dirname($status_file);
if (!is_dir($dir)) {
mkdir($dir, 0755, true);
file_put_contents($status_file, $html);
}
}
file_put_contents($this->make_update_path("status.html"), $html);
}

查看文件

@ -20,9 +20,6 @@ class Visitor extends CI_Controller {
elseif($method == "satellites") {
$this->satellites($method);
}
elseif($method == "getGridsjs") {
$this->getGridsjs();
}
elseif($method == "search") {
$this->search($method);
}
@ -67,10 +64,6 @@ class Visitor extends CI_Controller {
{
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
// Get logbook details to check public settings
$logbook_details = $this->logbooks_model->logbook($logbook_id);
$data['logbook_settings'] = $logbook_details->row();
if (!$logbooks_locations_array) {
show_404('Empty Logbook');
@ -184,7 +177,6 @@ class Visitor extends CI_Controller {
$this->load->library('qra');
$slug = $this->security->xss_clean($this->uri->segment(3));
$offset = $this->security->xss_clean($this->uri->segment(4));
$this->load->model('logbooks_model');
$logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($slug);
@ -201,7 +193,7 @@ class Visitor extends CI_Controller {
show_404('Unknown Public Page.');
}
$qsos = $this->logbook_model->get_qsos('18', $offset, $logbooks_locations_array);
$qsos = $this->logbook_model->get_qsos('18', null, $logbooks_locations_array);
// [PLOT] ADD plot //
$plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result());
@ -234,88 +226,36 @@ class Visitor extends CI_Controller {
$this->load->model('gridmap_model');
$data['page_title'] = "Public Gridsquare Map";
$data['page_title'] = "Satellite Gridsquare Map";
// Get available bands for this logbook
$location_list = "'".implode("','",$logbooks_locations_array)."'";
// Get bands (excluding satellites)
$bands_query = $this->db->query(
"SELECT distinct LOWER(`COL_BAND`) as `COL_BAND` FROM `".$this->config->item('table_name')."` WHERE station_id in (" . $location_list . ") AND COL_PROP_MODE != \"SAT\" ORDER BY COL_BAND"
);
$bands = array();
foreach($bands_query->result() as $row){
array_push($bands, strtoupper($row->COL_BAND));
}
// Check if satellites exist and add SAT band
$sat_query = $this->db->query(
"SELECT distinct LOWER(`COL_PROP_MODE`) as `COL_PROP_MODE` FROM `".$this->config->item('table_name')."` WHERE station_id in (" . $location_list . ") AND COL_PROP_MODE = \"SAT\""
);
if ($sat_query->num_rows() > 0) {
array_push($bands, 'SAT');
}
// Get available satellites
$sats_query = $this->db->query(
"SELECT distinct col_sat_name FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_sat_name, '') <> '' ORDER BY col_sat_name"
);
$sats_available = array();
foreach($sats_query->result() as $row){
array_push($sats_available, $row->col_sat_name);
}
// Get available modes
$modes_query = $this->db->query(
"SELECT distinct col_mode FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_mode, '') <> '' ORDER BY col_mode"
);
$modes = array();
foreach($modes_query->result() as $row){
if (!in_array($row->col_mode, $modes)) {
array_push($modes, $row->col_mode);
}
}
// Get submodes as well
$submodes_query = $this->db->query(
"SELECT distinct col_submode FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_submode, '') <> '' ORDER BY col_submode"
);
foreach($submodes_query->result() as $row){
if (!in_array($row->col_submode, $modes)) {
array_push($modes, $row->col_submode);
}
}
asort($modes);
$data['bands'] = $bands;
$data['sats_available'] = $sats_available;
$data['modes'] = $modes;
// Set default values for visitor (no user preferences)
$data['user_default_band'] = 'All';
$data['user_default_confirmation'] = '';
// Generate initial grid data (default to showing all bands)
$default_band = 'All';
$default_mode = 'All';
$default_sat = 'All';
$array_grid_2char = array();
$array_grid_4char = array();
$array_grid_6char = array();
$array_confirmed_grid_2char = array();
$array_confirmed_grid_4char = array();
$array_confirmed_grid_6char = array();
// Get initial data for "All" bands
$query = $this->gridmap_model->get_band_confirmed($default_band, $default_mode, 'false', 'false', 'false', 'false', $default_sat, $logbooks_locations_array);
$grid_2char = "";
$grid_4char = "";
$grid_6char = "";
$grid_2char_confirmed = "";
$grid_4char_confirmed = "";
$grid_6char_confirmed = "";
// Get Confirmed LoTW & Paper Squares (non VUCC)
$query = $this->gridmap_model->get_band_confirmed('SAT', 'All', 'true', 'true', 'false', 'false', 'All', $logbooks_locations_array);
if ($query && $query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
$grid_2char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,2));
$grid_4char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,4));
if ($this->config->item('map_6digit_grids')) {
@ -327,25 +267,30 @@ class Visitor extends CI_Controller {
array_push($array_confirmed_grid_2char, $grid_2char_confirmed);
}
if(!in_array($grid_4char_confirmed, $array_confirmed_grid_4char)){
array_push($array_confirmed_grid_4char, $grid_4char_confirmed);
}
if ($this->config->item('map_6digit_grids')) {
if(!in_array($grid_6char_confirmed, $array_confirmed_grid_6char)){
array_push($array_confirmed_grid_6char, $grid_6char_confirmed);
}
}
}
}
// Get worked squares (all bands by default)
$query = $this->gridmap_model->get_band($default_band, $default_mode, 'false', 'false', 'false', 'false', $default_sat, $logbooks_locations_array);
// Get worked squares
$query = $this->gridmap_model->get_band('SAT', 'All', 'false', 'true', 'false', 'false', 'All', $logbooks_locations_array);
if ($query && $query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
$grid_two = strtoupper(substr($row->GRID_SQUARES,0,2));
$grid_four = strtoupper(substr($row->GRID_SQUARES,0,4));
if ($this->config->item('map_6digit_grids')) {
@ -357,25 +302,29 @@ class Visitor extends CI_Controller {
array_push($array_grid_2char, $grid_two);
}
if(!in_array($grid_four, $array_grid_4char)){
array_push($array_grid_4char, $grid_four);
}
if ($this->config->item('map_6digit_grids')) {
if(!in_array($grid_six, $array_grid_6char)){
array_push($array_grid_6char, $grid_six);
}
}
}
}
// Get VUCC squares (worked)
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($default_band, $default_mode, 'false', 'false', 'false', 'false', $default_sat, $logbooks_locations_array);
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'false', 'All', $logbooks_locations_array);
if ($query_vucc && $query_vucc->num_rows() > 0)
if ($query && $query_vucc->num_rows() > 0)
{
foreach ($query_vucc->result() as $row)
{
$grids = explode(",", $row->COL_VUCC_GRIDS);
foreach($grids as $key) {
@ -387,6 +336,7 @@ class Visitor extends CI_Controller {
array_push($array_grid_2char, $grid_two);
}
if(!in_array($grid_four, $array_grid_4char)){
array_push($array_grid_4char, $grid_four);
}
@ -394,13 +344,14 @@ class Visitor extends CI_Controller {
}
}
// Confirmed VUCC Squares
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($default_band, $default_mode, 'false', 'false', 'false', 'false', $default_sat, $logbooks_locations_array);
// Confirmed Squares
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares('SAT', 'All', 'true', 'true', 'false', 'false', 'All', $logbooks_locations_array);
if ($query_vucc && $query_vucc->num_rows() > 0)
if ($query && $query_vucc->num_rows() > 0)
{
foreach ($query_vucc->result() as $row)
{
$grids = explode(",", $row->COL_VUCC_GRIDS);
foreach($grids as $key) {
@ -412,6 +363,7 @@ class Visitor extends CI_Controller {
array_push($array_confirmed_grid_2char, $grid_2char_confirmed);
}
if(!in_array($grid_4char_confirmed, $array_confirmed_grid_4char)){
array_push($array_confirmed_grid_4char, $grid_4char_confirmed);
}
@ -498,159 +450,4 @@ class Visitor extends CI_Controller {
}
}
public function getGridsjs()
{
$slug = $this->security->xss_clean($this->input->post('slug'));
$band = $this->security->xss_clean($this->input->post('band'));
$mode = $this->security->xss_clean($this->input->post('mode'));
$sat = $this->security->xss_clean($this->input->post('sat'));
if (!$slug) {
header('Content-Type: application/json');
echo json_encode(array('error' => 'No slug provided'));
return;
}
$this->load->model('logbooks_model');
if(!$this->logbooks_model->public_slug_exists($slug)) {
header('Content-Type: application/json');
echo json_encode(array('error' => 'Invalid slug'));
return;
}
$logbook_id = $this->logbooks_model->public_slug_exists_logbook_id($slug);
if($logbook_id == false) {
header('Content-Type: application/json');
echo json_encode(array('error' => 'Invalid logbook'));
return;
}
// Get associated station locations for mysql queries
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
if (!$logbooks_locations_array) {
header('Content-Type: application/json');
echo json_encode(array('error' => 'No station locations'));
return;
}
$this->load->model('gridmap_model');
$array_grid_2char = array();
$array_grid_4char = array();
$array_grid_6char = array();
$array_grid_2char_confirmed = array();
$array_grid_4char_confirmed = array();
$array_grid_6char_confirmed = array();
// For public visitor, we don't show QSL confirmations, so set all to false
$query = $this->gridmap_model->get_band_confirmed($band, $mode, 'false', 'false', 'false', 'false', $sat, $logbooks_locations_array);
if ($query && $query->num_rows() > 0) {
foreach ($query->result() as $row) {
$grid_2char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,2));
$grid_4char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,4));
$grid_6char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,6));
// Check if 2 Char is in array
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){
array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
}
if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){
array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
}
if(!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)){
array_push($array_grid_6char_confirmed, $grid_6char_confirmed);
}
}
}
$query = $this->gridmap_model->get_band($band, $mode, 'false', 'false', 'false', 'false', $sat, $logbooks_locations_array);
if ($query && $query->num_rows() > 0) {
foreach ($query->result() as $row) {
$grid_two = strtoupper(substr($row->GRID_SQUARES,0,2));
$grid_four = strtoupper(substr($row->GRID_SQUARES,0,4));
$grid_six = strtoupper(substr($row->GRID_SQUARES,0,6));
// Check if 2 Char is in array
if(!in_array($grid_two, $array_grid_2char)){
array_push($array_grid_2char, $grid_two);
}
if(!in_array($grid_four, $array_grid_4char)){
array_push($array_grid_4char, $grid_four);
}
if(!in_array($grid_six, $array_grid_6char)){
array_push($array_grid_6char, $grid_six);
}
}
}
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, 'false', 'false', 'false', 'false', $sat, $logbooks_locations_array);
if ($query_vucc && $query_vucc->num_rows() > 0) {
foreach ($query_vucc->result() as $row) {
$grids = explode(",", $row->COL_VUCC_GRIDS);
foreach($grids as $key) {
$grid_two = strtoupper(substr($key,0,2));
$grid_four = strtoupper(substr($key,0,4));
// Check if 2 Char is in array
if(!in_array($grid_two, $array_grid_2char)){
array_push($array_grid_2char, $grid_two);
}
if(!in_array($grid_four, $array_grid_4char)){
array_push($array_grid_4char, $grid_four);
}
}
}
}
// // Confirmed Squares
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, 'false', 'false', 'false', 'false', $sat, $logbooks_locations_array);
if ($query_vucc && $query_vucc->num_rows() > 0) {
foreach ($query_vucc->result() as $row) {
$grids = explode(",", $row->COL_VUCC_GRIDS);
foreach($grids as $key) {
$grid_2char_confirmed = strtoupper(substr($key,0,2));
$grid_4char_confirmed = strtoupper(substr($key,0,4));
// Check if 2 Char is in array
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){
array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
}
if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){
array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
}
}
}
}
$data['grid_2char_confirmed'] = ($array_grid_2char_confirmed);
$data['grid_4char_confirmed'] = ($array_grid_4char_confirmed);
$data['grid_6char_confirmed'] = ($array_grid_6char_confirmed);
$data['grid_2char'] = ($array_grid_2char);
$data['grid_4char'] = ($array_grid_4char);
$data['grid_6char'] = ($array_grid_6char);
header('Content-Type: application/json');
echo json_encode($data);
}
}

查看文件

@ -29,81 +29,70 @@ class Workabledxcc extends CI_Controller
public function dxcclist()
{
$json = file_get_contents($this->optionslib->get_option('dxped_url'));
// Decode the JSON data into a PHP array
$dataResult = json_decode($json, true);
if (empty($dataResult)) {
$data['dxcclist'] = array();
$this->load->view('/workabledxcc/components/dxcclist', $data);
return;
}
// Initialize an empty array to store the required data
$requiredData = array();
// Get Date format
if ($this->session->userdata('user_date_format')) {
// If Logged in and session exists
$custom_date_format = $this->session->userdata('user_date_format');
} else {
// Get Default date format from /config/cloudlog.php
$custom_date_format = $this->config->item('qso_date_format');
}
// Load models once
$this->load->model('logbook_model');
$this->load->model('Workabledxcc_model');
// Get all DXCC entities for all callsigns in one batch
$callsigns = array_column($dataResult, 'callsign');
$dates = array_column($dataResult, '0');
$dxccEntities = $this->Workabledxcc_model->batchDxccLookup($callsigns, $dates);
// Get worked/confirmed status for all entities in batch
$uniqueEntities = array_unique(array_filter($dxccEntities));
$dxccStatus = $this->Workabledxcc_model->batchDxccWorkedStatus($uniqueEntities);
// If JSON contains iota fields, batch process IOTA status
$iotas = [];
// Iterate through the decoded JSON data
foreach ($dataResult as $item) {
if (!empty($item['iota'])) {
$iotas[] = $item['iota'];
}
}
$uniqueIotas = array_unique($iotas);
$iotaStatus = [];
if (!empty($uniqueIotas)) {
$iotaStatus = $this->Workabledxcc_model->batchIotaWorkedStatus($uniqueIotas);
}
// Process results
$requiredData = array();
foreach ($dataResult as $index => $item) {
// Create a new array with the required fields and add it to the main array
$oldStartDate = DateTime::createFromFormat('Y-m-d', $item['0']);
$StartDate = $oldStartDate->format($custom_date_format);
$oldEndDate = DateTime::createFromFormat('Y-m-d', $item['1']);
$EndDate = $oldEndDate->format($custom_date_format);
// Get DXCC status for this callsign
$entity = $dxccEntities[$index] ?? null;
$worked = $entity && isset($dxccStatus[$entity]) ? $dxccStatus[$entity] : [
'workedBefore' => false,
'confirmed' => false,
'workedViaSatellite' => false
];
$oldStartDate1 = DateTime::createFromFormat('Y-m-d', $item['0']);
$StartDate1 = $oldStartDate1->format('Y-m-d');
$this->load->model('logbook_model');
$dxccInfo = $this->logbook_model->dxcc_lookup($item['callsign'], $StartDate1);
// Call DXCC Worked function to check if the DXCC has been worked before
if (isset($dxccInfo['entity'])) {
$dxccWorked = $this->dxccWorked($dxccInfo['entity']);
} else {
// Handle the case where 'entity' is not set in $dxccInfo
$dxccWorked = array(
'workedBefore' => false,
'confirmed' => false,
);
}
$requiredData[] = array(
'clean_date' => $item['0'],
'start_date' => $StartDate,
'end_date' => $EndDate,
'country' => $item['2'],
'iota' => isset($item['iota']) ? $item['iota'] : null,
'iota_status' => (isset($item['iota']) && isset($iotaStatus[$item['iota']])) ? $iotaStatus[$item['iota']] : null,
'notes' => $item['6'],
'callsign' => $item['callsign'],
'workedBefore' => $worked['workedBefore'],
'confirmed' => $worked['confirmed'],
'workedViaSatellite' => $worked['workedViaSatellite'],
'workedBefore' => $dxccWorked['workedBefore'],
'confirmed' => $dxccWorked['confirmed'],
);
}
$data['dxcclist'] = $requiredData;
// Return the array with the required data
$this->load->view('/workabledxcc/components/dxcclist', $data);
}
@ -113,7 +102,6 @@ class Workabledxcc extends CI_Controller
$return = [
"workedBefore" => false,
"confirmed" => false,
"workedViaSatellite" => false,
];
$user_default_confirmation = $this->session->userdata('user_default_confirmation');
@ -122,28 +110,16 @@ class Workabledxcc extends CI_Controller
$this->load->model('logbook_model');
if (!empty($logbooks_locations_array)) {
// Check terrestrial contacts
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where_in('station_id', $logbooks_locations_array);
// Fix case sensitivity issue for DXCC country matching
$this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country));
$this->db->where('COL_COUNTRY', urldecode($country));
$query = $this->db->get($this->config->item('table_name'), 1, 0);
foreach ($query->result() as $workedBeforeRow) {
$return['workedBefore'] = true;
}
// Check satellite contacts
$this->db->where('COL_PROP_MODE', 'SAT');
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country));
$query = $this->db->get($this->config->item('table_name'), 1, 0);
foreach ($query->result() as $satelliteRow) {
$return['workedViaSatellite'] = true;
}
$extrawhere = '';
if (isset($user_default_confirmation) && strpos($user_default_confirmation, 'Q') !== false) {
$extrawhere = "COL_QSL_RCVD='Y'";
@ -179,8 +155,7 @@ class Workabledxcc extends CI_Controller
$this->db->where_in('station_id', $logbooks_locations_array);
// Fix case sensitivity issue for DXCC country matching
$this->db->where('UPPER(COL_COUNTRY) = UPPER(?)', urldecode($country));
$this->db->where('COL_COUNTRY', urldecode($country));
$query = $this->db->get($this->config->item('table_name'), 1, 0);
foreach ($query->result() as $workedBeforeRow) {

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Days with QSOs';
$lang['menu_timeline'] = 'Timeline';
$lang['menu_accumulated_statistics'] = 'Accumulated Statistics';
$lang['menu_timeplotter'] = 'Timeplotter';
$lang['menu_most_worked'] = 'Най-Работени';
$lang['menu_custom_maps'] = 'Custom Maps';
$lang['menu_continents'] = 'Continents';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Най-Работени Позивни';
$lang['most_worked_description'] = 'Тази страница показва позивните, с които сте работили най-често от вашия активен дневник.';
$lang['most_worked_rank'] = 'Ранг';
$lang['most_worked_callsign'] = 'Позивен';
$lang['most_worked_contacts'] = 'Контакти';
$lang['most_worked_first_qso'] = 'Първо QSO';
$lang['most_worked_last_qso'] = 'Последно QSO';
$lang['most_worked_bands'] = 'Ленти';
$lang['most_worked_modes'] = 'Режими';
$lang['most_worked_no_data'] = 'Няма намерени QSO! Уверете се, че имате избран активен дневник и записани QSO.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Настройките за външен вид са запазени успешно.';

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = '天数';
$lang['menu_timeline'] = '时间线';
$lang['menu_accumulated_statistics'] = '累积统计';
$lang['menu_timeplotter'] = '时间图';
$lang['menu_most_worked'] = '最常工作';
$lang['menu_custom_maps'] = '自定义地图';
$lang['menu_continents'] = '大陆';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = '最常工作的呼号';
$lang['most_worked_description'] = '此页面显示您从活动日志簿中最频繁工作的呼号。';
$lang['most_worked_rank'] = '排名';
$lang['most_worked_callsign'] = '呼号';
$lang['most_worked_contacts'] = '联系';
$lang['most_worked_first_qso'] = '首次QSO';
$lang['most_worked_last_qso'] = '最后QSO';
$lang['most_worked_bands'] = '频段';
$lang['most_worked_modes'] = '模式';
$lang['most_worked_no_data'] = '未找到QSO请确保您已选择活动日志簿并记录了QSO。';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "波段中 CW 的频率以Hz为单位
$lang['options_bands_name_band'] = "波段名称例如20m";
$lang['options_bands_name_bandgroup'] = "频段名称例如HF、VHF、UHF、SHF";
$lang['options_bands_delete_warning'] = "警告! 您确定要删除以下波段:";
$lang['options_appearance_settings_saved'] = '外观设置已成功保存。';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "输入公共日志选项";
$lang['station_logbooks_public_slug_visit'] = "访问公开日志页面";
$lang['station_logbooks_public_search_hint'] = "启用公共搜索功能可在通过公共 slug 访问的公共日志页面上提供搜索输入框。 搜索仅涵盖此日志。";
$lang['station_logbooks_public_search_enabled'] = "启用公共搜索";
$lang['station_logbooks_public_radio_status_hint'] = "启用公共电台状态将在通过公共 slug 访问的公共日志页面上显示当前电台状态信息。";
$lang['station_logbooks_public_radio_status_enabled'] = "启用公共电台状态";
$lang['station_logbooks_select_avail_loc'] = "选择可用的台站位置";
$lang['station_logbooks_link_loc'] = "链接的台站位置";
$lang['station_logbooks_linked_loc'] = "已链接的台站位置";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Dny s QSO';
$lang['menu_timeline'] = 'Časová osa';
$lang['menu_accumulated_statistics'] = 'Kumulativní statistiky';
$lang['menu_timeplotter'] = 'Graf času';
$lang['menu_most_worked'] = 'Nejvíce Pracované';
$lang['menu_custom_maps'] = 'Vlastní mapy';
$lang['menu_continents'] = 'Kontinenty';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Nejvíce Pracované Značky';
$lang['most_worked_description'] = 'Tato stránka zobrazuje značky, se kterými jste pracovali nejčastěji z vašeho aktivního deníku.';
$lang['most_worked_rank'] = 'Pořadí';
$lang['most_worked_callsign'] = 'Značka';
$lang['most_worked_contacts'] = 'Kontakty';
$lang['most_worked_first_qso'] = 'První QSO';
$lang['most_worked_last_qso'] = 'Poslední QSO';
$lang['most_worked_bands'] = 'Pásma';
$lang['most_worked_modes'] = 'Režimy';
$lang['most_worked_no_data'] = 'Nebyly nalezeny žádné QSO! Ujistěte se, že máte vybraný aktivní deník a zaznamenané QSO.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Nastavení vzhledu byla úspěšně uložena.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice";
$lang['station_logbooks_public_slug_visit'] = "Visit Public Page";
$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.";
$lang['station_logbooks_public_search_enabled'] = "Public search enabled";
$lang['station_logbooks_public_radio_status_hint'] = "Enabling public radio status will display current radio status information on the public logbook page accessed via public slug.";
$lang['station_logbooks_public_radio_status_enabled'] = "Public radio status enabled";
$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations";
$lang['station_logbooks_link_loc'] = "Link Location";
$lang['station_logbooks_linked_loc'] = "Linked Locations";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Days with QSOs';
$lang['menu_timeline'] = 'Timeline';
$lang['menu_accumulated_statistics'] = 'Accumulated Statistics';
$lang['menu_timeplotter'] = 'Timeplotter';
$lang['menu_most_worked'] = 'Meest Gewerkt';
$lang['menu_custom_maps'] = 'Custom Maps';
$lang['menu_continents'] = 'Continents';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Meest Gewerkte Roepletters';
$lang['most_worked_description'] = 'Deze pagina toont de roepletters waarmee u het vaakst heeft gewerkt vanuit uw actieve logboek.';
$lang['most_worked_rank'] = 'Rang';
$lang['most_worked_callsign'] = 'Roepletter';
$lang['most_worked_contacts'] = 'Contacten';
$lang['most_worked_first_qso'] = 'Eerste QSO';
$lang['most_worked_last_qso'] = 'Laatste QSO';
$lang['most_worked_bands'] = 'Banden';
$lang['most_worked_modes'] = 'Modi';
$lang['most_worked_no_data'] = 'Geen QSO\'s gevonden! Zorg ervoor dat u een actief logboek hebt geselecteerd en QSO\'s hebt gelogd.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Weergave-instellingen zijn succesvol opgeslagen.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice";
$lang['station_logbooks_public_slug_visit'] = "Visit Public Page";
$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.";
$lang['station_logbooks_public_search_enabled'] = "Public search enabled";
$lang['station_logbooks_public_radio_status_hint'] = "Enabling public radio status will display current radio status information on the public logbook page accessed via public slug.";
$lang['station_logbooks_public_radio_status_enabled'] = "Public radio status enabled";
$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations";
$lang['station_logbooks_link_loc'] = "Link Location";
$lang['station_logbooks_linked_loc'] = "Linked Locations";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Days with QSOs';
$lang['menu_timeline'] = 'Timeline';
$lang['menu_accumulated_statistics'] = 'Accumulated Statistics';
$lang['menu_timeplotter'] = 'Timeplotter';
$lang['menu_most_worked'] = 'Most Worked';
$lang['menu_custom_maps'] = 'Custom Maps';
$lang['menu_continents'] = 'Continents';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Most Worked Callsigns';
$lang['most_worked_description'] = 'This page shows the callsigns you have worked most frequently from your active logbook.';
$lang['most_worked_rank'] = 'Rank';
$lang['most_worked_callsign'] = 'Callsign';
$lang['most_worked_contacts'] = 'Contacts';
$lang['most_worked_first_qso'] = 'First QSO';
$lang['most_worked_last_qso'] = 'Last QSO';
$lang['most_worked_bands'] = 'Bands';
$lang['most_worked_modes'] = 'Modes';
$lang['most_worked_no_data'] = 'No QSOs found! Make sure you have an active logbook selected and QSOs logged.';

查看文件

@ -101,7 +101,6 @@ $lang['options_version_dialog_show_all_hint'] = "This will show the version dial
$lang['options_version_dialog_hide_all_hint'] = "This will deactivate the automatic popup of the version dialog for all users.";
$lang['options_save'] = 'Save';
$lang['options_appearance_settings_saved'] = 'Appearance settings have been saved successfully.';
// Bands

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice";
$lang['station_logbooks_public_slug_visit'] = "Visit Public Page";
$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.";
$lang['station_logbooks_public_search_enabled'] = "Public search enabled";
$lang['station_logbooks_public_radio_status_hint'] = "Enabling public radio status will display current radio status information on the public logbook page accessed via public slug.";
$lang['station_logbooks_public_radio_status_enabled'] = "Public radio status enabled";
$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations";
$lang['station_logbooks_link_loc'] = "Link Location";
$lang['station_logbooks_linked_loc'] = "Linked Locations";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'QSO:llsia päiviä';
$lang['menu_timeline'] = 'Aikajana';
$lang['menu_accumulated_statistics'] = 'Kertyneet tilastot';
$lang['menu_timeplotter'] = 'Aikajana';
$lang['menu_most_worked'] = 'Eniten Työskennellyt';
$lang['menu_custom_maps'] = 'Custom Maps';
$lang['menu_continents'] = 'Mantereet';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Eniten Työskennellyt Kutsumerkit';
$lang['most_worked_description'] = 'Tämä sivu näyttää kutsumerkit, joiden kanssa olet työskennellyt useimmin aktiivisesta lokikirjastasi.';
$lang['most_worked_rank'] = 'Sijoitus';
$lang['most_worked_callsign'] = 'Kutsumerkki';
$lang['most_worked_contacts'] = 'Yhteydet';
$lang['most_worked_first_qso'] = 'Ensimmäinen QSO';
$lang['most_worked_last_qso'] = 'Viimeinen QSO';
$lang['most_worked_bands'] = 'Kaistat';
$lang['most_worked_modes'] = 'Tilat';
$lang['most_worked_no_data'] = 'QSO:ja ei löytynyt! Varmista, että sinulla on aktiivinen lokikirja valittuna ja QSO:ja kirjattuna.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Ulkoasuasetukset on tallennettu onnistuneesti.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice";
$lang['station_logbooks_public_slug_visit'] = "Visit Public Page";
$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.";
$lang['station_logbooks_public_search_enabled'] = "Public search enabled";
$lang['station_logbooks_public_radio_status_hint'] = "Enabling public radio status will display current radio status information on the public logbook page accessed via public slug.";
$lang['station_logbooks_public_radio_status_enabled'] = "Public radio status enabled";
$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations";
$lang['station_logbooks_link_loc'] = "Link Location";
$lang['station_logbooks_linked_loc'] = "Linked Locations";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Days with QSOs';
$lang['menu_timeline'] = 'Timeline';
$lang['menu_accumulated_statistics'] = 'Accumulated Statistics';
$lang['menu_timeplotter'] = 'Timeplotter';
$lang['menu_most_worked'] = 'Plus Travaillé';
$lang['menu_custom_maps'] = 'Custom Maps';
$lang['menu_continents'] = 'Continents';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Indicatifs les Plus Travaillés';
$lang['most_worked_description'] = 'Cette page affiche les indicatifs que vous avez travaillés le plus fréquemment de votre carnet de trafic actif.';
$lang['most_worked_rank'] = 'Rang';
$lang['most_worked_callsign'] = 'Indicatif';
$lang['most_worked_contacts'] = 'Contacts';
$lang['most_worked_first_qso'] = 'Premier QSO';
$lang['most_worked_last_qso'] = 'Dernier QSO';
$lang['most_worked_bands'] = 'Bandes';
$lang['most_worked_modes'] = 'Modes';
$lang['most_worked_no_data'] = 'Aucun QSO trouvé ! Assurez-vous d\'avoir un carnet de trafic actif sélectionné et des QSO enregistrés.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Les paramètres d\'apparence ont été enregistrés avec succès.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice";
$lang['station_logbooks_public_slug_visit'] = "Visit Public Page";
$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.";
$lang['station_logbooks_public_search_enabled'] = "Public search enabled";
$lang['station_logbooks_public_radio_status_hint'] = "Enabling public radio status will display current radio status information on the public logbook page accessed via public slug.";
$lang['station_logbooks_public_radio_status_enabled'] = "Public radio status enabled";
$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations";
$lang['station_logbooks_link_loc'] = "Link Location";
$lang['station_logbooks_linked_loc'] = "Linked Locations";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Tage mit QSOs';
$lang['menu_timeline'] = 'Zeitleiste';
$lang['menu_accumulated_statistics'] = 'Kumulierte Statistiken';
$lang['menu_timeplotter'] = 'Zeitplotter';
$lang['menu_most_worked'] = 'Meist Gearbeitet';
$lang['menu_custom_maps'] = 'Benutzerdefinierte Karte';
$lang['menu_continents'] = 'Kontinente';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Meist Gearbeitete Rufzeichen';
$lang['most_worked_description'] = 'Diese Seite zeigt die Rufzeichen, die Sie am häufigsten aus Ihrem aktiven Logbuch gearbeitet haben.';
$lang['most_worked_rank'] = 'Rang';
$lang['most_worked_callsign'] = 'Rufzeichen';
$lang['most_worked_contacts'] = 'Kontakte';
$lang['most_worked_first_qso'] = 'Erstes QSO';
$lang['most_worked_last_qso'] = 'Letztes QSO';
$lang['most_worked_bands'] = 'Bänder';
$lang['most_worked_modes'] = 'Modi';
$lang['most_worked_no_data'] = 'Keine QSOs gefunden! Stellen Sie sicher, dass Sie ein aktives Logbuch ausgewählt haben und QSOs protokolliert sind.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequenz für die CW QRG auf dem Band (Mus
$lang['options_bands_name_band'] = "Name des Bandes (z.B. 20m)";
$lang['options_bands_name_bandgroup'] = "Name der Bandgruppe (z.B. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warnung! Bist du dir sicher, dass du das folgende Band löschen willst: ";
$lang['options_appearance_settings_saved'] = 'Erscheinungseinstellungen wurden erfolgreich gespeichert.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Gib ein, wie der öffentliche Lin
$lang['station_logbooks_public_slug_visit'] = "Besuche die öffentl. Seite";
$lang['station_logbooks_public_search_hint'] = "Einschalten der Suchfunktion gibt Besuchern deiner öffentlichen Logbuch Seite die Möglichkeit über ein Suchfeld Einträge zu suchen. Die Suche deckt dabei nur dieses Logbuch ab.";
$lang['station_logbooks_public_search_enabled'] = "Öffentliche Suche eingeschaltet";
$lang['station_logbooks_public_radio_status_hint'] = "Einschalten des Radio Status zeigt Besuchern der öffentlichen Logbuch Seite aktuelle Radio Status Informationen an.";
$lang['station_logbooks_public_radio_status_enabled'] = "Öffentlicher Radio Status eingeschaltet";
$lang['station_logbooks_select_avail_loc'] = "Wähle verfügbare Stationsstandorte";
$lang['station_logbooks_link_loc'] = "Verknüpfe Standort";
$lang['station_logbooks_linked_loc'] = "Verknüpfte Standorte";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Days with QSOs';
$lang['menu_timeline'] = 'Timeline';
$lang['menu_accumulated_statistics'] = 'Accumulated Statistics';
$lang['menu_timeplotter'] = 'Timeplotter';
$lang['menu_most_worked'] = 'Περισσότερα Εργασμένα';
$lang['menu_custom_maps'] = 'Custom Maps';
$lang['menu_continents'] = 'Continents';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Περισσότερα Εργασμένα Διακριτικά';
$lang['most_worked_description'] = 'Αυτή η σελίδα δείχνει τα διακριτικά που έχετε εργαστεί πιο συχνά από το ενεργό σας ημερολόγιο.';
$lang['most_worked_rank'] = 'Κατάταξη';
$lang['most_worked_callsign'] = 'Διακριτικό';
$lang['most_worked_contacts'] = 'Επαφές';
$lang['most_worked_first_qso'] = 'Πρώτο QSO';
$lang['most_worked_last_qso'] = 'Τελευταίο QSO';
$lang['most_worked_bands'] = 'Ζώνες';
$lang['most_worked_modes'] = 'Τρόποι';
$lang['most_worked_no_data'] = 'Δεν βρέθηκαν QSO! Βεβαιωθείτε ότι έχετε επιλέξει ενεργό ημερολόγιο και καταγεγραμμένα QSO.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Οι ρυθμίσεις εμφάνισης αποθηκεύτηκαν με επιτυχία.';

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Giorni con QSO';
$lang['menu_timeline'] = 'Cronologia';
$lang['menu_accumulated_statistics'] = 'Statistiche accumulate';
$lang['menu_timeplotter'] = 'Plotter temporale';
$lang['menu_most_worked'] = 'Più Lavorato';
$lang['menu_custom_maps'] = 'Mappe personalizzate';
$lang['menu_continents'] = 'Continenti';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Nominativi Più Lavorati';
$lang['most_worked_description'] = 'Questa pagina mostra i nominativi con cui hai lavorato più frequentemente dal tuo logbook attivo.';
$lang['most_worked_rank'] = 'Posizione';
$lang['most_worked_callsign'] = 'Nominativo';
$lang['most_worked_contacts'] = 'Contatti';
$lang['most_worked_first_qso'] = 'Primo QSO';
$lang['most_worked_last_qso'] = 'Ultimo QSO';
$lang['most_worked_bands'] = 'Bande';
$lang['most_worked_modes'] = 'Modi';
$lang['most_worked_no_data'] = 'Nessun QSO trovato! Assicurati di aver selezionato un logbook attivo e di aver registrato dei QSO.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequenza per CW QRG in banda (deve essere
$lang['options_bands_name_band'] = "Nome della banda (es. 20m)";
$lang['options_bands_name_bandgroup'] = "Nome del gruppo di banda (es. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Attenzione! Sei sicuro di voler eliminare la seguente banda: ";
$lang['options_appearance_settings_saved'] = 'Le impostazioni di aspetto sono state salvate con successo.';

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Dni z QSO';
$lang['menu_timeline'] = 'Oś czasu';
$lang['menu_accumulated_statistics'] = 'Skumulowane statystyki';
$lang['menu_timeplotter'] = 'Ploter czasu';
$lang['menu_most_worked'] = 'Najczęściej Pracowane';
$lang['menu_custom_maps'] = 'Niestandardowe mapy';
$lang['menu_continents'] = 'Kontynenty';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Najczęściej Pracowane Znaki';
$lang['most_worked_description'] = 'Ta strona pokazuje znaki, z którymi pracowałeś najczęściej z twojego aktywnego dziennika.';
$lang['most_worked_rank'] = 'Pozycja';
$lang['most_worked_callsign'] = 'Znak';
$lang['most_worked_contacts'] = 'Kontakty';
$lang['most_worked_first_qso'] = 'Pierwsze QSO';
$lang['most_worked_last_qso'] = 'Ostatnie QSO';
$lang['most_worked_bands'] = 'Pasma';
$lang['most_worked_modes'] = 'Tryby';
$lang['most_worked_no_data'] = 'Nie znaleziono QSO! Upewnij się, że masz wybrany aktywny dziennik i zarejestrowane QSO.';

查看文件

@ -133,5 +133,4 @@ $lang['options_bands_cw_qrg_hint'] = "Częstotliwość dla CW QRG w paśmie (mus
$lang['options_bands_name_band'] = "Nazwa pasma (np. 20m)";
$lang['options_bands_name_bandgroup'] = "Nazwa grupy pasm (np. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Ostrzeżenie! Czy na pewno chcesz usunąć następujące pasmo: ";
$lang['options_appearance_settings_saved'] = 'Ustawienia wyglądu zostały pomyślnie zapisane.';

查看文件

@ -31,7 +31,6 @@ $lang['menu_days_with_qsos'] = 'Dias com QSOs';
$lang['menu_timeline'] = 'Linha do Tempo';
$lang['menu_accumulated_statistics'] = 'Estatísticas Acumuladas';
$lang['menu_timeplotter'] = 'Gráfico Temporal';
$lang['menu_most_worked'] = 'Mais Trabalhado';
$lang['menu_custom_maps'] = 'Mapas Personalizados';
$lang['menu_continents'] = 'Continentes';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Indicativos Mais Trabalhados';
$lang['most_worked_description'] = 'Esta página mostra os indicativos com os quais você trabalhou com mais frequência a partir do seu livro de registro ativo.';
$lang['most_worked_rank'] = 'Posição';
$lang['most_worked_callsign'] = 'Indicativo';
$lang['most_worked_contacts'] = 'Contatos';
$lang['most_worked_first_qso'] = 'Primeiro QSO';
$lang['most_worked_last_qso'] = 'Último QSO';
$lang['most_worked_bands'] = 'Bandas';
$lang['most_worked_modes'] = 'Modos';
$lang['most_worked_no_data'] = 'Nenhum QSO encontrado! Certifique-se de ter um livro de registro ativo selecionado e QSOs registrados.';

查看文件

@ -122,4 +122,3 @@ $lang['options_bands_cw_qrg_hint'] = "Frequência CW da banda (em Hz)";
$lang['options_bands_name_band'] = "Nome da Banda (ex: 20m)";
$lang['options_bands_name_bandgroup'] = "Nome do grupo da banda (ex: hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Atenção! Deseja mesmo excluir a banda: ";
$lang['options_appearance_settings_saved'] = 'As configurações de aparência foram salvas com sucesso.';

查看文件

@ -1,13 +1,6 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
___________________________________________________________________________________________
Station Logbooks
___________________________________________________________________________________________
*/
$lang['station_logbooks'] = "Livros de Estação";
$lang['station_logbooks_description_header'] = "O que são Livros de Estação";
$lang['station_logbooks_description_text'] = "Livros de Estação permitem agrupar Locais de Estação, possibilitando visualizar todos os locais em uma única sessão, tanto no logbook quanto nas análises. Ideal para operações em múltiplos locais pertencentes ao mesmo DXCC ou círculo VUCC.";
@ -32,8 +25,6 @@ $lang['station_logbooks_public_slug_input'] = "Digite o slug público desejado";
$lang['station_logbooks_public_slug_visit'] = "Visitar Página Pública";
$lang['station_logbooks_public_search_hint'] = "Habilitar a busca pública permite uma caixa de busca na página pública do livro de estação, acessível via slug. A busca cobre apenas este livro.";
$lang['station_logbooks_public_search_enabled'] = "Busca pública ativada";
$lang['station_logbooks_public_radio_status_hint'] = "Ativar o status de rádio público exibirá informações atuais do status do rádio na página pública do livro de registro acessada via slug público.";
$lang['station_logbooks_public_radio_status_enabled'] = "Status de rádio público ativado";
$lang['station_logbooks_select_avail_loc'] = "Selecionar Locais de Estação Disponíveis";
$lang['station_logbooks_link_loc'] = "Vincular Local";
$lang['station_logbooks_linked_loc'] = "Locais Vinculados";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Дней с QSO';
$lang['menu_timeline'] = 'Лента событий';
$lang['menu_accumulated_statistics'] = 'Объединённая статистика';
$lang['menu_timeplotter'] = 'Графики';
$lang['menu_most_worked'] = 'Самые Работанные';
$lang['menu_custom_maps'] = 'Карты';
$lang['menu_continents'] = 'Континенты';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Самые Работанные Позывные';
$lang['most_worked_description'] = 'Эта страница показывает позывные, с которыми вы работали чаще всего из вашего активного журнала.';
$lang['most_worked_rank'] = 'Ранг';
$lang['most_worked_callsign'] = 'Позывной';
$lang['most_worked_contacts'] = 'Контакты';
$lang['most_worked_first_qso'] = 'Первое QSO';
$lang['most_worked_last_qso'] = 'Последнее QSO';
$lang['most_worked_bands'] = 'Диапазоны';
$lang['most_worked_modes'] = 'Режимы';
$lang['most_worked_no_data'] = 'QSO не найдены! Убедитесь, что у вас выбран активный журнал и записаны QSO.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Частота CW QRG в диапазон
$lang['options_bands_name_band'] = "Название диапазона (к прмиеру, 20м)";
$lang['options_bands_name_bandgroup'] = "Название группы диапазонов (к примеру, hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Предупреждение! Вы уверены в том, что хотите удалить следующий диапазон: ";
$lang['options_appearance_settings_saved'] = 'Настройки внешнего вида успешно сохранены.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Введите публичную
$lang['station_logbooks_public_slug_visit'] = "Посетите публичную страницу";
$lang['station_logbooks_public_search_hint'] = "Включение функции публичного поиска открывает поле ввода для поиска на странице публичного журнала, доступ к которой осуществляется по публичной метке. Поиск производится только в данном журнале.";
$lang['station_logbooks_public_search_enabled'] = "Публичный поиск включен";
$lang['station_logbooks_public_radio_status_hint'] = "Включение публичного статуса радио будет отображать текущую информацию о статусе радио на публичной странице журнала, доступной через публичную метку.";
$lang['station_logbooks_public_radio_status_enabled'] = "Публичный статус радио включен";
$lang['station_logbooks_select_avail_loc'] = "Выберите доступное местоположение станции";
$lang['station_logbooks_link_loc'] = "Привяжите местоположение станции";
$lang['station_logbooks_linked_loc'] = "Привязанные местоположения станции";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Días con QSOs';
$lang['menu_timeline'] = 'Línea de Tiempo';
$lang['menu_accumulated_statistics'] = 'Estadísticas Acumuladas';
$lang['menu_timeplotter'] = 'Gráfico de Tiempo';
$lang['menu_most_worked'] = 'Más Trabajado';
$lang['menu_custom_maps'] = 'Mapas Personalizados';
$lang['menu_continents'] = 'Continentes';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Indicativos Más Trabajados';
$lang['most_worked_description'] = 'Esta página muestra los indicativos que has trabajado con más frecuencia desde tu libro de guardia activo.';
$lang['most_worked_rank'] = 'Rango';
$lang['most_worked_callsign'] = 'Indicativo';
$lang['most_worked_contacts'] = 'Contactos';
$lang['most_worked_first_qso'] = 'Primer QSO';
$lang['most_worked_last_qso'] = 'Último QSO';
$lang['most_worked_bands'] = 'Bandas';
$lang['most_worked_modes'] = 'Modos';
$lang['most_worked_no_data'] = '¡No se encontraron QSOs! Asegúrate de tener un libro de guardia activo seleccionado y QSOs registrados.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frecuencia para el QRG de CW en la banda (
$lang['options_bands_name_band'] = "Nombre de la Banda (ej. 20m)";
$lang['options_bands_name_bandgroup'] = "Nombre del grupo de bandas (ej. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "¡Advertencia! ¿Está seguro que desea eliminar la banda a continuación: ";
$lang['options_appearance_settings_saved'] = 'La configuración de apariencia se ha guardado correctamente.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Introduzca la elección de Abrevi
$lang['station_logbooks_public_slug_visit'] = "Visitar Página Pública";
$lang['station_logbooks_public_search_hint'] = "El permitir la función de búsqueda pública le permite poner una casilla de búsqueda en la página pública del libro de guardia que sea accedida por una abreviatura pública. La búsqueda solo cubre este libro de guardia.";
$lang['station_logbooks_public_search_enabled'] = "Activar búsqueda pública";
$lang['station_logbooks_public_radio_status_hint'] = "El permitir el estado de radio público mostrará información actual del estado del radio en la página pública del libro de guardia accedida por abreviatura pública.";
$lang['station_logbooks_public_radio_status_enabled'] = "Activar estado de radio público";
$lang['station_logbooks_select_avail_loc'] = "Seleccionar Localizaciones de Estación Disponibles";
$lang['station_logbooks_link_loc'] = "Enlazar Localización";
$lang['station_logbooks_linked_loc'] = "Localizaciones Enlazadas";

查看文件

@ -1,3 +1,4 @@
<<<<<<< HEAD
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = 'Dagar med QSOs';
$lang['menu_timeline'] = 'Tidslinje';
$lang['menu_accumulated_statistics'] = 'Ackumulerad statistik';
$lang['menu_timeplotter'] = 'Tidplotter';
$lang['menu_most_worked'] = 'Mest Arbetade';
$lang['menu_custom_maps'] = 'Anpassade kartor';
$lang['menu_continents'] = 'Kontinenter';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'Mest Arbetade Anropssignaler';
$lang['most_worked_description'] = 'Den här sidan visar de anropssignaler du har arbetat med oftast från din aktiva loggbok.';
$lang['most_worked_rank'] = 'Rang';
$lang['most_worked_callsign'] = 'Anropssignal';
$lang['most_worked_contacts'] = 'Kontakter';
$lang['most_worked_first_qso'] = 'Första QSO';
$lang['most_worked_last_qso'] = 'Senaste QSO';
$lang['most_worked_bands'] = 'Band';
$lang['most_worked_modes'] = 'Lägen';
$lang['most_worked_no_data'] = 'Inga QSO hittades! Se till att du har en aktiv loggbok vald och QSO loggade.';

查看文件

@ -123,5 +123,4 @@ $lang['options_bands_cw_qrg_hint'] = "Frequency for CW QRG in band (must be in H
$lang['options_bands_name_band'] = "Name of Band (E.g. 20m)";
$lang['options_bands_name_bandgroup'] = "Name of bandgroup (E.g. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Warning! Are you sure you want to delete the following band: ";
$lang['options_appearance_settings_saved'] = 'Utseendeinställningar har sparats framgångsrikt.';

查看文件

@ -32,8 +32,6 @@ $lang['station_logbooks_public_slug_input'] = "Type in Public Slug choice";
$lang['station_logbooks_public_slug_visit'] = "Visit Public Page";
$lang['station_logbooks_public_search_hint'] = "Enabling public search function offers a search input box on the public logbook page accessed via public slug. Search only covers this logbook.";
$lang['station_logbooks_public_search_enabled'] = "Public search enabled";
$lang['station_logbooks_public_radio_status_hint'] = "Enabling public radio status will display current radio status information on the public logbook page accessed via public slug.";
$lang['station_logbooks_public_radio_status_enabled'] = "Public radio status enabled";
$lang['station_logbooks_select_avail_loc'] = "Select Available Station Locations";
$lang['station_logbooks_link_loc'] = "Link Location";
$lang['station_logbooks_linked_loc'] = "Linked Locations";

查看文件

@ -32,7 +32,6 @@ $lang['menu_days_with_qsos'] = "QSO'lu Günler";
$lang['menu_timeline'] = 'Zaman Çizelgesi';
$lang['menu_accumulated_statistics'] = 'Birikmiş İstatistikler';
$lang['menu_timeplotter'] = 'Zaman Çizici';
$lang['menu_most_worked'] = 'En Çok Çalışılan';
$lang['menu_custom_maps'] = 'Özel Haritalar';
$lang['menu_continents'] = 'Kıtalar';

查看文件

@ -1,12 +0,0 @@
<?php
$lang['most_worked_title'] = 'En Çok Çalışılan Çağrı İşaretleri';
$lang['most_worked_description'] = 'Bu sayfa, aktif günlük defterinizden en sık çalıştığınız çağrı işaretlerini gösterir.';
$lang['most_worked_rank'] = 'Sıra';
$lang['most_worked_callsign'] = 'Çağrı İşareti';
$lang['most_worked_contacts'] = 'İletişimler';
$lang['most_worked_first_qso'] = 'İlk QSO';
$lang['most_worked_last_qso'] = 'Son QSO';
$lang['most_worked_bands'] = 'Bantlar';
$lang['most_worked_modes'] = 'Modlar';
$lang['most_worked_no_data'] = 'QSO bulunamadı! Aktif bir günlük defteri seçtiğinizden ve QSO\'lar kaydettiğinizden emin olun.';

查看文件

@ -121,4 +121,3 @@ $lang['options_bands_cw_qrg_hint'] = "Banttaki CW QRG frekansı (Hz cinsinden ol
$lang['options_bands_name_band'] = "Bant Adı (Örn. 20m)";
$lang['options_bands_name_bandgroup'] = "Bant grubunun adı (Örn. hf, vhf, uhf, shf)";
$lang['options_bands_delete_warning'] = "Uyarı! Aşağıdaki bandı silmek istediğinizden emin misiniz: ";
$lang['options_appearance_settings_saved'] = 'Görünüm ayarları başarıyla kaydedildi.';

查看文件

@ -1,21 +1,21 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_add_lotw_credentials extends CI_Migration
{
class Migration_add_lotw_credentials extends CI_Migration {
public function up()
{
$fields = array(
'user_lotw_name VARCHAR(32) DEFAULT NULL',
'user_lotw_password VARCHAR(64) DEFAULT NULL'
);
$this->dbforge->add_column('users', $fields);
'user_lotw_name VARCHAR(32) DEFAULT NULL',
'user_lotw_password VARCHAR(64) DEFAULT NULL'
);
$this->dbforge->add_column('users', $fields);
}
public function down()
{
$this->dbforge->drop_column('users', 'user_lotw_name');
$this->dbforge->drop_column('users', 'user_lotw_password');
$this->dbforge->drop_column('users', 'user_lotw_password');
}
}
?>

查看文件

@ -1,12 +1,11 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_add_config_table extends CI_Migration
{
class Migration_add_config_table extends CI_Migration {
public function up()
{
$this->dbforge->add_field('id');
$this->dbforge->add_field('id');
$this->dbforge->add_field(array(
'lotw_download_url' => array(
'type' => 'VARCHAR',
@ -16,22 +15,22 @@ class Migration_add_config_table extends CI_Migration
'type' => 'VARCHAR',
'constraint' => 255,
),
'lotw_rcvd_mark' => array(
'lotw_rcvd_mark' => array(
'type' => 'VARCHAR',
'constraint' => 1,
),
));
$this->dbforge->create_table('config');
$data = array(
'lotw_download_url' => 'https://p1k.arrl.org/lotwuser/lotwreport.adi',
'lotw_upload_url' => 'https://p1k.arrl.org/lotwuser/upload',
'lotw_rcvd_mark' => 'Y'
);
$data = array(
'lotw_download_url' => 'https://p1k.arrl.org/lotwuser/lotwreport.adi',
'lotw_upload_url' => 'https://p1k.arrl.org/lotwuser/upload',
'lotw_rcvd_mark' => 'Y'
);
$this->db->insert('config', $data);
$this->db->insert('config', $data);
}
public function down()
@ -39,3 +38,4 @@ class Migration_add_config_table extends CI_Migration
$this->dbforge->drop_table('config');
}
}
?>

查看文件

@ -1,14 +1,13 @@
<?php defined('BASEPATH') or exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_add_lotw_login_url extends CI_Migration
{
class Migration_add_lotw_login_url extends CI_Migration {
public function up()
{
$fields = array('lotw_login_url VARCHAR(244) DEFAULT NULL');
$this->dbforge->add_column('config', $fields);
$this->dbforge->add_column('config', $fields);
$sql = "UPDATE config SET lotw_login_url = 'https://p1k.arrl.org/lotwuser/default' WHERE id=1";
$this->db->query($sql);
@ -16,6 +15,7 @@ class Migration_add_lotw_login_url extends CI_Migration
public function down()
{
$this->dbforge->drop_column('config', 'lotw_login_url');
$this->dbforge->drop_column('config', 'lotw_login_url');
}
}
?>

查看文件

@ -1,4 +1,4 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_modify_eQSL_url extends CI_Migration {

查看文件

@ -1,30 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Tag Cloudlog as 2.6.22
*/
class Migration_tag_2_6_22 extends CI_Migration {
public function up()
{
// Tag Cloudlog 2.6.22
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.22'));
// 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'));
}
public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.21'));
}
}

查看文件

@ -1,50 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_add_workable_dxcc_indexes extends CI_Migration
{
public function up()
{
// Add composite index for workable DXCC queries
// This will greatly improve performance for COL_COUNTRY + station_id + COL_PROP_MODE queries
$this->db->db_debug = false;
// Check if index already exists
$index_exists = $this->db->query("SHOW INDEX FROM " . $this->config->item('table_name') . " WHERE Key_name = 'idx_workable_dxcc'")->num_rows();
if ($index_exists == 0) {
$sql = "ALTER TABLE " . $this->config->item('table_name') . " ADD INDEX `idx_workable_dxcc` (`COL_COUNTRY`, `station_id`, `COL_PROP_MODE`)";
$this->db->query($sql);
}
// Add index for confirmation status columns
$conf_index_exists = $this->db->query("SHOW INDEX FROM " . $this->config->item('table_name') . " WHERE Key_name = 'idx_qsl_confirmations'")->num_rows();
if ($conf_index_exists == 0) {
$sql = "ALTER TABLE " . $this->config->item('table_name') . " ADD INDEX `idx_qsl_confirmations` (`COL_QSL_RCVD`, `COL_LOTW_QSL_RCVD`, `COL_EQSL_QSL_RCVD`, `COL_QRZCOM_QSO_DOWNLOAD_STATUS`)";
$this->db->query($sql);
}
$this->db->db_debug = true;
}
public function down()
{
$this->db->db_debug = false;
// Drop the indexes if they exist
$index_exists = $this->db->query("SHOW INDEX FROM " . $this->config->item('table_name') . " WHERE Key_name = 'idx_workable_dxcc'")->num_rows();
if ($index_exists > 0) {
$this->db->query("ALTER TABLE " . $this->config->item('table_name') . " DROP INDEX `idx_workable_dxcc`");
}
$conf_index_exists = $this->db->query("SHOW INDEX FROM " . $this->config->item('table_name') . " WHERE Key_name = 'idx_qsl_confirmations'")->num_rows();
if ($conf_index_exists > 0) {
$this->db->query("ALTER TABLE " . $this->config->item('table_name') . " DROP INDEX `idx_qsl_confirmations`");
}
$this->db->db_debug = true;
}
}

查看文件

@ -1,30 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Tag Cloudlog as 2.7.0
*/
class Migration_tag_2_7_0 extends CI_Migration {
public function up()
{
// Tag Cloudlog 2.7.0
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.7.0'));
// 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'));
}
public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.22'));
}
}

查看文件

@ -1,29 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/*
* This adds an option to enable/disable Radio Status panel on public logbook displays
*/
class Migration_add_radio_panel_option_to_logbook extends CI_Migration
{
public function up()
{
if (!$this->db->field_exists('public_radio_status', 'station_logbooks')) {
$fields = array(
'public_radio_status integer DEFAULT 0 AFTER public_search',
);
$this->dbforge->add_column('station_logbooks', $fields);
}
}
public function down()
{
if ($this->db->field_exists('public_radio_status', 'station_logbooks')) {
$this->dbforge->drop_column('station_logbooks', 'public_radio_status');
}
}
}

查看文件

@ -1,38 +0,0 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_add_indexes_lotw_users extends CI_Migration
{
public function up()
{
if ($this->db->table_exists('lotw_users')) {
// add an index on callsign if no index exists on that column
$callsignIndex = $this->db->query("SHOW INDEX FROM lotw_users WHERE Column_name = 'callsign'");
if ($callsignIndex->num_rows() == 0) {
$this->db->query("ALTER TABLE lotw_users ADD INDEX `callsign` (`callsign`)");
}
// add an index on lastupload if it doesn't exist
$lastuploadIndex = $this->db->query("SHOW INDEX FROM lotw_users WHERE Column_name = 'lastupload'");
if ($lastuploadIndex->num_rows() == 0) {
$this->db->query("ALTER TABLE lotw_users ADD INDEX `lastupload` (`lastupload`)");
}
}
}
public function down()
{
if ($this->db->table_exists('lotw_users')) {
// drop the indexes we might have created (only if the index name matches)
$li = $this->db->query("SHOW INDEX FROM lotw_users WHERE Key_name = 'lastupload'");
if ($li->num_rows() > 0) {
$this->db->query("ALTER TABLE lotw_users DROP INDEX `lastupload`");
}
$ci = $this->db->query("SHOW INDEX FROM lotw_users WHERE Key_name = 'callsign'");
if ($ci->num_rows() > 0) {
$this->db->query("ALTER TABLE lotw_users DROP INDEX `callsign`");
}
}
}
}

查看文件

@ -1,30 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Class Migration_lotw_cert_archive_status
*
* Adds a simple boolean `archived` column to the `lotw_certs` table so
* certificates can be marked as archived.
*/
class Migration_lotw_cert_archive_status extends CI_Migration {
public function up()
{
if (! $this->db->field_exists('archived', 'lotw_certs')) {
$fields = array(
'archived BOOLEAN DEFAULT FALSE',
);
$this->dbforge->add_column('lotw_certs', $fields);
}
}
public function down()
{
if ($this->db->field_exists('archived', 'lotw_certs')) {
$this->dbforge->drop_column('lotw_certs', 'archived');
}
}
}

查看文件

@ -1,30 +0,0 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Tag Cloudlog as 2.7.1
*/
class Migration_tag_2_7_1 extends CI_Migration {
public function up()
{
// Tag Cloudlog 2.7.1
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.7.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'));
}
public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.7.0'));
}
}

查看文件

@ -58,12 +58,6 @@ class DXCC extends CI_Model {
return $this->db->get('dxcc_entities');
}
/* Optimized method to get count of current DXCC entities without loading all records */
function get_total_dxcc_count() {
$this->db->where('end', null);
return $this->db->count_all_results('dxcc_entities');
}
function get_dxcc_array($dxccArray, $bands, $postdata) {
$CI =& get_instance();
$CI->load->model('logbooks_model');

查看文件

@ -151,7 +151,7 @@ class Labels_model extends CI_Model {
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
$this->db->where_in('COL_QSL_SENT', array('R', 'Q'));
$this->db->order_by("COL_DXCC", "ASC");
$this->db->order_by("CASE WHEN COL_QSL_VIA IS NOT NULL AND COL_QSL_VIA != '' THEN COL_QSL_VIA ELSE COL_CALL END", "ASC");
$this->db->order_by("COL_CALL", "ASC");
$this->db->order_by("COL_SAT_NAME", "ASC");
$this->db->order_by("COL_SAT_MODE", "ASC");
$this->db->order_by("COL_BAND_RX", "ASC");
@ -169,7 +169,6 @@ class Labels_model extends CI_Model {
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));
$this->db->where_in('COL_PRIMARY_KEY', $ids);
$this->db->order_by("COL_DXCC", "ASC");
$this->db->order_by("CASE WHEN COL_QSL_VIA IS NOT NULL AND COL_QSL_VIA != '' THEN COL_QSL_VIA ELSE COL_CALL END", "ASC");
$query = $this->db->get($this->config->item('table_name'));
return $query;

查看文件

@ -8,11 +8,10 @@ class Logbook_model extends CI_Model
{
$callsign = str_replace('Ø', '0', $this->input->post('callsign'));
// Join date+time - Parse date according to user's format preference
$parsed_date = $this->parse_user_date($this->input->post('start_date'));
$datetime = $parsed_date . " " . $this->input->post('start_time');
// Join date+time
$datetime = date("Y-m-d", strtotime($this->input->post('start_date'))) . " " . $this->input->post('start_time');
if ($this->input->post('end_time') != null) {
$datetime_off = $parsed_date . " " . $this->input->post('end_time');
$datetime_off = date("Y-m-d", strtotime($this->input->post('start_date'))) . " " . $this->input->post('end_time');
// if time off < time on, and time off is on 00:xx >> add 1 day (concidering start and end are between 23:00 and 00:59) //
$_tmp_datetime_off = strtotime($datetime_off);
if (($_tmp_datetime_off < strtotime($datetime)) && (substr($this->input->post('end_time'), 0, 2) == "00")) {
@ -99,13 +98,10 @@ class Logbook_model extends CI_Model
if ($this->input->post('country') == "") {
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
$country = ucwords(strtolower($dxcc[1]), "- (/");
$dxcc_id = $dxcc[0];
} else {
$country = $this->input->post('country');
}
if ($this->input->post('cqz') == "") {
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
if (empty($dxcc[2])) {
@ -118,6 +114,7 @@ class Logbook_model extends CI_Model
}
if ($this->input->post('dxcc_id') == "") {
$dxcc = $this->check_dxcc_table(strtoupper(trim($callsign)), $datetime);
if (empty($dxcc[0])) {
$dxcc_id = null;
@ -125,12 +122,7 @@ class Logbook_model extends CI_Model
$dxcc_id = $dxcc[0];
}
} else {
// if $country isn't empty and dxcc_id is 0 use the DXCC ID from the callsign lookup
if (!empty($country) && $this->input->post('dxcc_id') == "0") {
$dxcc_id = $dxcc_id;
} else {
$dxcc_id = $this->input->post('dxcc_id');
}
$dxcc_id = $this->input->post('dxcc_id');
}
if ($this->input->post('continent') == "") {
@ -192,13 +184,13 @@ class Logbook_model extends CI_Model
case 'power':
$qso_rx_power = $srx_string;
break;
// Example for more sophisticated exchanges and their split into the db:
//case 'name/power':
// if (strlen($srx_string) == 0) break;
// $exch_pt = explode(" ",$srx_string);
// $qso_name = $exch_pt[0];
// if (count($exch_pt)>1) $qso_power = $exch_pt[1];
// break;
// Example for more sophisticated exchanges and their split into the db:
//case 'name/power':
// if (strlen($srx_string) == 0) break;
// $exch_pt = explode(" ",$srx_string);
// $qso_name = $exch_pt[0];
// if (count($exch_pt)>1) $qso_power = $exch_pt[1];
// break;
default:
}
}
@ -1094,15 +1086,7 @@ class Logbook_model extends CI_Model
$entity = $this->get_entity($this->input->post('dxcc_id'));
$stationId = $this->input->post('station_profile');
if (is_array($entity)) {
$rawCountry = $entity['name'] ?? '';
} elseif (is_object($entity)) {
$rawCountry = $entity->name ?? '';
} else {
$rawCountry = (string)$entity;
}
$country = ucwords(strtolower($rawCountry), "- (/");
$country = ucwords(strtolower($entity['name']), "- (/");
// be sure that station belongs to user
$CI = &get_instance();
@ -1932,9 +1916,7 @@ class Logbook_model extends CI_Model
function get_last_qsos($num, $StationLocationsArray = null)
{
// Ensure $num is always an integer to prevent SQL injection
$num = intval($num);
if ($StationLocationsArray == null) {
$CI = &get_instance();
$CI->load->model('logbooks_model');
@ -1947,13 +1929,13 @@ class Logbook_model extends CI_Model
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$sql = "SELECT * FROM ( select * from " . $this->config->item('table_name') . "
WHERE station_id IN(" . $location_list . ")
order by col_time_on desc, col_primary_key desc
limit " . $num .
WHERE station_id IN(" . $location_list . ")
order by col_time_on desc, col_primary_key desc
limit " . $num .
") hrd
LEFT JOIN station_profile ON station_profile.station_id = hrd.station_id
LEFT JOIN dxcc_entities ON hrd.col_dxcc = dxcc_entities.adif
order by col_time_on desc, col_primary_key desc";
JOIN station_profile ON station_profile.station_id = hrd.station_id
LEFT JOIN dxcc_entities ON hrd.col_dxcc = dxcc_entities.adif
order by col_time_on desc, col_primary_key desc";
$query = $this->db->query($sql);
@ -2096,7 +2078,7 @@ class Logbook_model extends CI_Model
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->group_start();
$this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4));
$this->db->or_like('COL_VUCC_GRIDS', substr($grid, 0, 4));
$this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4));
$this->db->group_end();
if ($band != null && $band != 'SAT') {
@ -2638,99 +2620,95 @@ class Logbook_model extends CI_Model
}
if (!empty($logbooks_locations_array)) {
// Pre-calculate today's date for better performance
$today_date = date('Y-m-d');
$this->db->select("
COUNT(IF(COL_QSL_SENT='Y',COL_QSL_SENT,null)) as QSL_Sent,
COUNT(IF(COL_QSL_RCVD='Y',COL_QSL_RCVD,null)) as QSL_Received,
COUNT(IF(COL_QSL_SENT IN('Q', 'R') ,COL_QSL_SENT,null)) as QSL_Requested,
COUNT(IF(COL_EQSL_QSL_SENT='Y',COL_EQSL_QSL_SENT,null)) as eQSL_Sent,
COUNT(IF(COL_EQSL_QSL_RCVD='Y',COL_EQSL_QSL_RCVD,null)) as eQSL_Received,
COUNT(IF(COL_LOTW_QSL_SENT='Y',COL_LOTW_QSL_SENT,null)) as LoTW_Sent,
COUNT(IF(COL_LOTW_QSL_RCVD='Y',COL_LOTW_QSL_RCVD,null)) as LoTW_Received,
COUNT(IF(COL_QRZCOM_QSO_UPLOAD_STATUS='Y',COL_QRZCOM_QSO_UPLOAD_STATUS,null)) as QRZ_Sent,
COUNT(IF(COL_QRZCOM_QSO_DOWNLOAD_STATUS='Y',COL_QRZCOM_QSO_DOWNLOAD_STATUS,null)) as QRZ_Received,
COUNT(IF(COL_QSL_SENT='Y' and DATE(COL_QSLSDATE)='$today_date',COL_QSL_SENT,null)) as QSL_Sent_today,
COUNT(IF(COL_QSL_RCVD='Y' and DATE(COL_QSLRDATE)='$today_date',COL_QSL_RCVD,null)) as QSL_Received_today,
COUNT(IF(COL_QSL_SENT IN('Q', 'R') and DATE(COL_QSLSDATE)='$today_date' ,COL_QSL_SENT,null)) as QSL_Requested_today,
COUNT(IF(COL_EQSL_QSL_SENT='Y' and DATE(COL_EQSL_QSLSDATE)='$today_date',COL_EQSL_QSL_SENT,null)) as eQSL_Sent_today,
COUNT(IF(COL_EQSL_QSL_RCVD='Y' and DATE(COL_EQSL_QSLRDATE)='$today_date',COL_EQSL_QSL_RCVD,null)) as eQSL_Received_today,
COUNT(IF(COL_LOTW_QSL_SENT='Y' and DATE(COL_LOTW_QSLSDATE)='$today_date',COL_LOTW_QSL_SENT,null)) as LoTW_Sent_today,
COUNT(IF(COL_LOTW_QSL_RCVD='Y' and DATE(COL_LOTW_QSLRDATE)='$today_date',COL_LOTW_QSL_RCVD,null)) as LoTW_Received_today,
COUNT(IF(COL_QRZCOM_QSO_UPLOAD_STATUS='Y' and DATE(COL_QRZCOM_QSO_UPLOAD_DATE)='$today_date',COL_QRZCOM_QSO_UPLOAD_STATUS,null)) as QRZ_Sent_today,
COUNT(IF(COL_QRZCOM_QSO_DOWNLOAD_STATUS='Y' and DATE(COL_QRZCOM_QSO_DOWNLOAD_DATE)='$today_date',COL_QRZCOM_QSO_DOWNLOAD_STATUS,null)) as QRZ_Received_today
", FALSE);
$this->db->select('
COUNT(IF(COL_QSL_SENT="Y",COL_QSL_SENT,null)) as QSL_Sent,
COUNT(IF(COL_QSL_RCVD="Y",COL_QSL_RCVD,null)) as QSL_Received,
COUNT(IF(COL_QSL_SENT IN("Q", "R") ,COL_QSL_SENT,null)) as QSL_Requested,
COUNT(IF(COL_EQSL_QSL_SENT="Y",COL_EQSL_QSL_SENT,null)) as eQSL_Sent,
COUNT(IF(COL_EQSL_QSL_RCVD="Y",COL_EQSL_QSL_RCVD,null)) as eQSL_Received,
COUNT(IF(COL_LOTW_QSL_SENT="Y",COL_LOTW_QSL_SENT,null)) as LoTW_Sent,
COUNT(IF(COL_LOTW_QSL_RCVD="Y",COL_LOTW_QSL_RCVD,null)) as LoTW_Received,
COUNT(IF(COL_QRZCOM_QSO_UPLOAD_STATUS="Y",COL_QRZCOM_QSO_UPLOAD_STATUS,null)) as QRZ_Sent,
COUNT(IF(COL_QRZCOM_QSO_DOWNLOAD_STATUS="Y",COL_QRZCOM_QSO_DOWNLOAD_STATUS,null)) as QRZ_Received,
COUNT(IF(COL_QSL_SENT="Y" and DATE(COL_QSLSDATE)=DATE(SYSDATE()),COL_QSL_SENT,null)) as QSL_Sent_today,
COUNT(IF(COL_QSL_RCVD="Y" and DATE(COL_QSLRDATE)=DATE(SYSDATE()),COL_QSL_RCVD,null)) as QSL_Received_today,
COUNT(IF(COL_QSL_SENT IN("Q", "R") and DATE(COL_QSLSDATE)=DATE(SYSDATE()) ,COL_QSL_SENT,null)) as QSL_Requested_today,
COUNT(IF(COL_EQSL_QSL_SENT="Y" and DATE(COL_EQSL_QSLSDATE)=DATE(SYSDATE()),COL_EQSL_QSL_SENT,null)) as eQSL_Sent_today,
COUNT(IF(COL_EQSL_QSL_RCVD="Y" and DATE(COL_EQSL_QSLRDATE)=DATE(SYSDATE()),COL_EQSL_QSL_RCVD,null)) as eQSL_Received_today,
COUNT(IF(COL_LOTW_QSL_SENT="Y" and DATE(COL_LOTW_QSLSDATE)=DATE(SYSDATE()),COL_LOTW_QSL_SENT,null)) as LoTW_Sent_today,
COUNT(IF(COL_LOTW_QSL_RCVD="Y" and DATE(COL_LOTW_QSLRDATE)=DATE(SYSDATE()),COL_LOTW_QSL_RCVD,null)) as LoTW_Received_today,
COUNT(IF(COL_QRZCOM_QSO_UPLOAD_STATUS="Y" and DATE(COL_QRZCOM_QSO_UPLOAD_DATE)=DATE(SYSDATE()),COL_QRZCOM_QSO_UPLOAD_STATUS,null)) as QRZ_Sent_today,
COUNT(IF(COL_QRZCOM_QSO_DOWNLOAD_STATUS="Y" and DATE(COL_QRZCOM_QSO_DOWNLOAD_DATE)=DATE(SYSDATE()),COL_QRZCOM_QSO_DOWNLOAD_STATUS,null)) as QRZ_Received_today
');
$this->db->where_in('station_id', $logbooks_locations_array);
if ($query = $this->db->get($this->config->item('table_name'))) {
if ($query->num_rows() > 0) {
$row = $query->row();
return array(
'QSL_Sent' => (int)$row->QSL_Sent,
'QSL_Received' => (int)$row->QSL_Received,
'QSL_Requested' => (int)$row->QSL_Requested,
'eQSL_Sent' => (int)$row->eQSL_Sent,
'eQSL_Received' => (int)$row->eQSL_Received,
'LoTW_Sent' => (int)$row->LoTW_Sent,
'LoTW_Received' => (int)$row->LoTW_Received,
'QRZ_Sent' => (int)$row->QRZ_Sent,
'QRZ_Received' => (int)$row->QRZ_Received,
'QSL_Sent_today' => (int)$row->QSL_Sent_today,
'QSL_Received_today' => (int)$row->QSL_Received_today,
'QSL_Requested_today' => (int)$row->QSL_Requested_today,
'eQSL_Sent_today' => (int)$row->eQSL_Sent_today,
'eQSL_Received_today' => (int)$row->eQSL_Received_today,
'LoTW_Sent_today' => (int)$row->LoTW_Sent_today,
'LoTW_Received_today' => (int)$row->LoTW_Received_today,
'QRZ_Sent_today' => (int)$row->QRZ_Sent_today,
'QRZ_Received_today' => (int)$row->QRZ_Received_today
);
$this->db->last_query();
foreach ($query->result() as $row) {
$QSLBreakdown['QSL_Sent'] = $row->QSL_Sent;
$QSLBreakdown['QSL_Received'] = $row->QSL_Received;
$QSLBreakdown['QSL_Requested'] = $row->QSL_Requested;
$QSLBreakdown['eQSL_Sent'] = $row->eQSL_Sent;
$QSLBreakdown['eQSL_Received'] = $row->eQSL_Received;
$QSLBreakdown['LoTW_Sent'] = $row->LoTW_Sent;
$QSLBreakdown['LoTW_Received'] = $row->LoTW_Received;
$QSLBreakdown['QRZ_Sent'] = $row->QRZ_Sent;
$QSLBreakdown['QRZ_Received'] = $row->QRZ_Received;
$QSLBreakdown['QSL_Sent_today'] = $row->QSL_Sent_today;
$QSLBreakdown['QSL_Received_today'] = $row->QSL_Received_today;
$QSLBreakdown['QSL_Requested_today'] = $row->QSL_Requested_today;
$QSLBreakdown['eQSL_Sent_today'] = $row->eQSL_Sent_today;
$QSLBreakdown['eQSL_Received_today'] = $row->eQSL_Received_today;
$QSLBreakdown['LoTW_Sent_today'] = $row->LoTW_Sent_today;
$QSLBreakdown['LoTW_Received_today'] = $row->LoTW_Received_today;
$QSLBreakdown['QRZ_Sent_today'] = $row->QRZ_Sent_today;
$QSLBreakdown['QRZ_Received_today'] = $row->QRZ_Received_today;
}
}
// Return default values if no results
return array(
'QSL_Sent' => 0,
'QSL_Received' => 0,
'QSL_Requested' => 0,
'eQSL_Sent' => 0,
'eQSL_Received' => 0,
'LoTW_Sent' => 0,
'LoTW_Received' => 0,
'QRZ_Sent' => 0,
'QRZ_Received' => 0,
'QSL_Sent_today' => 0,
'QSL_Received_today' => 0,
'QSL_Requested_today' => 0,
'eQSL_Sent_today' => 0,
'eQSL_Received_today' => 0,
'LoTW_Sent_today' => 0,
'LoTW_Received_today' => 0,
'QRZ_Sent_today' => 0,
'QRZ_Received_today' => 0
);
return $QSLBreakdown;
} else {
$QSLBreakdown['QSL_Sent'] = 0;
$QSLBreakdown['QSL_Received'] = 0;
$QSLBreakdown['QSL_Requested'] = 0;
$QSLBreakdown['eQSL_Sent'] = 0;
$QSLBreakdown['eQSL_Received'] = 0;
$QSLBreakdown['LoTW_Sent'] = 0;
$QSLBreakdown['LoTW_Received'] = 0;
$QSLBreakdown['QRZ_Sent'] = 0;
$QSLBreakdown['QRZ_Received'] = 0;
$QSLBreakdown['QSL_Sent_today'] = 0;
$QSLBreakdown['QSL_Received_today'] = 0;
$QSLBreakdown['QSL_Requested_today'] = 0;
$QSLBreakdown['eQSL_Sent_today'] = 0;
$QSLBreakdown['eQSL_Received_today'] = 0;
$QSLBreakdown['LoTW_Sent_today'] = 0;
$QSLBreakdown['LoTW_Received_today'] = 0;
$QSLBreakdown['QRZ_Sent_today'] = 0;
$QSLBreakdown['QRZ_Received_today'] = 0;
return $QSLBreakdown;
}
} else {
return array(
'QSL_Sent' => 0,
'QSL_Received' => 0,
'QSL_Requested' => 0,
'eQSL_Sent' => 0,
'eQSL_Received' => 0,
'LoTW_Sent' => 0,
'LoTW_Received' => 0,
'QRZ_Sent' => 0,
'QRZ_Received' => 0,
'QSL_Sent_today' => 0,
'QSL_Received_today' => 0,
'QSL_Requested_today' => 0,
'eQSL_Sent_today' => 0,
'eQSL_Received_today' => 0,
'LoTW_Sent_today' => 0,
'LoTW_Received_today' => 0,
'QRZ_Sent_today' => 0,
'QRZ_Received_today' => 0
);
$QSLBreakdown['QSL_Sent'] = 0;
$QSLBreakdown['QSL_Received'] = 0;
$QSLBreakdown['QSL_Requested'] = 0;
$QSLBreakdown['eQSL_Sent'] = 0;
$QSLBreakdown['eQSL_Received'] = 0;
$QSLBreakdown['LoTW_Sent'] = 0;
$QSLBreakdown['LoTW_Received'] = 0;
$QSLBreakdown['QRZ_Sent'] = 0;
$QSLBreakdown['QRZ_Received'] = 0;
$QSLBreakdown['QSL_Sent_today'] = 0;
$QSLBreakdown['QSL_Received_today'] = 0;
$QSLBreakdown['QSL_Requested_today'] = 0;
$QSLBreakdown['eQSL_Sent_today'] = 0;
$QSLBreakdown['eQSL_Received_today'] = 0;
$QSLBreakdown['LoTW_Sent_today'] = 0;
$QSLBreakdown['LoTW_Received_today'] = 0;
$QSLBreakdown['QRZ_Sent_today'] = 0;
$QSLBreakdown['QRZ_Received_today'] = 0;
return $QSLBreakdown;
}
}
@ -3007,54 +2985,6 @@ class Logbook_model extends CI_Model
}
}
// Consolidated method to get all country statistics in one query
function get_countries_statistics_consolidated($StationLocationsArray = null)
{
if ($StationLocationsArray == null) {
$CI = &get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
} else {
$logbooks_locations_array = $StationLocationsArray;
}
if (!empty($logbooks_locations_array)) {
// Get both confirmed countries and current countries in one query
$this->db->select('
COUNT(DISTINCT COL_COUNTRY) as Countries_Worked,
COUNT(DISTINCT IF(COL_QSL_RCVD = "Y", COL_COUNTRY, NULL)) as Countries_Worked_QSL,
COUNT(DISTINCT IF(COL_EQSL_QSL_RCVD = "Y", COL_COUNTRY, NULL)) as Countries_Worked_EQSL,
COUNT(DISTINCT IF(COL_LOTW_QSL_RCVD = "Y", COL_COUNTRY, NULL)) as Countries_Worked_LOTW,
COUNT(DISTINCT IF(dxcc_entities.end IS NULL, COL_COUNTRY, NULL)) as Countries_Current
');
$this->db->join('dxcc_entities', 'dxcc_entities.adif = ' . $this->config->item('table_name') . '.col_dxcc', 'left');
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->where('COL_COUNTRY !=', 'Invalid');
$this->db->where('COL_DXCC >', '0');
if ($query = $this->db->get($this->config->item('table_name'))) {
if ($query->num_rows() > 0) {
$row = $query->row();
return array(
'Countries_Worked' => $row->Countries_Worked,
'Countries_Worked_QSL' => $row->Countries_Worked_QSL,
'Countries_Worked_EQSL' => $row->Countries_Worked_EQSL,
'Countries_Worked_LOTW' => $row->Countries_Worked_LOTW,
'Countries_Current' => $row->Countries_Current
);
}
}
}
return array(
'Countries_Worked' => 0,
'Countries_Worked_QSL' => 0,
'Countries_Worked_EQSL' => 0,
'Countries_Worked_LOTW' => 0,
'Countries_Current' => 0
);
}
/* Return total number of countries confirmed with paper QSL */
function total_countries_confirmed_paper()
{
@ -4084,7 +4014,7 @@ class Logbook_model extends CI_Model
return null;
}
}
/*
* Check the dxxc_prefixes table and return (dxcc, country)
*/
@ -4093,7 +4023,7 @@ class Logbook_model extends CI_Model
$csadditions = '/^P$|^R$|^A$|^M$/';
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`, `cont`,`lat`,`long`')
$dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`, `cont`')
->where('call', $call)
->where('(start <= ', $date)
->or_where('start is null)', NULL, false)
@ -4103,7 +4033,7 @@ 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'], $row['cont'], $row['lat'], $row['long']);
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";
@ -4158,7 +4088,7 @@ class Logbook_model extends CI_Model
// 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`, `cont`,`lat`,`long`')
$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)
@ -4171,7 +4101,7 @@ 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'], $row['cont'], $row['lat'], $row['long']);
return array($row['adif'], $row['entity'], $row['cqz'], $row['cont']);
}
}
@ -4411,13 +4341,13 @@ class Logbook_model extends CI_Model
public function get_entity($dxcc)
{
$sql = "SELECT name, cqz, lat, `long` FROM dxcc_entities WHERE adif = ?";
$query = $this->db->query($sql, array($dxcc));
if ($query->num_rows() > 0) {
return $query->row_array();
}
return '';
$sql = "SELECT name, cqz, lat, `long` FROM dxcc_entities WHERE adif = ?";
$query = $this->db->query($sql, array($dxcc));
if ($query->num_rows() > 0) {
return $query->row_array();
}
return '';
}
/*
@ -4508,37 +4438,37 @@ class Logbook_model extends CI_Model
foreach ($r->result_array() as $row) {
$callsign = $row['COL_CALL'];
if ($this->session->userdata('callbook_type') == "QRZ") {
// Lookup using QRZ
$this->load->library('qrz');
// Lookup using QRZ
$this->load->library('qrz');
// Load the encryption library
$this->load->library('encryption');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
if(!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'));
}
if ($this->session->userdata('callbook_type') == "HamQTH") {
// Load the HamQTH library
$this->load->library('hamqth');
// Load the HamQTH library
$this->load->library('hamqth');
// Load the encryption library
$this->load->library('encryption');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if(!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}
$callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
@ -4646,61 +4576,136 @@ class Logbook_model extends CI_Model
}
/**
* Get effective callbook configuration, falling back from session to config file
* Returns array with 'type', 'username', 'password', 'use_config'
*/
private function getCallbookConfig()
{
$callbook_type = $this->session->userdata('callbook_type');
$callbook_username = $this->session->userdata('callbook_username');
$callbook_password = $this->session->userdata('callbook_password');
// If session has valid callbook configuration, use it
if (!empty($callbook_type) && $callbook_type != "None" && !empty($callbook_username) && !empty($callbook_password)) {
// Load the encryption library and decrypt password
$this->load->library('encryption');
$decrypted_password = $this->encryption->decrypt($callbook_password);
return array(
'type' => $callbook_type,
'username' => $callbook_username,
'password' => $decrypted_password,
'use_config' => false
);
}
// Fall back to config file settings
$config_qrz_username = $this->config->item('qrz_username');
$config_qrz_password = $this->config->item('qrz_password');
$config_hamqth_username = $this->config->item('hamqth_username');
$config_hamqth_password = $this->config->item('hamqth_password');
$config_callbook = $this->config->item('callbook');
// Check QRZ config first
if (!empty($config_qrz_username) && !empty($config_qrz_password)) {
return array(
'type' => 'QRZ',
'username' => $config_qrz_username,
'password' => $config_qrz_password,
'use_config' => true
);
}
// Check HamQTH config
if (!empty($config_hamqth_username) && !empty($config_hamqth_password)) {
return array(
'type' => 'HamQTH',
'username' => $config_hamqth_username,
'password' => $config_hamqth_password,
'use_config' => true
);
}
// Check legacy callbook config setting
if ($config_callbook == 'qrz' && !empty($config_qrz_username) && !empty($config_qrz_password)) {
return array(
'type' => 'QRZ',
'username' => $config_qrz_username,
'password' => $config_qrz_password,
'use_config' => true
);
}
if ($config_callbook == 'hamqth' && !empty($config_hamqth_username) && !empty($config_hamqth_password)) {
return array(
'type' => 'HamQTH',
'username' => $config_hamqth_username,
'password' => $config_hamqth_password,
'use_config' => true
);
}
// No valid configuration found
return array(
'type' => null,
'username' => null,
'password' => null,
'use_config' => false
);
}
public function loadCallBook($callsign, $use_fullname = false)
{
$callbook = null;
try {
if ($this->session->userdata('callbook_type') == "QRZ") {
$config = $this->getCallbookConfig();
if ($config['type'] == "QRZ" && !empty($config['username']) && !empty($config['password'])) {
// Lookup using QRZ
$this->load->library('qrz');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
// Use a different session key name for config-based credentials to avoid conflicts
$session_key_name = $config['use_config'] ? 'qrz_config_session_key' : 'qrz_session_key';
if(!$this->session->userdata($session_key_name)) {
$qrz_session_key = $this->qrz->session($config['username'], $config['password']);
$this->session->set_userdata($session_key_name, $qrz_session_key);
}
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
$callbook = $this->qrz->search($callsign, $this->session->userdata($session_key_name), $use_fullname);
// if we got nothing, it's probably because our session key is invalid, try again
if (($callbook['callsign'] ?? '') == '') {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname);
$qrz_session_key = $this->qrz->session($config['username'], $config['password']);
$this->session->set_userdata($session_key_name, $qrz_session_key);
$callbook = $this->qrz->search($callsign, $this->session->userdata($session_key_name), $use_fullname);
// if we still got nothing, and it's a compound callsign, then try a search for the base call
if (($callbook['callsign'] ?? '') == '' && strpos($callsign, "/") !== false) {
$callbook = $this->qrz->search($this->get_plaincall($callsign), $this->session->userdata('qrz_session_key'), $use_fullname);
$callbook = $this->qrz->search($this->get_plaincall($callsign), $this->session->userdata($session_key_name), $use_fullname);
}
}
}
if ($this->session->userdata('callbook_type') == "HamQTH") {
if ($config['type'] == "HamQTH" && !empty($config['username']) && !empty($config['password'])) {
// Load the HamQTH library
$this->load->library('hamqth');
// Load the encryption library
$this->load->library('encryption');
// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
if (!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
// Use a different session key name for config-based credentials to avoid conflicts
$session_key_name = $config['use_config'] ? 'hamqth_config_session_key' : 'hamqth_session_key';
if(!$this->session->userdata($session_key_name)) {
$hamqth_session_key = $this->hamqth->session($config['username'], $config['password']);
$this->session->set_userdata($session_key_name, $hamqth_session_key);
}
$callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
$callbook = $this->hamqth->search($callsign, $this->session->userdata($session_key_name));
// If HamQTH session has expired, start a new session and retry the search.
if ($callbook['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
$hamqth_session_key = $this->hamqth->session($config['username'], $config['password']);
$this->session->set_userdata($session_key_name, $hamqth_session_key);
$callbook = $this->hamqth->search($callsign, $this->session->userdata($session_key_name));
}
}
} finally {
@ -4864,20 +4869,19 @@ class Logbook_model extends CI_Model
// [JSON PLOT] return array for plot qso for map //
public function get_plot_array_for_map($qsos_result, $isVisitor = false)
{
{
$this->load->library('qra');
$CI = &get_instance();
$CI->load->library('DxccFlag');
$json["markers"] = array();
foreach ($qsos_result as $row) {
$plot = array('lat' => 0, 'lng' => 0, 'html' => '', 'label' => '', 'flag' => '', 'confirmed' => 'N');
$plot['label'] = $row->COL_CALL;
$plot['callsign'] = $row->COL_CALL;
$flag = strtolower($CI->dxccflag->getISO($row->COL_DXCC));
$plot['flag'] = '<span data-bs-toggle="tooltip" title="' . ucwords(strtolower(($row->name == null ? "- NONE -" : $row->name))) . '"><span class="fi fi-' . $flag . '"></span></span> ';
$plot['flag'] = '<span data-bs-toggle="tooltip" title="' . ucwords(strtolower(($row->name==null?"- NONE -":$row->name))) . '"><span class="fi fi-' . $flag .'"></span></span> ';
$plot['html'] = ($row->COL_GRIDSQUARE != null ? "<b>Grid:</b> " . $row->COL_GRIDSQUARE . "<br />" : "");
$plot['html'] .= "<b>Date/Time:</b> " . $row->COL_TIME_ON . "<br />";
$plot['html'] .= ($row->COL_SAT_NAME != null) ? ("<b>SAT:</b> " . $row->COL_SAT_NAME . "<br />") : ("<b>Band:</b> " . $row->COL_BAND . " ");
@ -4938,13 +4942,12 @@ class Logbook_model extends CI_Model
}
/**
* Processes a batch of QRZ ADIF records for efficient database updates.
*
* @param array $batch_data Array of records from the ADIF file.
* @return string HTML table rows for the processed batch.
*/
public function process_qrz_batch($batch_data)
{
* Processes a batch of QRZ ADIF records for efficient database updates.
*
* @param array $batch_data Array of records from the ADIF file.
* @return string HTML table rows for the processed batch.
*/
public function process_qrz_batch($batch_data) {
$table = "";
$update_batch_data = [];
$this->load->model('Stations');
@ -4954,14 +4957,14 @@ class Logbook_model extends CI_Model
}
// Step 1: Build WHERE clause for fetching potential matches
$this->db->select($this->config->item('table_name') . '.COL_PRIMARY_KEY, ' . $this->config->item('table_name') . '.COL_CALL, ' . $this->config->item('table_name') . '.COL_TIME_ON, ' . $this->config->item('table_name') . '.COL_BAND, ' . $this->config->item('table_name') . '.COL_MODE, ');
$this->db->select($this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_MODE, ');
$this->db->from($this->config->item('table_name'));
$this->db->group_start(); // Start grouping OR conditions
foreach ($batch_data as $record) {
$this->db->or_group_start(); // Start group for this record's AND conditions
$this->db->where($this->config->item('table_name') . '.COL_CALL', $record['call']);
$this->db->like($this->config->item('table_name') . '.COL_TIME_ON', $record['time_on'], 'after');
$this->db->where($this->config->item('table_name') . '.COL_BAND', $record['band']);
$this->db->where($this->config->item('table_name').'.COL_CALL', $record['call']);
$this->db->where($this->config->item('table_name').'.COL_TIME_ON', $record['time_on']);
$this->db->where($this->config->item('table_name').'.COL_BAND', $record['band']);
$this->db->group_end(); // End group for this record's AND conditions
}
$this->db->group_end(); // End grouping OR conditions
@ -4973,8 +4976,7 @@ class Logbook_model extends CI_Model
// Index DB results for faster lookup
$indexed_results = [];
foreach ($db_results as $row) {
$time = substr($row['COL_TIME_ON'], 0, 16);
$key = $row['COL_CALL'] . '|' . $time . '|' . $row['COL_BAND'];
$key = $row['COL_CALL'] . '|' . $row['COL_TIME_ON'] . '|' . $row['COL_BAND'];
$indexed_results[$key] = $row['COL_PRIMARY_KEY'];
}
@ -4992,7 +4994,7 @@ class Logbook_model extends CI_Model
$update_batch_data[] = [
'COL_PRIMARY_KEY' => $primary_key,
'COL_QRZCOM_QSO_DOWNLOAD_DATE' => $record['qsl_date'],
'COL_QRZCOM_QSO_DOWNLOAD_STATUS' => $record['qsl_rcvd'] // Should be 'Y' if confirmed
'COL_QRZCOM_QSO_UPLOAD_STATUS' => $record['qsl_rcvd'] // Should be 'Y' if confirmed
];
}
@ -5015,100 +5017,6 @@ class Logbook_model extends CI_Model
// Step 6: Return Table HTML
return $table;
}
/**
* Parse date from user input according to user's preferred date format
* @param string $date_input The date string from user input
* @param string $user_format The user's preferred date format (e.g., 'd/m/Y', 'Y-m-d')
* @return string Returns date in Y-m-d format for database storage, or original input if parsing fails
*/
private function parse_user_date($date_input, $user_format = null)
{
if (empty($date_input)) {
return $date_input;
}
// If no user format provided, try to get it from session or config
if ($user_format === null) {
if ($this->session->userdata('user_date_format')) {
$user_format = $this->session->userdata('user_date_format');
} else {
$user_format = $this->config->item('qso_date_format');
}
}
// Try to parse with the user's format first
$date = DateTime::createFromFormat($user_format, $date_input);
if ($date !== false) {
return $date->format('Y-m-d');
}
// Fallback to strtotime for formats it can handle (mostly Y-m-d, m/d/Y, etc.)
$timestamp = strtotime($date_input);
if ($timestamp !== false) {
return date('Y-m-d', $timestamp);
}
// If all parsing fails, return the original input and let the database handle it
return $date_input;
}
/* Consolidated QSO Statistics - Get all basic counts in a single query */
function get_qso_statistics_consolidated($StationLocationsArray = null)
{
if ($StationLocationsArray == null) {
$this->load->model('logbooks_model');
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
} else {
$logbooks_locations_array = $StationLocationsArray;
}
if (!$logbooks_locations_array) {
return array(
'total_qsos' => 0,
'todays_qsos' => 0,
'month_qsos' => 0,
'year_qsos' => 0
);
}
// Calculate date ranges
$today_morning = date('Y-m-d 00:00:00');
$today_night = date('Y-m-d 23:59:59');
$month_morning = date('Y-m-01 00:00:00');
$date = new DateTime('now');
$date->modify('last day of this month');
$month_night = $date->format('Y-m-d') . " 23:59:59";
$year_morning = date('Y-01-01 00:00:00');
$year_night = date('Y-12-31 23:59:59');
// Build the consolidated query
$this->db->select("
COUNT(*) as total_qsos,
COUNT(CASE WHEN COL_TIME_ON >= '$today_morning' AND COL_TIME_ON <= '$today_night' THEN 1 END) as todays_qsos,
COUNT(CASE WHEN COL_TIME_ON >= '$month_morning' AND COL_TIME_ON <= '$month_night' THEN 1 END) as month_qsos,
COUNT(CASE WHEN COL_TIME_ON >= '$year_morning' AND COL_TIME_ON <= '$year_night' THEN 1 END) as year_qsos
", FALSE);
$this->db->where_in('station_id', $logbooks_locations_array);
$query = $this->db->get($this->config->item('table_name'));
if ($query->num_rows() > 0) {
$row = $query->row();
return array(
'total_qsos' => (int)$row->total_qsos,
'todays_qsos' => (int)$row->todays_qsos,
'month_qsos' => (int)$row->month_qsos,
'year_qsos' => (int)$row->year_qsos
);
}
return array(
'total_qsos' => 0,
'todays_qsos' => 0,
'month_qsos' => 0,
'year_qsos' => 0
);
}
}
// Function to validate ADIF date format
@ -5119,4 +5027,4 @@ function validateADIFDate($date, $format = 'Ymd')
{
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
}

查看文件

@ -220,16 +220,6 @@ class Logbooks_model extends CI_Model {
$this->db->update('station_logbooks', $data);
}
function save_public_radio_status($public_radio_status, $logbook_id) {
$data = array(
'public_radio_status' => xss_clean($public_radio_status),
);
$this->db->where('user_id', $this->session->userdata('user_id'));
$this->db->where('logbook_id', xss_clean($logbook_id));
$this->db->update('station_logbooks', $data);
}
function save_public_slug($public_slug, $logbook_id) {
$data = array(
'public_slug' => xss_clean($public_slug),

查看文件

@ -12,7 +12,7 @@ class LotwCert extends CI_Model {
*/
function lotw_certs($user_id) {
$this->db->select('lotw_certs.lotw_cert_id as lotw_cert_id, lotw_certs.callsign as callsign, dxcc_entities.name as cert_dxcc, dxcc_entities.end as cert_dxcc_end, lotw_certs.qso_start_date as qso_start_date, lotw_certs.qso_end_date as qso_end_date, lotw_certs.date_created as date_created, lotw_certs.date_expires as date_expires, lotw_certs.last_upload as last_upload, lotw_certs.archived as archived');
$this->db->select('lotw_certs.lotw_cert_id as lotw_cert_id, lotw_certs.callsign as callsign, dxcc_entities.name as cert_dxcc, dxcc_entities.end as cert_dxcc_end, lotw_certs.qso_start_date as qso_start_date, lotw_certs.qso_end_date as qso_end_date, lotw_certs.date_created as date_created, lotw_certs.date_expires as date_expires, lotw_certs.last_upload as last_upload');
$this->db->where('user_id', $user_id);
$this->db->join('dxcc_entities','lotw_certs.cert_dxcc_id = dxcc_entities.adif','left');
$this->db->order_by('cert_dxcc', 'ASC');
@ -77,29 +77,6 @@ class LotwCert extends CI_Model {
$this->db->delete('lotw_certs');
}
function toggle_archive_certificate($user_id, $lotw_cert_id) {
// First get current archive status
$this->db->select('archived');
$this->db->where('lotw_cert_id', $lotw_cert_id);
$this->db->where('user_id', $user_id);
$query = $this->db->get('lotw_certs');
if($query->num_rows() == 0) {
return false;
}
$current_status = $query->row()->archived;
$new_status = $current_status ? 0 : 1;
// Update the archive status
$data = array('archived' => $new_status);
$this->db->where('lotw_cert_id', $lotw_cert_id);
$this->db->where('user_id', $user_id);
$this->db->update('lotw_certs', $data);
return array('archived' => $new_status);
}
function last_upload($certID) {
$data = array(
@ -119,7 +96,7 @@ class LotwCert extends CI_Model {
}
function lotw_cert_expired($user_id, $date) {
$array = array('user_id' => $user_id, 'date_expires <' => $date, 'archived' => 0);
$array = array('user_id' => $user_id, 'date_expires <' => $date);
$this->db->where($array);
$query = $this->db->get('lotw_certs');
@ -131,7 +108,7 @@ class LotwCert extends CI_Model {
}
function lotw_cert_expiring($user_id, $date) {
$array = array('user_id' => $user_id, 'DATE_SUB(date_expires, INTERVAL 30 DAY) <' => $date, 'date_expires >' => $date, 'archived' => 0);
$array = array('user_id' => $user_id, 'DATE_SUB(date_expires, INTERVAL 30 DAY) <' => $date, 'date_expires >' => $date);
$this->db->where($array);
$query = $this->db->get('lotw_certs');

查看文件

@ -1,216 +0,0 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Mostworked_model extends CI_Model
{
/*
* Get callsigns worked more than a minimum number of times from the active logbook
*/
function get_most_worked_callsigns($filters = array())
{
$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 array();
}
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
// Set defaults
$min_qsos = isset($filters['min_qsos']) ? intval($filters['min_qsos']) : 5;
$band = isset($filters['band']) ? $filters['band'] : 'all';
$mode = isset($filters['mode']) ? $filters['mode'] : 'all';
$satellite = isset($filters['satellite']) ? $filters['satellite'] : 'all';
$fromdate = isset($filters['fromdate']) ? $filters['fromdate'] : '';
$todate = isset($filters['todate']) ? $filters['todate'] : '';
$sql = "SELECT
CASE
WHEN col_call REGEXP '/[PMAQLBR]$|/MM$|/AM$|/QRP$|/LH$|/BCN$' THEN
SUBSTRING(col_call, 1, LOCATE('/', col_call) - 1)
ELSE
col_call
END as callsign,
COUNT(*) as contact_count,
MIN(col_time_on) as first_qso,
MAX(col_time_on) as last_qso,
GROUP_CONCAT(DISTINCT col_band ORDER BY col_band) as bands,
GROUP_CONCAT(DISTINCT COALESCE(col_submode, col_mode) ORDER BY col_mode) as modes
FROM " . $this->config->item('table_name') . "
WHERE station_id IN (" . $location_list . ")
AND col_call IS NOT NULL
AND col_call != ''";
// Apply filters
if ($band != 'all') {
if ($band == 'SAT') {
$sql .= " AND col_prop_mode = 'SAT'";
} else {
$sql .= " AND col_band = '" . $this->db->escape_str($band) . "'";
$sql .= " AND (col_prop_mode != 'SAT' OR col_prop_mode IS NULL)";
}
}
if ($mode != 'all') {
$sql .= " AND (col_mode = '" . $this->db->escape_str($mode) . "' OR col_submode = '" . $this->db->escape_str($mode) . "')";
}
if ($satellite != 'all') {
$sql .= " AND col_sat_name = '" . $this->db->escape_str($satellite) . "'";
}
if (!empty($fromdate)) {
$sql .= " AND DATE(col_time_on) >= '" . $this->db->escape_str($fromdate) . "'";
}
if (!empty($todate)) {
$sql .= " AND DATE(col_time_on) <= '" . $this->db->escape_str($todate) . "'";
}
$sql .= " GROUP BY CASE
WHEN col_call REGEXP '/[PMAQLBR]$|/MM$|/AM$|/QRP$|/LH$|/BCN$' THEN
SUBSTRING(col_call, 1, LOCATE('/', col_call) - 1)
ELSE
col_call
END
HAVING contact_count >= " . $min_qsos . "
ORDER BY contact_count DESC, callsign ASC";
$query = $this->db->query($sql);
return $query->result();
}
/*
* Get list of modes from the active logbook
*/
function get_modes()
{
$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 array();
}
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$sql = "SELECT DISTINCT COALESCE(col_submode, col_mode) as mode
FROM " . $this->config->item('table_name') . "
WHERE station_id IN (" . $location_list . ")
AND COALESCE(col_submode, col_mode) IS NOT NULL
AND COALESCE(col_submode, col_mode) != ''
ORDER BY mode";
$query = $this->db->query($sql);
return $query->result();
}
/*
* Get list of satellites from the active logbook
*/
function get_satellites()
{
$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 array();
}
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$sql = "SELECT DISTINCT col_sat_name as satellite
FROM " . $this->config->item('table_name') . "
WHERE station_id IN (" . $location_list . ")
AND col_sat_name IS NOT NULL
AND col_sat_name != ''
ORDER BY col_sat_name";
$query = $this->db->query($sql);
return $query->result();
}
/*
* Get list of bands from the active logbook
*/
function get_bands()
{
$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 array();
}
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$sql = "SELECT DISTINCT col_band as band
FROM " . $this->config->item('table_name') . "
WHERE station_id IN (" . $location_list . ")
AND col_band IS NOT NULL
AND col_band != ''
AND (col_prop_mode != 'SAT' OR col_prop_mode IS NULL)
ORDER BY
CASE col_band
WHEN '160m' THEN 1
WHEN '80m' THEN 2
WHEN '60m' THEN 3
WHEN '40m' THEN 4
WHEN '30m' THEN 5
WHEN '20m' THEN 6
WHEN '17m' THEN 7
WHEN '15m' THEN 8
WHEN '12m' THEN 9
WHEN '10m' THEN 10
WHEN '6m' THEN 11
WHEN '4m' THEN 12
WHEN '2m' THEN 13
WHEN '1.25m' THEN 14
WHEN '70cm' THEN 15
ELSE 999
END, col_band";
$query = $this->db->query($sql);
$results = array();
foreach($query->result() as $row) {
$results[] = $row->band;
}
return $results;
}
/*
* Get detailed contact information for a specific callsign
*/
function get_callsign_details($callsign)
{
$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 array();
}
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$this->db->select('col_time_on, col_band, col_mode, col_submode, col_rst_sent, col_rst_rcvd, col_country, col_qsl_sent, col_qsl_rcvd');
$this->db->from($this->config->item('table_name'));
$this->db->where('station_id IN (' . $location_list . ')', NULL, FALSE);
$this->db->where('col_call', $callsign);
$this->db->order_by('col_time_on', 'DESC');
$query = $this->db->get();
return $query->result();
}
}

查看文件

@ -24,25 +24,6 @@ class Setup_model extends CI_Model {
return $query->row()->count;
}
// Consolidated method to get all setup counts in one query
function getAllSetupCounts() {
$userid = xss_clean($this->session->userdata('user_id'));
$sql = "SELECT
(SELECT COUNT(*) FROM dxcc_entities) as country_count,
(SELECT COUNT(*) FROM station_logbooks WHERE user_id = {$userid}) as logbook_count,
(SELECT COUNT(*) FROM station_profile WHERE user_id = {$userid}) as location_count";
$query = $this->db->query($sql);
$row = $query->row();
return array(
'country_count' => $row->country_count,
'logbook_count' => $row->logbook_count,
'location_count' => $row->location_count
);
}
}
?>

查看文件

@ -77,9 +77,9 @@ class Stations extends CI_Model {
// Check if the state is Canada and get the correct state
if ($this->input->post('dxcc') == 1 && $this->input->post('station_ca_state') !="") {
$state = xss_clean($this->input->post('station_ca_state', true));
$state = $this->input->post('station_ca_state');
} else {
$state = xss_clean($this->input->post('station_state', true));
$state = $this->input->post('station_state');
}
// Create data array with field values
@ -131,9 +131,9 @@ class Stations extends CI_Model {
// Check if the state is Canada and get the correct state
if ($this->input->post('dxcc') == 1 && $this->input->post('station_ca_state') !="") {
$state = xss_clean($this->input->post('station_ca_state', true));
$state = $this->input->post('station_ca_state');
} else {
$state = xss_clean($this->input->post('station_state', true));
$state = $this->input->post('station_state');
}
$data = array(

查看文件

@ -88,20 +88,10 @@
}
}
// Initialize bandcalls array with all bands set to 0
foreach ($bands as $band) {
$bandcalls[$band] = 0;
}
foreach ($bandunique as $band) {
$bandcalls[$band->band] = $band->calls;
}
// Initialize modecalls array with all modes set to 0
foreach ($modes as $mode) {
$modecalls[$mode] = 0;
}
foreach ($modeunique as $mode) {
//if ($mode->col_submode == null) {
if ($mode->col_submode == null || $mode->col_submode == "") {

某些文件未显示,因为此 diff 中更改的文件太多 显示更多