Merge branch 'dev' into online_qsl_request

这个提交包含在:
Andreas Kristiansen 2022-12-21 22:11:33 +01:00 提交者 GitHub
当前提交 1759e44106
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 26 个文件被更改,包括 1876 次插入59 次删除

查看文件

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

查看文件

@ -509,7 +509,7 @@ class Logbook extends CI_Controller {
$html = "";
if(!empty($logbooks_locations_array)) {
$this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, station_profile.*');
$this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_FREQ, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, station_profile.*');
$this->db->from($this->config->item('table_name'));
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
@ -530,10 +530,14 @@ class Logbook extends CI_Controller {
$html .= "<tr>";
$html .= "<td>Date</td>";
$html .= "<td>Callsign</td>";
$html .= "<td>Mode</td>";
$html .= "<td>RST (S)</td>";
$html .= "<td>RST (R)</td>";
$html .= "<td>Band</td>";
$html .= "<td>Mode</td>";
if ($this->session->userdata('user_column1')=='Frequency' || $this->session->userdata('user_column2')=='Frequency' || $this->session->userdata('user_column3')=='Frequency' || $this->session->userdata('user_column4')=='Frequency' || $this->session->userdata('user_column5')=='Frequency') {
$html .= "<td>Frequency</td>";
} else {
$html .= "<td>Band</td>";
}
switch($this->session->userdata('user_previous_qsl_type')) {
case 0:
$html .= "<td>".$this->lang->line('gen_hamradio_qsl')."</td>";
@ -568,17 +572,21 @@ class Logbook extends CI_Controller {
$html .= "<tr>";
$html .= "<td>".date($custom_date_format, $timestamp). date(' H:i',strtotime($row->COL_TIME_ON)) . "</td>";
$html .= "<td><a id='edit_qso' href='javascript:displayQso(" . $row->COL_PRIMARY_KEY . ");'>" . str_replace('0','&Oslash;',strtoupper($row->COL_CALL)) . "</a></td>";
$html .= "<td>".$row->COL_RST_SENT."</td>";
$html .= "<td>".$row->COL_RST_RCVD."</td>";
if($row->COL_SAT_NAME != null) {
$html .= "<td>".$row->COL_SAT_NAME."</td>";
} else {
$html .= "<td>".$row->COL_BAND."</td>";
}
if ($row->COL_SUBMODE==null)
$html .= "<td>".$row->COL_MODE."</td>";
else
$html .= "<td>".$row->COL_SUBMODE."</td>";
$html .= "<td>".$row->COL_RST_SENT."</td>";
$html .= "<td>".$row->COL_RST_RCVD."</td>";
if($row->COL_SAT_NAME != null) {
$html .= "<td>".$row->COL_SAT_NAME."</td>";
} else {
if ($this->session->userdata('user_column1')=='Frequency' || $this->session->userdata('user_column2')=='Frequency' || $this->session->userdata('user_column3')=='Frequency' || $this->session->userdata('user_column4')=='Frequency' || $this->session->userdata('user_column5')=='Frequency') {
$html .= "<td>".$this->frequency->hz_to_mhz($row->COL_FREQ)."</td>";
} else {
$html .= "<td>".$row->COL_BAND."</td>";
}
}
if ($this->session->userdata('user_previous_qsl_type') == 1) {
$html .= "<td class=\"lotw\">";
$html .= "<span class=\"qsl-";

查看文件

@ -0,0 +1,175 @@
<?php
use Cloudlog\QSLManager\QSO;
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Logbookadvanced extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->helper(array('form', 'url', 'psr4_autoloader'));
$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');
}
}
function index() {
$this->load->model('stations');
$this->load->model('logbookadvanced_model');
$this->load->model('logbook_model');
$this->load->model('bands');
$this->load->model('iota');
$this->load->model('dxcc');
$stationIds = [];
$deOptions = [];
foreach ($this->stations->all_of_user()->result() as $station) {
$deOptions[$station->station_callsign] = 1;
$stationIds[] = $station->station_id;
}
ksort($deOptions);
$deOptions = array_keys($deOptions);
$modes = [];
if ($stationIds !== []) {
foreach ($this->logbookadvanced_model->get_worked_modes($stationIds) as $mode) {
$key = $mode['mode'];
if ($mode['submode'] !== null) {
$key .= "|" . $mode['submode'];
}
if ($mode['submode'] == null) {
$modes[$key] = $mode['mode'];
} else {
$modes[$key] = $mode['submode'];
}
}
}
$data = [];
$data['page_title'] = "Advanced logbook";
$data['hasDatePicker'] = true;
$pageData = [];
$pageData['datePlaceholder'] = 'DD/MM/YYYY';
$pageData['deOptions'] = $deOptions;
$pageData['modes'] = $modes;
$pageData['dxccarray'] = $this->logbook_model->fetchDxcc();
$pageData['iotaarray'] = $this->logbook_model->fetchIota();
$pageData['bands'] = $this->bands->get_worked_bands();
$footerData = [];
$footerData['scripts'] = [
'assets/js/moment.min.js',
'assets/js/tempusdominus-bootstrap-4.min.js',
'assets/js/sections/logbookadvanced.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/logbookadvanced.js"))
];
$this->load->view('interface_assets/header', $data);
$this->load->view('logbookadvanced/index', $pageData);
$this->load->view('interface_assets/footer', $footerData);
}
public function search() {
$this->load->model('logbookadvanced_model');
$searchCriteria = array(
'user_id' => (int)$this->session->userdata('user_id'),
'dateFrom' => xss_clean($this->input->post('dateFrom')),
'dateTo' => xss_clean($this->input->post('dateTo')),
'de' => xss_clean($this->input->post('de')),
'dx' => xss_clean($this->input->post('dx')),
'mode' => xss_clean($this->input->post('mode')),
'band' => xss_clean($this->input->post('band')),
'qslSent' => xss_clean($this->input->post('qslSent')),
'qslReceived' => xss_clean($this->input->post('qslReceived')),
'iota' => xss_clean($this->input->post('iota')),
'dxcc' => xss_clean($this->input->post('dxcc')),
'propmode' => xss_clean($this->input->post('propmode')),
'gridsquare' => xss_clean($this->input->post('gridsquare')),
'state' => xss_clean($this->input->post('state')),
'qsoresults' => xss_clean($this->input->post('qsoresults')),
);
$qsos = [];
foreach ($this->logbookadvanced_model->searchQsos($searchCriteria) as $qso) {
$qsos[] = $qso->toArray();
}
header("Content-Type: application/json");
print json_encode($qsos);
}
public function updateFromCallbook() {
$this->load->model('logbook_model');
$this->load->model('logbookadvanced_model');
$qsoID = xss_clean($this->input->post('qsoID'));
$qso = $this->logbook_model->qso_info($qsoID)->row_array();
if ($qso === null) {
header("Content-Type: application/json");
echo json_encode([]);
return;
}
$callbook = $this->logbook_model->loadCallBook($qso['COL_CALL'], $this->config->item('use_fullname'));
if ($callbook['callsign'] !== "") {
$this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook);
$qso['COL_NAME'] = trim($callbook['name']);
if (isset($callbook['qslmgr'])) {
$qso['COL_QSL_VIA'] = trim($callbook['qslmgr']);
}
}
$qsoObj = new QSO($qso);
header("Content-Type: application/json");
echo json_encode($qsoObj->toArray());
}
function export_to_adif() {
$this->load->model('logbookadvanced_model');
$ids = xss_clean($this->input->post('id'));
$user_id = (int)$this->session->userdata('user_id');
$data['qsos'] = $this->logbookadvanced_model->getQsosForAdif($ids, $user_id);
$this->load->view('adif/data/exportall', $data);
}
function update_qsl() {
$this->load->model('logbookadvanced_model');
$ids = xss_clean($this->input->post('id'));
$user_id = (int)$this->session->userdata('user_id');
$method = xss_clean($this->input->post('method'));
$sent = xss_clean($this->input->post('sent'));
$status = $this->logbookadvanced_model->updateQsl($ids, $user_id, $method, $sent);
$data = $this->logbookadvanced_model->getQsosForAdif($ids, $user_id);
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
}
$q = [];
foreach ($qsos as $qso) {
$q[] = $qso->toArray();
}
header("Content-Type: application/json");
print json_encode($q);
}
}

查看文件

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Extremely simple autoloader helper, has lots of shortcomings
*/
spl_autoload_register(function ($class) {
if (mb_substr($class, 0, 9) !== 'Cloudlog\\') {
return false;
}
$class=substr($class,9);
$file = str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
$file = __DIR__ . "/../../src/" . $file;
if (file_exists($file)) {
require $file;
return true;
}
return false;
});

查看文件

@ -0,0 +1,19 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_rename_cas5a extends CI_Migration
{
public function up()
{
$this->db->set('COL_SAT_NAME', 'FO-118');
$this->db->where('COL_SAT_NAME', 'CAS-5A');
$this->db->update($this->config->item('table_name'));
}
public function down()
{
$this->db->set('COL_SAT_NAME', 'CAS-5A');
$this->db->where('COL_SAT_NAME', 'FO-118');
$this->db->update($this->config->item('table_name'));
}
}

查看文件

@ -0,0 +1,21 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_reupload_io117_and_fo118 extends CI_Migration
{
public function up()
{
$this->db->set('COL_LOTW_QSL_SENT', 'N');
$this->db->where('COL_SAT_NAME', 'IO-117');
$this->db->update($this->config->item('table_name'));
$this->db->set('COL_LOTW_QSL_SENT', 'N');
$this->db->where('COL_SAT_NAME', 'FO-118');
$this->db->update($this->config->item('table_name'));
}
public function down()
{
// Not Possible
}
}

查看文件

@ -776,7 +776,7 @@ class Logbook_model extends CI_Model {
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->select('COL_CALL, COL_BAND, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME');
$this->db->select('COL_CALL, COL_BAND, COL_FREQ, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME');
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit(10);
@ -791,7 +791,7 @@ class Logbook_model extends CI_Model {
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if(!empty($logbooks_locations_array)) {
$this->db->select('COL_CALL, COL_BAND, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME');
$this->db->select('COL_CALL, COL_BAND, COL_FREQ, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME');
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->order_by("COL_TIME_ON", "desc");
$this->db->limit($num);

查看文件

@ -0,0 +1,227 @@
<?php
use Cloudlog\QSLManager\QSO;
class Logbookadvanced_model extends CI_Model {
/**
* Returns worked modes in the supplied stations as a simple array
* @param array $stationIds
* @return array
*/
function get_worked_modes(array $stationIds): array {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$ids = "'".implode("','",$stationIds)."'";
$sql = "
SELECT distinct `COL_MODE`, `COL_SUBMODE`
FROM `" . $this->config->item('table_name') . "` qsos
WHERE qsos.station_id IN (".$ids.")
ORDER BY COL_MODE, COL_SUBMODE";
$data = $this->db->query($sql);
$results = [];
foreach ($data->result() as $row) {
$results[] = [
'mode' => $row->COL_MODE,
'submode' => $row->COL_SUBMODE
];
}
return $results;
}
/*
* @param array $searchCriteria
* @return array
*/
public function searchQsos($searchCriteria) : array {
$conditions = [];
$binding = [$searchCriteria['user_id']];
if ($searchCriteria['dateFrom'] !== '') {
$from = DateTime::createFromFormat('d/m/Y', $searchCriteria['dateFrom']);
$from = $from->format('Y-m-d');
$conditions[] = "date(COL_TIME_ON) >= ?";
$binding[] = $from;
}
if ($searchCriteria['dateTo'] !== '') {
$to = DateTime::createFromFormat('d/m/Y', $searchCriteria['dateTo']);
$to = $to->format('Y-m-d');
$conditions[] = "date(COL_TIME_ON) <= ?";
$binding[] = $to;
}
if ($searchCriteria['de'] !== '') {
$conditions[] = "COL_STATION_CALLSIGN = ?";
$binding[] = trim($searchCriteria['de']);
}
if ($searchCriteria['dx'] !== '') {
$conditions[] = "COL_CALL LIKE ?";
$binding[] = '%' . trim($searchCriteria['dx']) . '%';
}
if ($searchCriteria['mode'] !== '') {
list ($mode, $subMode) = explode("|", trim($searchCriteria['mode']));
$mode = trim($mode);
$subMode = trim($subMode);
$conditions[] = "COL_MODE = ?";
$binding[] = $mode;
if ($subMode !== '') {
$conditions[] = "COL_SUBMODE = ?";
$binding[] = $subMode;
}
}
if ($searchCriteria['band'] !== '') {
if($searchCriteria['band'] != "SAT") {
$conditions[] = "COL_BAND = ? and COL_PROP_MODE != 'SAT'";
$binding[] = trim($searchCriteria['band']);
} else {
$conditions[] = "COL_PROP_MODE = 'SAT'";
}
}
if ($searchCriteria['qslSent'] !== '') {
$conditions[] = "COL_QSL_SENT = ?";
$binding[] = $searchCriteria['qslSent'];
}
if ($searchCriteria['qslReceived'] !== '') {
$conditions[] = "COL_QSL_RCVD = ?";
$binding[] = $searchCriteria['qslReceived'];
}
if ($searchCriteria['iota'] !== '') {
$conditions[] = "COL_IOTA = ?";
$binding[] = $searchCriteria['iota'];
}
if ($searchCriteria['dxcc'] !== '') {
$conditions[] = "COL_DXCC = ?";
$binding[] = $searchCriteria['dxcc'];
}
if ($searchCriteria['state'] !== '') {
$conditions[] = "COL_STATE = ?";
$binding[] = $searchCriteria['state'];
}
if ($searchCriteria['gridsquare'] !== '') {
$conditions[] = "(COL_GRIDSQUARE like ? or COL_VUCC_GRIDS like ?)";
$binding[] = '%' . $searchCriteria['gridsquare'] . '%';
$binding[] = '%' . $searchCriteria['gridsquare'] . '%';
}
if ($searchCriteria['propmode'] !== '') {
$conditions[] = "COL_PROP_MODE = ?";
$binding[] = $searchCriteria['propmode'];
}
$where = trim(implode(" AND ", $conditions));
if ($where != "") {
$where = "AND $where";
}
$limit = $searchCriteria['qsoresults'];
$sql = "
SELECT *
FROM " . $this->config->item('table_name') . " qsos
INNER JOIN station_profile ON qsos.station_id=station_profile.station_id
WHERE station_profile.user_id = ?
$where
ORDER BY qsos.COL_TIME_ON desc
LIMIT $limit
";
$data = $this->db->query($sql, $binding);
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
}
return $qsos;
}
public function getQsosForAdif($ids, $user_id) : object {
$binding = [$user_id];
$conditions[] = "COL_PRIMARY_KEY in ?";
$binding[] = json_decode($ids, true);
$where = trim(implode(" AND ", $conditions));
if ($where != "") {
$where = "AND $where";
}
$sql = "
SELECT *
FROM " . $this->config->item('table_name') . " qsos
INNER JOIN station_profile ON qsos.station_id = station_profile.station_id
WHERE station_profile.user_id = ?
$where
ORDER BY qsos.COL_TIME_ON desc
";
return $this->db->query($sql, $binding);
}
public function updateQsl($ids, $user_id, $method, $sent) {
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) {
return array('message' => 'Error');
} else {
$data = array(
'COL_QSLSDATE' => date('Y-m-d H:i:s'),
'COL_QSL_SENT' => $sent,
'COL_QSL_SENT_VIA' => $method
);
$this->db->where_in('COL_PRIMARY_KEY', json_decode($ids, true));
$this->db->update($this->config->item('table_name'), $data);
return array('message' => 'OK');
}
}
public function updateQsoWithCallbookInfo($qsoID, $qso, $callbook) {
$updatedData = array();
if (!empty($callbook['name']) && empty($qso['COL_NAME'])) {
$updatedData['COL_NAME'] = $callbook['name'];
}
if (!empty($callbook['gridsquare']) && empty($qso['COL_GRIDSQUARE']) && empty($qso['COL_VUCC_GRIDS'] )) {
if (strpos(trim($callbook['gridsquare']), ',') === false) {
$updatedData['COL_GRIDSQUARE'] = strtoupper(trim($callbook['gridsquare']));
} else {
$updatedData['COL_VUCC_GRIDS'] = strtoupper(trim($callbook['gridsquare']));
}
}
if (!empty($callbook['city']) && empty($qso['COL_QTH'])) {
$updatedData['COL_QTH'] = $callbook['city'];
}
if (!empty($callbook['lat']) && empty($qso['COL_LAT'])) {
$updatedData['COL_LAT'] = $callbook['lat'];
}
if (!empty($callbook['long']) && empty($qso['COL_LON'])) {
$updatedData['COL_LON'] = $callbook['long'];
}
if (!empty($callbook['iota']) && empty($qso['COL_IOTA'])) {
$updatedData['COL_IOTA'] = $callbook['iota'];
}
if (!empty($callbook['state']) && empty($qso['COL_STATE'])) {
$updatedData['COL_STATE'] = $callbook['state'];
}
if (!empty($callbook['us_county']) && empty($qso['COL_USACA_COUNTIES'])) {
$updatedData['COL_USACA_COUNTIES'] = $callbook['us_county'];
}
if (!empty($callbook['qslmgr']) && empty($qso['COL_QSL_VIA'])) {
$updatedData['COL_QSL_VIA'] = $callbook['qslmgr'];
}
if (count($updatedData) > 0) {
$this->db->where('COL_PRIMARY_KEY', $qsoID);
$this->db->update($this->config->item('table_name'), $updatedData);
return true;
}
return false;
}
}

查看文件

@ -12,11 +12,13 @@ function echo_table_header_col($ctx, $name) {
case 'State': echo '<th>'.$ctx->lang->line('gen_hamradio_state').'</th>'; break;
case 'Grid': echo '<th>'.$ctx->lang->line('gen_hamradio_gridsquare').'</th>'; break;
case 'Band': echo '<th>'.$ctx->lang->line('gen_hamradio_band').'</th>'; break;
case 'Frequency': echo '<th>'.$ctx->lang->line('gen_hamradio_frequency').'</th>'; break;
case 'Operator': echo '<th>'.$ctx->lang->line('gen_hamradio_operator').'</th>'; break;
}
}
function echo_table_col($row, $name) {
$ci =& get_instance();
switch($name) {
case 'Mode': echo '<td>'; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . '</td>'; break;
case 'RSTS': echo '<td class="d-none d-sm-table-cell">' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_STX); echo '</span>';} if ($row->COL_STX_STRING) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_STX_STRING . '</span>';} echo '</td>'; break;
@ -28,15 +30,16 @@ function echo_table_col($row, $name) {
case 'POTA': echo '<td>' . ($row->COL_POTA_REF) . '</td>'; break;
case 'Grid': echo '<td>'; echoQrbCalcLink($row->station_gridsquare, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { if($row->COL_FREQ != null) { echo $ci->frequency->hz_to_mhz($row->COL_FREQ); } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
case 'State': echo '<td>' . ($row->COL_STATE) . '</td>'; break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
}
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
if (!empty($grid)) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
} else if (!empty($vucc)) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}

