diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index bf4f48e2c..a709c5e6c 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -93,6 +93,7 @@ class Lotw extends CI_Controller { | | do_cert_upload is called from cert_upload form submit and handles uploading | and processing of p12 files and storing the data into mysql + | Now supports HTMX requests for modal-based uploads | */ public function do_cert_upload() @@ -106,6 +107,9 @@ class Lotw extends CI_Controller { echo "You must install php OpenSSL for LoTW functions to work"; } + // Check if this is an HTMX request + $is_htmx = $this->input->get_request_header('HX-Request'); + // create folder to store certs while processing if (!file_exists('./uploads/lotw/certs')) { mkdir('./uploads/lotw/certs', 0755, true); @@ -119,17 +123,21 @@ class Lotw extends CI_Controller { if ( ! $this->upload->do_upload('userfile')) { // Upload of P12 Failed - $error = array('error' => $this->upload->display_errors()); + $error = $this->upload->display_errors(); - // Load DXCC Countrys List + // If HTMX request, return just the error message + if($is_htmx) { + echo '
| + | + | + | + | + | + | + | + |
|---|---|---|---|---|---|---|---|
| callsign; ?> | +cert_dxcc == '' ? '- NONE -' : ucfirst($row->cert_dxcc); if ($row->cert_dxcc_end != NULL) { echo ' '.lang('gen_hamradio_deleted_dxcc').''; } ?> | +qso_start_date)) { + $valid_qso_start = strtotime( $row->qso_start_date ); + $new_valid_qso_start = date($this->config->item('qso_date_format'), $valid_qso_start ); + echo $new_valid_qso_start; + } else { + echo "n/a"; + } ?> + | +qso_end_date)) { + $valid_qso_end = strtotime( $row->qso_end_date ); + $new_valid_qso_end = date($this->config->item('qso_date_format'), $valid_qso_end ); + echo $new_valid_qso_end; + } else { + echo "n/a"; + } ?> + | +date_created ); + $new_valid_from = date($this->config->item('qso_date_format'), $valid_from ); + echo $new_valid_from; ?> + | ++ date_expires ); + $new_valid_to = date($this->config->item('qso_date_format'), $valid_to ); + echo $new_valid_to; ?> + | ++ + date_expires.'-30 days')); ?> + + archived) { ?> + + + $row->date_expires) { ?> + + date_expires && $current_date > $warning_date) { ?> + + + + + + + last_upload) { + $last_upload = date($this->config->item('qso_date_format').' H:i:s', strtotime( $row->last_upload )); ?> + + + + + | ++ archived) { ?> + + Unarchive + + + + Archive + + + + | +
| - | - | - | - | - | - | - | - |
|---|---|---|---|---|---|---|---|
| callsign; ?> | -cert_dxcc == '' ? '- NONE -' : ucfirst($row->cert_dxcc); if ($row->cert_dxcc_end != NULL) { echo ' '.lang('gen_hamradio_deleted_dxcc').''; } ?> | -qso_start_date)) { - $valid_qso_start = strtotime( $row->qso_start_date ); - $new_valid_qso_start = date($this->config->item('qso_date_format'), $valid_qso_start ); - echo $new_valid_qso_start; - } else { - echo "n/a"; - } ?> - | -qso_end_date)) { - $valid_qso_end = strtotime( $row->qso_end_date ); - $new_valid_qso_end = date($this->config->item('qso_date_format'), $valid_qso_end ); - echo $new_valid_qso_end; - } else { - echo "n/a"; - } ?> - | -date_created ); - $new_valid_from = date($this->config->item('qso_date_format'), $valid_from ); - echo $new_valid_from; ?> - | -- date_expires ); - $new_valid_to = date($this->config->item('qso_date_format'), $valid_to ); - echo $new_valid_to; ?> - | -- - date_expires.'-30 days')); ?> - - archived) { ?> - - - $row->date_expires) { ?> - - date_expires && $current_date > $warning_date) { ?> - - - - - - - last_upload) { - $last_upload = date($this->config->item('qso_date_format').' H:i:s', strtotime( $row->last_upload )); ?> - - - - - | -- archived) { ?> - - Unarchive - - - - Archive - - - - | -