2012-11-19 22:24:10 +00:00
|
|
|
<?php
|
|
|
|
|
class Update extends CI_Controller {
|
|
|
|
|
|
|
|
|
|
/*
|
2024-01-17 14:20:10 +00:00
|
|
|
Controls Updating Elements of Wavelog
|
2012-11-19 22:24:10 +00:00
|
|
|
Functions:
|
2014-03-03 17:28:33 +00:00
|
|
|
dxcc - imports the latest clublog cty.xml data
|
|
|
|
|
lotw_users - imports lotw users
|
2012-11-19 22:24:10 +00:00
|
|
|
*/
|
2016-02-17 15:06:43 +00:00
|
|
|
|
2024-02-29 13:52:54 +01:00
|
|
|
function __construct()
|
|
|
|
|
{
|
|
|
|
|
parent::__construct();
|
2024-03-29 08:53:23 +01:00
|
|
|
|
2024-02-29 13:52:54 +01:00
|
|
|
if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') {
|
2024-06-08 11:01:59 +02:00
|
|
|
echo __("Maintenance Mode is active. Try again later.")."\n";
|
2024-02-29 13:52:54 +01:00
|
|
|
redirect('user/login');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-19 22:24:10 +00:00
|
|
|
public function index()
|
|
|
|
|
{
|
2024-04-22 23:32:34 +02:00
|
|
|
$this->load->model('user_model');
|
2024-08-16 10:08:44 +02:00
|
|
|
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
2024-04-22 23:32:34 +02:00
|
|
|
|
2024-06-08 11:01:59 +02:00
|
|
|
$data['page_title'] = __("Updates");
|
2019-05-25 17:59:19 +01:00
|
|
|
$this->load->view('interface_assets/header', $data);
|
2016-02-17 15:06:43 +00:00
|
|
|
$this->load->view('update/index');
|
2019-05-25 17:59:19 +01:00
|
|
|
$this->load->view('interface_assets/footer');
|
2016-04-02 16:24:28 +01:00
|
|
|
|
2012-11-19 22:24:10 +00:00
|
|
|
}
|
2016-02-17 15:06:43 +00:00
|
|
|
|
2025-01-16 17:11:06 +01:00
|
|
|
/*
|
2025-01-16 17:19:37 +01:00
|
|
|
* Load the DXCC entities
|
|
|
|
|
*/
|
|
|
|
|
public function dxcc_entities($xml_data = null) {
|
|
|
|
|
// Ensure the Paths library is loaded
|
|
|
|
|
if (!$this->load->is_loaded('Paths')) {
|
|
|
|
|
$this->load->library('Paths');
|
2024-07-21 17:47:09 +02:00
|
|
|
}
|
2025-01-16 17:19:37 +01:00
|
|
|
|
|
|
|
|
// Load XML data if not provided
|
|
|
|
|
if ($xml_data === null) {
|
2025-01-16 17:11:06 +01:00
|
|
|
$xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml"));
|
|
|
|
|
}
|
2024-01-25 05:20:44 +00:00
|
|
|
|
2025-01-16 17:19:37 +01:00
|
|
|
$a_data = [];
|
|
|
|
|
$batch_size = 100; // Batch size for database insertion
|
2024-01-25 05:20:44 +00:00
|
|
|
$count = 0;
|
2025-01-16 17:19:37 +01:00
|
|
|
|
2016-02-17 15:06:43 +00:00
|
|
|
foreach ($xml_data->entities->entity as $entity) {
|
2025-01-16 17:19:37 +01:00
|
|
|
$a_data[] = [
|
|
|
|
|
'adif' => isset($entity->adif) ? (int) $entity->adif : 0,
|
|
|
|
|
'name' => isset($entity->cqz) ? (string) $entity->name : (string) $entity->entity,
|
|
|
|
|
'prefix' => isset($entity->cqz) ? (string) $entity->prefix : (string) $entity->call,
|
|
|
|
|
'ituz' => isset($entity->ituz) ? (float) $entity->ituz : 0,
|
|
|
|
|
'cqz' => isset($entity->cqz) ? (int) $entity->cqz : 0,
|
|
|
|
|
'cont' => isset($entity->cont) ? (string) $entity->cont : '',
|
|
|
|
|
'long' => isset($entity->long) ? (float) $entity->long : 0,
|
|
|
|
|
'lat' => isset($entity->lat) ? (float) $entity->lat : 0,
|
|
|
|
|
'start' => isset($entity->start) ? date('Y-m-d H:i:s', strtotime($entity->start)) : null,
|
|
|
|
|
'end' => isset($entity->end) ? date('Y-m-d H:i:s', strtotime($entity->end)) : null,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$count++;
|
|
|
|
|
|
|
|
|
|
// Insert in batches for better performance
|
|
|
|
|
if ($count % $batch_size === 0) {
|
|
|
|
|
$this->db->insert_batch('dxcc_entities', $a_data);
|
|
|
|
|
$a_data = []; // Clear batch data
|
|
|
|
|
$this->update_status(__("Preparing DXCC-Entries: ") . $count);
|
2024-01-25 05:20:44 +00:00
|
|
|
}
|
2025-01-16 17:19:37 +01:00
|
|
|
}
|
2024-01-25 05:20:44 +00:00
|
|
|
|
2025-01-16 17:19:37 +01:00
|
|
|
// Add the final special entity
|
|
|
|
|
$a_data[] = [
|
|
|
|
|
'adif' => 0,
|
|
|
|
|
'name' => '- NONE - (e.g. /MM, /AM)',
|
|
|
|
|
'prefix' => '',
|
|
|
|
|
'ituz' => 0,
|
|
|
|
|
'cqz' => 0,
|
|
|
|
|
'cont' => '',
|
|
|
|
|
'long' => 0,
|
|
|
|
|
'lat' => 0,
|
|
|
|
|
'start' => null,
|
|
|
|
|
'end' => null,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// Insert remaining data
|
|
|
|
|
if (!empty($a_data)) {
|
|
|
|
|
$this->db->insert_batch('dxcc_entities', $a_data);
|
2016-02-17 15:06:43 +00:00
|
|
|
}
|
2025-01-16 17:19:37 +01:00
|
|
|
|
|
|
|
|
$this->update_status(); // Final status update
|
2024-02-02 09:28:49 +01:00
|
|
|
return $count;
|
2016-02-17 15:06:43 +00:00
|
|
|
}
|
|
|
|
|
|
2025-01-16 17:19:37 +01:00
|
|
|
/*
|
|
|
|
|
* Load the dxcc prefixes
|
|
|
|
|
*/
|
2025-01-16 17:11:06 +01:00
|
|
|
public function dxcc_exceptions($xml_data = null) {
|
|
|
|
|
// Ensure the Paths library is loaded
|
|
|
|
|
if (!$this->load->is_loaded('Paths')) {
|
|
|
|
|
$this->load->library('Paths');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Load XML data if not provided
|
|
|
|
|
if ($xml_data === null) {
|
|
|
|
|
$xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$a_data = [];
|
|
|
|
|
$batch_size = 100; // Batch size for efficient database inserts
|
|
|
|
|
$count = 0;
|
|
|
|
|
|
|
|
|
|
foreach ($xml_data->exceptions->exception as $record) {
|
|
|
|
|
$a_data[] = [
|
|
|
|
|
'record' => (int) $record->attributes()->record,
|
|
|
|
|
'call' => (string) $record->call,
|
|
|
|
|
'entity' => (string) $record->entity,
|
|
|
|
|
'adif' => (int) $record->adif,
|
|
|
|
|
'cqz' => (int) $record->cqz,
|
|
|
|
|
'cont' => (string) $record->cont,
|
|
|
|
|
'long' => (float) $record->long,
|
|
|
|
|
'lat' => (float) $record->lat,
|
2025-01-17 07:51:21 +01:00
|
|
|
'start' => (!empty($record->start) && strtotime($record->start)) ? date('Y-m-d H:i:s', strtotime($record->start)) : null,
|
2025-01-16 17:11:06 +01:00
|
|
|
'end' => $record->end ? date('Y-m-d H:i:s', strtotime($record->end)) : null,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$count++;
|
|
|
|
|
|
|
|
|
|
// Insert in batches for better performance
|
|
|
|
|
if ($count % $batch_size === 0) {
|
|
|
|
|
$this->db->insert_batch('dxcc_exceptions', $a_data);
|
|
|
|
|
$a_data = []; // Clear batch data
|
|
|
|
|
$this->update_status(__("Preparing DXCC Exceptions: ") . $count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert any remaining records
|
|
|
|
|
if (!empty($a_data)) {
|
|
|
|
|
$this->db->insert_batch('dxcc_exceptions', $a_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->update_status(); // Final status update
|
|
|
|
|
return $count;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-16 17:19:37 +01:00
|
|
|
/*
|
|
|
|
|
* Load the dxcc prefixes
|
2016-02-17 15:06:43 +00:00
|
|
|
*/
|
2025-01-16 17:11:06 +01:00
|
|
|
public function dxcc_prefixes($xml_data = null) {
|
|
|
|
|
// Load the cty file
|
|
|
|
|
if (!$this->load->is_loaded('Paths')) {
|
|
|
|
|
$this->load->library('Paths');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Load XML data if not provided
|
|
|
|
|
if ($xml_data === null) {
|
|
|
|
|
$xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$a_data = [];
|
|
|
|
|
$batch_size = 100; // Insert in batches of 100 for efficiency
|
|
|
|
|
$count = 0;
|
|
|
|
|
|
|
|
|
|
foreach ($xml_data->prefixes->prefix as $record) {
|
|
|
|
|
$a_data[] = [
|
|
|
|
|
'record' => (int) $record->attributes()->record,
|
|
|
|
|
'call' => (string) $record->call,
|
|
|
|
|
'entity' => (string) $record->entity,
|
|
|
|
|
'adif' => (int) $record->adif,
|
|
|
|
|
'cqz' => (int) $record->cqz,
|
|
|
|
|
'cont' => (string) $record->cont,
|
|
|
|
|
'long' => (float) $record->long,
|
|
|
|
|
'lat' => (float) $record->lat,
|
2025-01-17 07:51:21 +01:00
|
|
|
'start' => (!empty($record->start) && strtotime($record->start)) ? date('Y-m-d H:i:s', strtotime($record->start)) : null,
|
2025-01-16 17:11:06 +01:00
|
|
|
'end' => $record->end ? date('Y-m-d H:i:s', strtotime($record->end)) : null,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$count++;
|
|
|
|
|
|
|
|
|
|
// Insert in batches to avoid memory overload
|
|
|
|
|
if ($count % $batch_size === 0) {
|
|
|
|
|
$this->db->insert_batch('dxcc_prefixes', $a_data);
|
|
|
|
|
$a_data = []; // Clear the batch array
|
|
|
|
|
$this->update_status(__("Preparing DXCC Prefixes: ") . $count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Insert any remaining records
|
|
|
|
|
if (!empty($a_data)) {
|
|
|
|
|
$this->db->insert_batch('dxcc_prefixes', $a_data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->update_status(); // Clear the status message
|
|
|
|
|
return $count;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-08 20:53:14 +01:00
|
|
|
// Updates the DXCC & Exceptions from the Club Log Cty.xml file.
|
2012-11-19 22:24:10 +00:00
|
|
|
public function dxcc() {
|
2016-02-17 15:06:43 +00:00
|
|
|
|
2024-07-21 17:47:09 +02:00
|
|
|
if(!$this->load->is_loaded('Paths')) {
|
|
|
|
|
$this->load->library('Paths');
|
|
|
|
|
}
|
2024-02-02 09:28:49 +01:00
|
|
|
|
2024-05-03 11:14:52 +02:00
|
|
|
// set the last run in cron table for the correct cron id
|
2024-04-26 17:43:58 +02:00
|
|
|
$this->load->model('cron_model');
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->cron_model->set_last_run($this->router->class.'_'.$this->router->method);
|
2014-03-03 01:26:26 +00:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->update_status("Downloading file");
|
2024-02-02 09:28:49 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
// give it 10 minutes...
|
|
|
|
|
set_time_limit(600);
|
2023-02-08 17:32:08 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
// Load Migration data if any.
|
|
|
|
|
$this->load->library('migration');
|
|
|
|
|
$this->fix_migrations();
|
|
|
|
|
$this->migration->latest();
|
2020-09-01 20:16:21 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
// Download latest file.
|
2025-01-03 19:26:01 +01:00
|
|
|
$url = "https://cdn.clublog.org/cty.php?api=608df94896cb9c5421ae748235492b43815610c9";
|
2024-02-02 09:28:49 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$gz = gzopen($url, 'r');
|
|
|
|
|
if ($gz === FALSE) {
|
2025-01-03 19:24:55 +01:00
|
|
|
$msg = "FAILED: Could not download data from clublog.org. Trying alternative URL.";
|
|
|
|
|
$this->update_status($msg);
|
|
|
|
|
log_message('error', $msg);
|
|
|
|
|
|
|
|
|
|
$alt_url = "https://github.com/wavelog/dxcc_data/raw/refs/heads/master/cty.xml.gz";
|
|
|
|
|
$gz = gzopen($alt_url, 'r');
|
|
|
|
|
|
|
|
|
|
if ($gz === FALSE) {
|
|
|
|
|
$msg = "FAILED: Could not download dxcc data. Please check your internet connection.";
|
|
|
|
|
$this->update_status($msg);
|
|
|
|
|
log_message('error', $msg);
|
|
|
|
|
exit();
|
|
|
|
|
} else {
|
|
|
|
|
$msg = "Downloaded data successfully from alternative URL (github).";
|
|
|
|
|
$this->update_status($msg);
|
|
|
|
|
log_message('debug', $msg);
|
|
|
|
|
}
|
2024-05-05 09:33:35 +02:00
|
|
|
}
|
2023-02-08 17:32:08 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$data = "";
|
|
|
|
|
while (!gzeof($gz)) {
|
|
|
|
|
$data .= gzgetc($gz);
|
|
|
|
|
}
|
|
|
|
|
gzclose($gz);
|
2020-09-01 20:16:21 +01:00
|
|
|
|
2024-05-05 10:05:48 +02:00
|
|
|
if (file_put_contents($this->paths->make_update_path("cty.xml"), $data) === FALSE) {
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->update_status("FAILED: Could not write to cty.xml file");
|
2024-12-03 11:11:04 +01:00
|
|
|
log_message('error', 'DXCC UPDATE FAILED: Could not write to cty.xml file');
|
2024-07-21 17:47:09 +02:00
|
|
|
exit();
|
2024-05-05 09:33:35 +02:00
|
|
|
}
|
2012-11-19 22:24:10 +00:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
// Clear the tables, ready for new data
|
|
|
|
|
$this->db->empty_table("dxcc_entities");
|
|
|
|
|
$this->db->empty_table("dxcc_exceptions");
|
|
|
|
|
$this->db->empty_table("dxcc_prefixes");
|
|
|
|
|
$this->update_status();
|
2016-02-17 15:06:43 +00:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
// Parse the three sections of the file and update the tables
|
|
|
|
|
$this->db->trans_start();
|
2025-01-16 17:11:06 +01:00
|
|
|
$xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml"));
|
|
|
|
|
$this->dxcc_exceptions($xml_data);
|
|
|
|
|
$this->dxcc_entities($xml_data);
|
|
|
|
|
$this->dxcc_prefixes($xml_data);
|
2024-09-11 11:21:30 +02:00
|
|
|
$sql = "update dxcc_entities
|
|
|
|
|
join dxcc_temp on dxcc_entities.adif = dxcc_temp.adif
|
|
|
|
|
set dxcc_entities.ituz = dxcc_temp.ituz;";
|
|
|
|
|
$this->db->query($sql);
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->db->trans_complete();
|
2016-02-17 15:06:43 +00:00
|
|
|
|
2024-06-08 11:20:00 +02:00
|
|
|
$this->update_status(__("DONE"));
|
2024-07-21 17:47:09 +02:00
|
|
|
|
|
|
|
|
echo 'success';
|
2016-02-17 15:06:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function update_status($done=""){
|
|
|
|
|
|
2024-07-21 17:47:09 +02:00
|
|
|
if(!$this->load->is_loaded('Paths')) {
|
|
|
|
|
$this->load->library('Paths');
|
|
|
|
|
}
|
2024-05-05 09:33:35 +02:00
|
|
|
|
2024-01-25 05:20:44 +00:00
|
|
|
if ($done != "Downloading file"){
|
|
|
|
|
// Check that everything is done?
|
|
|
|
|
if ($done == ""){
|
2024-07-21 17:47:09 +02:00
|
|
|
$done = __("Updating...");
|
2024-01-25 05:20:44 +00:00
|
|
|
}
|
|
|
|
|
$html = $done."<br/>";
|
2024-07-21 17:47:09 +02:00
|
|
|
$html .= __("Dxcc Entities:")." ".$this->db->count_all('dxcc_entities')."<br/>";
|
|
|
|
|
$html .= __("Dxcc Exceptions:")." ".$this->db->count_all('dxcc_exceptions')."<br/>";
|
|
|
|
|
$html .= __("Dxcc Prefixes:")." ".$this->db->count_all('dxcc_prefixes')."<br/>";
|
2024-01-25 05:20:44 +00:00
|
|
|
} else {
|
|
|
|
|
$html = $done."....<br/>";
|
|
|
|
|
}
|
2016-02-17 15:06:43 +00:00
|
|
|
|
2024-05-05 10:05:48 +02:00
|
|
|
file_put_contents($this->paths->make_update_path("status.html"), $html);
|
2016-02-17 15:06:43 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-11 13:58:43 +01:00
|
|
|
|
2016-02-17 15:06:43 +00:00
|
|
|
private function fix_migrations(){
|
2024-05-05 09:33:35 +02:00
|
|
|
$res = $this->db->query("SELECT version FROM migrations");
|
2016-02-17 15:06:43 +00:00
|
|
|
if ($res->num_rows() >0){
|
|
|
|
|
$row = $res->row();
|
|
|
|
|
$version = $row->version;
|
|
|
|
|
|
|
|
|
|
if ($version < 7){
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->db->query("UPDATE migrations SET version=7");
|
2016-02-17 15:06:43 +00:00
|
|
|
}
|
|
|
|
|
}
|
2012-11-19 22:24:10 +00:00
|
|
|
}
|
2024-02-02 09:28:49 +01:00
|
|
|
|
2016-02-23 22:00:35 +00:00
|
|
|
public function check_missing_dxcc($all = false){
|
2024-03-29 08:53:23 +01:00
|
|
|
$this->load->model('user_model');
|
|
|
|
|
if (!$this->user_model->authorize(99)) {
|
2024-08-16 10:08:44 +02:00
|
|
|
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
2024-03-29 08:53:23 +01:00
|
|
|
redirect('dashboard');
|
|
|
|
|
}
|
2016-02-22 08:09:50 +00:00
|
|
|
|
2024-03-29 08:53:23 +01:00
|
|
|
$this->load->model('logbook_model');
|
|
|
|
|
$this->logbook_model->check_missing_dxcc_id($all);
|
2016-02-22 08:09:50 +00:00
|
|
|
}
|
2024-02-02 09:28:49 +01:00
|
|
|
|
2023-02-04 17:41:21 +01:00
|
|
|
public function check_missing_continent() {
|
2024-03-29 08:53:23 +01:00
|
|
|
$this->load->model('user_model');
|
|
|
|
|
if (!$this->user_model->authorize(99)) {
|
2024-08-16 10:08:44 +02:00
|
|
|
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
2024-03-29 08:53:23 +01:00
|
|
|
redirect('dashboard');
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-04 17:41:21 +01:00
|
|
|
$this->load->model('logbook_model');
|
|
|
|
|
$this->logbook_model->check_missing_continent();
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-17 22:39:33 +02:00
|
|
|
public function update_distances($all = false) {
|
2024-03-29 08:53:23 +01:00
|
|
|
$this->load->model('user_model');
|
|
|
|
|
if (!$this->user_model->authorize(99)) {
|
2024-08-16 10:08:44 +02:00
|
|
|
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
2024-03-29 08:53:23 +01:00
|
|
|
redirect('dashboard');
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-19 14:02:08 +02:00
|
|
|
$this->load->model('logbook_model');
|
2024-08-17 22:39:33 +02:00
|
|
|
$this->logbook_model->update_distances($all);
|
2023-06-19 14:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
2021-03-30 21:04:49 -04:00
|
|
|
public function check_missing_grid($all = false){
|
2024-03-29 08:53:23 +01:00
|
|
|
$this->load->model('user_model');
|
|
|
|
|
if (!$this->user_model->authorize(99)) {
|
2024-08-16 10:08:44 +02:00
|
|
|
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
2024-03-29 08:53:23 +01:00
|
|
|
redirect('dashboard');
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-30 21:04:49 -04:00
|
|
|
$this->load->model('logbook_model');
|
|
|
|
|
$this->logbook_model->check_missing_grid_id($all);
|
|
|
|
|
}
|
2016-02-22 08:09:50 +00:00
|
|
|
|
2019-10-11 16:42:18 +01:00
|
|
|
public function update_clublog_scp() {
|
2024-04-22 23:57:29 +02:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$result = $this->Update_model->clublog_scp();
|
|
|
|
|
echo $result;
|
2024-04-22 23:57:29 +02:00
|
|
|
|
2019-10-11 16:42:18 +01:00
|
|
|
}
|
|
|
|
|
|
2020-09-21 14:02:50 +01:00
|
|
|
public function download_lotw_users() {
|
2024-07-11 23:22:25 +02:00
|
|
|
$this->lotw_users();
|
2020-09-21 14:02:50 +01:00
|
|
|
}
|
|
|
|
|
|
2023-05-26 10:38:31 +02:00
|
|
|
public function lotw_users() {
|
2024-02-29 13:52:54 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$result = $this->Update_model->lotw_users();
|
|
|
|
|
echo $result;
|
2024-02-29 13:52:54 +01:00
|
|
|
|
2023-05-26 10:38:31 +02:00
|
|
|
}
|
|
|
|
|
|
2021-01-26 17:54:31 +01:00
|
|
|
/*
|
|
|
|
|
* Used for autoupdating the DOK file which is used in the QSO entry dialog for autocompletion.
|
|
|
|
|
*/
|
|
|
|
|
public function update_dok() {
|
|
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$result = $this->Update_model->dok();
|
|
|
|
|
echo $result;
|
2024-09-11 11:21:30 +02:00
|
|
|
|
2021-01-26 17:54:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Used for autoupdating the SOTA file which is used in the QSO entry dialog for autocompletion.
|
|
|
|
|
*/
|
|
|
|
|
public function update_sota() {
|
2023-02-08 17:32:08 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$result = $this->Update_model->sota();
|
|
|
|
|
echo $result;
|
2024-09-11 11:21:30 +02:00
|
|
|
|
2021-01-26 17:54:31 +01:00
|
|
|
}
|
|
|
|
|
|
2022-08-17 16:54:04 +02:00
|
|
|
/*
|
|
|
|
|
* Pulls the WWFF directory for autocompletion in QSO dialogs
|
|
|
|
|
*/
|
|
|
|
|
public function update_wwff() {
|
2023-02-08 17:32:08 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$result = $this->Update_model->wwff();
|
|
|
|
|
echo $result;
|
2023-02-08 17:32:08 +01:00
|
|
|
|
2022-08-17 16:54:04 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-30 17:01:57 +01:00
|
|
|
public function update_pota() {
|
2023-02-08 17:32:08 +01:00
|
|
|
|
2024-05-05 09:33:35 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$result = $this->Update_model->pota();
|
|
|
|
|
echo $result;
|
2024-09-11 11:21:30 +02:00
|
|
|
|
2022-11-30 17:01:57 +01:00
|
|
|
}
|
2020-09-21 14:02:50 +01:00
|
|
|
|
2024-12-09 21:34:46 +01:00
|
|
|
public function update_tle() {
|
|
|
|
|
$this->load->model('Update_model');
|
2024-12-07 20:04:28 +01:00
|
|
|
$result = $this->Update_model->tle();
|
|
|
|
|
echo $result;
|
2024-12-09 21:34:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function update_lotw_sats() {
|
|
|
|
|
$this->load->model('Update_model');
|
2024-12-12 13:25:53 +01:00
|
|
|
$bodyData['satupdates'] = $this->Update_model->lotw_sats();
|
|
|
|
|
$data['page_title'] = __("LoTW SAT Update");
|
|
|
|
|
$this->load->view('interface_assets/header', $data);
|
|
|
|
|
$this->load->view('lotw/satupdate', $bodyData);
|
|
|
|
|
$this->load->view('interface_assets/footer');
|
2024-12-09 21:34:46 +01:00
|
|
|
}
|
2024-05-01 21:06:47 +02:00
|
|
|
|
2024-09-12 17:55:36 +02:00
|
|
|
function version_check() {
|
|
|
|
|
// set the last run in cron table for the correct cron id
|
|
|
|
|
$this->load->model('cron_model');
|
|
|
|
|
$this->cron_model->set_last_run($this->router->class . '_' . $this->router->method);
|
2024-12-07 20:04:28 +01:00
|
|
|
|
2024-09-12 16:09:12 +02:00
|
|
|
$this->load->model('Update_model');
|
|
|
|
|
$this->Update_model->update_check();
|
2024-09-12 15:24:18 +02:00
|
|
|
}
|
2012-11-19 22:24:10 +00:00
|
|
|
}
|
2016-02-17 15:06:43 +00:00
|
|
|
?>
|