查看文件

@ -3217,5 +3217,14 @@ function deleteQsl(id) {
<?php } ?>
<?php } ?>
<?php
if (isset($scripts) && is_array($scripts)){
foreach($scripts as $script){
?><script type="text/javascript" src="<?php echo base_url() . $script ;?>"></script>
<?php
}
}
?>
</body>
</html>

查看文件

@ -36,7 +36,7 @@
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/datatables.min.css"/>
<?php if ($this->uri->segment(1) == "adif") { ?>
<?php if ($this->uri->segment(1) == "adif" || (isset($hasDatePicker) && $hasDatePicker)) { ?>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/datepicker.css" />
<?php } ?>
@ -58,7 +58,14 @@
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="<?php echo site_url('logbook');?>">Logbook</a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Logbook</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="<?php echo site_url('logbook');?>"><i class="fas fa-book"></i> Overview</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('logbookadvanced');?>"><i class="fas fa-book-open"></i> Advanced</a>
</div>
</li>
<?php if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
<!-- QSO Menu Dropdown -->

查看文件

@ -0,0 +1,207 @@
<div class="container-fluid qso_manager pt-3 pl-4 pr-4">
<?php if ($this->session->flashdata('message')) { ?>
<!-- Display Message -->
<div class="alert-message error">
<p><?php echo $this->session->flashdata('message'); ?></p>
</div>
<?php } ?>
<div class="row">
<form id="searchForm" name="searchForm" action="<?php echo base_url()."index.php/logbookadvanced/search";?>" method="post">
<div class="form-row">
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="dateFrom">From</label>
<div class="input-group input-group-sm date" id="dateFrom" data-target-input="nearest">
<input name="dateFrom" type="text" placeholder="<?php echo $datePlaceholder;?>" class="form-control" data-target="#dateFrom"/>
<div class="input-group-append" data-target="#dateFrom" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="dateTo">To</label>
<div class="input-group input-group-sm date" id="dateTo" data-target-input="nearest">
<input name="dateTo" type="text" placeholder="<?php echo $datePlaceholder;?>" class="form-control" data-target="#dateTo"/>
<div class="input-group-append" data-target="#dateTo" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="de">De</label>
<select id="de" name="de" class="form-control form-control-sm">
<option value="">All</option>
<?php
foreach($deOptions as $deOption){
?><option value="<?php echo htmlentities($deOption);?>"><?php echo htmlspecialchars($deOption);?></option><?php
}
?>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="dx">Dx</label>
<input type="text" name="dx" id="dx" class="form-control form-control-sm" value="">
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="dxcc">DXCC</label>
<select class="form-control form-control-sm" id="dxcc" name="dxcc">
<option value="">-</option>
<option value="0">None (/MM, /AM)</option>
<?php
foreach($dxccarray as $dxcc){
echo '<option value=' . $dxcc->adif;
echo '>' . $dxcc->prefix . ' - ' . ucwords(strtolower($dxcc->name), "- (/");
if ($dxcc->Enddate != null) {
echo ' - (Deleted DXCC)';
}
echo '</option>';
}
?>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="iota">IOTA</label>
<select class="form-control form-control-sm" id="iota" name="iota">
<option value ="">-</option>
<?php
foreach($iotaarray as $iota){
echo '<option value=' . $iota->tag;
echo '>' . $iota->tag . ' - ' . $iota->name . '</option>';
}
?>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="state">State</label>
<input type="text" name="state" id="state" class="form-control form-control-sm" value="">
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="gridsquare">Gridsquare</label>
<input type="text" name="gridsquare" id="gridsquare" class="form-control form-control-sm" value="">
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="mode">Mode</label>
<select id="mode" name="mode" class="form-control form-control-sm">
<option value="">All</option>
<?php
foreach($modes as $modeId => $mode){
?><option value="<?php echo htmlentities($modeId);?>"><?php echo htmlspecialchars($mode);?></option><?php
}
?>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="band">Band</label>
<select id="band" name="band" class="form-control form-control-sm">
<option value="">All</option>
<?php
foreach($bands as $band){
?><option value="<?php echo htmlentities($band);?>"><?php echo htmlspecialchars($band);?></option><?php
}
?>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="selectPropagation">Propagation</label>
<select id="selectPropagation" name="selectPropagation" class="form-control form-control-sm">
<option value="">All</option>
<option value="AS">Aircraft Scatter</option>
<option value="AUR">Aurora</option>
<option value="AUE">Aurora-E</option>
<option value="BS">Back scatter</option>
<option value="ECH">EchoLink</option>
<option value="EME">Earth-Moon-Earth</option>
<option value="ES">Sporadic E</option>
<option value="FAI">Field Aligned Irregularities</option>
<option value="F2">F2 Reflection</option>
<option value="INTERNET">Internet-assisted</option>
<option value="ION">Ionoscatter</option>
<option value="IRL">IRLP</option>
<option value="MS">Meteor scatter</option>
<option value="RPT">Terrestrial or atmospheric repeater or transponder</option>
<option value="RS">Rain scatter</option>
<option value="SAT">Satellite</option>
<option value="TEP">Trans-equatorial</option>
<option value="TR">Tropospheric ducting</option>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="qslSent">QSL Sent</label>
<select id="qslSent" name="qslSent" class="form-control form-control-sm">
<option value="">All</option>
<option value="Y">Yes</option>
<option value="N">No</option>
<option value="R">Requested</option>
<option value="Q">Queued</option>
<option value="I">Ignore/Invalid</option>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="qslReceived">QSL Received</label>
<select id="qslReceived" name="qslReceived" class="form-control form-control-sm">
<option value="">All</option>
<option value="Y">Yes</option>
<option value="N">No</option>
<option value="R">Requested</option>
<option value="I">Ignore/Invalid</option>
<option value="V">Verified</option>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="qsoResults"># Results</label>
<select id="qsoResults" name="qsoResults" class="form-control form-control-sm">
<option value="250">250</option>
<option value="1000">1000</option>
<option value="2500">2500</option>
<option value="5000">5000</option>
</select>
</div>
<div class="form-group col-lg col-md-3 col-sm-3 col-xl-1">
<label>&nbsp;</label><br>
<button type="submit" class="btn btn-sm btn-primary" id="searchButton">Search</button>
<button type="reset" class="btn btn-sm btn-danger" id="resetButton">Reset</button>
</div>
</div>
</form>
<div class="mb-2">
<span class="h6">With selected :</span>
<button type="button" class="btn btn-sm btn-primary" id="btnUpdateFromCallbook">Update from Callbook</button>
<button type="button" class="btn btn-sm btn-primary" id="queueBureau">Queue Bureau</button>
<button type="button" class="btn btn-sm btn-primary" id="queueDirect">Queue Direct</button>
<button type="button" class="btn btn-sm btn-success" id="sentBureau">Sent Bureau</button>
<button type="button" class="btn btn-sm btn-success" id="sentDirect">Sent Direct</button>
<button type="button" class="btn btn-sm btn-warning" id="dontSend">Don't Send</button>
<button type="button" class="btn btn-sm btn-info" id="exportAdif">Create ADIF</button>
<button type="button" class="btn btn-sm btn-danger" id="deleteQsos">Delete</button>
<span id="infoBox"></span>
</div>
</div>
<table style="width:100%" class="table-sm table table-bordered table-hover table-condensed text-center" id="qsoList">
<thead>
<tr>
<th><div class="form-check" style="margin-top: -1.5em"><input class="form-check-input" type="checkbox" id="checkBoxAll" /></div></th>
<th>Date/Time</th>
<th>De</th>
<th>Dx</th>
<th>Mode</th>
<th>RST (S)</th>
<th>RST (R)</th>
<th>Band</th>
<th>My Refs</th>
<th>Refs</th>
<th>Name</th>
<th>QSL Via</th>
<th>QSL Sent</th>
<th>QSL Received</th>
<th>QSL Msg</th>
<th>DXCC</th>
<th>State</th>
<th>CQ Zone</th>
<th>IOTA</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>

查看文件

@ -18,6 +18,7 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
@ -32,6 +33,7 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_band'); break;
}
echo '</td>';
@ -46,6 +48,7 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
@ -60,6 +63,7 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
@ -74,6 +78,7 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td><td></td></tr>';

