Merge branch 'dev' of https://github.com/emics/Cloudlog into dev

这个提交包含在:
Emiliano Macedonio 2024-06-07 13:29:17 +02:00
当前提交 5e77c84549
共有 9 个文件被更改,包括 466 次插入256 次删除

查看文件

@ -1,12 +1,11 @@
# Cloudlog
[![Cypress Tests](https://github.com/magicbug/Cloudlog/actions/workflows/cypress-tests.yml/badge.svg)](https://github.com/magicbug/Cloudlog/actions/workflows/cypress-tests.yml)
# Cloudlog
> Important: Only accepting PRs on the "dev" branch.
Cloudlog is a self-hosted PHP application that allows you to log your amateur radio contacts anywhere. All you need is a web browser and active internet connection.
While Cloudlog as started by Peter Goodhall, 2M0SQL, it is has gained a core group of contributors these are listed below. If you would like to contribute to Cloudlog please see the [Contributing](#contributing) section below.
Core Contributors: 2M0SQL ([@magicbug](https://github.com/magicbug)), LA8AJA ([@AndreasK79](https://github.com/AndreasK79)), DF2ET ([@phl0](https://github.com/phl0)), HB9HIL ([@HB9HIL](https://github.com/HB9HIL)), DJ7NT ([@int2001](https://github.com/int2001))
While Cloudlog as started by Peter Goodhall, 2M0SQL, although since has received a lot of community code contributions. If you would like to contribute to Cloudlog please see the [Contributing](#contributing) section below.
Website: [http://www.cloudlog.co.uk](http://www.cloudlog.co.uk)
@ -114,7 +113,11 @@ If you would prefer not to setup Cloudlog yourself [magicbug](https://magicbug.c
If you would like to contribute in any way to Cloudlog, it is most appreciated. This has been developed in free time, help coding new features or writing documentation is always useful.
Please note that Cloudlog was built using [Codeigniter](https://www.codeigniter.com/docs) version 3 and uses Bootstrap 4 for the user CSS framework documentation is available for this when building components.
Please note that Cloudlog was built using [Codeigniter](https://www.codeigniter.com/userguide3/) version 3 and uses [Bootstrap 5](https://getbootstrap.com/docs/5.3/getting-started/introduction/) as the frontend toolkit.
We also [HTMX](https://htmx.org/) for AJAX requests and [jQuery](https://jquery.com/) for some of the frontend functionality. We use [Font Awesome](https://fontawesome.com/) for icons.
At the moment we use [Cypress](https://www.cypress.io/) for end-to-end testing.
When submitting PRs please make sure code is commented and includes one feature only, multiple features or bug fixes will not be accepted. Please include a description of what your PR does and why it is needed.

查看文件

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

查看文件

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

查看文件

@ -165,7 +165,7 @@ class Logbook_model extends CI_Model
$qso_rx_power = null;
if ($this->input->post('copyexchangeto')) {
switch($this->input->post('copyexchangeto')) {
switch ($this->input->post('copyexchangeto')) {
case 'dok':
$darc_dok = $srx_string;
break;
@ -184,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:
}
}
@ -2057,6 +2057,37 @@ class Logbook_model extends CI_Model
return $query->num_rows();
}
function check_if_grid_4char_worked_in_logbook($grid, $StationLocationsArray = null, $band = 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;
}
$this->db->select('COL_GRIDSQUARE');
$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('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4));
$this->db->group_end();
if ($band != null && $band != 'SAT') {
$this->db->where('COL_BAND', $band);
} else if ($band == 'SAT') {
// Where col_sat_name is not empty
$this->db->where('COL_SAT_NAME !=', '');
}
$this->db->limit('2');
$query = $this->db->get($this->config->item('table_name'));
return $query->num_rows();
}
/* Get all QSOs with a valid grid for use in the KML export */
function kml_get_all_qsos($band, $mode, $dxcc, $cqz, $propagation, $fromdate, $todate)
{
@ -3458,7 +3489,7 @@ class Logbook_model extends CI_Model
$rx_pwr = $record['rx_pwr'];
} else {
$rx_pwr = null;
$my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (".$record['rx_pwr'].") is not a number<br>";
$my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (" . $record['rx_pwr'] . ") is not a number<br>";
}
}
} else {

查看文件

@ -2,153 +2,156 @@
<br>
<h2>Hamsat - Satellite Rovers</h2>
<p>This data is from <a target="_blank" href="https://hams.at/">https://hams.at/</a>.
<?php if ($user_hamsat_workable_only) {
echo " Only workable passes shown.";
} else {
echo " All passes shown.";
}?>
<?php if ($user_hamsat_workable_only) {
echo " Only workable passes shown.";
} else {
echo " All passes shown.";
} ?>
</p>
<?php if ($user_hamsat_workable_only && $user_hamsat_key == '') { ?>
<div class="alert alert-warning" role="warning">
Private feed key empty. Please set the feed key in your profile.
</div>
<div class="alert alert-warning" role="warning">
Private feed key empty. Please set the feed key in your profile.
</div>
<?php } else { ?>
<?php if ($rovedata['data'] == []) { ?>
<div class="alert alert-warning" role="warning">
<?php echo lang('hams_at_no_activations_found');?>
</div>
<?php } else { ?>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Date</th>
<th>Time</th>
<th>Callsign</th>
<th>Comment</th>
<th>Satellite</th>
<th>Mode</th>
<th>Gridsquare(s)</th>
<th>Workable</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($rovedata['data'] as $rove) :
if ($user_hamsat_workable_only) {
if (!$rove['is_workable']) {
continue;
}
} ?>
<tr>
<td>
<?php
// 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/wavelog.php
$custom_date_format = $this->config->item('qso_date_format');
}
?>
<?php $timestamp = strtotime($rove['aos_at']);
echo date($custom_date_format, $timestamp); ?>
</td>
<td>
<?php echo date("H:i:s", $timestamp)." - ".date("H:i:s", strtotime($rove['los_at'])); ?>
</td>
<td>
<?php
$CI = &get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$CI->load->model('logbook_model');
$call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT");
if ($call_worked != 0) {
echo "<span class=\"text-success\">".$rove['callsign']."</span>";
} else {
echo $rove['callsign'];
}
?>
</td>
<td>
<?php
echo xss_clean($rove['comment'] ?? '-');
?>
</td>
<?php
$direction = '';
if ($rove['mhz_direction'] == 'up') {
$direction = '&uarr;';
} else if ($rove['mhz_direction'] == 'down') {
$direction = '&darr;';
}
$modeclass = '';
if ($rove['mode'] == 'SSB' || $rove['mode'] == 'CW') {
$modeclass = 'hamsatBgLin';
} else if ($rove['mode'] == 'Data') {
$modeclass = 'hamsatBgData';
} else if ($rove['mode'] == 'FM') {
$modeclass = 'hamsatBgFm';
}
?>
<td><span data-bs-toggle="tooltip" title="<?php if ($rove['mhz'] != '') { printf("%.3f", $rove['mhz']); echo " ".$direction ?? ''; } ?>"><?= $rove['satellite']['name'] ?></span></td>
<td><span title="<?php echo $rove['mode']; ?>" class="badge <?php echo $modeclass; ?>"><?php echo $rove['mode']; ?></span></td>
<td>
<?php
// Load the logbook model and call check_if_grid_worked_in_logbook
foreach ($rove['grids'] as $grid) {
$worked = $CI->logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT");
if ($worked != 0) {
echo " <span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">" . $grid . "</span>";
} else {
echo " <span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge bg-danger\">" . $grid . "</span>";
}
}
?>
</td>
<td>
<?php
if ($user_hamsat_key != '') {
if ($rove['is_workable']) {
echo date("H:i", strtotime($rove['workable_start_at']))." - ".date("H:i", strtotime($rove['workable_end_at']));
} else {
echo "<span data-bs-toggle=\"tooltip\" title=\"No\" class=\"badge bg-danger\">No</span>";
}
} else {
echo "<span data-bs-toggle=\"tooltip\" title=\"Unkown\" class=\"badge bg-warning\">Unknown</span>";
}
?>
</td>
<td><a href="<?php echo $rove['url']; ?>" target="_blank">Track</a></td>
<?php
$sat = $rove['satellite']['name'];
switch (strtoupper($rove['satellite']['name'])) {
case "GREENCUBE":
$sat = 'IO-117';
break;
}
?>
<td>
<?php
if ($rove['is_workable'] || $user_hamsat_key == '') { ?>
<a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['grids'][0]; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a>
<?php } ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php } ?>
<?php if ($rovedata['data'] == []) { ?>
<div class="alert alert-warning" role="warning">
<?php echo lang('hams_at_no_activations_found'); ?>
</div>
<?php } else { ?>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Date</th>
<th>Time</th>
<th>Callsign</th>
<th>Comment</th>
<th>Satellite</th>
<th>Mode</th>
<th>Gridsquare(s)</th>
<th>Workable</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($rovedata['data'] as $rove) :
if ($user_hamsat_workable_only) {
if (!$rove['is_workable']) {
continue;
}
} ?>
<tr>
<td>
<?php
// 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/wavelog.php
$custom_date_format = $this->config->item('qso_date_format');
}
?>
<?php $timestamp = strtotime($rove['aos_at']);
echo date($custom_date_format, $timestamp); ?>
</td>
<td>
<?php echo date("H:i:s", $timestamp) . " - " . date("H:i:s", strtotime($rove['los_at'])); ?>
</td>
<td>
<?php
$CI = &get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$CI->load->model('logbook_model');
$call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT");
if ($call_worked != 0) {
echo "<span class=\"text-success\">" . $rove['callsign'] . "</span>";
} else {
echo $rove['callsign'];
}
?>
</td>
<td>
<?php
echo xss_clean($rove['comment'] ?? '-');
?>
</td>
<?php
$direction = '';
if ($rove['mhz_direction'] == 'up') {
$direction = '&uarr;';
} else if ($rove['mhz_direction'] == 'down') {
$direction = '&darr;';
}
$modeclass = '';
if ($rove['mode'] == 'SSB' || $rove['mode'] == 'CW') {
$modeclass = 'hamsatBgLin';
} else if ($rove['mode'] == 'Data') {
$modeclass = 'hamsatBgData';
} else if ($rove['mode'] == 'FM') {
$modeclass = 'hamsatBgFm';
}
?>
<td><span data-bs-toggle="tooltip" title="<?php if ($rove['mhz'] != '') {
printf("%.3f", $rove['mhz']);
echo " " . $direction ?? '';
} ?>"><?= $rove['satellite']['name'] ?></span></td>
<td><span title="<?php echo $rove['mode']; ?>" class="badge <?php echo $modeclass; ?>"><?php echo $rove['mode']; ?></span></td>
<td>
<?php
// Load the logbook model and call check_if_grid_worked_in_logbook
foreach ($rove['grids'] as $grid) {
$worked = $CI->logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT");
if ($worked != 0) {
echo " <span data-bs-toggle=\"tooltip\" title=\"Worked\" class=\"badge bg-success\">" . $grid . "</span>";
} else {
echo " <span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge bg-danger\">" . $grid . "</span>";
}
}
?>
</td>
<td>
<?php
if ($user_hamsat_key != '') {
if ($rove['is_workable']) {
echo date("H:i", strtotime($rove['workable_start_at'])) . " - " . date("H:i", strtotime($rove['workable_end_at']));
} else {
echo "<span data-bs-toggle=\"tooltip\" title=\"No\" class=\"badge bg-danger\">No</span>";
}
} else {
echo "<span data-bs-toggle=\"tooltip\" title=\"Unkown\" class=\"badge bg-warning\">Unknown</span>";
}
?>
</td>
<td><a href="<?php echo $rove['url']; ?>" target="_blank">Track</a></td>
<?php
$sat = $rove['satellite']['name'];
switch (strtoupper($rove['satellite']['name'])) {
case "GREENCUBE":
$sat = 'IO-117';
break;
}
?>
<td>
<?php
if ($rove['is_workable'] || $user_hamsat_key == '') { ?>
<a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['grids'][0]; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a>
<?php } ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php } ?>
<?php } ?>
</div>
</div>

查看文件

@ -143,7 +143,7 @@ function echo_table_col($row, $name)
case 'Flag':
$ci->load->library('DxccFlag');
$flag = strtolower($ci->dxccflag->getISO($row->COL_DXCC));
echo '<td><span data-bs-toggle="tooltip" title="' . ucwords(strtolower(($row->name==null?"- NONE -":$row->name))) . '"><span class="fi fi-' . $flag .'"></span></span></td>';
echo '<td><span data-bs-toggle="tooltip" title="' . ucwords(strtolower(($row->name == null ? "- NONE -" : $row->name))) . '"><span class="fi fi-' . $flag . '"></span></span></td>';
break;
}
}
@ -185,15 +185,17 @@ function echoQrbCalcLink($mygrid, $grid, $vucc)
<?php } ?>
<?php if ($this->optionslib->get_option('dashboard_banner') != "false") { ?>
<?php if ($todays_qsos >= 1) { ?>
<div class="alert alert-success" role="alert">
<?php echo lang('dashboard_you_have_had'); ?> <strong><?php echo $todays_qsos; ?></strong> <?php echo $todays_qsos != 1 ? lang('dashboard_qsos_today') : str_replace('QSOs', 'QSO', lang('dashboard_qsos_today')); ?>
</div>
<?php } else { ?>
<div class="alert alert-warning" role="alert">
<span class="badge text-bg-info"><?php echo lang('general_word_important'); ?></span> <i class="fas fa-broadcast-tower"></i> <?php echo lang('notice_turn_the_radio_on'); ?>
</div>
<?php } ?>
<div hx-get="<?php echo site_url('dashboard/todays_qso_component'); ?>" hx-trigger="every 30s">
<?php if ($todays_qsos >= 1) { ?>
<div class="alert alert-success" role="alert">
<?php echo lang('dashboard_you_have_had'); ?> <strong><?php echo $todays_qsos; ?></strong> <?php echo $todays_qsos != 1 ? lang('dashboard_qsos_today') : str_replace('QSOs', 'QSO', lang('dashboard_qsos_today')); ?>
</div>
<?php } else { ?>
<div class="alert alert-warning" role="alert">
<span class="badge text-bg-info"><?php echo lang('general_word_important'); ?></span> <i class="fas fa-broadcast-tower"></i> <?php echo lang('notice_turn_the_radio_on'); ?>
</div>
<?php } ?>
</div>
<?php } ?>
<?php if ($current_active == 0) { ?>
@ -294,80 +296,80 @@ function echoQrbCalcLink($mygrid, $grid, $vucc)
<td width="50%"><?php echo $total_countries_needed; ?></td>
</tr>
</table>
<?php if ($dashboard_qslcard_card != false) { ?>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_qsl_sent != 0 || $total_qsl_rcvd != 0 || $total_qsl_requested != 0)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-envelope"></i> <?php echo lang('general_word_qslcards'); ?></td>
<td colspan="1"><?php echo lang('general_word_today'); ?></td>
</tr>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_qsl_sent != 0 || $total_qsl_rcvd != 0 || $total_qsl_requested != 0)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-envelope"></i> <?php echo lang('general_word_qslcards'); ?></td>
<td colspan="1"><?php echo lang('general_word_today'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_sent'); ?></td>
<td width="25%"><?php echo $total_qsl_sent; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','QSLSDATE','');"><?php echo $qsl_sent_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_sent'); ?></td>
<td width="25%"><?php echo $total_qsl_sent; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','QSLSDATE','');"><?php echo $qsl_sent_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_received'); ?></td>
<td width="25%"><?php echo $total_qsl_rcvd; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','QSLRDATE','');"><?php echo $qsl_rcvd_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_received'); ?></td>
<td width="25%"><?php echo $total_qsl_rcvd; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','QSLRDATE','');"><?php echo $qsl_rcvd_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_requested'); ?></td>
<td width="25%"><?php echo $total_qsl_requested; ?></td>
<td width="25%"><?php echo $qsl_requested_today; ?></td>
</tr>
</table>
<?php } ?>
<tr>
<td width="50%"><?php echo lang('general_word_requested'); ?></td>
<td width="25%"><?php echo $total_qsl_requested; ?></td>
<td width="25%"><?php echo $qsl_requested_today; ?></td>
</tr>
</table>
<?php } ?>
<?php } ?>
<?php if ($dashboard_eqslcard_card != false) { ?>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_rcvd != 0)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-address-card"></i> <?php echo lang('general_word_eqslcards'); ?></td>
<td colspan="1"><?php echo lang('general_word_today'); ?></td>
</tr>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_rcvd != 0)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-address-card"></i> <?php echo lang('general_word_eqslcards'); ?></td>
<td colspan="1"><?php echo lang('general_word_today'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_sent'); ?></td>
<td width="25%"><?php echo $total_eqsl_sent; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','EQSLSDATE','');"><?php echo $eqsl_sent_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_sent'); ?></td>
<td width="25%"><?php echo $total_eqsl_sent; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','EQSLSDATE','');"><?php echo $eqsl_sent_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_received'); ?></td>
<td width="25%"><?php echo $total_eqsl_rcvd; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','EQSLRDATE','');"><?php echo $eqsl_rcvd_today; ?></a></td>
</tr>
</table>
<?php } ?>
<tr>
<td width="50%"><?php echo lang('general_word_received'); ?></td>
<td width="25%"><?php echo $total_eqsl_rcvd; ?></td>
<td width="25%"><a href="javascript:displayContacts('','All','All','EQSLRDATE','');"><?php echo $eqsl_rcvd_today; ?></a></td>
</tr>
</table>
<?php } ?>
<?php } ?>
<?php if ($dashboard_lotw_card != false) { ?>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_lotw_sent != 0 || $total_lotw_rcvd != 0)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-list"></i> <?php echo lang('general_word_lotw'); ?></td>
<td colspan="1"><?php echo lang('general_word_today'); ?></td>
</tr>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_lotw_sent != 0 || $total_lotw_rcvd != 0)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-list"></i> <?php echo lang('general_word_lotw'); ?></td>
<td colspan="1"><?php echo lang('general_word_today'); ?></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_sent'); ?></td>
<td width="25%"><?php echo $total_lotw_sent; ?></td>
<td width="25%"><a href="javascript:displayContacts('','all','all','LOTWSDATE','');"><?php echo $lotw_sent_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_sent'); ?></td>
<td width="25%"><?php echo $total_lotw_sent; ?></td>
<td width="25%"><a href="javascript:displayContacts('','all','all','LOTWSDATE','');"><?php echo $lotw_sent_today; ?></a></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_received'); ?></td>
<td width="25%"><?php echo $total_lotw_rcvd; ?></td>
<td width="25%"><a href="javascript:displayContacts('','all','all','LOTWRDATE','');"><?php echo $lotw_rcvd_today; ?></a></td>
</tr>
</table>
<?php } ?>
<tr>
<td width="50%"><?php echo lang('general_word_received'); ?></td>
<td width="25%"><?php echo $total_lotw_rcvd; ?></td>
<td width="25%"><a href="javascript:displayContacts('','all','all','LOTWRDATE','');"><?php echo $lotw_rcvd_today; ?></a></td>
</tr>
</table>
<?php } ?>
<?php } ?>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_qrz_sent != 0 || $total_qrz_rcvd != 0)) { ?>
@ -392,27 +394,27 @@ function echoQrbCalcLink($mygrid, $grid, $vucc)
<?php } ?>
<?php if ($dashboard_vuccgrids_card != false) { ?>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-globe-europe"></i> VUCC-Grids</td>
<td colspan="1">SAT</td>
</tr>
<?php if ((($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE)) { ?>
<table class="table table-striped border-top">
<tr class="titles">
<td colspan="2"><i class="fas fa-globe-europe"></i> VUCC-Grids</td>
<td colspan="1">SAT</td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_worked'); ?></td>
<td width="25%"><?php echo $vucc['All']['worked']; ?></td>
<td width="25%"><?php echo $vuccSAT['SAT']['worked'] ?? '0'; ?></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_worked'); ?></td>
<td width="25%"><?php echo $vucc['All']['worked']; ?></td>
<td width="25%"><?php echo $vuccSAT['SAT']['worked'] ?? '0'; ?></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_confirmed'); ?></td>
<td width="25%"><?php echo $vucc['All']['confirmed']; ?></td>
<td width="25%"><?php echo $vuccSAT['SAT']['confirmed'] ?? '0'; ?></td>
</tr>
<tr>
<td width="50%"><?php echo lang('general_word_confirmed'); ?></td>
<td width="25%"><?php echo $vucc['All']['confirmed']; ?></td>
<td width="25%"><?php echo $vuccSAT['SAT']['confirmed'] ?? '0'; ?></td>
</tr>
</table>
<?php } ?>
</table>
<?php } ?>
<?php } ?>
</div>
</div>

