From c06baf39e32260b3b157d15e1e8e2d2319c4193e Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 20 Sep 2020 11:09:22 +0200 Subject: [PATCH] Added bootstrapdialog for IOTA award. --- application/controllers/Awards.php | 13 ++++++++ application/models/Iota.php | 4 +-- .../views/awards/iota/details_ajax.php | 3 ++ application/views/interface_assets/footer.php | 30 +++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 application/views/awards/iota/details_ajax.php diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 473ac838..1bebcda1 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -481,4 +481,17 @@ class Awards extends CI_Controller { $this->load->view('awards/iota/details'); $this->load->view('interface_assets/footer'); } + + public function iota_details_ajax(){ + $this->load->model('logbook_model'); + + $iota = str_replace('"', "", $this->input->post("Iota")); + $band = str_replace('"', "", $this->input->post("Band")); + $data['results'] = $this->logbook_model->iota_qso_details($iota, $band); + + // Render Page + $data['page_title'] = "Log View - IOTA"; + $data['filter'] = "iota ".$iota. " and ".$band; + $this->load->view('awards/iota/details_ajax', $data); + } } diff --git a/application/models/Iota.php b/application/models/Iota.php index 06eab514..12c5d539 100644 --- a/application/models/Iota.php +++ b/application/models/Iota.php @@ -81,7 +81,7 @@ class IOTA extends CI_Model { if ($postdata['worked'] != NULL) { $workedIota = $this->getIotaBandWorked($station_id, $band, $postdata); foreach ($workedIota as $wiota) { - $iotaMatrix[$wiota->tag][$band] = '
tag.'"&Band="'. $band . '"\'>W
';; + $iotaMatrix[$wiota->tag][$band] = '
tag.'","'. $band . '")\'>W
'; } } @@ -89,7 +89,7 @@ class IOTA extends CI_Model { if ($postdata['confirmed'] != NULL) { $confirmedIota = $this->getIotaBandConfirmed($station_id, $band, $postdata); foreach ($confirmedIota as $ciota) { - $iotaMatrix[$ciota->tag][$band] = '
tag.'"&Band="'. $band . '"\'>C
';; + $iotaMatrix[$ciota->tag][$band] = '
tag.'","'. $band . '")\'>C
'; } } } diff --git a/application/views/awards/iota/details_ajax.php b/application/views/awards/iota/details_ajax.php new file mode 100644 index 00000000..bdd89954 --- /dev/null +++ b/application/views/awards/iota/details_ajax.php @@ -0,0 +1,3 @@ +

Filtering on

+ +load->view('view_log/partial/log_ajax') ?> \ No newline at end of file diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index e43ff990..11f9f08b 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1486,6 +1486,36 @@ $(document).ready(function(){ + uri->segment(2) == "iota") { ?> + + function displayIotaContacts(iota, band) { + var baseURL= ""; + $.ajax({ + url: baseURL + 'index.php/awards/iota_details_ajax', + type: 'post', + data: {'Iota': iota, + 'Band': band + }, + success: function(html) { + BootstrapDialog.show({ + title: 'QSO Data', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'qso-iota-dialog', + nl2br: false, + message: html, + buttons: [{ + label: 'Close', + action: function (dialogItself) { + dialogItself.close(); + } + }] + }); + } + }); + } + + + uri->segment(2) == "cq") { ?> function displayCqContacts(cqzone, band) {