查看文件

@ -528,7 +528,12 @@
<td><?php echo $this->lang->line('gen_hamradio_mode'); ?></td>
<td><?php echo $this->lang->line('gen_hamradio_rsts'); ?></td>
<td><?php echo $this->lang->line('gen_hamradio_rstr'); ?></td>
<td><?php echo $this->lang->line('gen_hamradio_band'); ?></td>
<?php if ($this->session->userdata('user_column1')=='Frequency' || $this->session->userdata('user_column2')=='Frequency' || $this->session->userdata('user_column3')=='Frequency' || $this->session->userdata('user_column4')=='Frequency' || $this->session->userdata('user_column5')=='Frequency') {
echo '<td>'.$this->lang->line('gen_hamradio_frequency').'</td>';
} else {
echo '<td>'.$this->lang->line('gen_hamradio_band').'</td>';
}
?>
</tr>
<?php
@ -560,9 +565,19 @@
<td><?php echo $row->COL_RST_RCVD; ?></td>
<?php if($row->COL_SAT_NAME != null) { ?>
<td><?php echo $row->COL_SAT_NAME; ?></td>
<?php } else { ?>
<td><?php echo $row->COL_BAND; ?></td>
<?php } ?>
<?php } else {
if ($this->session->userdata('user_column1')=='Frequency' || $this->session->userdata('user_column2')=='Frequency' || $this->session->userdata('user_column3')=='Frequency' || $this->session->userdata('user_column4')=='Frequency' || $this->session->userdata('user_column5')=='Frequency') {
echo '<td>';
if ($row->COL_FREQ != null) {
echo $this->frequency->hz_to_mhz($row->COL_FREQ);
} else {
echo $row->COL_BAND;
}
echo '</td>';
} else {
echo '<td>'.$row->COL_BAND.'</td>';
}
} ?>
</tr>
<?php $i++; } } ?>
</table>