查看文件

@ -529,7 +529,124 @@
<small id="StateHelp" class="form-text text-muted"><?php echo lang("station_location_state_hint"); ?></small>
</div>
<div class="mb-3" id="venezuela_state">
<label for="stateInput"><?php echo lang("station_location_state"); ?></label>
<select class="form-select" name="station_state" id="StateHelp" aria-describedby="stationCntyInputHelp">
<option value=""></option>
<option value="AM" <?php if($my_station_profile->state == "AM") { echo "selected"; } ?>>Amazonas</option>
<option value="AN" <?php if($my_station_profile->state == "AN") { echo "selected"; } ?>>Anzoátegui</option>
<option value="AP" <?php if($my_station_profile->state == "AP") { echo "selected"; } ?>>Apure</option>
<option value="AR" <?php if($my_station_profile->state == "AR") { echo "selected"; } ?>>Aragua</option>
<option value="BA" <?php if($my_station_profile->state == "BA") { echo "selected"; } ?>>Barinas</option>
<option value="BO" <?php if($my_station_profile->state == "BO") { echo "selected"; } ?>>Bolívar</option>
<option value="CA" <?php if($my_station_profile->state == "CA") { echo "selected"; } ?>>Carabobo</option>
<option value="CO" <?php if($my_station_profile->state == "CO") { echo "selected"; } ?>>Cojedes</option>
<option value="DA" <?php if($my_station_profile->state == "DA") { echo "selected"; } ?>>Delta Amacuro</option>
<option value="DC" <?php if($my_station_profile->state == "DC") { echo "selected"; } ?>>Distrito Capital</option>
<option value="FA" <?php if($my_station_profile->state == "FA") { echo "selected"; } ?>>Falcón</option>
<option value="GU" <?php if($my_station_profile->state == "GU") { echo "selected"; } ?>>Guárico</option>
<option value="LA" <?php if($my_station_profile->state == "LA") { echo "selected"; } ?>>Lara</option>
<option value="ME" <?php if($my_station_profile->state == "ME") { echo "selected"; } ?>>Mérida</option>
<option value="MI" <?php if($my_station_profile->state == "MI") { echo "selected"; } ?>>Miranda</option>
<option value="MO" <?php if($my_station_profile->state == "MO") { echo "selected"; } ?>>Monagas</option>
<option value="NE" <?php if($my_station_profile->state == "NE") { echo "selected"; } ?>>Nueva Esparta</option>
<option value="PO" <?php if($my_station_profile->state == "PO") { echo "selected"; } ?>>Portuguesa</option>
<option value="SU" <?php if($my_station_profile->state == "SU") { echo "selected"; } ?>>Sucre</option>
<option value="TA" <?php if($my_station_profile->state == "TA") { echo "selected"; } ?>>Táchira</option>
<option value="TR" <?php if($my_station_profile->state == "TR") { echo "selected"; } ?>>Trujillo</option>
<option value="VA" <?php if($my_station_profile->state == "VA") { echo "selected"; } ?>>Vargas</option>
<option value="YA" <?php if($my_station_profile->state == "YA") { echo "selected"; } ?>>Yaracuy</option>
<option value="ZU" <?php if($my_station_profile->state == "ZU") { echo "selected"; } ?>>Zulia</option>
</select>
<small id="StateHelp" class="form-text text-muted"><?php echo lang("station_location_state_hint"); ?></small>
</div>
<div class="mb-3" id="australia_state">
<label for="stateInput"><?php echo lang("station_location_state"); ?></label>
<select class="form-select" name="station_state" id="StateHelp" aria-describedby="stationCntyInputHelp">
<option value=""></option>
<option value="ACT" <?php if($my_station_profile->state == "ACT") { echo "selected"; } ?>>Australian Capital Territory</option>
<option value="NSW" <?php if($my_station_profile->state == "NSW") { echo "selected"; } ?>>New South Wales</option>
<option value="VIC" <?php if($my_station_profile->state == "VIC") { echo "selected"; } ?>>Victoria</option>
<option value="QLD" <?php if($my_station_profile->state == "QLD") { echo "selected"; } ?>>Queensland</option>
<option value="SA" <?php if($my_station_profile->state == "SA") { echo "selected"; } ?>>South Australia</option>
<option value="WA" <?php if($my_station_profile->state == "WA") { echo "selected"; } ?>>Western Australia</option>
<option value="TAS" <?php if($my_station_profile->state == "TAS") { echo "selected"; } ?>>Tasmania</option>
<option value="NT" <?php if($my_station_profile->state == "NT") { echo "selected"; } ?>>Northern Territory</option>
</select>
<small id="StateHelp" class="form-text text-muted"><?php echo lang("station_location_state_hint"); ?></small>
</div>
<div class="mb-3" id="png_state">
<label for="stateInput"><?php echo lang("station_location_state"); ?></label>
<select class="form-select" name="station_state" id="StateHelp" aria-describedby="stationCntyInputHelp">
<option value=""></option>
<option value="NCD" <?php if($my_station_profile->state == "NCD") { echo "selected"; } ?>>National Capital District (Port Moresby)</option>
<option value="CPM" <?php if($my_station_profile->state == "CPM") { echo "selected"; } ?>>Central</option>
<option value="CPK" <?php if($my_station_profile->state == "CPK") { echo "selected"; } ?>>Chimbu</option>
<option value="EHG" <?php if($my_station_profile->state == "EHG") { echo "selected"; } ?>>Eastern Highlands</option>
<option value="EBR" <?php if($my_station_profile->state == "EBR") { echo "selected"; } ?>>East New Britain</option>
<option value="ESW" <?php if($my_station_profile->state == "ESW") { echo "selected"; } ?>>East Sepik</option>
<option value="EPW" <?php if($my_station_profile->state == "EPW") { echo "selected"; } ?>>Enga</option>
<option value="GPK" <?php if($my_station_profile->state == "GPK") { echo "selected"; } ?>>Gulf</option>
<option value="MPM" <?php if($my_station_profile->state == "MPM") { echo "selected"; } ?>>Madang</option>
<option value="MRL" <?php if($my_station_profile->state == "MRL") { echo "selected"; } ?>>Manus</option>
<option value="MBA" <?php if($my_station_profile->state == "MBA") { echo "selected"; } ?>>Milne Bay</option>
<option value="MPL" <?php if($my_station_profile->state == "MPL") { echo "selected"; } ?>>Morobe</option>
<option value="NIK" <?php if($my_station_profile->state == "NIK") { echo "selected"; } ?>>New Ireland</option>
<option value="NPP" <?php if($my_station_profile->state == "NPP") { echo "selected"; } ?>>Northern</option>
<option value="NSA" <?php if($my_station_profile->state == "NSA") { echo "selected"; } ?>>North Solomons</option>
<option value="SAN" <?php if($my_station_profile->state == "SAN") { echo "selected"; } ?>>Santaun</option>
<option value="SHM" <?php if($my_station_profile->state == "SHM") { echo "selected"; } ?>>Southern Highlands</option>
<option value="WPD" <?php if($my_station_profile->state == "WPD") { echo "selected"; } ?>>Western</option>
<option value="WHM" <?php if($my_station_profile->state == "WHM") { echo "selected"; } ?>>Western Highlands</option>
<option value="WBR" <?php if($my_station_profile->state == "WBR") { echo "selected"; } ?>>West New Britain</option>
</select>
<small id="StateHelp" class="form-text text-muted"><?php echo lang("station_location_state_hint"); ?></small>
</div>
<div class="mb-3" id="nz_state">
<label for="stateInput"><?php echo lang("station_location_state"); ?></label>
<select class="form-select" name="station_state" id="StateHelp" aria-describedby="stationCntyInputHelp">
<option value=""></option>
<option value="AUK" <?php if($my_station_profile->state == "AUK") { echo "selected"; } ?>>Auckland</option>
<option value="BOP" <?php if($my_station_profile->state == "BOP") { echo "selected"; } ?>>Bay of Plenty</option>
<option value="NTL" <?php if($my_station_profile->state == "NTL") { echo "selected"; } ?>>Northland</option>
<option value="WKO" <?php if($my_station_profile->state == "WKO") { echo "selected"; } ?>>Waikato</option>
<option value="GIS" <?php if($my_station_profile->state == "GIS") { echo "selected"; } ?>>Gisborne</option>
<option value="HKB" <?php if($my_station_profile->state == "HKB") { echo "selected"; } ?>>Hawkes Bay</option>
<option value="MWT" <?php if($my_station_profile->state == "MWT") { echo "selected"; } ?>>Manawatu-Wanganui</option>
<option value="TKI" <?php if($my_station_profile->state == "TKI") { echo "selected"; } ?>>Taranaki</option>
<option value="WGN" <?php if($my_station_profile->state == "WGN") { echo "selected"; } ?>>Wellington</option>
<option value="CAN" <?php if($my_station_profile->state == "CAN") { echo "selected"; } ?>>Canterbury</option>
<option value="MBH" <?php if($my_station_profile->state == "MBH") { echo "selected"; } ?>>Marlborough</option>
<option value="NSN" <?php if($my_station_profile->state == "NSN") { echo "selected"; } ?>>Nelson</option>
<option value="TAS" <?php if($my_station_profile->state == "TAS") { echo "selected"; } ?>>Tasman</option>
<option value="WTC" <?php if($my_station_profile->state == "WTC") { echo "selected"; } ?>>West Coast</option>
<option value="OTA" <?php if($my_station_profile->state == "OTA") { echo "selected"; } ?>>Otago</option>
<option value="STL" <?php if($my_station_profile->state == "STL") { echo "selected"; } ?>>Southland</option>
</select>
<small id="StateHelp" class="form-text text-muted"><?php echo lang("station_location_state_hint"); ?></small>
</div>
<div class="mb-3" id="belgium_state">
<label for="stateInput"><?php echo lang("station_location_state"); ?></label>
<select class="form-select" name="station_state" id="StateHelp" aria-describedby="stationCntyInputHelp">
<option value=""></option>
<option value="AN" <?php if($my_station_profile->state == "AN") { echo "selected"; } ?>>Antwerpen</option>
<option value="BR" <?php if($my_station_profile->state == "BR") { echo "selected"; } ?>>Brussels</option>
<option value="BW" <?php if($my_station_profile->state == "BW") { echo "selected"; } ?>>Brabant Wallon</option>
<option value="HT" <?php if($my_station_profile->state == "HT") { echo "selected"; } ?>>Hainaut</option>
<option value="LB" <?php if($my_station_profile->state == "LB") { echo "selected"; } ?>>Limburg</option>
<option value="LG" <?php if($my_station_profile->state == "LG") { echo "selected"; } ?>>Liêge</option>
<option value="NM" <?php if($my_station_profile->state == "NM") { echo "selected"; } ?>>Namur</option>
<option value="LU" <?php if($my_station_profile->state == "LU") { echo "selected"; } ?>>Luxembourg</option>
<option value="OV" <?php if($my_station_profile->state == "OV") { echo "selected"; } ?>>Oost-Vlaanderen</option>
<option value="VB" <?php if($my_station_profile->state == "VB") { echo "selected"; } ?>>Vlaams Brabant</option>
<option value="WV" <?php if($my_station_profile->state == "WV") { echo "selected"; } ?>>West-Vlaanderen</option>
</select>
<small id="StateHelp" class="form-text text-muted"><?php echo lang("station_location_state_hint"); ?></small>
</div>
<!-- US County -->

