diff --git a/application/config/autoload.php b/application/config/autoload.php index 98027e74..79f701f0 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -80,7 +80,7 @@ $autoload['helper'] = array('url', 'security'); | */ -$autoload['config'] = array('cloudlog', 'bands'); +$autoload['config'] = array('cloudlog', 'bands', 'lotw'); /* diff --git a/application/config/lotw.php b/application/config/lotw.php new file mode 100644 index 00000000..650b53d9 --- /dev/null +++ b/application/config/lotw.php @@ -0,0 +1,19 @@ + array('application/json', 'text/json'), 'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'), 'p10' => array('application/x-pkcs10', 'application/pkcs10'), - 'p12' => 'application/x-pkcs12', + 'p12' => 'application/octet-stream', 'p7a' => 'application/x-pkcs7-signature', 'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'), 'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'), diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 4064f27c..2035e577 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -1,6 +1,22 @@ load->helper(array('form', 'url')); } + /* + |-------------------------------------------------------------------------- + | Function: index + |-------------------------------------------------------------------------- + | + | Default function for the controller which loads when doing /lotw + | this shows all the uploaded lotw p12 certificates the user has uploaded + | + */ + public function index() { + // Load required models for page generation + $this->load->model('LotwCert'); + + // Get Array of the logged in users LOTW certs. + $data['lotw_cert_results'] = $this->LotwCert->lotw_certs($this->session->userdata('user_id')); + + // Set Page Title + $data['page_title'] = "Logbook of the World"; + + // Load Views + $this->load->view('interface_assets/header', $data); + $this->load->view('lotw_views/index'); + $this->load->view('interface_assets/footer'); + } + + /* + |-------------------------------------------------------------------------- + | Function: cert_upload + |-------------------------------------------------------------------------- + | + | Nothing fancy just shows the cert_upload form for uploading p12 files + | + */ + public function cert_upload() { + // Set Page Title + $data['page_title'] = "Logbook of the World"; + + // Load Views + $this->load->view('interface_assets/header', $data); + $this->load->view('lotw_views/upload_cert', array('error' => ' ' )); + $this->load->view('interface_assets/footer'); + } + + /* + |-------------------------------------------------------------------------- + | Function: do_cert_upload + |-------------------------------------------------------------------------- + | + | do_cert_upload is called from cert_upload form submit and handles uploading + | and processing of p12 files and storing the data into mysql + | + */ + public function do_cert_upload() + { + $config['upload_path'] = './uploads/lotw/certs'; + $config['allowed_types'] = 'p12'; + + $this->load->library('upload', $config); + + if ( ! $this->upload->do_upload('userfile')) + { + // Upload of P12 Failed + $error = array('error' => $this->upload->display_errors()); + + // Set Page Title + $data['page_title'] = "Logbook of the World"; + + // Load Views + $this->load->view('interface_assets/header', $data); + $this->load->view('lotw_views/upload_cert', $error); + $this->load->view('interface_assets/footer'); + } + else + { + // Load database queries + $this->load->model('LotwCert'); + + //Upload of P12 successful + $data = array('upload_data' => $this->upload->data()); + + $info = $this->decrypt_key($data['upload_data']['full_path']); + + // Check to see if certificate is already in the system + $new_certficiate = $this->LotwCert->find_cert($info['issued_callsign'], $this->session->userdata('user_id')); + + // Check DXCC & Store Country Name + $this->load->model('Logbook_model'); + $dxcc_check = $this->Logbook_model->check_dxcc_table($info['issued_callsign'], $info['validFrom']); + $dxcc = $dxcc_check[1]; + + if($new_certficiate == 0) { + // New Certificate Store in Database + + // Store Certificate Data into MySQL + $this->LotwCert->store_certficiate($this->session->userdata('user_id'), $info['issued_callsign'], $dxcc, $info['validFrom'], $info['validTo_Date'], $info['pem_key'], $info['general_cert']); + + // Cert success flash message + $this->session->set_flashdata('Success', $info['issued_callsign'].' Certficiate Imported.'); + } else { + // Certficiate is in the system time to update + + $this->LotwCert->update_certficiate($this->session->userdata('user_id'), $info['issued_callsign'], $dxcc, $info['validFrom'], $info['validTo_Date'], $info['pem_key'], $info['general_cert']); + + // Cert success flash message + $this->session->set_flashdata('Success', $info['issued_callsign'].' Certficiate Updated.'); + + } + + // p12 certificate processed time to delete the file + unlink($data['upload_data']['full_path']); + + // Get Array of the logged in users LOTW certs. + $data['lotw_cert_results'] = $this->LotwCert->lotw_certs($this->session->userdata('user_id')); + + // Set Page Title + $data['page_title'] = "Logbook of the World"; + + // Load Views + $this->load->view('interface_assets/header', $data); + $this->load->view('lotw_views/index'); + $this->load->view('interface_assets/footer'); + + + + } + } + + /* + |-------------------------------------------------------------------------- + | Function: lotw_upload + |-------------------------------------------------------------------------- + | + | This function Uploads to LOTW + | + */ + public function lotw_upload() { + // Get Station Profile Data + $this->load->model('Stations'); + + $station_profiles = $this->Stations->all(); + + // Array of QSO IDs being Uploaded + + $qso_id_array = array(); + + if ($station_profiles->num_rows() >= 1) { + + foreach ($station_profiles->result() as $station_profile) + { + + // Get Certificate Data + $this->load->model('LotwCert'); + $data['station_profile'] = $station_profile; + $data['lotw_cert_info'] = $this->LotwCert->lotw_cert_details($station_profile->station_callsign); + + $this->load->model('Dxcc'); + $data['station_profile_dxcc'] = $this->Dxcc->lookup_country($data['lotw_cert_info']->cert_dxcc); + + // Get QSOs + + $this->load->model('Logbook_model'); + + $data['qsos'] = $this->Logbook_model->get_lotw_qsos_to_upload($data['station_profile']->station_id, $data['lotw_cert_info']->date_created, $data['lotw_cert_info']->date_expires); + + foreach ($data['qsos']->result() as $temp_qso) { + array_push($qso_id_array, $temp_qso->COL_PRIMARY_KEY); + } + + //$this->load->view('lotw_views/adif_views/adif_export', $data); + + + // Build File to save + $adif_to_save = $this->load->view('lotw_views/adif_views/adif_export', $data, TRUE); + + // Build Filename + + $filename_for_saving = $data['lotw_cert_info']->callsign."-".date("Y-m-d-H-i-s")."-cloudlog.tq8"; + + $gzdata = gzencode($adif_to_save, 9); + $fp = fopen($filename_for_saving, "w"); + fwrite($fp, $gzdata); + fclose($fp); + + //The URL that accepts the file upload. + $url = 'https://lotw.arrl.org/lotw/upload'; + + //The name of the field for the uploaded file. + $uploadFieldName = 'upfile'; + + //The full path to the file that you want to upload + $filePath = realpath($filename_for_saving); + + //Initiate cURL + $ch = curl_init(); + + //Set the URL + curl_setopt($ch, CURLOPT_URL, $url); + + //Set the HTTP request to POST + curl_setopt($ch, CURLOPT_POST, true); + + //Tell cURL to return the output as a string. + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + //If the function curl_file_create exists + if(function_exists('curl_file_create')){ + //Use the recommended way, creating a CURLFile object. + $filePath = curl_file_create($filePath); + } else{ + //Otherwise, do it the old way. + //Get the canonicalized pathname of our file and prepend + //the @ character. + $filePath = '@' . realpath($filePath); + //Turn off SAFE UPLOAD so that it accepts files + //starting with an @ + curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); + } + + //Setup our POST fields + $postFields = array( + $uploadFieldName => $filePath + ); + + curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); + + //Execute the request + $result = curl_exec($ch); + + //If an error occured, throw an exception + //with the error message. + if(curl_errno($ch)){ + throw new Exception(curl_error($ch)); + } + + $pos = strpos($result, ""); + + if ($pos === false) { + // Upload of TQ8 Failed for unknown reason + echo "Upload Failed"; + } else { + // Upload of TQ8 was successfull + + echo "Upload Successful - ".$filename_for_saving; + + $this->LotwCert->last_upload($data['lotw_cert_info']->lotw_cert_id); + + // Mark QSOs as Sent + foreach ($qso_id_array as $qso_number) { + $this->Logbook_model->mark_lotw_sent($qso_number); + } + } + + // Delete TQ8 File - This is done regardless of whether upload was succcessful + unlink(realpath($filename_for_saving)); + } + } else { + echo "No Station Profiles"; + } + + } + + /* + |-------------------------------------------------------------------------- + | Function: delete_cert + |-------------------------------------------------------------------------- + | + | Deletes LOTW certificate from the MySQL table + | + */ + public function delete_cert($cert_id) { + $this->load->model('LotwCert'); + + $this->LotwCert->delete_certficiate($this->session->userdata('user_id'), $cert_id); + + $this->session->set_flashdata('Success', 'Certficiate Deleted.'); + + redirect('/lotw/'); + } + + /* + |-------------------------------------------------------------------------- + | Function: peter + |-------------------------------------------------------------------------- + | + | Temp function to test development bits + | + */ + public function peter() { + $this->load->model('LotwCert'); + $this->load->model('Logbook_model'); + $dxcc = $this->Logbook_model->check_dxcc_table("2M0SQL", "2020-05-07 17:20:27"); + + print_r($dxcc); + // Get Array of the logged in users LOTW certs. + echo $this->LotwCert->find_cert($this->session->userdata('user_id'), "2M0SQL"); + } + + /* + |-------------------------------------------------------------------------- + | Function: decrypt_key + |-------------------------------------------------------------------------- + | + | Accepts p12 file and optional password and encrypts the file returning + | the required fields for LOTW and the PEM Key + | + */ + public function decrypt_key($file, $password = "") { + $results = array(); + $password = $password; // Only needed if 12 has a password set + $filename = file_get_contents('file://'.$file); + $worked = openssl_pkcs12_read($filename, $results, $password); + + $data['general_cert'] = $results['cert']; + + + if($worked) { + // Reading p12 successful + $new_password = "cloudlog"; // set default password + $result = null; + $worked = openssl_pkey_export($results['pkey'], $result, $new_password); + + if($worked) { + // Store PEM Key in Array + $data['pem_key'] = $result; + } else { + // Error Log Error Message + log_message('error', openssl_error_string()); + + // Set warning message redirect to LOTW main page + $this->session->set_flashdata('Warning', openssl_error_string()); + redirect('/lotw/'); + } + } else { + // Reading p12 failed log error message + log_message('error', openssl_error_string()); + + // Set warning message redirect to LOTW main page + $this->session->set_flashdata('Warning', openssl_error_string()); + redirect('/lotw/'); + } + + // Read Cert Data + $certdata= openssl_x509_parse($results['cert'],0); + + // Store Variables + $data['issued_callsign'] = $certdata['subject']['undefined']; + $data['issued_name'] = $certdata['subject']['commonName']; + $data['validFrom'] = $certdata['extensions']['1.3.6.1.4.1.12348.1.2']; + $data['validTo_Date'] = $certdata['extensions']['1.3.6.1.4.1.12348.1.3']; + + return $data; + } + private function loadFromFile($filepath) { $this->load->model('user_model'); @@ -206,7 +575,7 @@ class Lotw extends CI_Controller { $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'); } - $data['page_title'] = "LoTW .TQ8 Upload"; + $data['page_title'] = "LoTW .TQ8 Upload"; $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'tq8|TQ8'; @@ -367,4 +736,24 @@ class Lotw extends CI_Controller { } + function signlog($sign_key, $string) { + + $qso_string = $string; + + $key = $sign_key; + + $pkeyid = openssl_pkey_get_private($key, 'cloudlog'); + //openssl_sign($plaintext, $signature, $pkeyid, OPENSSL_ALGO_SHA1 ); + //openssl_free_key($pkeyid); + + + if(openssl_sign($qso_string, $signature, $pkeyid, OPENSSL_ALGO_SHA1)) { + openssl_free_key($pkeyid); + $signature_b64 = base64_encode($signature); + return $signature_b64; + } + + + } + } // end class diff --git a/application/migrations/043_add_lotw_certs_table.php b/application/migrations/043_add_lotw_certs_table.php new file mode 100644 index 00000000..e1717a6f --- /dev/null +++ b/application/migrations/043_add_lotw_certs_table.php @@ -0,0 +1,46 @@ +dbforge->add_field(array( + 'lotw_cert_id' => array( + 'type' => 'INT', + 'constraint' => 1, + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + + 'callsign' => array( + 'type' => 'VARCHAR', + 'constraint' => '100', + ), + + 'cert_dxcc' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + ), + + 'date_created' => array( + 'type' => 'DATETIME', + 'null' => TRUE, + ), + + 'date_expires' => array( + 'type' => 'DATETIME', + 'null' => TRUE, + ), + )); + + $this->dbforge->add_key('lotw_cert_id', TRUE); + $this->dbforge->create_table('lotw_certs'); + } + + public function down() + { + $this->dbforge->drop_table('lotw_certs'); + } +} \ No newline at end of file diff --git a/application/migrations/044_add_key_to_lotw_certs.php b/application/migrations/044_add_key_to_lotw_certs.php new file mode 100644 index 00000000..7a7f2b89 --- /dev/null +++ b/application/migrations/044_add_key_to_lotw_certs.php @@ -0,0 +1,21 @@ +dbforge->add_column('lotw_certs', $fields); + } + + public function down() + { + $this->dbforge->drop_column('lotw_certs', 'key'); + } +} \ No newline at end of file diff --git a/application/migrations/045_add_userid_to_lotw_certs.php b/application/migrations/045_add_userid_to_lotw_certs.php new file mode 100644 index 00000000..09892fa0 --- /dev/null +++ b/application/migrations/045_add_userid_to_lotw_certs.php @@ -0,0 +1,21 @@ +dbforge->add_column('lotw_certs', $fields); + } + + public function down() + { + $this->dbforge->drop_column('lotw_certs', 'user_id'); + } +} \ No newline at end of file diff --git a/application/migrations/046_add_last_upload_to_lotw_certs.php b/application/migrations/046_add_last_upload_to_lotw_certs.php new file mode 100644 index 00000000..562ecebc --- /dev/null +++ b/application/migrations/046_add_last_upload_to_lotw_certs.php @@ -0,0 +1,21 @@ +dbforge->add_column('lotw_certs', $fields); + } + + public function down() + { + $this->dbforge->drop_column('lotw_certs', 'last_upload'); + } +} \ No newline at end of file diff --git a/application/migrations/047_add_cert_to_lotw_certs.php b/application/migrations/047_add_cert_to_lotw_certs.php new file mode 100644 index 00000000..d47f74f6 --- /dev/null +++ b/application/migrations/047_add_cert_to_lotw_certs.php @@ -0,0 +1,21 @@ +dbforge->add_column('lotw_certs', $fields); + } + + public function down() + { + $this->dbforge->drop_column('lotw_certs', 'cert'); + } +} \ No newline at end of file diff --git a/application/migrations/048_add_county_to_stationprofile.php b/application/migrations/048_add_county_to_stationprofile.php new file mode 100644 index 00000000..a05b5b59 --- /dev/null +++ b/application/migrations/048_add_county_to_stationprofile.php @@ -0,0 +1,20 @@ +dbforge->add_column('station_profile', $fields); + } + + public function down() + { + $this->dbforge->drop_column('station_profile', 'county'); + } +} \ No newline at end of file diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 4e06ffa9..d186b5ae 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -463,7 +463,7 @@ class DXCC extends CI_Model { } return $sql; } - + /* * Function gets worked and confirmed summary on each band on the active stationprofile */ @@ -520,5 +520,18 @@ class DXCC extends CI_Model { return $query->result(); } + + function lookup_country($country) + { + $query = $this->db->query(' + SELECT * + FROM dxcc_entities + WHERE name = "'.$country.'" + ORDER BY LENGTH( prefix ) DESC + LIMIT 1 + '); + + return $query->row(); + } } ?> diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index a17d4000..485b3a51 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2209,7 +2209,37 @@ class Logbook_model extends CI_Model { return null; } } - + + function get_lotw_qsos_to_upload($station_id, $start_date, $end_date) { + + $this->db->select('COL_PRIMARY_KEY,COL_CALL, COL_BAND, COL_BAND_RX, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_FREQ, COL_FREQ_RX, COL_GRIDSQUARE, COL_SAT_NAME, COL_PROP_MODE, COL_LOTW_QSL_SENT, station_id'); + + $this->db->where("station_id", $station_id); + $this->db->where('COL_LOTW_QSL_SENT !=', "Y"); + $this->db->where('COL_PROP_MODE !=', "INTERNET"); + $this->db->where('COL_TIME_ON >=', $start_date); + $this->db->where('COL_TIME_ON <=', $end_date); + $this->db->order_by("COL_TIME_ON", "desc"); + + $query = $this->db->get($this->config->item('table_name')); + + return $query; + } + + function mark_lotw_sent($qso_id) { + + $data = array( + 'COL_LOTW_QSLSDATE' => date("Y-m-d H:i:s"), + 'COL_LOTW_QSL_SENT' => 'Y', + ); + + + $this->db->where('COL_PRIMARY_KEY', $qso_id); + + $this->db->update($this->config->item('table_name'), $data); + + return "Updated"; + } } function validateADIFDate($date, $format = 'Ymd') diff --git a/application/models/Lotw.php b/application/models/Lotw.php deleted file mode 100644 index 8b74cb30..00000000 --- a/application/models/Lotw.php +++ /dev/null @@ -1,16 +0,0 @@ -db->empty_table($table); - } -} -?> \ No newline at end of file diff --git a/application/models/LotwCert.php b/application/models/LotwCert.php new file mode 100644 index 00000000..6cb1c2a1 --- /dev/null +++ b/application/models/LotwCert.php @@ -0,0 +1,95 @@ +db->where('user_id', $user_id); + $this->db->group_by("callsign"); + $this->db->order_by('cert_dxcc', 'ASC'); + $query = $this->db->get('lotw_certs'); + + return $query; + } + + function lotw_cert_details($callsign) { + $this->db->where('callsign', $callsign); + $query = $this->db->get('lotw_certs'); + + return $query->row(); + } + + function find_cert($callsign, $user_id) { + $this->db->where('user_id', $user_id); + $this->db->where('callsign', $callsign); + $query = $this->db->get('lotw_certs'); + + return $query->num_rows(); + } + + function store_certficiate($user_id, $callsign, $dxcc, $date_created, $date_expires, $cert_key, $general_cert) { + $data = array( + 'user_id' => $user_id, + 'callsign' => $callsign, + 'cert_dxcc' => $dxcc, + 'date_created' => $date_created, + 'date_expires' => $date_expires, + 'cert_key' => $cert_key, + 'cert' => $general_cert, + ); + + $this->db->insert('lotw_certs', $data); + } + + function update_certficiate($user_id, $callsign, $dxcc, $date_created, $date_expires, $cert_key, $general_cert) { + $data = array( + 'cert_dxcc' => $dxcc, + 'date_created' => $date_created, + 'date_expires' => $date_expires, + 'cert_key' => $cert_key, + 'cert' => $general_cert + ); + + $this->db->where('user_id', $user_id); + $this->db->where('callsign', $callsign); + $this->db->update('lotw_certs', $data); + } + + function delete_certficiate($user_id, $lotw_cert_id) { + $this->db->where('lotw_cert_id', $lotw_cert_id); + $this->db->where('user_id', $user_id); + $this->db->delete('lotw_certs'); + } + + function last_upload($certID) { + + $data = array( + 'last_upload' => date("Y-m-d H:i:s"), + ); + + + $this->db->where('lotw_cert_id', $certID); + + $this->db->update('lotw_certs', $data); + + return "Updated"; + } + + function empty_table($table) { + $this->db->empty_table($table); + } +} +?> \ No newline at end of file diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index faecb8a0..fe905ce5 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -110,7 +110,7 @@ - LoTW Import + LoTW diff --git a/application/views/lotw_views/adif_views/adif_export.php b/application/views/lotw_views/adif_views/adif_export.php new file mode 100644 index 00000000..8c7832c7 --- /dev/null +++ b/application/views/lotw_views/adif_views/adif_export.php @@ -0,0 +1,137 @@ +cert); +$cert1 = str_replace("-----BEGIN CERTIFICATE-----", "", $clean_cert); +$cert2 = str_replace("-----END CERTIFICATE-----", "", $cert1); +?> +TQSL V2.5.4 Lib: V2.5 Config: V11.12 AllowDupes: false + +tCERT +1 +> + + + +tSTATION +1 +1 +callsign); ?>>callsign; ?> + +adif); ?>>adif; ?> + +station_gridsquare)) { ?>station_gridsquare); ?>>station_gridsquare; ?> + +station_itu)) { ?>station_itu); ?>>station_itu; ?> + +station_cq)) { ?>station_cq); ?>>station_cq; ?> + +station_iota)) { ?>station_iota); ?>>station_iota; ?> + +state) && $station_profile->station_country = "UNITED STATES OF AMERICA") { ?>state); ?>>state; ?> + +station_cnty) && $station_profile->station_country = "UNITED STATES OF AMERICA") { ?>station_cnty); ?>>station_cnty; ?> + + + +result() as $qso) { ?> +tCONTACT +1 +COL_CALL); ?>>COL_CALL; ?> + +COL_BAND); ?>>COL_BAND); ?> + +COL_MODE); ?>>COL_MODE); ?> + +COL_FREQ != "" || $qso->COL_FREQ != "0") { ?>COL_FREQ / 1000000; ?>> + +COL_FREQ_RX != "" || $qso->COL_FREQ_RX != "0") { ?>COL_FREQ_RX / 1000000; ?>> + +COL_PROP_MODE) { ?>COL_PROP_MODE); ?>>COL_PROP_MODE); ?> + +COL_SAT_NAME) { ?>COL_SAT_NAME); ?>>COL_SAT_NAME); ?> + +COL_BAND_RX) { ?>COL_BAND_RX); ?>>COL_BAND_RX); ?> + +COL_TIME_ON); $new_date = date('Y-m-d', $date_on); ?> +> + +COL_TIME_ON); $new_on = date('H:i:s', $time_on); ?> +> + +station_cq) { + $sign_string .= $station_profile->station_cq; +} + +// Add Gridsquare +if($station_profile->station_gridsquare) { + $sign_string .= strtoupper($station_profile->station_gridsquare); +} + +if($station_profile->station_iota) { + $sign_string .= strtoupper($station_profile->station_iota); +} + +if($station_profile->station_itu) { + $sign_string .= $station_profile->station_itu; +} + +if(isset($station_profile->state) && $station_profile->station_country = "UNITED STATES OF AMERICA") { + $sign_string .= strtoupper($station_profile->state); +} + +if($qso->COL_BAND) { + $sign_string .= strtoupper($qso->COL_BAND); +} + +if($qso->COL_BAND_RX) { + $sign_string .= strtoupper($qso->COL_BAND_RX); +} + +if($qso->COL_CALL) { + $sign_string .= strtoupper($qso->COL_CALL); +} + +if($freq_in_mhz) { + $sign_string .= strtoupper($freq_in_mhz); +} + +if($qso->COL_FREQ_RX != "" || $qso->COL_FREQ_RX != "0") { + $sign_string .= strtoupper($freq_in_mhz_rx); +} + +if($qso->COL_MODE) { + $sign_string .= strtoupper($qso->COL_MODE); +} + + +if($qso->COL_PROP_MODE) { + $sign_string .= strtoupper($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); +} + + ?> +signlog($lotw_cert_info->cert_key, $sign_string); + +?> +:6> + +> + + + + + diff --git a/application/views/lotw_views/index.php b/application/views/lotw_views/index.php new file mode 100644 index 00000000..bf3c9672 --- /dev/null +++ b/application/views/lotw_views/index.php @@ -0,0 +1,95 @@ +
+
+ LoTW Import

+ + + + +
+
+ Upload Certificate Available Certificates +
+ +
+ + + + + + + + + num_rows() > 0) { ?> + +
+ + + + + + + + + + + + + + + result() as $row) { ?> + + + + + + + + + + + +
CallsignDXCCDate CreatedDate ExpiresStatusOptions
callsign; ?>cert_dxcc); ?>date_created ); + $new_valid_from = date($this->config->item('qso_date_format'), $valid_form ); + echo $new_valid_from; ?> + + date_expires ); + $new_valid_to = date($this->config->item('qso_date_format'), $valid_to ); + echo $new_valid_to; ?> + + + + date_expires) { ?> + Valid + + Expired + + + last_upload) { ?> + last_upload; ?> + + Not Synced + + + Delete +
+
+ + + + + +
+
+ + +
diff --git a/application/views/lotw_views/upload_cert.php b/application/views/lotw_views/upload_cert.php new file mode 100644 index 00000000..a214c10a --- /dev/null +++ b/application/views/lotw_views/upload_cert.php @@ -0,0 +1,43 @@ +
+ +

+ + +
+
+ Upload Logbook of the World .p12 Certificate +
+ +
+ + + + + + + +
+ + +
+ + + + + +
+
+ + +
diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index e7d77451..726df5ea 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -53,7 +53,7 @@ Station DXCC -
+
Station City for example Inverness