查看文件

@ -2,13 +2,14 @@
<table style="width:100%" class="table table-sm tablewas table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr class="titles">
<td><?php echo $this->lang->line('general_word_date'); ?></td>
<th><?php echo $this->lang->line('general_word_date'); ?></th>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<td><?php echo $this->lang->line('general_word_time'); ?></td>
<th><?php echo $this->lang->line('general_word_time'); ?></th>
<?php } ?>
<td><?php echo $this->lang->line('gen_hamradio_call'); ?></td>
<th><?php echo $this->lang->line('gen_hamradio_call'); ?></th>
<?php
echo '<td>';
$ci =& get_instance();
echo '<th>';
switch($this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')) {
case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break;
case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break;
@ -19,10 +20,11 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
echo '<td>';
echo '</th>';
echo '<th>';
switch($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')) {
case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break;
case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break;
@ -33,10 +35,11 @@
case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
echo '<td>';
echo '</th>';
echo '<th>';
switch($this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')) {
case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break;
case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break;
@ -47,10 +50,11 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
echo '<td>';
echo '</th>';
echo '<th>';
switch($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')) {
case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break;
case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break;
@ -61,10 +65,11 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
echo '<td>';
echo '</th>';
echo '<th>';
switch($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')) {
case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break;
case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break;
@ -75,22 +80,23 @@
case 'State': echo $this->lang->line('gen_hamradio_state'); break;
case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break;
case 'Band': echo $this->lang->line('gen_hamradio_band'); break;
case 'Frequency': echo $this->lang->line('gen_hamradio_frequency'); break;
case 'Operator': echo $this->lang->line('gen_hamradio_operator'); break;
}
echo '</td>';
echo '</th>';
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
<td>QSL</td>
<th>QSL</th>
<?php if($this->session->userdata('user_eqsl_name') != "") { ?>
<td>eQSL</td>
<th>eQSL</th>
<?php } ?>
<?php if($this->session->userdata('user_lotw_name') != "") { ?>
<td>LoTW</td>
<th>LoTW</th>
<?php } ?>
<?php } ?>
<td><?php echo $this->lang->line('gen_hamradio_station'); ?></td>
<th><?php echo $this->lang->line('gen_hamradio_station'); ?></th>
<?php if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
<td></td>
<th></th>
<?php } ?>
</tr>
</thead>
@ -130,6 +136,7 @@
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break;
case 'State': echo '<td>' . ($row->COL_STATE); break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR); break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'; if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'.$row->COL_SAT_NAME.'</span>'; } else { echo $row->COL_SAT_NAME; } echo '</a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
}
echo '</td>';
switch($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')) {
@ -145,6 +152,7 @@
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break;
case 'State': echo '<td>' . ($row->COL_STATE); break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR); break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'; if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'.$row->COL_SAT_NAME.'</span>'; } else { echo $row->COL_SAT_NAME; } echo '</a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
}
echo '</td>';
@ -161,6 +169,7 @@
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break;
case 'State': echo '<td>' . ($row->COL_STATE); break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR); break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'; if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'.$row->COL_SAT_NAME.'</span>'; } else { echo $row->COL_SAT_NAME; } echo '</a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
}
echo '</td>';
switch($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')) {
@ -176,6 +185,7 @@
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break;
case 'State': echo '<td>' . ($row->COL_STATE); break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR); break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'; if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'.$row->COL_SAT_NAME.'</span>'; } else { echo $row->COL_SAT_NAME; } echo '</a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
}
echo '</td>';
switch($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')) {
@ -191,6 +201,7 @@
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break;
case 'State': echo '<td>' . ($row->COL_STATE); break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR); break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'; if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'.$row->COL_SAT_NAME.'</span>'; } else { echo $row->COL_SAT_NAME; } echo '</a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
}
echo '</td>';
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>

查看文件

@ -170,6 +170,7 @@
<label for="column1"><?php echo $this->lang->line('account_column1_text'); ?></label>
<select class="custom-select" id="column1" name="user_column1">
<option value="Band"> <?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency"> <?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode" selected ='selected'> <?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS"><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR"><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -186,6 +187,7 @@
<label for="column2"><?php echo $this->lang->line('account_column2_text'); ?></label>
<select class="custom-select" id="column2" name="user_column2">
<option value="Band"> <?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency"> <?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode"> <?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS" selected ='selected'><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR"><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -202,6 +204,7 @@
<label for="column3"><?php echo $this->lang->line('account_column3_text'); ?></label>
<select class="custom-select" id="column3" name="user_column3">
<option value="Band"> <?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency"> <?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode"> <?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS"><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR" selected ='selected'><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -218,6 +221,7 @@
<label for="column4"><?php echo $this->lang->line('account_column4_text'); ?></label>
<select class="custom-select" id="column4" name="user_column4">
<option value="Band" selected ='selected'> <?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency"> <?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode"> <?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS"><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR"><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -234,6 +238,7 @@
<label for="column5"><?php echo $this->lang->line('account_column5_text'); ?></label>
<select class="custom-select" id="column5" name="user_column5">
<option value="Band"> <?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency"> <?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode"> <?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS"><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR"><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>

查看文件