查看文件

@ -253,7 +253,7 @@
$ci->load->library('DxccFlag');
$flag = strtolower($ci->dxccflag->getISO($row->COL_DXCC));
echo '<span class="fi fi-' . $flag .'"></span> ';
echo ucwords(strtolower(($row->name)), "- (/"); if (isset($dxccFlag)) { echo " ".$dxccFlag; } if ($row->end != null) { echo ' <span class="badge text-bg-danger">'.lang('gen_hamradio_deleted_dxcc').'</span>'; } ?></td>
echo ucwords(strtolower(($row->name)), "- (/"); if ($row->end != null) { echo ' <span class="badge text-bg-danger">'.lang('gen_hamradio_deleted_dxcc').'</span>'; } ?></td>
</tr>
<?php } ?>

查看文件

@ -1,7 +1,13 @@
/**
* Initializes the DataTable and handles the logic for showing/hiding states based on the selected DXCC ID.
*/
$(document).ready( function () {
// Use Jquery to hide div ca_state
/**
* Initializes the DataTable with state saving enabled and custom language settings.
*
* @type {DataTable}
*/
$('#station_locations_table').DataTable({
"stateSave": true,
"language": {
@ -9,6 +15,11 @@ $(document).ready( function () {
}
});
/**
* Maps DXCC IDs to their corresponding state IDs.
*
* @type {Object}
*/
var stateMap = {
'1': 'canada_state',
'5': 'aland_state',
@ -21,12 +32,21 @@ $(document).ready( function () {
'112': 'chile_state',
'132': 'paraguay_state',
'137': 'korea_state',
'144': 'uruguay_state'
'144': 'uruguay_state',
'291': 'us_state',
'148': 'venezuela_state',
'150': 'australia_state',
'163': 'png_state',
'170': 'nz_state',
'209': 'belgium_state',
'6': 'us_state' // Alaska
};
// Hide all states initially
$("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state").hide();
$("#canada_state, #aland_state, #asiatic_russia_state, #belarus_state, #mexico_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #us_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state").hide();
/**
* Gets the selected DXCC ID and shows the corresponding state.
*/
var selectedDXCCID = $('#dxcc_select').find(":selected").val();
var stateToShow = stateMap[selectedDXCCID];
@ -38,12 +58,16 @@ $(document).ready( function () {
$("#us_state").show();
}
/**
* Handles the change event of the DXCC select element.
* Shows the corresponding state based on the selected DXCC ID.
*/
$('#dxcc_select').change(function(){
var selectedValue = $(this).val();
var stateToShow = stateMap[selectedValue] || stateMap['default'];
// Hide all states
$("#mexico_state, #belarus_state, #asiatic_russia_state, #aland_state, #canada_state, #us_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #paraguay_state, #korea_state, #uruguay_state").hide();
$("#mexico_state, #belarus_state, #asiatic_russia_state, #aland_state, #canada_state, #us_state, #eu_russia_state, #argentina_state, #brazil_state, #chile_state, #paraguay_state, #korea_state, #uruguay_state, #venezuela_state, #australia_state, #png_state, #nz_state, #belgium_state").hide();
// Show the selected state
$("#" + stateToShow).show();