Merge remote-tracking branch 'upstream/dev' into map-simplify-centralize-json-call

pull/2810/head
abarrau 2023-12-13 22:54:38 +01:00
commit 78c8a94055
12 zmienionych plików z 717 dodań i 289 usunięć

Wyświetl plik

@ -214,6 +214,12 @@ class API extends CI_Controller {
die();
}
if(!(isset($record['call'])) || (trim($record['call']) == '')) {
http_response_code(401);
echo json_encode(['status' => 'failed', 'reason' => "QSO Call is empty."]);
die();
}
$this->api_model->update_last_used($obj['key']);
$msg = $this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, NULL, false, false, true);

Wyświetl plik

@ -442,6 +442,11 @@ class Awards extends CI_Controller {
}
public function was() {
$footerData = [];
$footerData['scripts'] = [
'assets/js/sections/wasmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wasmap.js"))
];
$this->load->model('was');
$this->load->model('modes');
$this->load->model('bands');
@ -491,7 +496,7 @@ class Awards extends CI_Controller {
$data['page_title'] = "Awards - WAS (Worked All States)";
$this->load->view('interface_assets/header', $data);
$this->load->view('awards/was/index');
$this->load->view('interface_assets/footer');
$this->load->view('interface_assets/footer', $footerData);
}
public function iota () {
@ -874,28 +879,53 @@ class Awards extends CI_Controller {
This displays the WAS map and requires the $band_type and $mode_type
*/
public function was_map($band_type, $mode_type) {
public function was_map() {
$stateString = 'AK,AL,AR,AZ,CA,CO,CT,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NV,NY,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY';
$wasArray = explode(',', $stateString);
$this->load->model('was');
$data['mode'] = $mode_type;
$bands[] = $this->security->xss_clean($this->input->post('band'));
$bands[] = $band_type;
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
$postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1;
$postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1;
$postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1;
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = 0;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['band'] = $band_type;
$postdata['mode'] = $mode_type;
$was_array = $this->was->get_was_array($bands, $postdata);
$data['was_array'] = $this->was->get_was_array($bands, $postdata);
$states = array();
$data['page_title'] = "";
foreach ($wasArray as $state) { // Generating array for use in the table
$states[$state] = '-'; // Inits each state's count
}
$this->load->view('awards/was/map', $data);
foreach ($was_array as $was => $value) {
foreach ($value as $key) {
if($key != "") {
if (strpos($key, '>W<') !== false) {
$states[$was] = 'W';
break;
}
if (strpos($key, '>C<') !== false) {
$states[$was] = 'C';
break;
}
if (strpos($key, '-') !== false) {
$states[$was] = '-';
break;
}
}
}
}
header('Content-Type: application/json');
echo json_encode($states);
}
/*

Wyświetl plik

@ -599,6 +599,7 @@ class Logbook extends CI_Controller {
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
$this->load->library('qra');
$this->load->library('subdivisions');
$this->load->model('logbook_model');
$data['query'] = $this->logbook_model->get_qso($id);
@ -612,6 +613,8 @@ class Logbook extends CI_Controller {
$this->load->model('Qsl_model');
$data['qslimages'] = $this->Qsl_model->getQslForQsoId($id);
$data['primary_subdivision'] = $this->subdivisions->get_primary_subdivision_name($data['query']->result()[0]->COL_DXCC);
$data['secondary_subdivision'] = $this->subdivisions->get_secondary_subdivision_name($data['query']->result()[0]->COL_DXCC);
$data['max_upload'] = ini_get('upload_max_filesize');
$this->load->view('interface_assets/mini_header', $data);
$this->load->view('view_log/qso');

Wyświetl plik

@ -597,7 +597,7 @@ class QSO extends CI_Controller {
// Allow empty locator
if (preg_match('/^$/', $grid)) return true;
// Allow 6-digit locator
if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Za-z]{2}$/', $grid)) return true;
if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Xa-x]{2}$/', $grid)) return true;
// Allow 4-digit locator
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
// Allow 4-digit grid line
@ -607,7 +607,9 @@ class QSO extends CI_Controller {
// Allow 2-digit locator
else if (preg_match('/^[A-Ra-r]{2}$/', $grid)) return true;
// Allow 8-digit locator
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Za-z]{2}[0-9]{2}$/', $grid)) return true;
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Xa-x]{2}[0-9]{2}$/', $grid)) return true;
// Allow 10-digit locator
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Xa-x]{2}[0-9]{2}[A-Xa-x]{2}$/', $grid)) return true;
else {
$this->form_validation->set_message('check_locator', 'Please check value for grid locator ('.strtoupper($grid).').');
return false;

Wyświetl plik

@ -173,75 +173,79 @@ function get_bearing($lat1, $lon1, $lat2, $lon2) {
}
function qra2latlong($strQRA) {
if (substr_count($strQRA, ',') > 0) {
if (substr_count($strQRA, ',') == 3) {
// Handle grid corners
$grids = explode(',', $strQRA);
$gridlengths = array(strlen($grids[0]), strlen($grids[1]), strlen($grids[2]), strlen($grids[3]));
$same = array_count_values($gridlengths);
if (count($same) != 1) {
return false;
}
$coords = array(0, 0);
for($i=0; $i<4; $i++) {
$cornercoords[$i] = qra2latlong($grids[$i]);
$coords[0] += $cornercoords[$i][0];
$coords[1] += $cornercoords[$i][1];
}
return array (round($coords[0]/4), round($coords[1]/4));
} else if (substr_count($strQRA, ',') == 1) {
// Handle grid lines
$grids = explode(',', $strQRA);
if (strlen($grids[0]) != strlen($grids[1])) {
return false;
}
$coords = array(0, 0);
for($i=0; $i<2; $i++) {
$linecoords[$i] = qra2latlong($grids[$i]);
}
if ($linecoords[0][0] != $linecoords[1][0]) {
$coords[0] = round((($linecoords[0][0] + $linecoords[1][0]) / 2),1);
} else {
$coords[0] = round($linecoords[0][0],1);
}
if ($linecoords[0][1] != $linecoords[1][1]) {
$coords[1] = round(($linecoords[0][1] + $linecoords[1][1]) / 2);
} else {
$coords[1] = round($linecoords[0][1]);
}
return $coords;
} else {
return false;
}
}
$strQRA=trim($strQRA);
if (substr_count($strQRA, ',') > 0) {
if (substr_count($strQRA, ',') == 3) {
// Handle grid corners
$grids = explode(',', $strQRA);
$gridlengths = array(strlen($grids[0]), strlen($grids[1]), strlen($grids[2]), strlen($grids[3]));
$same = array_count_values($gridlengths);
if (count($same) != 1) {
return false;
}
$coords = array(0, 0);
for($i=0; $i<4; $i++) {
$cornercoords[$i] = qra2latlong($grids[$i]);
$coords[0] += $cornercoords[$i][0];
$coords[1] += $cornercoords[$i][1];
}
return array (round($coords[0]/4), round($coords[1]/4));
} else if (substr_count($strQRA, ',') == 1) {
// Handle grid lines
$grids = explode(',', $strQRA);
if (strlen($grids[0]) != strlen($grids[1])) {
return false;
}
$coords = array(0, 0);
for($i=0; $i<2; $i++) {
$linecoords[$i] = qra2latlong($grids[$i]);
}
if ($linecoords[0][0] != $linecoords[1][0]) {
$coords[0] = round((($linecoords[0][0] + $linecoords[1][0]) / 2),1);
} else {
$coords[0] = round($linecoords[0][0],1);
}
if ($linecoords[0][1] != $linecoords[1][1]) {
$coords[1] = round(($linecoords[0][1] + $linecoords[1][1]) / 2);
} else {
$coords[1] = round($linecoords[0][1]);
}
return $coords;
} else {
return false;
}
}
if ((strlen($strQRA) % 2 == 0) && (strlen($strQRA) <= 8)) { // Check if QRA is EVEN (the % 2 does that) and smaller/equal 8
$strQRA = strtoupper($strQRA);
if (strlen($strQRA) == 4) $strQRA .= "MM"; // Only 4 Chars? Fill with center "MM"
if (strlen($strQRA) == 6) $strQRA .= "55"; // Only 6 Chars? Fill with center "55"
if ((strlen($strQRA) % 2 == 0) && (strlen($strQRA) <= 10)) { // Check if QRA is EVEN (the % 2 does that) and smaller/equal 8
$strQRA = strtoupper($strQRA);
if (strlen($strQRA) == 4) $strQRA .= "LL"; // Only 4 Chars? Fill with center "LL" as only A-R allowed
if (strlen($strQRA) == 6) $strQRA .= "55"; // Only 6 Chars? Fill with center "55"
if (strlen($strQRA) == 8) $strQRA .= "LL"; // Only 8 Chars? Fill with center "LL" as only A-R allowed
if (!preg_match('/^[A-R]{2}[0-9]{2}[A-X]{2}[0-9]{2}$/', $strQRA)) {
return false;
}
if (!preg_match('/^[A-R]{2}[0-9]{2}[A-X]{2}[0-9]{2}[A-X]{2}$/', $strQRA)) {
return false;
}
list($a, $b, $c, $d, $e, $f, $g, $h) = str_split($strQRA, 1); // Maidenhead is always alternating. e.g. "AA00AA00AA00" - doesn't matter how deep. 2 chars, 2 numbers, etc.
$a = ord($a) - ord('A');
$b = ord($b) - ord('A');
$c = ord($c) - ord('0');
$d = ord($d) - ord('0');
$e = ord($e) - ord('A');
$f = ord($f) - ord('A');
$g = ord($g) - ord('0');
$h = ord($h) - ord('0');
list($a, $b, $c, $d, $e, $f, $g, $h, $i, $j) = str_split($strQRA, 1); // Maidenhead is always alternating. e.g. "AA00AA00AA00" - doesn't matter how deep. 2 chars, 2 numbers, etc.
$a = ord($a) - ord('A');
$b = ord($b) - ord('A');
$c = ord($c) - ord('0');
$d = ord($d) - ord('0');
$e = ord($e) - ord('A');
$f = ord($f) - ord('A');
$g = ord($g) - ord('0');
$h = ord($h) - ord('0');
$i = ord($i) - ord('A');
$j = ord($j) - ord('A');
$nLong = ($a*20) + ($c*2) + (($e+0.5)/12) + (($g-5)/120) - 180; // the 4th pair is "in the middle", so we've to substract 5
$nLat = ($b*10) + $d + (($f+0.5)/24) + (($h-5)/240) - 90;
$nLong = ($a*20) + ($c*2) + ($e/12) + ($g/120) + ($i/2880) - 180;
$nLat = ($b*10) + $d + ($f/24) + ($h/240) + ($j/5760) - 90;
$arLatLong = array($nLat, $nLong);
return $arLatLong;
} else {
return array(0, 0);
}
$arLatLong = array($nLat, $nLong);
return $arLatLong;
} else {
return array(0, 0);
}
}

Wyświetl plik

@ -0,0 +1,96 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Lookup functions for subdivisions
*/
class Subdivisions {
public function get_primary_subdivision_name($dxcc) {
// ref. http://adif.org.uk/314/ADIF_314_annotated.htm#Primary_Administrative_Subdivision
switch($dxcc) {
case '1':
case '29':
case '32':
case '100':
case '137':
case '163':
case '206':
case '209':
case '212':
case '225':
case '248':
case '263':
case '269':
case '281':
case '284':
case '318':
case '375':
case '386':
return 'Province';
case '27':
case '15':
case '54':
case '61':
case '126':
case '151':
case '288':
return 'Oblast';
case '112':
return 'Region';
case '132':
case '144':
case '227':
return 'Department';
case '170':
return 'Region';
case '224':
return 'Municipality';
case '230':
return 'Federal State';
case '239':
case '245':
case '275':
case '497':
return 'County';
case '272':
case '503':
case '504':
return 'District';
case '287':
return 'Canton';
case '291':
return 'US State';
case '318':
case '339':
return 'Prefecture';
}
return 'State';
}
public function get_secondary_subdivision_name($dxcc) {
// ref. http://adif.org.uk/314/ADIF_314_annotated.htm#Secondary_Administrative_Subdivision
switch($dxcc) {
case '6':
case '110':
case '291':
return 'US County';
case '15':
case '54':
case '61':
case '126':
case '151':
case '288':
return 'District';
case '21':
case '29':
case '32':
case '281':
return 'DME';
case '339':
return 'City / Ku / Gun';
}
return 'County';
}
}

Wyświetl plik

@ -1015,210 +1015,214 @@ class Logbook_model extends CI_Model {
/* Edit QSO */
function edit() {
$qso = $this->get_qso($this->input->post('id'))->row();
$qso = $this->get_qso($this->input->post('id'))->row();
$entity = $this->get_entity($this->input->post('dxcc_id'));
$stationId = $this->input->post('station_profile');
$country = ucwords(strtolower($entity['name']), "- (/");
$entity = $this->get_entity($this->input->post('dxcc_id'));
$stationId = $this->input->post('station_profile');
$country = ucwords(strtolower($entity['name']), "- (/");
// be sure that station belongs to user
$CI =& get_instance();
$CI->load->model('stations');
if (!$CI->stations->check_station_is_accessible($stationId)) {
return;
}
// be sure that station belongs to user
$CI =& get_instance();
$CI->load->model('stations');
if (!$CI->stations->check_station_is_accessible($stationId)) {
return;
}
$station_profile=$CI->stations->profile_clean($stationId);
$stationCallsign=$station_profile->station_callsign;
if (trim($this->input->post('callsign')) == '') {
return;
}
$mode = $this->get_main_mode_if_submode($this->input->post('mode'));
if ($mode == null) {
$mode = $this->input->post('mode');
$submode = null;
} else {
$submode = $this->input->post('mode');
}
$station_profile=$CI->stations->profile_clean($stationId);
$stationCallsign=$station_profile->station_callsign;
if($this->input->post('transmit_power')) {
$txpower = $this->input->post('transmit_power');
} else {
$txpower = null;
}
$mode = $this->get_main_mode_if_submode($this->input->post('mode'));
if ($mode == null) {
$mode = $this->input->post('mode');
$submode = null;
} else {
$submode = $this->input->post('mode');
}
if($this->input->post('stx')) {
$stx_string = $this->input->post('stx');
} else {
$stx_string = null;
}
if($this->input->post('transmit_power')) {
$txpower = $this->input->post('transmit_power');
} else {
$txpower = null;
}
if($this->input->post('srx')) {
$srx_string = $this->input->post('srx');
} else {
$srx_string = null;
}
if($this->input->post('stx')) {
$stx_string = $this->input->post('stx');
} else {
$stx_string = null;
}
if ($this->input->post('usa_county') && $this->input->post('usa_state')) {
$uscounty = trim($this->input->post('usa_state') . "," . $this->input->post('usa_county'));
} else {
$uscounty = null;
}
if($this->input->post('srx')) {
$srx_string = $this->input->post('srx');
} else {
$srx_string = null;
}
if ($this->input->post('qsl_sent')) {
$qsl_sent = $this->input->post('qsl_sent');
} else {
$qsl_sent = 'N';
}
if ($this->input->post('usa_county') && $this->input->post('usa_state')) {
$uscounty = trim($this->input->post('usa_state') . "," . $this->input->post('usa_county'));
} else {
$uscounty = null;
}
if ($this->input->post('qsl_rcvd')) {
$qsl_rcvd = $this->input->post('qsl_rcvd');
} else {
$qsl_rcvd = 'N';
}
if ($this->input->post('qsl_sent')) {
$qsl_sent = $this->input->post('qsl_sent');
} else {
$qsl_sent = 'N';
}
if ($this->input->post('eqsl_sent')) {
$eqsl_sent = $this->input->post('eqsl_sent');
} else {
$eqsl_sent = 'N';
}
if ($this->input->post('qsl_rcvd')) {
$qsl_rcvd = $this->input->post('qsl_rcvd');
} else {
$qsl_rcvd = 'N';
}
if ($this->input->post('eqsl_rcvd')) {
$eqsl_rcvd = $this->input->post('eqsl_rcvd');
} else {
$eqsl_rcvd = 'N';
}
if ($this->input->post('eqsl_sent')) {
$eqsl_sent = $this->input->post('eqsl_sent');
} else {
$eqsl_sent = 'N';
}
if ($this->input->post('lotw_sent')) {
$lotw_sent = $this->input->post('lotw_sent');
} else {
$lotw_sent = 'N';
}
if ($this->input->post('eqsl_rcvd')) {
$eqsl_rcvd = $this->input->post('eqsl_rcvd');
} else {
$eqsl_rcvd = 'N';
}
if ($this->input->post('lotw_rcvd')) {
$lotw_rcvd = $this->input->post('lotw_rcvd');
} else {
$lotw_rcvd = 'N';
}
if ($this->input->post('lotw_sent')) {
$lotw_sent = $this->input->post('lotw_sent');
} else {
$lotw_sent = 'N';
}
if ($qsl_sent == 'N') {
$qslsdate = null;
} elseif (!$qso->COL_QSLSDATE || $qso->COL_QSL_SENT != $qsl_sent) {
$qslsdate = date('Y-m-d H:i:s');
} else {
$qslsdate = $qso->COL_QSLSDATE;
}
if ($this->input->post('lotw_rcvd')) {
$lotw_rcvd = $this->input->post('lotw_rcvd');
} else {
$lotw_rcvd = 'N';
}
if ($qsl_rcvd == 'N') {
$qslrdate = null;
} elseif (!$qso->COL_QSLRDATE || $qso->COL_QSL_RCVD != $qsl_rcvd) {
$qslrdate = date('Y-m-d H:i:s');
} else {
$qslrdate = $qso->COL_QSLRDATE;
}
if ($qsl_sent == 'N') {
$qslsdate = null;
} elseif (!$qso->COL_QSLSDATE || $qso->COL_QSL_SENT != $qsl_sent) {
$qslsdate = date('Y-m-d H:i:s');
} else {
$qslsdate = $qso->COL_QSLSDATE;
}
if ($eqsl_sent == 'N') {
$eqslsdate = null;
} elseif (!$qso->COL_EQSL_QSLSDATE || $qso->COL_EQSL_QSL_SENT != $eqsl_sent) {
$eqslsdate = date('Y-m-d H:i:s');
} else {
$eqslsdate = $qso->COL_EQSL_QSLSDATE;
}
if ($qsl_rcvd == 'N') {
$qslrdate = null;
} elseif (!$qso->COL_QSLRDATE || $qso->COL_QSL_RCVD != $qsl_rcvd) {
$qslrdate = date('Y-m-d H:i:s');
} else {
$qslrdate = $qso->COL_QSLRDATE;
}
if ($eqsl_rcvd == 'N') {
$eqslrdate = null;
} elseif (!$qso->COL_EQSL_QSLRDATE || $qso->COL_EQSL_QSL_RCVD != $eqsl_rcvd) {
$eqslrdate = date('Y-m-d H:i:s');
} else {
$eqslrdate = $qso->COL_EQSL_QSLRDATE;
}
if ($eqsl_sent == 'N') {
$eqslsdate = null;
} elseif (!$qso->COL_EQSL_QSLSDATE || $qso->COL_EQSL_QSL_SENT != $eqsl_sent) {
$eqslsdate = date('Y-m-d H:i:s');
} else {
$eqslsdate = $qso->COL_EQSL_QSLSDATE;
}
if ($lotw_sent == 'N') {
$lotwsdate = null;
} elseif (!$qso->COL_LOTW_QSLSDATE || $qso->COL_LOTW_QSL_SENT != $lotw_sent) {
$lotwsdate = date('Y-m-d H:i:s');
} else {
$lotwsdate = $qso->COL_LOTW_QSLSDATE;
}
if ($eqsl_rcvd == 'N') {
$eqslrdate = null;
} elseif (!$qso->COL_EQSL_QSLRDATE || $qso->COL_EQSL_QSL_RCVD != $eqsl_rcvd) {
$eqslrdate = date('Y-m-d H:i:s');
} else {
$eqslrdate = $qso->COL_EQSL_QSLRDATE;
}
if ($lotw_rcvd == 'N') {
$lotwrdate = null;
} elseif (!$qso->COL_LOTW_QSLRDATE || $qso->COL_LOTW_QSL_RCVD != $lotw_rcvd) {
$lotwrdate = date('Y-m-d H:i:s');
} else {
$lotwrdate = $qso->COL_LOTW_QSLRDATE;
}
if ($lotw_sent == 'N') {
$lotwsdate = null;
} elseif (!$qso->COL_LOTW_QSLSDATE || $qso->COL_LOTW_QSL_SENT != $lotw_sent) {
$lotwsdate = date('Y-m-d H:i:s');
} else {
$lotwsdate = $qso->COL_LOTW_QSLSDATE;
}
$data = array(
'COL_TIME_ON' => $this->input->post('time_on'),
'COL_TIME_OFF' => $this->input->post('time_off'),
'COL_CALL' => strtoupper(trim($this->input->post('callsign'))),
'COL_BAND' => $this->input->post('band'),
'COL_BAND_RX' => $this->input->post('band_rx'),
'COL_FREQ' => $this->parse_frequency($this->input->post('freq')),
'COL_MODE' => $mode,
'COL_SUBMODE' => $submode,
'COL_RST_RCVD' => $this->input->post('rst_rcvd'),
'COL_RST_SENT' => $this->input->post('rst_sent'),
'COL_GRIDSQUARE' => strtoupper(trim($this->input->post('locator'))),
'COL_VUCC_GRIDS' => strtoupper(trim($this->input->post('vucc_grids'))),
'COL_DISTANCE' => $this->input->post('distance'),
'COL_COMMENT' => $this->input->post('comment'),
'COL_NAME' => $this->input->post('name'),
'COL_COUNTRY' => $country,
'COL_CONT' => $this->input->post('continent'),
'COL_DXCC'=> $this->input->post('dxcc_id'),
'COL_CQZ' => $this->input->post('cqz'),
'COL_SAT_NAME' => $this->input->post('sat_name'),
'COL_SAT_MODE' => $this->input->post('sat_mode'),
'COL_NOTES' => $this->input->post('notes'),
'COL_QSLSDATE' => $qslsdate,
'COL_QSLRDATE' => $qslrdate,
'COL_QSL_SENT' => $qsl_sent,
'COL_QSL_RCVD' => $qsl_rcvd,
'COL_QSL_SENT_VIA' => $this->input->post('qsl_sent_method'),
'COL_QSL_RCVD_VIA' => $this->input->post('qsl_rcvd_method'),
'COL_EQSL_QSLSDATE' => $eqslsdate,
'COL_EQSL_QSLRDATE' => $eqslrdate,
'COL_EQSL_QSL_SENT' => $this->input->post('eqsl_sent'),
'COL_EQSL_QSL_RCVD' => $this->input->post('eqsl_rcvd'),
'COL_QSLMSG' => $this->input->post('qslmsg'),
'COL_LOTW_QSLSDATE' => $lotwsdate,
'COL_LOTW_QSLRDATE' => $lotwrdate,
'COL_LOTW_QSL_SENT' => $this->input->post('lotw_sent'),
'COL_LOTW_QSL_RCVD' => $this->input->post('lotw_rcvd'),
'COL_IOTA' => $this->input->post('iota_ref'),
'COL_SOTA_REF' => $this->input->post('sota_ref'),
'COL_WWFF_REF' => $this->input->post('wwff_ref'),
'COL_POTA_REF' => $this->input->post('pota_ref'),
'COL_TX_PWR' => $txpower,
'COL_SIG' => $this->input->post('sig'),
'COL_SIG_INFO' => $this->input->post('sig_info'),
'COL_DARC_DOK' => strtoupper($this->input->post('darc_dok')),
'COL_QTH' => $this->input->post('qth'),
'COL_PROP_MODE' => $this->input->post('prop_mode'),
'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')),
'COL_STX_STRING' => strtoupper(trim($this->input->post('stx_string'))),
'COL_SRX_STRING' => strtoupper(trim($this->input->post('srx_string'))),
'COL_STX' => $stx_string,
'COL_SRX' => $srx_string,
'COL_CONTEST_ID' => $this->input->post('contest_name'),
'COL_QSL_VIA' => $this->input->post('qsl_via_callsign'),
'station_id' => $stationId,
'COL_STATION_CALLSIGN' => $stationCallsign,
'COL_OPERATOR' => $this->input->post('operator_callsign'),
'COL_STATE' =>$this->input->post('usa_state'),
'COL_CNTY' => $uscounty
);
if ($lotw_rcvd == 'N') {
$lotwrdate = null;
} elseif (!$qso->COL_LOTW_QSLRDATE || $qso->COL_LOTW_QSL_RCVD != $lotw_rcvd) {
$lotwrdate = date('Y-m-d H:i:s');
} else {
$lotwrdate = $qso->COL_LOTW_QSLRDATE;
}
if ($this->exists_hrdlog_code($data['station_id'])) {
$data['COL_HRDLOG_QSO_UPLOAD_STATUS'] = 'M';
}
$data = array(
'COL_TIME_ON' => $this->input->post('time_on'),
'COL_TIME_OFF' => $this->input->post('time_off'),
'COL_CALL' => strtoupper(trim($this->input->post('callsign'))),
'COL_BAND' => $this->input->post('band'),
'COL_BAND_RX' => $this->input->post('band_rx'),
'COL_FREQ' => $this->parse_frequency($this->input->post('freq')),
'COL_MODE' => $mode,
'COL_SUBMODE' => $submode,
'COL_RST_RCVD' => $this->input->post('rst_rcvd'),
'COL_RST_SENT' => $this->input->post('rst_sent'),
'COL_GRIDSQUARE' => strtoupper(trim($this->input->post('locator'))),
'COL_VUCC_GRIDS' => strtoupper(trim($this->input->post('vucc_grids'))),
'COL_DISTANCE' => $this->input->post('distance'),
'COL_COMMENT' => $this->input->post('comment'),
'COL_NAME' => $this->input->post('name'),
'COL_COUNTRY' => $country,
'COL_CONT' => $this->input->post('continent'),
'COL_DXCC'=> $this->input->post('dxcc_id'),
'COL_CQZ' => $this->input->post('cqz'),
'COL_SAT_NAME' => $this->input->post('sat_name'),
'COL_SAT_MODE' => $this->input->post('sat_mode'),
'COL_NOTES' => $this->input->post('notes'),
'COL_QSLSDATE' => $qslsdate,
'COL_QSLRDATE' => $qslrdate,
'COL_QSL_SENT' => $qsl_sent,
'COL_QSL_RCVD' => $qsl_rcvd,
'COL_QSL_SENT_VIA' => $this->input->post('qsl_sent_method'),
'COL_QSL_RCVD_VIA' => $this->input->post('qsl_rcvd_method'),
'COL_EQSL_QSLSDATE' => $eqslsdate,
'COL_EQSL_QSLRDATE' => $eqslrdate,
'COL_EQSL_QSL_SENT' => $this->input->post('eqsl_sent'),
'COL_EQSL_QSL_RCVD' => $this->input->post('eqsl_rcvd'),
'COL_QSLMSG' => $this->input->post('qslmsg'),
'COL_LOTW_QSLSDATE' => $lotwsdate,
'COL_LOTW_QSLRDATE' => $lotwrdate,
'COL_LOTW_QSL_SENT' => $this->input->post('lotw_sent'),
'COL_LOTW_QSL_RCVD' => $this->input->post('lotw_rcvd'),
'COL_IOTA' => $this->input->post('iota_ref'),
'COL_SOTA_REF' => $this->input->post('sota_ref'),
'COL_WWFF_REF' => $this->input->post('wwff_ref'),
'COL_POTA_REF' => $this->input->post('pota_ref'),
'COL_TX_PWR' => $txpower,
'COL_SIG' => $this->input->post('sig'),
'COL_SIG_INFO' => $this->input->post('sig_info'),
'COL_DARC_DOK' => strtoupper($this->input->post('darc_dok')),
'COL_QTH' => $this->input->post('qth'),
'COL_PROP_MODE' => $this->input->post('prop_mode'),
'COL_FREQ_RX' => $this->parse_frequency($this->input->post('freq_display_rx')),
'COL_STX_STRING' => strtoupper(trim($this->input->post('stx_string'))),
'COL_SRX_STRING' => strtoupper(trim($this->input->post('srx_string'))),
'COL_STX' => $stx_string,
'COL_SRX' => $srx_string,
'COL_CONTEST_ID' => $this->input->post('contest_name'),
'COL_QSL_VIA' => $this->input->post('qsl_via_callsign'),
'station_id' => $stationId,
'COL_STATION_CALLSIGN' => $stationCallsign,
'COL_OPERATOR' => $this->input->post('operator_callsign'),
'COL_STATE' =>$this->input->post('usa_state'),
'COL_CNTY' => $uscounty
);
if ($this->exists_qrz_api_key($data['station_id'])) {
$data['COL_QRZCOM_QSO_UPLOAD_STATUS'] = 'M';
}
if ($this->exists_hrdlog_code($data['station_id'])) {
$data['COL_HRDLOG_QSO_UPLOAD_STATUS'] = 'M';
}
$this->db->where('COL_PRIMARY_KEY', $this->input->post('id'));
$this->db->update($this->config->item('table_name'), $data);
if ($this->exists_qrz_api_key($data['station_id'])) {
$data['COL_QRZCOM_QSO_UPLOAD_STATUS'] = 'M';
}
$this->db->where('COL_PRIMARY_KEY', $this->input->post('id'));
$this->db->update($this->config->item('table_name'), $data);
}

Wyświetl plik

@ -93,7 +93,11 @@ class User_Model extends CI_Model {
$query = $this->db->get($this->config->item('auth_table'));
$ret = $query->row();
return $ret->user_email;
if ($ret->user_email ?? '' != '') {
return $ret->user_email;
} else {
return '';
}
}
function get_email_address($station_id) {

Wyświetl plik

@ -1,3 +1,55 @@
<script>
var tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"
</script>
<style>
#wasmap {
height: calc(100vh - 500px) !important;
max-height: 900px !important;
}
/*Legend specific*/
.legend {
padding: 6px 8px;
font: 14px Arial, Helvetica, sans-serif;
background: white;
background: rgba(255, 255, 255, 0.8);
line-height: 24px;
color: #555;
}
.legend h4 {
text-align: center;
font-size: 16px;
margin: 2px 12px 8px;
color: #555;
}
.legend span {
position: relative;
bottom: 3px;
color: #555;
}
.legend i {
width: 18px;
height: 18px;
float: left;
margin: 0 8px 0 0;
opacity: 0.7;
color: #555;
}
.info {
padding: 6px 8px;
font: 14px/16px Arial, Helvetica, sans-serif;
background: white;
background: rgba(255,255,255,0.8);
box-shadow: 0 0 15px rgba(0,0,0,0.2);
border-radius: 5px;
color: #555;
}
.info h4 {
margin: 0 0 5px;
color: #555;
}
</style>
<div class="container">
<!-- Award Info Box -->
@ -103,6 +155,27 @@
</fieldset>
</form>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="table-tab" data-bs-toggle="tab" href="#table" role="tab" aria-controls="table" aria-selected="true">Table</a>
</li>
<li class="nav-item">
<a class="nav-link" id="map-tab" onclick="load_was_map();" data-bs-toggle="tab" href="#wasmaptab" role="tab" aria-controls="home" aria-selected="false">Map</a>
</li>
</ul>
<br />
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade" id="wasmaptab" role="tabpanel" aria-labelledby="home-tab">
<br />
<div id="wasmap" class="map-leaflet" ></div>
</div>
<div class="tab-pane fade show active" id="table" role="tabpanel" aria-labelledby="table-tab">
<?php
if ($was_array) {
$i = 1;
@ -162,3 +235,7 @@
else {
echo '<div class="alert alert-danger" role="alert">Nothing found!</div>';
}
?>
</div>
</div>
</div>

Wyświetl plik

@ -55,18 +55,6 @@
$('[data-bs-toggle="tooltip"]').tooltip();
});
</script>
<?php if ($this->uri->segment(1) == "awards" && ($this->uri->segment(2) == "was") ) { ?>
<script>
function load_was_map() {
BootstrapDialog.show({
title: 'Worked All States Map ('+$('#band2').val()+' '+$('#mode').val()+')',
cssClass: 'was-map-dialog',
message: $('<div></div>').load(site_url + '/awards/was_map/' + $('#band2').val() + '/' + $('#mode').val())
});
}
</script>
<?php } ?>
<!-- Version Dialog START -->
<?php
@ -1289,7 +1277,7 @@ $(document).on('keypress',function(e) {
qso_set_eqsl_qslmsg(stationProfile,false,'.qso_panel');
});
// [eQSL default msg] change value on clic //
$('.qso_panel .qso_eqsl_qslmsg_update').off('click').on('click',function() {
$('.qso_panel .qso_eqsl_qslmsg_update').off('click').on('click',function() {
qso_set_eqsl_qslmsg($('.qso_panel #stationProfile').val(),true,'.qso_panel');
$('#charsLeft').text(" ");
});
@ -3107,10 +3095,10 @@ function viewEqsl(picture, callsign) {
if ($('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').is(":hidden")) { $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').show(); } else { $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').hide(); }
});
$('.icon_selectBox_data').off('mouseleave').on('mouseleave', function(){ if ($(this).is(":visible")) { $(this).hide(); } });
$('.icon_selectBox_data label').off('click').on('click', function(){
$('.icon_selectBox_data label').off('click').on('click', function(){
var boxcontent = $(this).closest('.icon_selectBox_data').attr('data-boxcontent');
$('input[name="user_map_'+boxcontent+'_icon"]').attr('value',$(this).attr('data-value'));
if ($(this).attr('data-value') != "0") {
if ($(this).attr('data-value') != "0") {
$('.user_icon_color[data-icon="'+boxcontent+'"]').show();
$('.icon_selectBox[data-boxcontent="'+boxcontent+'"] .icon_overSelect').html($(this).html());
} else {
@ -3118,10 +3106,10 @@ function viewEqsl(picture, callsign) {
$('.icon_selectBox[data-boxcontent="'+boxcontent+'"] .icon_overSelect').html($(this).html().substring(0,10)+'.');
}
$('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').hide();
});
});
});
</script>
<?php } ?>
<?php } ?>
<?php
if (isset($scripts) && is_array($scripts)){

Wyświetl plik

@ -128,12 +128,8 @@
<td><?php echo lang('general_total_distance'); //Total distance ?></td>
<td>
<?php
// Load the QRA Library
$CI =& get_instance();
$CI->load->library('qra');
// Cacluate Distance
$distance = $CI->qra->distance($row->station_gridsquare, $row->COL_GRIDSQUARE, $measurement_base);
$distance = $this->qra->distance($row->station_gridsquare, $row->COL_GRIDSQUARE, $measurement_base);
switch ($measurement_base) {
case 'M':
@ -161,16 +157,16 @@
<?php if($row->COL_STATE != null) { ?>
<tr>
<td>USA State:</td>
<td><?php echo $primary_subdivision ?>:</td>
<td><?php echo $row->COL_STATE; ?></td>
</tr>
<?php } ?>
<?php if($row->COL_CNTY != null && $row->COL_CNTY != ",") { ?>
<tr>
<td>USA County:</td>
<td><?php echo $row->COL_CNTY; ?></td>
</tr>
<tr>
<td><?php echo $secondary_subdivision ?>:</td>
<td><?php echo $row->COL_CNTY; ?></td>
</tr>
<?php } ?>
<?php if($row->COL_NAME != null) { ?>

File diff suppressed because one or more lines are too long