@ -350,6 +350,7 @@
<label for="column1"><?php echo $this->lang->line('account_column1_text'); ?></label>
<select class="custom-select" id="column1" name="user_column1">
<option value="Band" <?php if ($user_column1 == "Band") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency" <?php if ($user_column1 == "Frequency") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode" <?php if ($user_column1 == "Mode") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS" <?php if ($user_column1 == "RSTS") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR" <?php if ($user_column1 == "RSTR") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -368,6 +369,7 @@
<label for="column2"><?php echo $this->lang->line('account_column2_text'); ?></label>
<select class="custom-select" id="column2" name="user_column2">
<option value="Band" <?php if ($user_column2 == "Band") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency" <?php if ($user_column2 == "Frequency") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode" <?php if ($user_column2 == "Mode") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS" <?php if ($user_column2 == "RSTS") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR" <?php if ($user_column2 == "RSTR") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -386,6 +388,7 @@
<label for="column3"><?php echo $this->lang->line('account_column3_text'); ?></label>
<select class="custom-select" id="column3" name="user_column3">
<option value="Band" <?php if ($user_column3 == "Band") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency" <?php if ($user_column3 == "Frequency") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode" <?php if ($user_column3 == "Mode") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS" <?php if ($user_column3 == "RSTS") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR" <?php if ($user_column3 == "RSTR") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -404,6 +407,7 @@
<label for="column4"><?php echo $this->lang->line('account_column4_text'); ?></label>
<select class="custom-select" id="column4" name="user_column4">
<option value="Band" <?php if ($user_column4 == "Band") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency" <?php if ($user_column4 == "Frequency") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode" <?php if ($user_column4 == "Mode") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS" <?php if ($user_column4 == "RSTS") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR" <?php if ($user_column4 == "RSTR") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>
@ -421,6 +425,7 @@
<label for="column5"><?php echo $this->lang->line('account_column5_text'); ?></label>
<select class="custom-select" id="column5" name="user_column5">
<option value="Band" <?php if ($user_column5 == "Band") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_band'); ?></option>
<option value="Frequency" <?php if ($user_column5 == "Frequency") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_frequency'); ?></option>
<option value="Mode" <?php if ($user_column5 == "Mode") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_mode'); ?></option>
<option value="RSTS" <?php if ($user_column5 == "RSTS") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rsts'); ?></option>
<option value="RSTR" <?php if ($user_column5 == "RSTR") { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_rstr'); ?></option>

查看文件

@ -8,15 +8,17 @@ function echo_table_header_col($ctx, $name) {
case 'IOTA': echo '<th>'.$ctx->lang->line('gen_hamradio_iota').'</th>'; break;
case 'SOTA': echo '<th>'.$ctx->lang->line('gen_hamradio_sota').'</th>'; break;
case 'WWFF': echo '<th>'.$ctx->lang->line('gen_hamradio_wwff').'</th>'; break;
case 'POTA': echo '<th>'.$ctx->lang->line('gen_hamradio_pota').'</th>'; break;
case 'POTA': echo '<th>'.$ctx->lang->line('gen_hamradio_pota').'</th>'; break;
case 'State': echo '<th>'.$ctx->lang->line('gen_hamradio_state').'</th>'; break;
case 'Grid': echo '<th>'.$ctx->lang->line('gen_hamradio_gridsquare').'</th>'; break;
case 'Band': echo '<th>'.$ctx->lang->line('gen_hamradio_band').'</td>'; break;
case 'Operator': echo '<th>'.$ctx->lang->line('gen_hamradio_operator').'</th>'; break;
case 'Frequency': echo '<th>'.$ctx->lang->line('gen_hamradio_frequency').'</th>'; break;
case 'Operator': echo '<th>'.$ctx->lang->line('gen_hamradio_operator').'</th>'; break;
}
}
function echo_table_col($row, $name) {
$ci =& get_instance();
switch($name) {
case 'Mode': echo '<td>'; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . '</td>'; break;
case 'RSTS': echo '<td>' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_STX); echo '</span>';} if ($row->COL_STX_STRING) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_STX_STRING . '</span>';} echo '</td>'; break;
@ -27,16 +29,17 @@ function echo_table_col($row, $name) {
case 'WWFF': echo '<td>' . ($row->COL_WWFF_REF) . '</td>'; break;
case 'POTA': echo '<td>' . ($row->COL_POTA_REF) . '</td>'; break;
case 'Grid': echo '<td>'; echoQrbCalcLink($row->station_gridsquare, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank"><span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$row->COL_SAT_NAME.'</span></a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'. strtolower($row->COL_BAND).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
case 'Frequency': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'; if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'">'.$row->COL_SAT_NAME.'</span>'; } else { echo $row->COL_SAT_NAME; } echo '</a></td>'; } else { if ($row->COL_FREQ != null) { echo '<span data-toggle="tooltip" data-original-title="'.$row->COL_BAND.'">'.$ci->frequency->hz_to_mhz($row->COL_FREQ).'</span>'; } else { echo strtolower($row->COL_BAND); } } echo '</td>'; break;
case 'State': echo '<td>' . ($row->COL_STATE) . '</td>'; break;
case 'Operator':echo '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
}
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
if (!empty($grid)) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
} else if (!empty($vucc)) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}
@ -181,8 +184,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<?php if ($this->session->userdata('user_eqsl_name') != ""){ ?>
<td class="eqsl">
<span <?php if ($row->COL_EQSL_QSL_SENT == "Y") { $timestamp = strtotime($row->COL_EQSL_QSLSDATE); echo "data-original-title=\"".$this->lang->line('eqsl_short')." ".$this->lang->line('general_word_sent')." ".($timestamp!=''?date($custom_date_format, $timestamp):'')."\" data-toggle=\"tooltip\""; } ?> class="eqsl-<?php echo ($row->COL_EQSL_QSL_SENT=='Y')?'green':'red'?>">&#9650;</span>
<span <?php if ($row->COL_EQSL_QSL_RCVD == "Y") { $timestamp = strtotime($row->COL_EQSL_QSLRDATE); echo "data-original-title=\"".$this->lang->line('eqsl_short')." ".$this->lang->line('general_word_received')." ".($timestamp!=''?date($custom_date_format, $timestamp):'')."\" data-toggle=\"tooltip\""; } ?> class="eqsl-<?php echo ($row->COL_EQSL_QSL_RCVD=='Y')?'green':'red'?>">
<span <?php if ($row->COL_EQSL_QSL_SENT == "Y") { echo "data-original-title=\"".$this->lang->line('eqsl_short')." ".$this->lang->line('general_word_sent'); if ($row->COL_EQSL_QSLSDATE != null) { $timestamp = strtotime($row->COL_EQSL_QSLSDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-toggle=\"tooltip\""; } ?> class="eqsl-<?php echo ($row->COL_EQSL_QSL_SENT=='Y')?'green':'red'?>">&#9650;</span>
<span <?php if ($row->COL_EQSL_QSL_RCVD == "Y") { echo "data-original-title=\"".$this->lang->line('eqsl_short')." ".$this->lang->line('general_word_received'); if ($row->COL_EQSL_QSLRDATE != null) { $timestamp = strtotime($row->COL_EQSL_QSLRDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-toggle=\"tooltip\""; } ?> class="eqsl-<?php echo ($row->COL_EQSL_QSL_RCVD=='Y')?'green':'red'?>">
<?php if($row->COL_EQSL_QSL_RCVD =='Y') { ?>
<a class="eqsl-green" href="<?php echo site_url("eqsl/image/".$row->COL_PRIMARY_KEY); ?>" data-fancybox="images" data-width="528" data-height="336">&#9660;</a>
<?php } else { ?>
@ -194,8 +197,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<?php if($this->session->userdata('user_lotw_name') != "") { ?>
<td class="lotw">
<span <?php if ($row->COL_LOTW_QSL_SENT == "Y") { $timestamp = strtotime($row->COL_LOTW_QSLSDATE); echo "data-original-title=\"".$this->lang->line('lotw_short')." ".$this->lang->line('general_word_sent')." ".($timestamp!=''?date($custom_date_format, $timestamp):'')."\" data-toggle=\"tooltip\""; } ?> class="lotw-<?php echo ($row->COL_LOTW_QSL_SENT=='Y')?'green':'red'?>">&#9650;</span>
<span <?php if ($row->COL_LOTW_QSL_RCVD == "Y") { $timestamp = strtotime($row->COL_LOTW_QSLRDATE); echo "data-original-title=\"".$this->lang->line('lotw_short')." ".$this->lang->line('general_word_received')." ".($timestamp!=''?date($custom_date_format, $timestamp):'')."\" data-toggle=\"tooltip\""; } ?> class="lotw-<?php echo ($row->COL_LOTW_QSL_RCVD=='Y')?'green':'red'?>">&#9660;</span>
<span <?php if ($row->COL_LOTW_QSL_SENT == "Y") { echo "data-original-title=\"".$this->lang->line('lotw_short')." ".$this->lang->line('general_word_sent'); if ($row->COL_LOTW_QSLSDATE != null) { $timestamp = strtotime($row->COL_LOTW_QSLSDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-toggle=\"tooltip\""; } ?> class="lotw-<?php echo ($row->COL_LOTW_QSL_SENT=='Y')?'green':'red'?>">&#9650;</span>
<span <?php if ($row->COL_LOTW_QSL_RCVD == "Y") { echo "data-original-title=\"".$this->lang->line('lotw_short')." ".$this->lang->line('general_word_received'); if ($row->COL_LOTW_QSLRDATE != null) { $timestamp = strtotime($row->COL_LOTW_QSLRDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-toggle=\"tooltip\""; } ?> class="lotw-<?php echo ($row->COL_LOTW_QSL_RCVD=='Y')?'green':'red'?>">&#9660;</span>
</td>
<?php } ?>

查看文件

@ -10,11 +10,13 @@ function echo_table_header_col($ctx, $name) {
case 'State': echo '<th>'.$ctx->lang->line('gen_hamradio_state').'</th>'; break;
case 'Grid': echo '<th>'.$ctx->lang->line('gen_hamradio_gridsquare').'</th>'; break;
case 'Band': echo '<th>'.$ctx->lang->line('gen_hamradio_band').'</th>'; break;
case 'Frequency': echo '<th>'.$ctx->lang->line('gen_hamradio_frequency').'</th>'; break;
case 'Operator': echo '<th>'.$ctx->lang->line('gen_hamradio_operator').'</th>'; break;
}
}
function echo_table_col($row, $name) {
$ci =& get_instance();
switch($name) {
case 'Mode': echo '<td>'; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . '</td>'; break;
case 'RSTS': echo '<td class="d-none d-sm-table-cell">' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_STX); echo '</span>';} if ($row->COL_STX_STRING) { echo '<span data-toggle="tooltip" data-original-title="'.($row->COL_CONTEST_ID!=""?$row->COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_STX_STRING . '</span>';} echo '</td>'; break;
@ -26,15 +28,16 @@ function echo_table_col($row, $name) {
case 'POTA': echo '<td>' . ($row->COL_POTA_REF) . '</td>'; break;
case 'Grid': echo '<td>'; echoQrbCalcLink($row->station_gridsquare, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo '</td>'; break;
case 'Band': echo '<td>'; if($row->COL_SAT_NAME != null) { echo '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'Frequency': echo '<td>'; if($row->COL_FREQ != null) { echo $ci->frequency->hz_to_mhz($row->COL_FREQ); } else { echo strtolower($row->COL_BAND); } echo '</td>'; break;
case 'State': echo '<td>' . ($row->COL_STATE) . '</td>'; break;
case 'Operator': echo '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
}
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
if (!empty($grid)) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
} else if (!empty($vucc)) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}

查看文件

@ -0,0 +1,360 @@
var callBookProcessingDialog = null;
var inCallbookProcessing = false;
var inCallbookItemProcessing = false;
function updateRow(qso) {
let row = $('#qsoID-' + qso.qsoID);
let cells = row.find('td');
let c = 1;
cells.eq(c++).text(qso.qsoDateTime);
cells.eq(c++).text(qso.de);
cells.eq(c++).html('<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>');
cells.eq(c++).text(qso.mode);
cells.eq(c++).text(qso.rstS);
cells.eq(c++).text(qso.rstR);
cells.eq(c++).text(qso.band);
cells.eq(c++).text(qso.deRefs);
cells.eq(c++).text(qso.dxRefs);
cells.eq(c++).text(qso.name);
cells.eq(c++).text(qso.qslVia);
cells.eq(c++).text(qso.qslSent);
cells.eq(c++).text(qso.qslReceived);
cells.eq(c++).text(qso.qslMessage);
cells.eq(c++).text(qso.dxcc);
cells.eq(c++).text(qso.state);
cells.eq(c++).text(qso.cqzone);
cells.eq(c++).text(qso.iota);
return row;
}
function loadQSOTable(rows) {
var uninitialized = $('#qsoList').filter(function() {
return !$.fn.DataTable.fnIsDataTable(this);
});
uninitialized.each(function() {
$(this).DataTable({
searching: false,
responsive: false,
ordering: true,
"scrollY": window.innerHeight - $('#searchForm').innerHeight() - 250,
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"order": [ 0, 'asc' ],
});
});
var table = $('#qsoList').DataTable();
table.clear();
for (i = 0; i < rows.length; i++) {
let qso = rows[i];
var data = [
'<div class="form-check"><input class="form-check-input" type="checkbox" /></div>',
qso.qsoDateTime,
qso.de,
'<a id="edit_qso" href="javascript:displayQso('+qso.qsoID+')">'+qso.dx+'</a>',
qso.mode,
qso.rstS,
qso.rstR,
qso.band,
qso.deRefs,
qso.dxRefs,
qso.name,
qso.qslVia,
qso.qslSent,
qso.qslReceived,
qso.qslMessage,
qso.dxcc,
qso.state,
qso.cqzone,
qso.iota,
];
let createdRow = table.row.add(data).index();
table.rows(createdRow).nodes().to$().data('qsoID', qso.qsoID);
table.row(createdRow).node().id = 'qsoID-' + qso.qsoID;
}
table.draw();
}
function processNextCallbookItem() {
if (!inCallbookProcessing) return;
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
inCallbookProcessing = false;
callBookProcessingDialog.close();
return;
}
callBookProcessingDialog.setMessage("Retrieving callbook data : " + nElements + " remaining");
unselectQsoID(elements.first().closest('tr').data('qsoID'));
$.ajax({
url: site_url + '/logbookadvanced/updateFromCallbook',
type: 'post',
data: {
qsoID: elements.first().closest('tr').data('qsoID')
},
dataType: 'json',
success: function (data) {
if (data !== []) {
updateRow(data);
}
setTimeout("processNextCallbookItem()", 50);
},
error: function (data) {
setTimeout("processNextCallbookItem()", 50);
},
});
}
function selectQsoID(qsoID) {
var element = $("#qsoID-" + qsoID);
element.find("input[type=checkbox]").prop("checked", true);
element.addClass('alert-success');
}
function unselectQsoID(qsoID) {
var element = $("#qsoID-" + qsoID);
element.find("input[type=checkbox]").prop("checked", false);
element.removeClass('alert-success');
$('#checkBoxAll').prop("checked", false);
}
$(document).ready(function () {
$('#dateFrom').datetimepicker({
format: 'DD/MM/YYYY',
});
$('#dateTo').datetimepicker({
format: 'DD/MM/YYYY',
});
$('#searchForm').submit(function (e) {
$('#searchButton').prop("disabled", true);
$.ajax({
url: this.action,
type: 'post',
data: {
dateFrom: this.dateFrom.value,
dateTo: this.dateTo.value,
de: this.de.value,
dx: this.dx.value,
mode: this.mode.value,
band: this.band.value,
qslSent: this.qslSent.value,
qslReceived: this.qslReceived.value,
iota: this.iota.value,
dxcc: this.dxcc.value,
propmode: this.selectPropagation.value,
gridsquare: this.gridsquare.value,
state: this.state.value,
qsoresults: this.qsoResults.value
},
dataType: 'json',
success: function (data) {
$('#searchButton').prop("disabled", false);
loadQSOTable(data);
},
error: function (data) {
$('#searchButton').prop("disabled", false);
BootstrapDialog.alert({
title: 'ERROR',
message: 'An error ocurred while making the request',
type: BootstrapDialog.TYPE_DANGER,
closable: false,
draggable: false,
callback: function (result) {
}
});
},
});
return false;
});
$('#qsoList').on('click', 'input[type="checkbox"]', function() {
if ($(this).is(":checked")) {
$(this).closest('tr').addClass('alert-success');
} else {
$(this).closest('tr').removeClass('alert-success');
}
});
$('#btnUpdateFromCallbook').click(function (event) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
inCallbookProcessing = true;
callBookProcessingDialog = BootstrapDialog.show({
title: "Retrieving callbook data for " + nElements + " QSOs",
message: "Retrieving callbook data for " + nElements + " QSOs",
type: BootstrapDialog.TYPE_DANGER,
closable: false,
draggable: false,
buttons: [{
label: 'Cancel',
action: function(dialog) {
inCallbookProcessing = false;
dialog.close();
}
}]
});
processNextCallbookItem();
});
$('#deleteQsos').click(function (event) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
$('#deleteQsos').prop("disabled", true);
var table = $('#qsoList').DataTable();
BootstrapDialog.confirm({
title: 'DANGER',
message: 'Warning! Are you sure you want to delete the marked QSO(s)?' ,
type: BootstrapDialog.TYPE_DANGER,
closable: true,
draggable: true,
btnOKClass: 'btn-danger',
callback: function(result) {
if(result) {
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
$.ajax({
url: base_url + 'index.php/qso/delete_ajax',
type: 'post',
data: {'id': id
},
success: function(data) {
var row = $("#qsoID-" + id);
table.row(row).remove().draw(false);
}
});
$('#deleteQsos').prop("disabled", false);
})
}
}
});
});
$('#exportAdif').click(function (event) {
$('#exportAdif').prop("disabled", true);
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
var id_list=[];
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
id_list.push(id);
unselectQsoID(id);
});
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
var a;
if (xhttp.readyState === 4 && xhttp.status === 200) {
// Trick for making downloadable link
a = document.createElement('a');
a.href = window.URL.createObjectURL(xhttp.response);
// Give filename you wish to download
a.download = "logbook_export.adi";
a.style.display = 'none';
document.body.appendChild(a);
a.click();
}
};
// Post data to URL which handles post request
xhttp.open("POST", site_url+'/logbookadvanced/export_to_adif', true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// You should set responseType as blob for binary responses
xhttp.responseType = 'blob';
xhttp.send("id=" + JSON.stringify(id_list, null, 2));
$('#exportAdif').prop("disabled", false);
});
$('#queueBureau').click(function (event) {
handleQsl('Q','B', 'queueBureau');
});
$('#queueDirect').click(function (event) {
handleQsl('Q','D', 'queueDirect');
});
$('#sentBureau').click(function (event) {
handleQsl('Y','B', 'sentBureau');
});
$('#sentDirect').click(function (event) {
handleQsl('Y','D', 'sentDirect');
});
$('#dontSend').click(function (event) {
handleQsl('N','', 'dontSend');
});
$('#searchForm').on('reset', function(e) {
setTimeout(function() {
$('#searchForm').submit();
});
});
function handleQsl(sent, method, tag) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
$('#'+tag).prop("disabled", true);
var id_list=[];
elements.each(function() {
let id = $(this).first().closest('tr').data('qsoID')
id_list.push(id);
});
$.ajax({
url: base_url + 'index.php/logbookadvanced/update_qsl',
type: 'post',
data: {'id': JSON.stringify(id_list, null, 2),
'sent' : sent,
'method' : method
},
success: function(data) {
if (data !== []) {
$.each(data, function(k, v) {
updateRow(this);
unselectQsoID(this.qsoID);
});
}
$('#'+tag).prop("disabled", false);
}
});
}
$('#checkBoxAll').change(function (event) {
if (this.checked) {
$('#qsoList tbody tr').each(function (i) {
selectQsoID($(this).data('qsoID'))
});
} else {
$('#qsoList tbody tr').each(function (i) {
unselectQsoID($(this).data('qsoID'))
});
}
});
$('#searchForm').submit();
});

查看文件

@ -143,7 +143,19 @@
]
}
},
"CAS-5A":{
"CAS-10":{
"Modes":{
"V/U":[
{
"Uplink_Mode":"LSB",
"Uplink_Freq":"145870000",
"Downlink_Mode":"USB",
"Downlink_Freq":"435180000"
}
]
}
},
"FO-118":{
"Modes":{
"H/U":[
{

687
src/QSLManager/QSO.php 普通文件
查看文件

@ -0,0 +1,687 @@
<?php
declare(strict_types=1);
namespace Cloudlog\QSLManager;
use DateTime;
use DateTimeZone;
use DomainException;
class QSO
{
private string $qsoID;
private DateTime $qsoDateTime;
private string $de;
private string $dx;
private string $mode;
private string $submode;
private string $band;
private string $bandRX;
private string $rstR;
private string $rstS;
private string $propagationMode;
private string $satelliteMode;
private string $satelliteName;
private string $name;
private string $email;
private string $address;
private string $deGridsquare;
private string $deIOTA;
private string $deSig;
private string $deSigInfo;
private string $deIOTAIslandID;
private string $deSOTAReference;
/** Awards */
private string $cqzone;
private string $state;
private string $dxcc;
private string $iota;
/** @var string[] */
private array $deVUCCGridsquares;
private string $dxGridsquare;
private string $dxIOTA;
private string $dxSig;
private string $dxSigInfo;
private string $dxDARCDOK;
private string $dxSOTAReference;
/** @var string[] */
private array $dxVUCCGridsquares;
private string $QSLMsg;
private ?DateTime $QSLReceivedDate;
private string $QSLReceived;
private string $QSLReceivedVia;
private ?DateTime $QSLSentDate;
private string $QSLSent;
private string $QSLSentVia;
private string $QSLVia;
/**
* @param array $data Does no validation, it's assumed to be a row from the database in array format
*/
public function __construct(array $data)
{
$requiredKeys = [
'COL_PRIMARY_KEY',
'COL_ADDRESS',
'COL_BAND',
'COL_BAND_RX',
'COL_CALL',
'COL_EMAIL',
'COL_GRIDSQUARE',
'COL_IOTA',
'COL_MODE',
'COL_MY_GRIDSQUARE',
'COL_MY_IOTA',
'COL_MY_SIG',
'COL_MY_SIG_INFO',
'COL_NAME',
'COL_PROP_MODE',
'COL_QSLMSG',
'COL_QSLRDATE',
'COL_QSLSDATE',
'COL_QSL_RCVD',
'COL_QSL_RCVD_VIA',
'COL_QSL_SENT',
'COL_QSL_SENT_VIA',
'COL_QSL_VIA',
'COL_RST_RCVD',
'COL_RST_SENT',
'COL_SAT_MODE',
'COL_SAT_NAME',
'COL_SIG',
'COL_SIG_INFO',
'COL_STATION_CALLSIGN',
'COL_TIME_ON',
'COL_DARC_DOK',
'COL_MY_IOTA_ISLAND_ID',
'COL_MY_SOTA_REF',
'COL_MY_VUCC_GRIDS',
'COL_SOTA_REF',
'COL_SUBMODE',
'COL_VUCC_GRIDS',
'COL_CQZ',
'COL_STATE',
'COL_COUNTRY',
'COL_IOTA',
];
foreach ($requiredKeys as $requiredKey) {
if (!array_key_exists($requiredKey, $data)) {
throw new DomainException("Required key $requiredKey does not exist");
}
}
$this->qsoID = $data['COL_PRIMARY_KEY'];
$this->qsoDateTime = DateTime::createFromFormat("Y-m-d H:i:s", $data['COL_TIME_ON'], new DateTimeZone("UTC"));
$this->de = $data['COL_STATION_CALLSIGN'];
$this->dx = $data['COL_CALL'];
$this->mode = $data['COL_MODE'] ?? '';
$this->submode = $data['COL_SUBMODE'] ?? '';
$this->band = $data['COL_BAND'];
$this->bandRX = $data['COL_BAND_RX'] ?? '';
$this->rstR = $data['COL_RST_RCVD'];
$this->rstS = $data['COL_RST_SENT'];
$this->propagationMode = $data['COL_PROP_MODE'] ?? '';
$this->satelliteMode = $data['COL_SAT_MODE'] ?? '';
$this->satelliteName = $data['COL_SAT_NAME'] ?? '';
$this->name = $data['COL_NAME'] ?? '';
$this->email = $data['COL_EMAIL'] ?? '';
$this->address = $data['COL_ADDRESS'] ?? '';
$this->deGridsquare = $data['COL_MY_GRIDSQUARE'] ?? '';
$this->deIOTA = $data['COL_MY_IOTA'] ?? '';
$this->deSig = $data['COL_MY_SIG'] ?? '';
$this->deSigInfo = $data['COL_MY_SIG_INFO'] ?? '';
$this->deIOTAIslandID = $data['COL_MY_IOTA_ISLAND_ID'] ?? '';
$this->deSOTAReference = $data['COL_MY_SOTA_REF'] ?? '';
$this->deVUCCGridsquares = ($data['COL_MY_VUCC_GRIDS'] === null) ? [] : explode(",", $data['COL_MY_VUCC_GRIDS'] ?? '');
$this->dxGridsquare = $data['COL_GRIDSQUARE'] ?? '';
$this->dxIOTA = $data['COL_IOTA'] ?? '';
$this->dxSig = $data['COL_SIG'] ?? '';
$this->dxSigInfo = $data['COL_SIG_INFO'] ?? '';
$this->dxDARCDOK = $data['COL_DARC_DOK'] ?? '';
$this->dxSOTAReference = $data['COL_SOTA_REF'] ?? '';
$this->dxVUCCGridsquares = ($data['COL_VUCC_GRIDS'] === null) ? [] : explode(",", $data['COL_VUCC_GRIDS'] ?? '');
$this->QSLMsg = $data['COL_QSLMSG'] ?? '';
$this->QSLReceivedDate = ($data['COL_QSLRDATE'] === null) ? null : DateTime::createFromFormat("Y-m-d H:i:s", $data['COL_QSLRDATE'], new DateTimeZone('UTC'));
$this->QSLReceived = ($data['COL_QSL_RCVD'] === null) ? '' : $data['COL_QSL_RCVD'];
$this->QSLReceivedVia = ($data['COL_QSL_RCVD_VIA'] === null) ? '' : $data['COL_QSL_RCVD_VIA'];
$this->QSLSentDate = ($data['COL_QSLSDATE'] === null) ? null : DateTime::createFromFormat("Y-m-d H:i:s", $data['COL_QSLSDATE'], new DateTimeZone('UTC'));
$this->QSLSent = ($data['COL_QSL_SENT'] === null) ? '' : $data['COL_QSL_SENT'];
$this->QSLSentVia = ($data['COL_QSL_SENT_VIA'] === null) ? '' : $data['COL_QSL_SENT_VIA'];
$this->QSLVia = ($data['COL_QSL_VIA'] === null) ? '' : $data['COL_QSL_VIA'];
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $data['COL_CQZ'];
$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE'];
$this->dxcc = ($data['COL_COUNTRY'] === null) ? '' :$data['COL_COUNTRY'];
$this->iota = ($data['COL_IOTA'] === null) ? '' :$data['COL_IOTA'];
}
/**
* @return string
*/
public function getQsoID(): string
{
return $this->qsoID;
}
/**
* @return DateTime
*/
public function getQsoDateTime(): DateTime
{
return $this->qsoDateTime;
}
/**
* @return string
*/
public function getDe(): string
{
return $this->de;
}
/**
* @return string
*/
public function getDx(): string
{
return $this->dx;
}
/**
* @return string
*/
public function getMode(): string
{
return $this->mode;
}
/**
* @return string
*/
public function getSubmode(): string
{
return $this->submode;
}
/**
* @return string
*/
public function getBand(): string
{
return $this->band;
}
/**
* @return string
*/
public function getBandRX(): string
{
return $this->bandRX;
}
/**
* @return string
*/
public function getRstR(): string
{
return $this->rstR;
}
/**
* @return string
*/
public function getRstS(): string
{
return $this->rstS;
}
/**
* @return string
*/
public function getPropagationMode(): string
{
return $this->propagationMode;
}
/**
* @return string
*/
public function getSatelliteMode(): string
{
return $this->satelliteMode;
}
/**
* @return string
*/
public function getSatelliteName(): string
{
return $this->satelliteName;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @return string
*/
public function getEmail(): string
{
return $this->email;
}
/**
* @return string
*/
public function getAddress(): string
{
return $this->address;
}
/**
* @return string
*/
public function getDeGridsquare(): string
{
return $this->deGridsquare;
}
/**
* @return string
*/
public function getDeIOTA(): string
{
return $this->deIOTA;
}
/**
* @return string
*/
public function getDeSig(): string
{
return $this->deSig;
}
/**
* @return string
*/
public function getDeSigInfo(): string
{
return $this->deSigInfo;
}
/**
* @return string
*/
public function getDeIOTAIslandID(): string
{
return $this->deIOTAIslandID;
}
/**
* @return string
*/
public function getDeSOTAReference(): string
{
return $this->deSOTAReference;
}
/**
* @return string[]
*/
public function getDeVUCCGridsquares(): array
{
return $this->deVUCCGridsquares;
}
/**
* @return string
*/
public function getDxGridsquare(): string
{
return $this->dxGridsquare;
}
/**
* @return string
*/
public function getDxIOTA(): string
{
return $this->dxIOTA;
}
/**
* @return string
*/
public function getDxSig(): string
{
return $this->dxSig;
}
/**
* @return string
*/
public function getDxSigInfo(): string
{
return $this->dxSigInfo;
}
/**
* @return string
*/
public function getDxDARCDOK(): string
{
return $this->dxDARCDOK;
}
/**
* @return string
*/
public function getDxSOTAReference(): string
{
return $this->dxSOTAReference;
}
/**
* @return string[]
*/
public function getDxVUCCGridsquares(): array
{
return $this->dxVUCCGridsquares;
}
/**
* @return string
*/
public function getQSLMsg(): string
{
return $this->QSLMsg;
}
/**
* @return ?DateTime
*/
public function getQSLReceivedDate(): ?DateTime
{
return $this->QSLReceivedDate;
}
/**
* @return string
*/
public function getQSLReceived(): string
{
return $this->QSLReceived;
}
/**
* @return string
*/
public function getQSLReceivedVia(): string
{
return $this->QSLReceivedVia;
}
/**
* @return ?DateTime
*/
public function getQSLSentDate(): ?DateTime
{
return $this->QSLSentDate;
}
/**
* @return string
*/
public function getQSLSent(): string
{
return $this->QSLSent;
}
/**
* @return string
*/
public function getQSLSentVia(): string
{
return $this->QSLSentVia;
}
/**
* @return string
*/
public function getQSLVia(): string
{
return $this->QSLVia;
}
public function getDXCC(): string
{
return $this->dxcc;
}
public function getCqzone(): string
{
return $this->cqzone;
}
public function getState(): string
{
return $this->state;
}
public function getIOTA(): string
{
return $this->iota;
}
public function toArray(): array
{
return [
'qsoID' => $this->qsoID,
'qsoDateTime' => $this->qsoDateTime->format("Y-m-d H:i"),
'de' => $this->de,
'dx' => $this->dx,
'mode' => $this->getFormattedMode(),
'rstS' => $this->rstS,
'rstR' => $this->rstR,
'band' => $this->getFormattedBand(),
'deRefs' => $this->getFormattedDeRefs(),
'dxRefs' => $this->getFormattedDxRefs(),
'qslVia' => $this->QSLVia,
'qslSent' => $this->getFormattedQSLSent(),
'qslReceived' => $this->getFormattedQSLReceived(),
'qslMessage' => $this->getQSLMsg(),
'name' => $this->getName(),
'dxcc' => $this->getDXCC(),
'state' => $this->getState(),
'cqzone' => $this->getCqzone(),
'iota' => $this->getIOTA(),
];
}
private function getFormattedMode(): string
{
if ($this->submode !== '') {
return $this->submode;
} else {
return $this->mode;
}
}
private function getFormattedBand(): string
{
$label = "";
if ($this->propagationMode !== '') {
$label .= $this->propagationMode;
if ($this->satelliteName !== '') {
$label .= " " . $this->satelliteName;
if ($this->satelliteMode !== '') {
$label .= " " . $this->satelliteMode;
}
}
}
$label .= " " . $this->band;
if ($this->bandRX !== '' && $this->band !== '') {
$label .= "/" . $this->bandRX;
}
return trim($label);
}
private function getFormattedDeRefs(): string
{
$refs = [];
if ($this->deVUCCGridsquares !== []) {
$refs[] = implode(",", $this->deVUCCGridsquares);
} else {
if ($this->deGridsquare !== '') {
$refs[] = $this->deGridsquare;
}
}
if ($this->deIOTA !== '') {
if ($this->deIOTAIslandID !== '') {
$refs[] = "IOTA:" . $this->deIOTA . "(" . $this->deIOTAIslandID . ")";
} else {
$refs[] = "IOTA:" . $this->deIOTA;
}
}
if ($this->deSOTAReference !== '') {
$refs[] = "SOTA:" . $this->deSOTAReference;
}
if ($this->deSig !== '') {
$refs[] = $this->deSig . ":" . $this->deSigInfo;
}
return trim(implode(" ", $refs));
}
private function getFormattedDxRefs(): string
{
$refs = [];
if ($this->dxVUCCGridsquares !== []) {
$refs[] = implode(",", $this->dxVUCCGridsquares);
} else if ($this->dxGridsquare !== '') {
$refs[] = $this->dxGridsquare;
}
if ($this->dxSOTAReference !== '') {
$refs[] = "SOTA:" . $this->dxSOTAReference;
}
if ($this->dxSig !== '') {
$refs[] = $this->dxSig . ":" . $this->dxSigInfo;
}
if ($this->dxDARCDOK !== '') {
$refs[] = "DOK:" . $this->dxDARCDOK;
}
return implode(" ", $refs);
}
private function getFormattedQSLSent(): string
{
$showVia = false;
$label = [];
if ($this->QSLSent === "Y") {
if ($this->QSLSentDate !== null) {
$label[] = $this->QSLSentDate->format("Y-m-d");
} else {
$label[] = "Yes";
}
$showVia = true;
} else if ($this->QSLSent === "N") {
$label[] = "No";
} else if ($this->QSLSent === "Q") {
$label[] = "Queued";
if ($this->QSLSentDate !== null) {
$label[] = $this->QSLSentDate->format("Y-m-d");
}
$showVia = true;
} else if ($this->QSLSent === "R") {
$label[] = "Requested";
if ($this->QSLSentDate !== null) {
$label[] = $this->QSLSentDate->format("Y-m-d");
}
$showVia = true;
}
if ($showVia && $this->QSLSentVia !== '') {
switch ($this->QSLSentVia) {
case 'B':
$label[] = "Bureau";
break;
case 'D':
$label[] = "Direct";
break;
case 'E':
$label[] = "Electronic";
break;
case 'M':
$label[] = "Manager";
break;
}
}
return trim(implode(" ", $label));
}
private function getFormattedQSLReceived(): string
{
$showVia = false;
$label = [];
if ($this->QSLReceived === "Y") {
if ($this->QSLReceivedDate !== null) {
$label[] = $this->QSLReceivedDate->format("Y-m-d");
} else {
$label[] = "Yes";
}
$showVia = true;
} else if ($this->QSLReceived === "N") {
$label[] = "No";
} else if ($this->QSLReceived === "Q") {
$label[] = "Queued";
if ($this->QSLReceivedDate !== null) {
$label[] = $this->QSLReceivedDate->format("Y-m-d");
}
$showVia = true;
} else if ($this->QSLReceived === "R") {
$label[] = "Requested";
if ($this->QSLReceivedDate !== null) {
$label[] = $this->QSLReceivedDate->format("Y-m-d");
}
$showVia = true;
}
if ($showVia && $this->QSLReceivedVia !== '') {
switch ($this->QSLReceivedVia) {
case 'B':
$label[] = "Bureau";
break;
case 'D':
$label[] = "Direct";
break;
case 'E':
$label[] = "Electronic";
break;
case 'M':
$label[] = "Manager";
break;
}
}
return trim(implode(" ", $label));
}
}

查看文件

@ -727,6 +727,9 @@ if ( ! function_exists('remove_invisible_characters'))
do
{
if ($str == null) {
$str = "";
}
$str = preg_replace($non_displayables, '', $str, -1, $count);
}
while ($count);

查看文件

@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2019, British Columbia Institute of Technology
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -30,6 +30,7 @@
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
@ -55,7 +56,7 @@ class CI_Output {
*
* @var string
*/
public $final_output;
public $final_output = '';
/**
* Cache expiration time
@ -145,7 +146,7 @@ class CI_Output {
&& extension_loaded('zlib')
);
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
// Get mime types for later
$this->mimes =& get_mimes();
@ -299,10 +300,14 @@ class CI_Output {
*/
public function get_header($header)
{
// Combine headers already sent with our batched headers
// We only need [x][0] from our multi-dimensional array
$header_lines = array_map(function ($headers)
{
return array_shift($headers);
}, $this->headers);
$headers = array_merge(
// We only need [x][0] from our multi-dimensional array
array_map('array_shift', $this->headers),
$header_lines,
headers_list()
);

查看文件

@ -490,10 +490,10 @@ class CI_Profiler {
if (is_array($val) OR is_object($val))
{
$val = print_r($val, TRUE);
$pre = '<pre>' ;
$pre_close = '</pre>';
}
$val = $val == null ? "" : $val;
$output .= '<tr><td style="padding:5px;vertical-align:top;color:#900;background-color:#ddd;">'
.$config.'&nbsp;&nbsp;</td><td style="padding:5px;color:#000;background-color:#ddd;">'.$pre.htmlspecialchars($val, ENT_QUOTES, config_item('charset')).$pre_close."</td></tr>\n";
@ -522,6 +522,7 @@ class CI_Profiler {
foreach ($this->CI->session->userdata() as $key => $val)
{
$val = $val == null ? "" : $val;
$pre = '';
$pre_close = '';

查看文件

@ -129,7 +129,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $name Session cookie name
* @return bool
*/
public function open($save_path, $name)
public function open($save_path, $name): bool
{
if ( ! is_dir($save_path))
{
@ -165,6 +165,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_id Session ID
* @return string Serialized session data
*/
#[\ReturnTypeWillChange]
public function read($session_id)
{
// This might seem weird, but PHP 5.6 introduces session_reset(),
@ -238,6 +239,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_data Serialized session data
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($session_id, $session_data)
{
// If the two IDs don't match, we have a session_regenerate_id() call
@ -295,6 +297,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function close()
{
if (is_resource($this->_file_handle))
@ -318,6 +321,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_id Session ID
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($session_id)
{
if ($this->close() === $this->_success)
@ -359,6 +363,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param int $maxlifetime Maximum lifetime of sessions
* @return bool
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
if ( ! is_dir($this->_config['save_path']) OR ($directory = opendir($this->_config['save_path'])) === FALSE)