From 7e7f5ce63eb750da173c4aa2950545611e67c86f Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 20 Sep 2020 13:57:14 +0200 Subject: [PATCH] Added bootstrapdialog for DOK award. --- application/controllers/Awards.php | 35 +++++++++++++++++++ application/views/awards/dok/details_ajax.php | 3 ++ application/views/awards/dok/index.php | 2 +- application/views/interface_assets/footer.php | 31 ++++++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 application/views/awards/dok/details_ajax.php diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 1bebcda1..c02bd243 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -74,6 +74,41 @@ class Awards extends CI_Controller { $this->load->view('awards/dok/details'); $this->load->view('interface_assets/footer'); } + + public function dok_details_ajax(){ + $a = $this->input->post(); + $q = ""; + foreach ($a as $key => $value) { + $q .= $key."=".$value.("(and)"); + } + $q = substr($q, 0, strlen($q)-13); + + $arguments["query"] = $q; + $arguments["fields"] = ''; + $arguments["format"] = "json"; + $arguments["limit"] = ''; + $arguments["order"] = ''; + + // print_r($arguments); + // return; + + // Load the API and Logbook models + $this->load->model('api_model'); + $this->load->model('logbook_model'); + + // Call the parser within the API model to build the query + $query = $this->api_model->select_parse($arguments); + + // Execute the query, and retrieve the results + $data = $this->logbook_model->api_search_query($query); + + // Render Page + $data['page_title'] = "Log View - DOK"; + $data['filter'] = str_replace("(and)", ", ", $q);//implode(", ", array_keys($a)); + //$this->load->view('interface_assets/header', $data); + $this->load->view('awards/dok/details_ajax', $data); + //$this->load->view('interface_assets/footer'); + } public function dxcc () { $this->load->model('dxcc'); diff --git a/application/views/awards/dok/details_ajax.php b/application/views/awards/dok/details_ajax.php new file mode 100644 index 00000000..bdd89954 --- /dev/null +++ b/application/views/awards/dok/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/awards/dok/index.php b/application/views/awards/dok/index.php index a97bcfb6..e2ed2cf4 100644 --- a/application/views/awards/dok/index.php +++ b/application/views/awards/dok/index.php @@ -26,7 +26,7 @@ if ($count == 0){ print(" "); }else{ - printf("%d", str_replace("&", "%26", $dok), $band, $count); + printf("%d", str_replace("&", "%26", $dok), $band, $count); } } } diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 11f9f08b..40ae42cd 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1486,6 +1486,37 @@ $(document).ready(function(){ + + uri->segment(2) == "dok") { ?> + + function displayDokContacts(dok, band) { + var baseURL= ""; + $.ajax({ + url: baseURL + 'index.php/awards/dok_details_ajax', + type: 'post', + data: {'Dok': dok, + 'Band': band + }, + success: function(html) { + BootstrapDialog.show({ + title: 'QSO Data', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'qso-dok-dialog', + nl2br: false, + message: html, + buttons: [{ + label: 'Close', + action: function (dialogItself) { + dialogItself.close(); + } + }] + }); + } + }); + } + + + uri->segment(2) == "iota") { ?> function displayIotaContacts(iota, band) {