mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -4,92 +4,85 @@ $clean_cert = trim($lotw_cert_info->cert);
|
||||
$cert1 = str_replace("-----BEGIN CERTIFICATE-----", "", $clean_cert);
|
||||
$cert2 = str_replace("-----END CERTIFICATE-----", "", $cert1);
|
||||
?>
|
||||
<TQSL_IDENT:54>TQSL V2.8.1 Lib: V2.6 Config: V11.34 AllowDupes: false
|
||||
<TQSL_IDENT:54>TQSL V2.8.2 Lib: V2.6 Config: V11.34 AllowDupes: false
|
||||
|
||||
<Rec_Type:5>tCERT
|
||||
<CERT_UID:1>1
|
||||
<CERTIFICATE:<?php echo strlen(trim($cert2)) + 1; ?>><?php echo trim($cert2); ?>
|
||||
|
||||
<EOR>
|
||||
<eor>
|
||||
|
||||
<Rec_Type:8>tSTATION
|
||||
<STATION_UID:1>1
|
||||
<CERT_UID:1>1
|
||||
<CALL:<?php echo strlen($lotw_cert_info->callsign); ?>><?php echo $lotw_cert_info->callsign; ?>
|
||||
|
||||
<DXCC:<?php echo strlen($lotw_cert_info->cert_dxcc_id); ?>><?php echo $lotw_cert_info->cert_dxcc_id; ?>
|
||||
|
||||
<?php if($station_profile->station_gridsquare) { ?><GRIDSQUARE:<?php echo strlen($station_profile->station_gridsquare); ?>><?php echo $station_profile->station_gridsquare; } ?>
|
||||
|
||||
<?php if($station_profile->station_itu) { ?><ITUZ:<?php echo strlen($station_profile->station_itu); ?>><?php echo $station_profile->station_itu; } ?>
|
||||
|
||||
<?php if($station_profile->station_cq) { ?><CQZ:<?php echo strlen($station_profile->station_cq); ?>><?php echo $station_profile->station_cq; } ?>
|
||||
|
||||
<?php if($station_profile->station_iota) { ?><IOTA:<?php echo strlen($station_profile->station_iota); ?>><?php echo $station_profile->station_iota; } ?>
|
||||
|
||||
<?php
|
||||
switch ($lotw_cert_info->cert_dxcc_id) {
|
||||
case 6: // Alaska
|
||||
case 110: // Hawaii
|
||||
case 291: // Cont US
|
||||
if($station_profile->state != "") { ?>
|
||||
<US_STATE:<?php echo strlen($station_profile->state); ?>><?php echo $station_profile->state; ?>
|
||||
print "<CALL:".strlen($lotw_cert_info->callsign).">".$lotw_cert_info->callsign."\n";
|
||||
print "<DXCC:".strlen($lotw_cert_info->cert_dxcc_id).">".$lotw_cert_info->cert_dxcc_id."\n";
|
||||
if($station_profile->station_gridsquare) {
|
||||
print "<GRIDSQUARE:".strlen($station_profile->station_gridsquare).">".$station_profile->station_gridsquare."\n";
|
||||
}
|
||||
if($station_profile->station_itu) {
|
||||
print "<ITUZ:".strlen($station_profile->station_itu).">".$station_profile->station_itu."\n";
|
||||
}
|
||||
if($station_profile->station_cq) {
|
||||
print "<CQZ:".strlen($station_profile->station_cq).">".$station_profile->station_cq."\n";
|
||||
}
|
||||
if($station_profile->station_iota) {
|
||||
print "<IOTA:".strlen($station_profile->station_iota).">".$station_profile->station_iota."\n";
|
||||
}
|
||||
|
||||
<?php }
|
||||
if($station_profile->station_cnty != "") { ?>
|
||||
<US_COUNTY:<?php echo strlen($station_profile->station_cnty); ?>><?php echo $station_profile->station_cnty; ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
case 1: // Canada
|
||||
if($station_profile->state != "") { ?>
|
||||
<CA_PROVINCE:<?php echo strlen($CI->lotw_ca_province_map($station_profile->state)); ?>><?php echo $CI->lotw_ca_province_map($station_profile->state); ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
case 15: // Asiatic Russia
|
||||
case 54: // European Russia
|
||||
case 61: // FJL
|
||||
case 125: // Juan Fernandez
|
||||
case 151: // Malyj Vysotskij
|
||||
if($station_profile->state != "") { ?>
|
||||
<RU_OBLAST:<?php echo strlen($CI->lotw_ru_oblast_map($station_profile->state)); ?>><?php echo $CI->lotw_ru_oblast_map($station_profile->state); ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
case 318: // China
|
||||
if($station_profile->state != "") { ?>
|
||||
<CN_PROVINCE:<?php echo strlen($station_profile->state); ?>><?php echo $station_profile->state; ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
case 150: // Australia
|
||||
if($station_profile->state != "") { ?>
|
||||
<AU_STATE:<?php echo strlen($station_profile->state); ?>><?php echo $station_profile->state; ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
case 339: // Japan
|
||||
if($station_profile->state != "") { ?>
|
||||
<JA_PREFECTURE:<?php echo strlen($station_profile->state); ?>><?php echo $station_profile->state; ?>
|
||||
|
||||
<?php }
|
||||
if($station_profile->station_cnty != "") { ?>
|
||||
<JA_CITY_GUN_KU:<?php echo strlen($station_profile->station_cnty); ?>><?php echo $station_profile->station_cnty; ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
case 5: // Aland Island
|
||||
case 224: // Finland
|
||||
if($station_profile->state != "") { ?>
|
||||
<FI_KUNTA:<?php echo strlen($station_profile->state); ?>><?php echo $station_profile->state; ?>
|
||||
|
||||
<?php }
|
||||
break;
|
||||
}
|
||||
switch ($lotw_cert_info->cert_dxcc_id) {
|
||||
case 6: // Alaska
|
||||
case 110: // Hawaii
|
||||
case 291: // Cont US
|
||||
if($station_profile->state != "") {
|
||||
print "<US_STATE:".strlen($station_profile->state).">".$station_profile->state."\n";
|
||||
}
|
||||
if($station_profile->station_cnty != "") {
|
||||
print "<US_COUNTY:".strlen($station_profile->station_cnty).">".$station_profile->station_cnty."\n";
|
||||
}
|
||||
break;
|
||||
case 1: // Canada
|
||||
if($station_profile->state != "") {
|
||||
print "<CA_PROVINCE:".strlen($CI->lotw_ca_province_map($station_profile->state)).">".$CI->lotw_ca_province_map($station_profile->state)."\n";
|
||||
}
|
||||
break;
|
||||
case 15: // Asiatic Russia
|
||||
case 54: // European Russia
|
||||
case 61: // FJL
|
||||
case 125: // Juan Fernandez
|
||||
case 151: // Malyj Vysotskij
|
||||
if($station_profile->state != "") {
|
||||
print "<RU_OBLAST:".strlen($CI->lotw_ru_oblast_map($station_profile->state)).">".$CI->lotw_ru_oblast_map($station_profile->state)."\n";
|
||||
}
|
||||
break;
|
||||
case 318: // China
|
||||
if($station_profile->state != "") {
|
||||
print "<CN_PROVINCE:".strlen($station_profile->state).">".$station_profile->state."\n";
|
||||
}
|
||||
break;
|
||||
case 150: // Australia
|
||||
if($station_profile->state != "") {
|
||||
print "<AU_STATE:".strlen($station_profile->state).">".$station_profile->state."\n";
|
||||
}
|
||||
break;
|
||||
case 339: // Japan
|
||||
if($station_profile->state != "") {
|
||||
print "<JA_PREFECTURE:".strlen($station_profile->state).">".$station_profile->state."\n";
|
||||
}
|
||||
if($station_profile->station_cnty != "") {
|
||||
print "<JA_CITY_GUN_KU:".strlen($station_profile->station_cnty).">".$station_profile->station_cnty."\n";
|
||||
}
|
||||
break;
|
||||
case 5: // Aland Island
|
||||
case 224: // Finland
|
||||
if($station_profile->state != "") {
|
||||
print "<FI_KUNTA:".strlen($station_profile->state).">".$station_profile->state."\n";
|
||||
}
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<EOR>
|
||||
<eor>
|
||||
|
||||
<?php foreach ($qsos->result() as $qso) {
|
||||
unset($freq_in_mhz);
|
||||
@@ -97,41 +90,52 @@ $cert2 = str_replace("-----END CERTIFICATE-----", "", $cert1);
|
||||
?>
|
||||
<Rec_Type:8>tCONTACT
|
||||
<STATION_UID:1>1
|
||||
<CALL:<?php echo strlen($qso->COL_CALL); ?>><?php echo $qso->COL_CALL; ?>
|
||||
|
||||
<BAND:<?php echo strlen($qso->COL_BAND); ?>><?php echo strtoupper($qso->COL_BAND); ?>
|
||||
|
||||
<MODE:<?php echo strlen($CI->mode_map($qso->COL_MODE, $qso->COL_SUBMODE)); ?>><?php echo strtoupper($CI->mode_map(($qso->COL_MODE == null ? '' : strtoupper($qso->COL_MODE)), ($qso->COL_SUBMODE == null ? '' : strtoupper($qso->COL_SUBMODE)))); ?>
|
||||
|
||||
<?php if($qso->COL_FREQ != "" && $qso->COL_FREQ != "0") { $freq_in_mhz = $qso->COL_FREQ / 1000000; ?><FREQ:<?php echo strlen($freq_in_mhz); ?>><?php echo $freq_in_mhz; } ?>
|
||||
|
||||
<?php if($qso->COL_FREQ_RX != "" && $qso->COL_FREQ_RX != "0") { $freq_in_mhz_rx = $qso->COL_FREQ_RX / 1000000; ?><FREQ_RX:<?php echo strlen($freq_in_mhz_rx); ?>><?php echo $freq_in_mhz_rx; } ?>
|
||||
|
||||
<?php if($qso->COL_PROP_MODE) { ?><PROP_MODE:<?php echo strlen($qso->COL_PROP_MODE); ?>><?php echo strtoupper($qso->COL_PROP_MODE); } ?>
|
||||
|
||||
<?php if($qso->COL_SAT_NAME) { ?><SAT_NAME:<?php echo strlen($qso->COL_SAT_NAME); ?>><?php echo strtoupper($qso->COL_SAT_NAME); } ?>
|
||||
|
||||
<?php if($qso->COL_BAND_RX) { ?><BAND_RX:<?php echo strlen($qso->COL_BAND_RX); ?>><?php echo strtoupper($qso->COL_BAND_RX); } ?>
|
||||
|
||||
<?php $date_on = strtotime($qso->COL_TIME_ON); $new_date = date('Y-m-d', $date_on); ?>
|
||||
<QSO_DATE:<?php echo strlen($new_date); ?>><?php echo $new_date; ?>
|
||||
|
||||
<?php $time_on = strtotime($qso->COL_TIME_ON); $new_on = date('H:i:s', $time_on); ?>
|
||||
<QSO_TIME:<?php echo strlen($new_on."Z"); ?>><?php echo $new_on."Z"; ?>
|
||||
|
||||
<?php
|
||||
|
||||
<?php
|
||||
print "<CALL:".strlen($qso->COL_CALL).">".$qso->COL_CALL."\n";
|
||||
print "<BAND:".strlen($qso->COL_BAND).">".strtoupper($qso->COL_BAND)."\n";
|
||||
print "<MODE:".strlen($CI->mode_map($qso->COL_MODE, $qso->COL_SUBMODE)).">".strtoupper($CI->mode_map(($qso->COL_MODE == null ? '' : strtoupper($qso->COL_MODE)), ($qso->COL_SUBMODE == null ? '' : strtoupper($qso->COL_SUBMODE))))."\n";
|
||||
if($qso->COL_FREQ != "" && $qso->COL_FREQ != "0") {
|
||||
$freq_in_mhz = $qso->COL_FREQ / 1000000;
|
||||
print "<FREQ:".strlen($freq_in_mhz).">".$freq_in_mhz."\n";
|
||||
}
|
||||
if($qso->COL_FREQ_RX != "" && $qso->COL_FREQ_RX != "0") {
|
||||
$freq_in_mhz_rx = $qso->COL_FREQ_RX / 1000000;
|
||||
print "<FREQ_RX:".strlen($freq_in_mhz_rx).">".$freq_in_mhz_rx."\n";
|
||||
}
|
||||
if($qso->COL_PROP_MODE) {
|
||||
print "<PROP_MODE:".strlen($qso->COL_PROP_MODE).">".strtoupper($qso->COL_PROP_MODE)."\n";
|
||||
}
|
||||
if($qso->COL_SAT_NAME) {
|
||||
print "<SAT_NAME:".strlen($qso->COL_SAT_NAME).">".strtoupper($qso->COL_SAT_NAME)."\n";
|
||||
}
|
||||
if($qso->COL_BAND_RX) {
|
||||
print "<BAND_RX:".strlen($qso->COL_BAND_RX).">".strtoupper($qso->COL_BAND_RX)."\n";
|
||||
}
|
||||
$date_on = strtotime($qso->COL_TIME_ON);
|
||||
$new_date = date('Y-m-d', $date_on);
|
||||
print "<QSO_DATE:".strlen($new_date).">".$new_date."\n";
|
||||
$time_on = strtotime($qso->COL_TIME_ON);
|
||||
$new_on = date('H:i:s', $time_on);
|
||||
print "<QSO_TIME:".strlen($new_on."Z").">".$new_on."Z\n";
|
||||
|
||||
$sign_string = "";
|
||||
|
||||
// Adds CA Province
|
||||
if($station_profile->state != "" && $station_profile->station_country == "CANADA") {
|
||||
$sign_string .= strtoupper($CI->lotw_ca_province_map($station_profile->state));
|
||||
if ($lotw_cert_info->cert_dxcc_id == 150) { // If state is Australia add AU state
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $station_profile->state;
|
||||
}
|
||||
}
|
||||
|
||||
// Adds CN Province
|
||||
if($station_profile->state != "" && $station_profile->station_country == "CHINA") {
|
||||
$sign_string .= strtoupper($station_profile->state);
|
||||
if ($lotw_cert_info->cert_dxcc_id == 1) { // If state is Canada add CA province
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $CI->lotw_ca_province_map($station_profile->state);
|
||||
}
|
||||
}
|
||||
|
||||
if ($lotw_cert_info->cert_dxcc_id == 318) { // If state is China add CN province
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $station_profile->state;
|
||||
}
|
||||
}
|
||||
|
||||
// Add CQ Zone
|
||||
@@ -139,88 +143,93 @@ if($station_profile->station_cq) {
|
||||
$sign_string .= $station_profile->station_cq;
|
||||
}
|
||||
|
||||
if (in_array($lotw_cert_info->cert_dxcc_id, array(5, 224))) { // If state is Finland add FI kunta
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $station_profile->state;
|
||||
}
|
||||
}
|
||||
|
||||
// Add Gridsquare
|
||||
if($station_profile->station_gridsquare) {
|
||||
$sign_string .= strtoupper($station_profile->station_gridsquare);
|
||||
$sign_string .= $station_profile->station_gridsquare;
|
||||
}
|
||||
|
||||
if($station_profile->station_iota) {
|
||||
$sign_string .= strtoupper($station_profile->station_iota);
|
||||
$sign_string .= $station_profile->station_iota;
|
||||
}
|
||||
|
||||
if($station_profile->station_itu) {
|
||||
$sign_string .= $station_profile->station_itu;
|
||||
}
|
||||
|
||||
if($station_profile->station_cnty != "" && $station_profile->station_country == "UNITED STATES OF AMERICA") {
|
||||
$sign_string .= strtoupper($station_profile->station_cnty);
|
||||
if ($lotw_cert_info->cert_dxcc_id == 339) { // If state is Japan add JA city/gun/ku and prefecture
|
||||
if($station_profile->station_cnty != "") {
|
||||
$sign_string .= $station_profile->station_cnty;
|
||||
}
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $station_profile->state;
|
||||
}
|
||||
}
|
||||
|
||||
if($station_profile->station_cnty != "" && $station_profile->station_country == "ALASKA") {
|
||||
$sign_string .= strtoupper($station_profile->station_cnty);
|
||||
if (in_array($lotw_cert_info->cert_dxcc_id, array(15, 54, 61, 125, 151))) { // If state is Russia add RU oblast
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $CI->lotw_ru_oblast_map($station_profile->state);
|
||||
}
|
||||
}
|
||||
|
||||
if($station_profile->station_cnty != "" && $station_profile->station_country == "HAWAII") {
|
||||
$sign_string .= strtoupper($station_profile->station_cnty);
|
||||
}
|
||||
|
||||
if($station_profile->state != "" && $station_profile->station_country == "UNITED STATES OF AMERICA") {
|
||||
$sign_string .= strtoupper($station_profile->state);
|
||||
}
|
||||
|
||||
if($station_profile->state != "" && $station_profile->station_country == "ALASKA") {
|
||||
$sign_string .= strtoupper($station_profile->state);
|
||||
}
|
||||
|
||||
if($station_profile->state != "" && $station_profile->station_country == "HAWAII") {
|
||||
$sign_string .= strtoupper($station_profile->state);
|
||||
if (in_array($lotw_cert_info->cert_dxcc_id, array(6, 110, 291))) { // If state is US, Alaska or Hawaii add US cnty and state
|
||||
if($station_profile->station_cnty != "") {
|
||||
$sign_string .= $station_profile->station_cnty;
|
||||
}
|
||||
if($station_profile->state != "") {
|
||||
$sign_string .= $station_profile->state;
|
||||
}
|
||||
}
|
||||
|
||||
if($qso->COL_BAND) {
|
||||
$sign_string .= strtoupper($qso->COL_BAND);
|
||||
$sign_string .= $qso->COL_BAND;
|
||||
}
|
||||
|
||||
if($qso->COL_BAND_RX) {
|
||||
$sign_string .= strtoupper($qso->COL_BAND_RX);
|
||||
$sign_string .= $qso->COL_BAND_RX;
|
||||
}
|
||||
|
||||
if($qso->COL_CALL) {
|
||||
$sign_string .= strtoupper($qso->COL_CALL);
|
||||
$sign_string .= $qso->COL_CALL;
|
||||
}
|
||||
|
||||
if(isset($freq_in_mhz)) {
|
||||
$sign_string .= strtoupper($freq_in_mhz);
|
||||
$sign_string .= $freq_in_mhz;
|
||||
}
|
||||
|
||||
if(isset($freq_in_mhz_rx)) {
|
||||
$sign_string .= strtoupper($freq_in_mhz_rx);
|
||||
$sign_string .= $freq_in_mhz_rx;
|
||||
}
|
||||
|
||||
if($qso->COL_MODE) {
|
||||
$sign_string .= strtoupper($CI->mode_map($qso->COL_MODE, $qso->COL_SUBMODE));
|
||||
$sign_string .= $CI->mode_map($qso->COL_MODE, $qso->COL_SUBMODE);
|
||||
}
|
||||
|
||||
|
||||
if($qso->COL_PROP_MODE) {
|
||||
$sign_string .= strtoupper($qso->COL_PROP_MODE);
|
||||
$sign_string .= $qso->COL_PROP_MODE;
|
||||
}
|
||||
|
||||
$sign_string .= $new_date;
|
||||
|
||||
$sign_string .= $new_on."Z";
|
||||
|
||||
if($qso->COL_SAT_NAME) {
|
||||
$sign_string .= strtoupper($qso->COL_SAT_NAME);
|
||||
$sign_string .= $qso->COL_SAT_NAME;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
$signed_item = $CI->signlog($lotw_cert_info->cert_key, $sign_string);
|
||||
$sign_string = strtoupper($sign_string);
|
||||
|
||||
$signed_item = trim($CI->signlog($lotw_cert_info->cert_key, $sign_string));
|
||||
print "<SIGN_LOTW_V2.0:".(strlen($signed_item)+intdiv(strlen($signed_item),64)+1).":6>";
|
||||
for ($i=0; $i<strlen($signed_item); $i+=64) {
|
||||
print substr($signed_item, $i, 64)."\n";
|
||||
}
|
||||
print "<SIGNDATA:".strlen($sign_string).">".$sign_string."\n";
|
||||
?>
|
||||
<SIGN_LOTW_V2.0:<?php echo strlen($signed_item)+1; ?>:6><?php echo $signed_item; ?>
|
||||
|
||||
<SIGNDATA:<?php echo strlen($sign_string); ?>><?php echo $sign_string; ?>
|
||||
|
||||
<EOR>
|
||||
<eor>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user