diff --git a/README.md b/README.md index 49355f72b..5d59c16e4 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,12 @@ When submitting PRs please make sure code is commented and includes one feature ## Credits -Thanks to Andy (VE7CXZ), Gavin (M1BXF), Graham (W5ISP), Robert (M0VFC), Corby (K0SKW), Andy (GI0VGV), Tobias (DL4TMA), Tony (G0WFV), Kim (DG9VH), Michael (G7VJR), Andreas (LA8AJA), Matthias (DL9MJ) for contributing code or help to Cloudlog. +Thanks to Andy (VE7CXZ), Gavin (M1BXF), Graham (W5ISP), Robert (M0VFC), Corby (K0SKW), Andy (GI0VGV), Tobias (DL4TMA), Tony (G0WFV), Kim (DG9VH), Michael (G7VJR), Andreas (LA8AJA), Matthias (DL9MJ), Thomas (DO2TWE) and Pat (KT3PJ) for contributing code or help to Cloudlog. ## Patreons & Donors Cloudlog is supported by Patreon and donations via PayPal, thanks to the following people: -Paul (M0TZO), Tim (G4VXE), Paul (N8HM), Michelle (W5NYV), Mitchell (AD0HJ), Dan (M0TCB), Martin (DK3ML), Juan Carlos (EA5WA), Iain (M0PCB), Charlie (GM1TGY), Ondrej (OK1CDJ), Trystan (G0KAY), Oliver (DL6KBG), Volkmar Schirmer, Jordan (M0PIR), Thomas Ziegler, Mathis (DB9MAT), Ken (VE3HLS), Tyler (WL7T), Jeremy Taylor, Ben Kuhn, Eric Thresher, Michael Cullen, Juuso (OH1JW), Anthony Castiglia, Fernando Ramirez-Ferrer, Robert Dixon, Mark Percival, Julia (KV1V), Timo Tomasini, Ant (NU1U), Christopher Williams, Danny Barnes, Vic, Tom (M0LTE), smurphboy +Paul (M0TZO), Tim (G4VXE), Paul (N8HM), Michelle (W5NYV), Mitchell (AD0HJ), Dan (M0TCB), Martin (DK3ML), Juan Carlos (EA5WA), Iain (M0PCB), Charlie (GM1TGY), Ondrej (OK1CDJ), Trystan (G0KAY), Oliver (DL6KBG), Volkmar Schirmer, Jordan (M0PIR), Thomas Ziegler, Mathis (DB9MAT), Ken (VE3HLS), Tyler (WL7T), Jeremy Taylor, Ben Kuhn, Eric Thresher, Michael Cullen, Juuso (OH1JW), Anthony Castiglia, Fernando Ramirez-Ferrer, Robert Dixon, Mark Percival, Julia (KV1V), Timo Tomasini, Ant (NU1U), Christopher Williams, Danny Barnes, Vic, Tom (M0LTE), smurphboy, Lars (SM0TGU) If you'd like to donate to Cloudlog to help allow @magicbug spend less time doing commercial work and more time coding Cloudlog then you can donate via [PayPal](https://paypal.me/PGoodhall), [Github Sponsor](https://github.com/sponsors/magicbug) or become a [Patreon](https://www.patreon.com/2m0sql) diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index 3864f0be5..eb789d6da 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -121,26 +121,6 @@ class adif extends CI_Controller { $this->load->view('adif/mark_lotw', $data); } - public function mark_qrz() { - // Set memory limit to unlimited to allow heavy usage - ini_set('memory_limit', '-1'); - - $station_id = $this->security->xss_clean($this->input->post('station_profile')); - - $this->load->model('adif_data'); - - $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id); - - $this->load->model('logbook_model'); - - foreach ($data['qsos']->result() as $qso) - { - $this->logbook_model->mark_qrz_qsos_sent($qso->COL_PRIMARY_KEY); - } - - $this->load->view('adif/mark_qrz', $data); - } - public function export_lotw() { // Set memory limit to unlimited to allow heavy usage diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index b9996ccb2..6beb4edf3 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -1,16 +1,13 @@ lang->load('contesting'); @@ -18,47 +15,28 @@ class Contesting extends CI_Controller { if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } - public function index() - { - + public function index() { $this->load->model('cat'); $this->load->model('stations'); - $this->load->model('logbook_model'); - $this->load->model('user_model'); $this->load->model('modes'); $this->load->model('contesting_model'); - $data['active_station_profile'] = $this->stations->find_active(); - $data['notice'] = false; - $data['stations'] = $this->stations->all(); + $data['my_gridsquare'] = $this->stations->find_gridsquare(); $data['radios'] = $this->cat->radios(); $data['modes'] = $this->modes->active(); $data['contestnames'] = $this->contesting_model->getActivecontests(); - - $this->load->library('form_validation'); + $this->load->library('form_validation'); $this->form_validation->set_rules('start_date', 'Date', 'required'); $this->form_validation->set_rules('start_time', 'Time', 'required'); $this->form_validation->set_rules('callsign', 'Callsign', 'required'); - $data['page_title'] = "Contest Logging"; - - $this->load->view('interface_assets/header', $data); - $this->load->view('contesting/index'); - $this->load->view('interface_assets/footer'); - - - //setcookie("radio", $qso_data['radio'], time()+3600*24*99); - //setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99); - - //$this->session->set_userdata($qso_data); - - // If SAT name is set make it session set to sat - if($this->input->post('sat_name')) { - $this->session->set_userdata('prop_mode', 'SAT'); - } + $data['page_title'] = "Contest Logging"; + $this->load->view('interface_assets/header', $data); + $this->load->view('contesting/index'); + $this->load->view('interface_assets/footer'); } public function getSessionQsos() { @@ -73,8 +51,7 @@ class Contesting extends CI_Controller { return json_encode($data); } - public function create() - { + public function create() { $this->load->model('Contesting_model'); $this->load->library('form_validation'); @@ -104,8 +81,7 @@ class Contesting extends CI_Controller { $this->load->view('interface_assets/footer'); } - public function edit($id) - { + public function edit($id) { $this->load->library('form_validation'); $this->load->model('Contesting_model'); diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index 5462d8ddb..d061d156e 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -144,19 +144,17 @@ class eqsl extends CI_Controller { $active_station_info = $station_profile->row(); // Query the logbook to determine when the last LoTW confirmation was $eqsl_last_qsl_date = $this->logbook_model->eqsl_last_qsl_rcvd_date(); - - // Build URL for eQSL inbox file - $eqsl_url .= "?"; - $eqsl_url .= "UserName=" . $data['user_eqsl_name']; - $eqsl_url .= "&Password=" . urlencode($data['user_eqsl_password']); - - $eqsl_url .= "&RcvdSince=" . $eqsl_last_qsl_date; - $eqsl_url .= "&QTHNickname=" . urlencode($active_station_info->eqslqthnickname); - - // Pull back only confirmations - $eqsl_url .= "&ConfirmedOnly=1"; - //echo "

".$eqsl_url."

"; + // Build parameters for eQSL inbox file + $eqsl_params = http_build_query(array( + 'UserName' => $data['user_eqsl_name'], + 'Password' => $data['user_eqsl_password'], + 'RcvdSince' => $eqsl_last_qsl_date, + 'QTHNickname' => $active_station_info->eqslqthnickname, + 'ConfirmedOnly' => 1 + )); + + //echo "

".$eqsl_url."
".$eqsl_params."

"; // At this point, what we get isn't the ADI file we need, but rather // an HTML page, which contains a link to the generated ADI file that we want. @@ -170,8 +168,10 @@ class eqsl extends CI_Controller { curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); - // use the URL we built + // use the URL and params we built curl_setopt($ch, CURLOPT_URL, $eqsl_url); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $eqsl_params); $input = curl_exec($ch); $chi = curl_getinfo($ch); @@ -589,11 +589,24 @@ class eqsl extends CI_Controller { $this->load->view('interface_assets/footer'); } - function image($id, $callsign, $mode, $band, $hour, $minute, $day, $month, $year) { + function image($id) { $this->load->library('electronicqsl'); $this->load->model('Eqsl_images'); if($this->Eqsl_images->get_image($id) == "No Image") { + $this->load->model('logbook_model'); + $qso_query = $this->logbook_model->get_qso($id); + $qso = $qso_query->row(); + $qso_timestamp = strtotime($qso->COL_TIME_ON); + $callsign = $qso->COL_CALL; + $band = $qso->COL_BAND; + $mode = $qso->COL_MODE; + $year = date('Y', $qso_timestamp); + $month = date('m', $qso_timestamp); + $day = date('d', $qso_timestamp); + $hour = date('H', $qso_timestamp); + $minute = date('i', $qso_timestamp); + $query = $this->user_model->get_by_id($this->session->userdata('user_id')); $q = $query->row(); $username = $q->user_eqsl_name; @@ -613,14 +626,14 @@ class eqsl extends CI_Controller { } foreach ($images as $image) - { - header('Content-Type: image/jpg'); - readfile ("https://www.eqsl.cc".$image->getAttribute('src')); - $content = file_get_contents("https://www.eqsl.cc".$image->getAttribute('src')); - $filename = uniqid().'.jpg'; - file_put_contents('images/eqsl_card_images/' . '/'.$filename, $content); + { + header('Content-Type: image/jpg'); + readfile ("https://www.eqsl.cc".$image->getAttribute('src')); + $content = file_get_contents("https://www.eqsl.cc".$image->getAttribute('src')); + $filename = uniqid().'.jpg'; + file_put_contents('images/eqsl_card_images/' . '/'.$filename, $content); - $this->Eqsl_images->save_image($id, $filename); + $this->Eqsl_images->save_image($id, $filename); } } else { header('Content-Type: image/jpg'); diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index e05716b59..432bd82eb 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -137,7 +137,7 @@ class Logbook extends CI_Controller { $measurement_base = $this->session->userdata('user_measurement_base'); } - $return['callsign_name'] = $this->logbook_model->call_name($callsign); + $return['callsign_name'] = $this->logbook_model->call_name($callsign); $return['callsign_qra'] = $this->logbook_model->call_qra($callsign); $return['callsign_qth'] = $this->logbook_model->call_qth($callsign); $return['callsign_iota'] = $this->logbook_model->call_iota($callsign); @@ -155,38 +155,8 @@ class Logbook extends CI_Controller { } - if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) - { - // Lookup using QRZ - $this->load->library('qrz'); + $callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname')); - if(!$this->session->userdata('qrz_session_key')) { - $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); - $this->session->set_userdata('qrz_session_key', $qrz_session_key); - } - - $callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key')); - } - - if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) - { - // Load the HamQTH library - $this->load->library('hamqth'); - - if(!$this->session->userdata('hamqth_session_key')) { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); - $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); - } - - $callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); - - // If HamQTH session has expired, start a new session and retry the search. - if($callbook['error'] == "Session does not exist or expired") { - $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); - $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); - $callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); - } - } if (isset($callbook)) { @@ -552,8 +522,14 @@ class Logbook extends CI_Controller { $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); $this->session->set_userdata('qrz_session_key', $qrz_session_key); } + $data= $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); - $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key')); + if (empty($data['callsign'])) + { + $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $this->session->set_userdata('qrz_session_key', $qrz_session_key); + $data = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); + } } // There's no hamli integration? Disabled for now. @@ -610,7 +586,7 @@ class Logbook extends CI_Controller { $this->session->set_userdata('qrz_session_key', $qrz_session_key); } - $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key')); + $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); } else { // Lookup using hamli $this->load->library('hamli'); diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 29e1e856e..c663d6ff2 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -108,11 +108,8 @@ class Qrz extends CI_Controller { $data['page_title'] = "QRZ Logbook"; + $data['station_profiles'] = $this->stations->all(); $data['station_profile'] = $this->stations->stations_with_qrz_api_key(); - $active_station_id = $this->stations->find_active(); - $station_profile = $this->stations->profile($active_station_id); - - $data['active_station_info'] = $station_profile->row(); $this->load->view('interface_assets/header', $data); $this->load->view('qrz/export'); @@ -125,6 +122,7 @@ class Qrz extends CI_Controller { public function upload_station() { $this->setOptions(); $this->load->model('stations'); + $postData = $this->input->post(); $this->load->model('logbook_model'); @@ -148,4 +146,26 @@ class Qrz extends CI_Controller { echo json_encode($data); } } -} \ No newline at end of file + + public function mark_qrz() { + // Set memory limit to unlimited to allow heavy usage + ini_set('memory_limit', '-1'); + + $station_id = $this->security->xss_clean($this->input->post('station_profile')); + + $this->load->model('adif_data'); + + $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id); + + $this->load->model('logbook_model'); + + foreach ($data['qsos']->result() as $qso) + { + $this->logbook_model->mark_qrz_qsos_sent($qso->COL_PRIMARY_KEY); + } + + $this->load->view('interface_assets/header', $data); + $this->load->view('qrz/mark_qrz', $data); + $this->load->view('interface_assets/footer'); + } +} diff --git a/application/controllers/Qslprint.php b/application/controllers/Qslprint.php index 3de67e652..bc826b06b 100644 --- a/application/controllers/Qslprint.php +++ b/application/controllers/Qslprint.php @@ -35,8 +35,8 @@ class QSLPrint extends CI_Controller { // Set memory limit to unlimited to allow heavy usage ini_set('memory_limit', '-1'); - if ($this->uri->segment(3) == 'All') { - $station_id = NULL; + if ($this->uri->segment(3) == 'all') { + $station_id = 'All'; } else { $station_id = $this->security->xss_clean($this->uri->segment(3)); } @@ -53,8 +53,8 @@ class QSLPrint extends CI_Controller { // Set memory limit to unlimited to allow heavy usage ini_set('memory_limit', '-1'); - if ($this->uri->segment(3) == 'All') { - $station_id = NULL; + if ($this->uri->segment(3) == 'all') { + $station_id = 'All'; } else { $station_id = $this->security->xss_clean($this->uri->segment(3)); } @@ -115,8 +115,8 @@ class QSLPrint extends CI_Controller { function qsl_printed() { - if ($this->uri->segment(3) == 'All') { - $station_id = NULL; + if ($this->uri->segment(3) == 'all') { + $station_id = 'All'; } else { $station_id = $this->security->xss_clean($this->uri->segment(3)); } diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index e8e2f957d..245fc1a9a 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -153,6 +153,7 @@ class QSO extends CI_Controller { $this->load->model('logbook_model'); $this->load->model('user_model'); $this->load->model('modes'); + $this->load->model('contesting_model'); $this->load->library('form_validation'); @@ -167,6 +168,7 @@ class QSO extends CI_Controller { $data['dxcc'] = $this->logbook_model->fetchDxcc(); $data['iota'] = $this->logbook_model->fetchIota(); $data['modes'] = $this->modes->all(); + $data['contest'] = $this->contesting_model->getActivecontests(); $this->load->view('qso/edit_ajax', $data); } @@ -384,7 +386,7 @@ class QSO extends CI_Controller { foreach ($result as &$value) { $county = explode(',', $value); // Limit to 100 as to not slowdown browser too much - if (count($json) <= 100) { + if (count($json) <= 300) { $json[] = ["name"=>$county[1]]; } } diff --git a/application/controllers/Search.php b/application/controllers/Search.php index 3ef1f1f66..50de2354f 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -32,6 +32,7 @@ class Search extends CI_Controller { $this->load->model('Search_filter'); $data['get_table_names'] = $this->Search_filter->get_table_columns(); + $data['stored_queries'] = $this->Search_filter->get_stored_queries(); //print_r($this->Search_filter->get_table_columns()); @@ -50,262 +51,342 @@ class Search extends CI_Controller { } function json_result() { - if(isset($_POST['search'])) { - $json = $_POST['search']; - - $search_items = json_decode($json, true); - - $search_type = ""; - - foreach($search_items as $key=>$value){ - - - if($value == "AND") { - $search_type = "AND"; - } - if ($value == "OR") { - $search_type = "OR"; - } - - if(is_array($value)) { - foreach($value as $values) - { - - if(isset($values['rules'])) { - if($values['condition'] == "AND") { - $this->db->group_start(); - } else { - $this->db->or_group_start(); - } - foreach($values['rules'] as $group_value) - { - if($group_value['operator'] == "equal") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'], $group_value['value']); - } else { - $this->db->or_where($group_value['field'], $group_value['value']); - } - } - - if($group_value['operator'] == "not_equal") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' !=', $group_value['value']); - } else { - $this->db->or_where($group_value['field'].' !=', $group_value['value']); - } - } - - if($group_value['operator'] == "begins_with") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' like ', $group_value['value']."%"); - } else { - $this->db->or_where($group_value['field'].' like ', $group_value['value']."%"); - } - } - - if($group_value['operator'] == "contains") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' like ', "%".$group_value['value']."%"); - } else { - $this->db->or_where($group_value['field'].' like ', "%".$group_value['value']."%"); - } - } - - if($group_value['operator'] == "ends_with") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' like ', "%".$group_value['value']); - } else { - $this->db->or_where($group_value['field'].' like ', "%".$group_value['value']); - } - } - - if($group_value['operator'] == "is_empty") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'], "''"); - } else { - $this->db->or_where($group_value['field'], "''"); - } - } - - if($group_value['operator'] == "is_not_empty") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' !=', "''"); - } else { - $this->db->or_where($group_value['field'].' !=', "''"); - } - } - - if($group_value['operator'] == "is_null") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' is ', NULL); - } else { - $this->db->or_where($group_value['field'].' is ', NULL); - } - } - - if($group_value['operator'] == "is_not_null") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' is not ', NULL); - } else { - $this->db->or_where($group_value['field'].' is not ', NULL); - } - } - - - if($group_value['operator'] == "less") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' <', $group_value['value']); - } else { - $this->db->or_where($group_value['field'].' <', $group_value['value']); - } - } - - if($group_value['operator'] == "less_or_equal") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' <=', $group_value['value']); - } else { - $this->db->or_where($group_value['field'].' <=', $group_value['value']); - } - } - - if($group_value['operator'] == "greater") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' >', $group_value['value']); - } else { - $this->db->or_where($group_value['field'].' >', $group_value['value']); - } - } - - if($group_value['operator'] == "greater_or_equal") { - if($values['condition'] == "AND") { - $this->db->where($group_value['field'].' >=', $group_value['value']); - } else { - $this->db->or_where($group_value['field'].' >=', $group_value['value']); - } - } - - } - $this->db->group_end(); - } else { - //print_r($values['field']); - if(isset($values['operator'])) { - - } - if($values['operator'] == "equal") { - if($search_type == "AND") { - $this->db->where($values['field'], $values['value']); - } else { - $this->db->or_where($values['field'], $values['value']); - } - } - - if($values['operator'] == "not_equal") { - if($search_type == "AND") { - $this->db->where($values['field'].' !=', $values['value']); - } else { - $this->db->or_where($values['field'].' !=', $values['value']); - } - } - - if($values['operator'] == "begins_with") { - if($search_type == "AND") { - $this->db->where($values['field'].' like ', $values['value']."%"); - } else { - $this->db->or_where($values['field'].' like ', $values['value']."%"); - } - } - - if($values['operator'] == "contains") { - if($search_type == "AND") { - $this->db->where($values['field'].' like ', "%".$values['value']."%"); - } else { - $this->db->or_where($values['field'].' like ', "%".$values['value']."%"); - } - } - - if($values['operator'] == "ends_with") { - if($search_type == "AND") { - $this->db->where($values['field'].' like ', "%".$values['value']); - } else { - $this->db->or_where($values['field'].' like ', "%".$values['value']); - } - } - - if($values['operator'] == "is_empty") { - if($search_type == "AND") { - $this->db->where($values['field'], ""); - } else { - $this->db->or_where($values['field'], ""); - } - } - - if($values['operator'] == "is_not_empty") { - if($search_type == "AND") { - $this->db->where($values['field'].' !=', ""); - } else { - $this->db->or_where($values['field'].' !=', ""); - } - } - - if($values['operator'] == "is_null") { - if($search_type == "AND") { - $this->db->where($values['field'].' is ', NULL); - } else { - $this->db->or_where($values['field'].' is ', NULL); - } - } - - if($values['operator'] == "is_not_null") { - if($search_type == "AND") { - $this->db->where($values['field'].' is not ', NULL); - } else { - $this->db->or_where($values['field'].' is not ', NULL); - } - } - - if($values['operator'] == "less") { - if($search_type == "AND") { - $this->db->where($values['field'].' <', $values['value']); - } else { - $this->db->or_where($values['field'].' <', $values['value']); - } - } - - if($values['operator'] == "less_or_equal") { - if($search_type == "AND") { - $this->db->where($values['field'].' <=', $values['value']); - } else { - $this->db->or_where($values['field'].' <=', $values['value']); - } - } - - if($values['operator'] == "greater") { - if($search_type == "AND") { - $this->db->where($values['field'].' >', $values['value']); - } else { - $this->db->or_where($values['field'].' >', $values['value']); - } - } - - if($values['operator'] == "greater_or_equal") { - if($search_type == "AND") { - $this->db->where($values['field'].' >=', $values['value']); - } else { - $this->db->or_where($values['field'].' >=', $values['value']); - } - } - } - - } - } - } - $this->db->order_by('COL_TIME_ON', 'DESC'); - $query = $this->db->get($this->config->item('table_name')); - echo json_encode($query->result_array()); - } else { - echo "Noooooooob"; - } - + $result = $this->fetchQueryResult($_POST['search'], false); + echo json_encode($result->result_array()); + } } + + function get_stored_queries() { + $this->load->model('Search_filter'); + $data['result'] = $this->Search_filter->get_stored_queries(); + $this->load->view('search/stored_queries', $data); + } + + function search_result() { + if(isset($_POST['search'])) { + $data['results'] = $this->fetchQueryResult($_POST['search'], false); + $this->load->view('search/search_result_ajax', $data); + } + } + + function export_to_adif() { + if(isset($_POST['search'])) { + $data['qsos'] = $this->fetchQueryResult($_POST['search'], false); + $this->load->view('adif/data/exportall', $data); + } + } + + function export_stored_query_to_adif() { + $this->db->where('id', xss_clean($this->input->post('id'))); + $sql = $this->db->get('queries')->result(); + + $data['qsos'] = $this->db->query($sql[0]->query); + $this->load->view('adif/data/exportall', $data); + } + + function run_query() { + $this->db->where('id', xss_clean($this->input->post('id'))); + $sql = $this->db->get('queries')->result(); + $sql = $sql[0]->query; + + if (stristr($sql, 'select') && !stristr($sql, 'delete') && !stristr($sql, 'update')) { + $data['results'] = $this->db->query($sql); + + $this->load->view('search/search_result_ajax', $data); + } + } + + function save_query() { + if(isset($_POST['search'])) { + $query = $this->fetchQueryResult($_POST['search'], true); + + $data = array( + 'userid' => xss_clean($this->session->userdata('user_id')), + 'query' => $query, + 'description' => xss_clean($_POST['description']) + ); + + $this->db->insert('queries', $data); + $last_id = $this->db->insert_id(); + header('Content-Type: application/json'); + echo json_encode(array('id' => $last_id, 'description' => xss_clean($_POST['description']))); + } + } + + function delete_query() { + $id = xss_clean($this->input->post('id')); + $this->load->model('search_filter'); + $this->search_filter->delete_query($id); + } + + function save_edited_query() { + $data = array( + 'description' => xss_clean($this->input->post('description')), + ); + + $this->db->where('id', xss_clean($this->input->post('id'))); + $this->db->where('userid', $this->session->userdata['user_id']); + $this->db->update('queries', $data); + } + + function fetchQueryResult($json, $returnquery) { + + $search_items = json_decode($json, true); + + $search_type = ""; + + foreach($search_items as $key=>$value){ + + + if($value == "AND") { + $search_type = "AND"; + } + if ($value == "OR") { + $search_type = "OR"; + } + + if(is_array($value)) { + foreach($value as $values) + { + + if(isset($values['rules'])) { + if($values['condition'] == "AND") { + $this->db->group_start(); + } else { + $this->db->or_group_start(); + } + foreach($values['rules'] as $group_value) + { + if($group_value['operator'] == "equal") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'], $group_value['value']); + } else { + $this->db->or_where($group_value['field'], $group_value['value']); + } + } + + if($group_value['operator'] == "not_equal") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' !=', $group_value['value']); + } else { + $this->db->or_where($group_value['field'].' !=', $group_value['value']); + } + } + + if($group_value['operator'] == "begins_with") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' like ', $group_value['value']."%"); + } else { + $this->db->or_where($group_value['field'].' like ', $group_value['value']."%"); + } + } + + if($group_value['operator'] == "contains") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' like ', "%".$group_value['value']."%"); + } else { + $this->db->or_where($group_value['field'].' like ', "%".$group_value['value']."%"); + } + } + + if($group_value['operator'] == "ends_with") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' like ', "%".$group_value['value']); + } else { + $this->db->or_where($group_value['field'].' like ', "%".$group_value['value']); + } + } + + if($group_value['operator'] == "is_empty") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'], "''"); + } else { + $this->db->or_where($group_value['field'], "''"); + } + } + + if($group_value['operator'] == "is_not_empty") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' !=', "''"); + } else { + $this->db->or_where($group_value['field'].' !=', "''"); + } + } + + if($group_value['operator'] == "is_null") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' is ', NULL); + } else { + $this->db->or_where($group_value['field'].' is ', NULL); + } + } + + if($group_value['operator'] == "is_not_null") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' is not ', NULL); + } else { + $this->db->or_where($group_value['field'].' is not ', NULL); + } + } + + + if($group_value['operator'] == "less") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' <', $group_value['value']); + } else { + $this->db->or_where($group_value['field'].' <', $group_value['value']); + } + } + + if($group_value['operator'] == "less_or_equal") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' <=', $group_value['value']); + } else { + $this->db->or_where($group_value['field'].' <=', $group_value['value']); + } + } + + if($group_value['operator'] == "greater") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' >', $group_value['value']); + } else { + $this->db->or_where($group_value['field'].' >', $group_value['value']); + } + } + + if($group_value['operator'] == "greater_or_equal") { + if($values['condition'] == "AND") { + $this->db->where($group_value['field'].' >=', $group_value['value']); + } else { + $this->db->or_where($group_value['field'].' >=', $group_value['value']); + } + } + + } + $this->db->group_end(); + } else { + //print_r($values['field']); + if(isset($values['operator'])) { + + } + if($values['operator'] == "equal") { + if($search_type == "AND") { + $this->db->where($values['field'], $values['value']); + } else { + $this->db->or_where($values['field'], $values['value']); + } + } + + if($values['operator'] == "not_equal") { + if($search_type == "AND") { + $this->db->where($values['field'].' !=', $values['value']); + } else { + $this->db->or_where($values['field'].' !=', $values['value']); + } + } + + if($values['operator'] == "begins_with") { + if($search_type == "AND") { + $this->db->where($values['field'].' like ', $values['value']."%"); + } else { + $this->db->or_where($values['field'].' like ', $values['value']."%"); + } + } + + if($values['operator'] == "contains") { + if($search_type == "AND") { + $this->db->where($values['field'].' like ', "%".$values['value']."%"); + } else { + $this->db->or_where($values['field'].' like ', "%".$values['value']."%"); + } + } + + if($values['operator'] == "ends_with") { + if($search_type == "AND") { + $this->db->where($values['field'].' like ', "%".$values['value']); + } else { + $this->db->or_where($values['field'].' like ', "%".$values['value']); + } + } + + if($values['operator'] == "is_empty") { + if($search_type == "AND") { + $this->db->where($values['field'], ""); + } else { + $this->db->or_where($values['field'], ""); + } + } + + if($values['operator'] == "is_not_empty") { + if($search_type == "AND") { + $this->db->where($values['field'].' !=', ""); + } else { + $this->db->or_where($values['field'].' !=', ""); + } + } + + if($values['operator'] == "is_null") { + if($search_type == "AND") { + $this->db->where($values['field'].' is ', NULL); + } else { + $this->db->or_where($values['field'].' is ', NULL); + } + } + + if($values['operator'] == "is_not_null") { + if($search_type == "AND") { + $this->db->where($values['field'].' is not ', NULL); + } else { + $this->db->or_where($values['field'].' is not ', NULL); + } + } + + if($values['operator'] == "less") { + if($search_type == "AND") { + $this->db->where($values['field'].' <', $values['value']); + } else { + $this->db->or_where($values['field'].' <', $values['value']); + } + } + + if($values['operator'] == "less_or_equal") { + if($search_type == "AND") { + $this->db->where($values['field'].' <=', $values['value']); + } else { + $this->db->or_where($values['field'].' <=', $values['value']); + } + } + + if($values['operator'] == "greater") { + if($search_type == "AND") { + $this->db->where($values['field'].' >', $values['value']); + } else { + $this->db->or_where($values['field'].' >', $values['value']); + } + } + + if($values['operator'] == "greater_or_equal") { + if($search_type == "AND") { + $this->db->where($values['field'].' >=', $values['value']); + } else { + $this->db->or_where($values['field'].' >=', $values['value']); + } + } + } + + } + } + } + + $this->db->order_by('COL_TIME_ON', 'DESC'); + $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); + + if ($returnquery) { + $query = $this->db->get_compiled_select($this->config->item('table_name')); + } else { + $query = $this->db->get($this->config->item('table_name')); + } + return $query; + } } diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index 9f7c057b9..3454a7064 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -94,6 +94,7 @@ $lang['gen_hamradio_wwff_reference'] = 'WWFF Reference'; $lang['gen_hamradio_dok'] = 'DOK'; $lang['gen_hamradio_state'] = 'State'; $lang['gen_hamradio_iota'] = 'IOTA'; +$lang['gen_hamradio_sota'] = 'SOTA'; $lang['gen_hamradio_gridsquare'] = 'Gridsquare'; $lang['gen_hamradio_sig'] = 'Sig'; diff --git a/application/language/german/general_words_lang.php b/application/language/german/general_words_lang.php index 09c616625..d48b88cc0 100644 --- a/application/language/german/general_words_lang.php +++ b/application/language/german/general_words_lang.php @@ -14,7 +14,7 @@ $lang['general_word_date'] = 'Datum'; $lang['general_word_time'] = 'Zeit'; $lang['general_word_none'] = 'None'; $lang['general_word_name'] = 'Name'; -$lang['general_word_location'] = 'Stelle'; +$lang['general_word_location'] = 'Standort'; $lang['general_word_comment'] = 'Kommentar'; $lang['general_word_general'] = 'Allgemeines'; $lang['general_word_satellite'] = 'Satellit'; diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 65a26c379..c2d045e44 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -110,6 +110,8 @@ class AdifHelper { $line .= $this->getAdifFieldLine("SRX_STRING", $qso->COL_SRX_STRING); + $line .= $this->getAdifFieldLine("CONTEST_ID", $qso->COL_CONTEST_ID); + $line .= $this->getAdifFieldLine("TX_PWR", $qso->COL_TX_PWR); $line .= $this->getAdifFieldLine("COMMENT", $qso->COL_COMMENT); diff --git a/application/libraries/Hamqth.php b/application/libraries/Hamqth.php index ff10e1e8d..b347b47e4 100644 --- a/application/libraries/Hamqth.php +++ b/application/libraries/Hamqth.php @@ -56,41 +56,44 @@ class Hamqth { public function search($callsign, $key) { + $data = null; + try { + // URL to the XML Source + $xml_feed_url = 'https://www.hamqth.com/xml.php?id=' . $key . '&callsign=' . $callsign . '&prg=cloudlog'; - // URL to the XML Source - $xml_feed_url = 'https://www.hamqth.com/xml.php?id='.$key.'&callsign='.$callsign.'&prg=cloudlog'; + // CURL Functions + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $xml_feed_url); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $xml = curl_exec($ch); + curl_close($ch); - // CURL Functions - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $xml_feed_url); - curl_setopt($ch, CURLOPT_HEADER, false); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $xml = curl_exec($ch); - curl_close($ch); + // Create XML object + $xml = simplexml_load_string($xml); + if (empty($xml)) return; - // Create XML object - $xml = simplexml_load_string($xml); + // Return Required Fields + $data['callsign'] = (string)$xml->search->callsign; + $data['name'] = (string)$xml->search->nick; + $data['gridsquare'] = (string)$xml->search->grid; + $data['city'] = (string)$xml->search->adr_city; + $data['lat'] = (string)$xml->search->latitude; + $data['long'] = (string)$xml->search->longitude; + $data['iota'] = (string)$xml->search->iota; + $data['us_state'] = (string)$xml->search->us_state; + $data['us_county'] = (string)$xml->search->us_county; + $data['error'] = (string)$xml->session->error; - // Return Required Fields - $data['callsign'] = (string) $xml->search->callsign; - $data['name'] = (string) $xml->search->nick; - $data['gridsquare'] = (string) $xml->search->grid; - $data['city'] = (string) $xml->search->adr_city; - $data['lat'] = (string) $xml->search->latitude; - $data['long'] = (string) $xml->search->longitude; - $data['iota'] = (string) $xml->search->iota; - $data['us_state'] = (string) $xml->search->us_state; - $data['us_county'] = (string) $xml->search->us_county; - $data['error'] = (string) $xml->session->error; - - if($xml->search->country == "United States") { - $data['state'] = (string) $xml->search->us_state; - $data['us_county'] = (string) $xml->search->us_county; - } else { - $data['state'] = null; - $data['us_county'] = null; - } - - return $data; + if ($xml->search->country == "United States") { + $data['state'] = (string)$xml->search->us_state; + $data['us_county'] = (string)$xml->search->us_county; + } else { + $data['state'] = null; + $data['us_county'] = null; + } + } finally { + return $data; + } } } diff --git a/application/libraries/Qra.php b/application/libraries/Qra.php index 7398151d9..322b3e1ed 100644 --- a/application/libraries/Qra.php +++ b/application/libraries/Qra.php @@ -23,14 +23,18 @@ class Qra { // calculate the bearing between two squares function bearing($tx, $rx, $unit = 'M') { - if(strlen($tx) <= 6 && strlen($rx) <= 6) { - $my = qra2latlong($tx); - $stn = qra2latlong($rx); - - $bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit); - - return $bearing; + if(strlen($tx) > 6) { + $tx = substr($tx, 0, 6); } + if(strlen($rx) > 6) { + $rx = substr($rx, 0, 6); + } + $my = qra2latlong($tx); + $stn = qra2latlong($rx); + + $bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit); + + return $bearing; } /* @@ -40,6 +44,12 @@ class Qra { * */ function distance($tx, $rx, $unit = 'M') { + if(strlen($tx) > 6) { + $tx = substr($tx, 0, 6); + } + if(strlen($rx) > 6) { + $rx = substr($rx, 0, 6); + } // Calc LatLongs $my = qra2latlong($tx); $stn = qra2latlong($rx); @@ -52,12 +62,9 @@ class Qra { } } - - function distance($lat1, $lon1, $lat2, $lon2, $unit = 'M') { $theta = $lon1 - $lon2; - $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * -cos(deg2rad($theta)); + $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $dist = $dist * 60 * 1.1515; @@ -111,27 +118,28 @@ function get_bearing($lat1, $lon1, $lat2, $lon2) { return (rad2deg(atan2(sin(deg2rad($lon2) - deg2rad($lon1)) * cos(deg2rad($lat2)), cos(deg2rad($lat1)) * sin(deg2rad($lat2)) - sin(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon2) - deg2rad($lon1)))) + 360) % 360; } -function qra2latlong($strQRA) - -{ - if (strlen($strQRA) %2 == 0) { - $strQRA = strtoupper($strQRA); - if (strlen($strQRA) == 4) $strQRA .= "MM"; - if (!preg_match('/^[A-R]{2}[0-9]{2}[A-X]{2}$/',$strQRA)) return false; - list($a,$b,$c,$d,$e,$f) = str_split($strQRA,1); - $a = ord($a) - ord('A'); - $b = ord($b) - ord('A'); - $c = ord($c) - ord('0'); - $d = ord($d) - ord('0'); - $e = ord($e) - ord('A'); - $f = ord($f) - ord('A'); - $nLong = ($a*20) + ($c*2) + (($e+0.5)/12) - 180; - $nLat = ($b*10) + $d + (($f+0.5)/24) - 90; - $arLatLong = array($nLat,$nLong); - return($arLatLong); - } else { - return array(0, 0); +function qra2latlong($strQRA) { + if (strlen($strQRA) %2 == 0) { + $strQRA = strtoupper($strQRA); + if (strlen($strQRA) == 4) $strQRA .= "MM"; + if(strlen($strQRA) > 6) { + $strQRA = substr($strQRA, 0, 6); } + if (!preg_match('/^[A-R]{2}[0-9]{2}[A-X]{2}$/',$strQRA)) return false; + list($a,$b,$c,$d,$e,$f) = str_split($strQRA,1); + $a = ord($a) - ord('A'); + $b = ord($b) - ord('A'); + $c = ord($c) - ord('0'); + $d = ord($d) - ord('0'); + $e = ord($e) - ord('A'); + $f = ord($f) - ord('A'); + $nLong = ($a*20) + ($c*2) + (($e+0.5)/12) - 180; + $nLat = ($b*10) + $d + (($f+0.5)/24) - 90; + $arLatLong = array($nLat,$nLong); + return($arLatLong); + } else { + return array(0, 0); + } } /* End of file Qra.php */ diff --git a/application/libraries/Qrz.php b/application/libraries/Qrz.php index 1359a8c9c..d1a26f30f 100755 --- a/application/libraries/Qrz.php +++ b/application/libraries/Qrz.php @@ -54,42 +54,51 @@ class Qrz { } - public function search($callsign, $key) + public function search($callsign, $key, $use_fullname) { + $data = null; + try { + // URL to the XML Source + $xml_feed_url = 'http://xmldata.qrz.com/xml/current/?s=' . $key . ';callsign=' . $callsign . ''; - // URL to the XML Source - $xml_feed_url = 'http://xmldata.qrz.com/xml/current/?s='.$key.';callsign='.$callsign.''; - - // CURL Functions - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $xml_feed_url); - curl_setopt($ch, CURLOPT_HEADER, false); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $xml = curl_exec($ch); - curl_close($ch); - - // Create XML object - $xml = simplexml_load_string($xml); - - // Return Required Fields - $data['callsign'] = (string) $xml->Callsign->call; - $data['name'] = (string) $xml->Callsign->fname; - $data['gridsquare'] = (string) $xml->Callsign->grid; - $data['city'] = (string) $xml->Callsign->addr2; - $data['lat'] = (string) $xml->Callsign->lat; - $data['long'] = (string) $xml->Callsign->lon; - $data['iota'] = (string) $xml->Callsign->iota; - $data['qslmgr'] = (string) $xml->Callsign->qslmgr; + // CURL Functions + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $xml_feed_url); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $xml = curl_exec($ch); + curl_close($ch); - if($xml->Callsign->country == "United States") { - $data['state'] = (string) $xml->Callsign->state; - $data['us_county'] = (string) $xml->Callsign->county; - } else { - $data['state'] = null; - $data['us_county'] = null; - } + // Create XML object + $xml = simplexml_load_string($xml); + if (empty($xml)) return; - - return $data; + // Return Required Fields + $data['callsign'] = (string)$xml->Callsign->call; + + if ($use_fullname === true) { + $data['name'] = (string)$xml->Callsign->fname. ' ' . (string)$xml->Callsign->name; + } else { + $data['name'] = (string)$xml->Callsign->fname; + } + $data['name'] = trim($data['name']); + $data['gridsquare'] = (string)$xml->Callsign->grid; + $data['city'] = (string)$xml->Callsign->addr2; + $data['lat'] = (string)$xml->Callsign->lat; + $data['long'] = (string)$xml->Callsign->lon; + $data['iota'] = (string)$xml->Callsign->iota; + $data['qslmgr'] = (string)$xml->Callsign->qslmgr; + + if ($xml->Callsign->country == "United States") { + $data['state'] = (string)$xml->Callsign->state; + $data['us_county'] = (string)$xml->Callsign->county; + } else { + $data['state'] = null; + $data['us_county'] = null; + } + } finally { + + return $data; + } } } diff --git a/application/migrations/071_add_queries_table.php b/application/migrations/071_add_queries_table.php new file mode 100644 index 000000000..a1f90889b --- /dev/null +++ b/application/migrations/071_add_queries_table.php @@ -0,0 +1,14 @@ +db->query("create table if not exists queries (id integer not null auto_increment, query text, description text, userid integer not null, primary key (id)) ENGINE=myisam DEFAULT CHARSET=utf8;"); + } + + public function down() + { + $this->db->query(""); + } +} diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php index b43ef50e8..7210dbe41 100644 --- a/application/models/Adif_data.php +++ b/application/models/Adif_data.php @@ -25,7 +25,7 @@ class adif_data extends CI_Model { if ($station_id == NULL) { $this->db->where($this->config->item('table_name').'.station_id', $active_station_id); - } else { + } else if ($station_id != 'All') { $this->db->where($this->config->item('table_name').'.station_id', $station_id); } diff --git a/application/models/Contesting_model.php b/application/models/Contesting_model.php index 1b6d60d8e..a3832258e 100644 --- a/application/models/Contesting_model.php +++ b/application/models/Contesting_model.php @@ -21,7 +21,10 @@ class Contesting_model extends CI_Model { $date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]); $date = $date->format('Y-m-d H:i:s'); - $sql = "SELECT date_format(col_time_on, '%d-%m-%Y %H:%i:%s') as col_time_on, col_call, col_band, col_mode, col_submode, col_rst_sent, col_rst_rcvd, col_srx, col_srx_string, col_stx, col_stx_string FROM " . + $sql = "SELECT date_format(col_time_on, '%d-%m-%Y %H:%i:%s') as col_time_on, col_call, col_band, col_mode, + col_submode, col_rst_sent, col_rst_rcvd, coalesce(col_srx, '') col_srx, coalesce(col_srx_string, '') col_srx_string, + coalesce(col_stx, '') col_stx, coalesce(col_stx_string, '') col_stx_string, coalesce(col_gridsquare, '') col_gridsquare, + coalesce(col_vucc_grids, '') col_vucc_grids FROM " . $this->config->item('table_name') . " WHERE station_id = " . $station_id . " AND COL_TIME_ON >= '" . $date . "'" . diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 660dd3145..798412f49 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -23,18 +23,11 @@ class Logbook_model extends CI_Model { } // Contest exchange, need to separate between serial and other type of exchange - if($this->input->post('exchangeradio')) { - if($this->input->post('exchangeradio') == "serial") { - $srx = $this->input->post('exch_recv'); - $stx = $this->input->post('exch_sent'); - $srx_string = null; - $stx_string = null; - } else { - $srx = null; - $stx = null; - $srx_string = $this->input->post('exch_recv'); - $stx_string = $this->input->post('exch_sent'); - } + if($this->input->post('exchangetype')) { + $srx_string = $this->input->post('exch_recv'); + $stx_string = $this->input->post('exch_sent'); + $srx = $this->input->post('exch_serial_r'); + $stx = $this->input->post('exch_serial_s'); } else { $srx_string = null; $stx_string = null; @@ -162,7 +155,7 @@ class Logbook_model extends CI_Model { 'COL_SIG' => trim($this->input->post('sig')), 'COL_SIG_INFO' => trim($this->input->post('sig_info')), 'COL_DARC_DOK' => trim($this->input->post('darc_dok')), - 'COL_NOTES' => $this->input->post('notes'), + 'COL_NOTES' => $this->input->post('notes'), ); $station_id = $this->input->post('station_profile'); @@ -494,6 +487,12 @@ class Logbook_model extends CI_Model { $srx_string = null; } + if (stristr($this->input->post('usa_county'), ',')) { + $uscounty = $this->input->post('usa_county'); + } else { + $uscounty = $this->input->post('usa_state') .",".$this->input->post('usa_county'); + } + $data = array( 'COL_TIME_ON' => $this->input->post('time_on'), 'COL_TIME_OFF' => $this->input->post('time_off'), @@ -543,7 +542,7 @@ class Logbook_model extends CI_Model { 'station_id' => $this->input->post('station_profile'), 'COL_OPERATOR' => $this->input->post('operator_callsign'), 'COL_STATE' =>$this->input->post('usa_state'), - 'COL_CNTY' =>$this->input->post('usa_state') .",".$this->input->post('usa_county'), + 'COL_CNTY' => $uscounty ); if ($this->exists_qrz_api_key($data['station_id'])) { @@ -802,23 +801,21 @@ class Logbook_model extends CI_Model { COL_SAT_MODE, COL_QSL_RCVD, COL_COMMENT, - (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) AS COL_ROUTING, - ADIF, - ENTITY - FROM '.$this->config->item('table_name').', dxcc_prefixes, station_profile - WHERE - COL_QSL_SENT in (\'R\', \'Q\') - and (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) like CONCAT(dxcc_prefixes.call,\'%\') - and (end is null or end > now()) - and ' . $this->config->item('table_name') . '.station_id = station_profile.station_id'; + (select adif from dxcc_prefixes where (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) like concat(dxcc_prefixes.`call`,\'%\') order by end limit 1) as ADIF, + (select entity from dxcc_prefixes where (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) like concat(dxcc_prefixes.`call`,\'%\') order by end limit 1) as ENTITY, + (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) AS COL_ROUTING + FROM '.$this->config->item('table_name').' thcv + join station_profile on thcv.station_id = station_profile.station_id + WHERE + COL_QSL_SENT in (\'R\', \'Q\')'; if ($station_id2 == NULL) { - $sql .= ' and ' . $this->config->item('table_name') . '.station_id = ' . $station_id; - } else { - $sql .= ' and ' . $this->config->item('table_name') . '.station_id = ' . $station_id2; + $sql .= ' and thcv.station_id = ' . $station_id; + } else if ($station_id2 != 'All') { + $sql .= ' and thcv.station_id = ' . $station_id2; } - $sql .= ' ORDER BY adif, col_routing'; + $sql .= ' ORDER BY ADIF, COL_ROUTING'; $query = $this->db->query($sql); return $query; @@ -1667,7 +1664,7 @@ class Logbook_model extends CI_Model { $entity = $this->get_entity($record['dxcc']); $dxcc = array($record['dxcc'], $entity['name']); } else { - $dxcc = NULL; + $dxcc = $this->check_dxcc_table($record['call'], $time_off); } } else { $dxcc = $this->check_dxcc_table($record['call'], $time_off); @@ -1680,7 +1677,9 @@ class Logbook_model extends CI_Model { if(isset($record['country'])) { $country = $record['country']; } else { - $country = ucwords(strtolower($dxcc[1])); + if (isset($dxcc[1])) { + $country = ucwords(strtolower($dxcc[1])); + } } // RST recevied @@ -2410,6 +2409,54 @@ class Logbook_model extends CI_Model { } } + public function loadCallBook($callsign, $use_fullname=false) + { + $callbook = null; + try { + if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) { + // Lookup using QRZ + $this->load->library('qrz'); + + if (!$this->session->userdata('qrz_session_key')) { + $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $this->session->set_userdata('qrz_session_key', $qrz_session_key); + } + + + + $callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname); + + // if we got nothing, it's probably because our session key is invalid, try again + if (!isset($callbook['callsign'])) + { + $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); + $this->session->set_userdata('qrz_session_key', $qrz_session_key); + $callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname); + } + } + + if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { + // Load the HamQTH library + $this->load->library('hamqth'); + + if (!$this->session->userdata('hamqth_session_key')) { + $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); + } + + $callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); + + // If HamQTH session has expired, start a new session and retry the search. + if ($callbook['error'] == "Session does not exist or expired") { + $hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password')); + $this->session->set_userdata('hamqth_session_key', $hamqth_session_key); + $callbook = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key')); + } + } + } finally { + return $callbook; + } + } public function update_all_station_ids() { @@ -2537,4 +2584,6 @@ function validateADIFDate($date, $format = 'Ymd') $d = DateTime::createFromFormat($format, $date); return $d && $d->format($format) == $date; } + + ?> diff --git a/application/models/Qslprint_model.php b/application/models/Qslprint_model.php index b32ef8b55..23177eb3b 100644 --- a/application/models/Qslprint_model.php +++ b/application/models/Qslprint_model.php @@ -22,7 +22,7 @@ class Qslprint_model extends CI_Model { if ($station_id2 == NULL) { $this->db->where("station_id", $station_id); - } else { + } else if ($station_id2 != 'All') { $this->db->where("station_id", $station_id2); } diff --git a/application/models/Search_filter.php b/application/models/Search_filter.php index c215c780b..d6d4c835d 100644 --- a/application/models/Search_filter.php +++ b/application/models/Search_filter.php @@ -13,6 +13,15 @@ class Search_filter extends CI_Model { return $query; } + function get_stored_queries() { + $this->db->where('userid', $this->session->userdata('user_id')); + return $this->db->get('queries')->result(); + } + + function delete_query($id) { + $this->db->delete('queries', array('id' => xss_clean($id), 'userid' =>$this->session->userdata('user_id'))); + } + } -?> \ No newline at end of file +?> diff --git a/application/models/User_model.php b/application/models/User_model.php index aa68b105a..e1ab3ac12 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -363,7 +363,7 @@ class User_Model extends CI_Model { // FUNCTION: array timezones() // Returns a list of timezones function timezones() { - $r = $this->db->query('SELECT id, name FROM timezones ORDER BY offset'); + $r = $this->db->query('SELECT id, name FROM timezones ORDER BY `offset`'); $ts = array(); foreach ($r->result_array() as $t) { $ts[$t['id']] = $t['name']; diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 7405abdf4..33b97b8e7 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -14,9 +14,6 @@ - @@ -186,40 +183,6 @@ - -
- - -
- -

Warning If a date range is not selected then all QSOs will be marked!

-

From date:

-
-
- -
-
-
-
-
-

To date:

-
-
- -
-
-
-
-
-
- -
-
diff --git a/application/views/contesting/create.php b/application/views/contesting/create.php index 5437fa4d9..4a0bd5ee3 100644 --- a/application/views/contesting/create.php +++ b/application/views/contesting/create.php @@ -19,7 +19,7 @@ -
+
@@ -32,7 +32,7 @@ Name of Contest in ADIF-specification
- +
diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index 2b4820854..2519e03a6 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -8,19 +8,18 @@
- + -
-
- - -
- -
- - -
-
+
+ +
@@ -121,21 +120,40 @@
-
+ + + + +
-
- - -
+ + + +
@@ -180,6 +198,10 @@ lang->line('gen_hamradio_rstr'); ?> lang->line('gen_hamradio_exchange_sent_short'); ?> lang->line('gen_hamradio_exchange_recv_short'); ?> + Serial (R) + Serial (S) + Gridsquare + Vucc Gridsquare @@ -190,3 +212,6 @@
+ diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 0baec27e9..b23c83260 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -48,6 +48,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -60,6 +61,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -72,6 +74,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -84,6 +87,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -126,6 +130,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -138,6 +143,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -150,6 +156,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -162,6 +169,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; diff --git a/application/views/eqsl/import.php b/application/views/eqsl/import.php index 05b0081cb..2a6d86342 100644 --- a/application/views/eqsl/import.php +++ b/application/views/eqsl/import.php @@ -39,7 +39,7 @@ -

Cloudlog will use the eQSL credentials from your Cloudlog user profile to connect to eQSL and download confirmations. Only confirmations received since your last eQSL-confirmed QSO will be downloaded.

+

Cloudlog will use the eQSL credentials from your Cloudlog user profile to connect to eQSL and download confirmations.

diff --git a/application/views/gridsquares/index.php b/application/views/gridsquares/index.php index 9bc61d13a..3b71cf5e2 100644 --- a/application/views/gridsquares/index.php +++ b/application/views/gridsquares/index.php @@ -20,7 +20,7 @@ -
+
uri->segment(2) == "satellites") { ?> diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index bcece9009..1aafb1d74 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -6,6 +6,7 @@ + + @@ -618,7 +852,7 @@ $(document).on('keypress',function(e) { -uri->segment(1) == "qso" && $_GET['manual'] == 0) || $this->uri->segment(1) == "contesting") { ?> +uri->segment(1) == "qso" && $_GET['manual'] == 0) || ($this->uri->segment(1) == "contesting" && $this->uri->segment(2) != "add")) { ?> - -uri->segment(1) == "qso" && $_GET['manual'] == 0) || $this->uri->segment(1) == "contesting") { ?> + @@ -1009,10 +1239,8 @@ $(document).ready(function(){ ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } @@ -1077,10 +1305,8 @@ $(document).ready(function(){ ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } @@ -1114,10 +1340,8 @@ $(document).ready(function(){ ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } @@ -1150,10 +1374,8 @@ $(document).ready(function(){ ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } @@ -1213,7 +1435,7 @@ $(document).ready(function(){ }, success: function(data) { if (data.message == 'OK') { - $("#qso_" + id).find("td:eq(8)").find("span:eq(0)").attr('class', 'qsl-red'); // Paints arrow green + $("#qso_" + id).find("td:eq(8)").find("span:eq(0)").attr('class', 'qsl-grey'); // Paints arrow grey } else { $(".bootstrap-dialog-message").append('
×You are not allowed to update QSL status!
'); @@ -1266,27 +1488,27 @@ $(document).ready(function(){ nl2br: false, message: html, onshown: function(dialog) { - var state = $("#input_usa_state option:selected").text(); + var state = $("#input_usa_state_edit option:selected").text(); if (state != "") { - $("#stationCntyInput").prop('disabled', false); + $("#stationCntyInputEdit").prop('disabled', false); selectize_usa_county(); } - $('#input_usa_state').change(function(){ - var state = $("#input_usa_state option:selected").text(); + $('#input_usa_state_edit').change(function(){ + var state = $("#input_usa_state_edit option:selected").text(); if (state != "") { - $("#stationCntyInput").prop('disabled', false); + $("#stationCntyInputEdit").prop('disabled', false); selectize_usa_county(); } else { - $("#stationCntyInput").prop('disabled', true); + $("#stationCntyInputEdit").prop('disabled', true); //$('#stationCntyInput')[0].selectize.destroy(); - $("#stationCntyInput").val(""); + $("#stationCntyInputEdit").val(""); } }); - $('#sota_ref').selectize({ + $('#sota_ref_edit').selectize({ maxItems: 1, closeAfterSelect: true, loadThrottle: 250, @@ -1314,7 +1536,7 @@ $(document).ready(function(){ } }); - $('#darc_dok').selectize({ + $('#darc_dok_edit').selectize({ maxItems: 1, closeAfterSelect: true, loadThrottle: 250, @@ -1322,7 +1544,7 @@ $(document).ready(function(){ labelField: 'name', searchField: 'name', options: [], - create: false, + create: true, load: function(query, callback) { if (!query) return callback(); // Only trigger if 3 or more characters are entered $.ajax({ @@ -1349,7 +1571,7 @@ $(document).ready(function(){ function selectize_usa_county() { var baseURL= ""; - $('#stationCntyInput').selectize({ + $('#stationCntyInputEdit').selectize({ delimiter: ';', maxItems: 1, closeAfterSelect: true, @@ -1360,7 +1582,7 @@ $(document).ready(function(){ options: [], create: false, load: function(query, callback) { - var state = $("#input_usa_state option:selected").text(); + var state = $("#input_usa_state_edit option:selected").text(); if (!query || state == "") return callback(); $.ajax({ @@ -1420,10 +1642,8 @@ $(document).ready(function(){ ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } @@ -1753,139 +1973,8 @@ function deleteQsl(id) { }); } -uri->segment(1) == "contesting") { ?> +uri->segment(1) == "contesting" && $this->uri->segment(2) != "add" ) { ?> - - uri->segment(1) == "station") { ?> @@ -1961,10 +2050,9 @@ function deleteQsl(id) { 'csv' ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } @@ -2010,13 +2098,10 @@ function deleteQsl(id) { ] }); - // using this to change color of csv-button if dark mode is chosen - var background = $('body').css( "background-color"); - - if (background != ('rgb(255, 255, 255)')) { + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { $(".buttons-csv").css("color", "white"); } - diff --git a/application/views/lotw/import.php b/application/views/lotw/import.php index ceda94e46..7efd04068 100644 --- a/application/views/lotw/import.php +++ b/application/views/lotw/import.php @@ -41,7 +41,7 @@

-
+
diff --git a/application/views/adif/mark_qrz.php b/application/views/qrz/mark_qrz.php similarity index 100% rename from application/views/adif/mark_qrz.php rename to application/views/qrz/mark_qrz.php diff --git a/application/views/qslcard/searchresult.php b/application/views/qslcard/searchresult.php index 0523f8e63..20f2e8f1e 100644 --- a/application/views/qslcard/searchresult.php +++ b/application/views/qslcard/searchresult.php @@ -14,6 +14,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -26,6 +27,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -38,6 +40,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -50,6 +53,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -62,6 +66,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -95,6 +100,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -106,6 +112,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -118,6 +125,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -129,6 +137,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -140,6 +149,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; diff --git a/application/views/qslprint/index.php b/application/views/qslprint/index.php index dbbc9a98a..b8250c579 100644 --- a/application/views/qslprint/index.php +++ b/application/views/qslprint/index.php @@ -40,6 +40,7 @@ '. $this->lang->line('general_word_time') .' ' . $this->lang->line('gen_hamradio_mode') . ' ' . $this->lang->line('gen_hamradio_band') . ' + ' . $this->lang->line('gen_hamradio_qsl') . ' ' . $this->lang->line('general_word_qslcard_via') . ' ' . $this->lang->line('gen_hamradio_station') . ' @@ -62,6 +63,7 @@ echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; echo ''; + echo '' . $qsl->COL_QSL_VIA . ''; echo '' . $qsl->station_callsign . ''; echo ''; echo ''; diff --git a/application/views/qslprint/qslprint.php b/application/views/qslprint/qslprint.php index 7c34a9427..8c7a4bcf8 100644 --- a/application/views/qslprint/qslprint.php +++ b/application/views/qslprint/qslprint.php @@ -8,6 +8,7 @@ if ($qsos->result() != NULL) { '. $this->lang->line('general_word_time') .' ' . $this->lang->line('gen_hamradio_mode') . ' ' . $this->lang->line('gen_hamradio_band') . ' + ' . $this->lang->line('gen_hamradio_qsl') . ' ' . $this->lang->line('general_word_qslcard_via') . ' ' . $this->lang->line('gen_hamradio_station') . ' @@ -30,6 +31,7 @@ if ($qsos->result() != NULL) { echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; echo ''; + echo '' . $qsl->COL_QSL_VIA . ''; echo '' . $qsl->station_callsign . ''; echo ''; echo ''; diff --git a/application/views/qslprint/qsolist.php b/application/views/qslprint/qsolist.php index bbf28c238..8e8db6756 100644 --- a/application/views/qslprint/qsolist.php +++ b/application/views/qslprint/qsolist.php @@ -9,7 +9,14 @@ if ($qsos->result() != NULL) { ' . $this->lang->line('gen_hamradio_mode') . ' ' . $this->lang->line('gen_hamradio_band') . ' ' . $this->lang->line('gen_hamradio_station') . ' - + QSL'; + if($this->session->userdata('user_lotw_name') != "") { + echo 'LoTW'; + } + if ($this->session->userdata('user_eqsl_name') != "") { + echo 'eQSL'; + } + echo ' '; @@ -30,6 +37,39 @@ if ($qsos->result() != NULL) { echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; echo ''; echo '' . $qsl->station_callsign . ''; + echo ' + + '; + if($this->session->userdata('user_lotw_name') != "") { + echo ''; + if ($qsl->COL_LOTW_QSL_SENT != ''){ + echo ' + '; + } + echo ''; + } + if ($this->session->userdata('user_eqsl_name') != ""){ + echo ' + + + '; + } echo ''; echo ''; } diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index 4a977ce89..e474504be 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -42,6 +42,7 @@ Notes QSL Station + Contest @@ -191,19 +192,8 @@ - COL_STX_STRING) { ?> -
- - -
- - COL_SRX_STRING) { ?> -
- - -
- +
@@ -315,7 +305,7 @@
- @@ -373,7 +363,7 @@
- +
@@ -396,7 +386,7 @@
- +
@@ -411,7 +401,7 @@
- +
@@ -578,8 +568,50 @@
+ + diff --git a/application/views/search/filter.php b/application/views/search/filter.php index 13ec43885..9b654175a 100644 --- a/application/views/search/filter.php +++ b/application/views/search/filter.php @@ -24,17 +24,41 @@
-
+
- +

- + - +

+

+ - Info You can find out how to use the search filter functions in the wiki. + +

+ + +
+ +
+ +
+ +
+ + + +
Info You can find out how to use the search filter functions in the wiki.

@@ -45,24 +69,9 @@
- Search Results + Search Results:
-
- -
- - - - - - - - - - - -
Date/TimeCallModeSentRecv'dBandCountry
-
+
diff --git a/application/views/search/search_result_ajax.php b/application/views/search/search_result_ajax.php new file mode 100644 index 000000000..1d20cc774 --- /dev/null +++ b/application/views/search/search_result_ajax.php @@ -0,0 +1,282 @@ +
+ + + + + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?> + + + +'; + switch($this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')) { + case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break; + case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break; + case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; + case 'Country': echo $this->lang->line('general_word_country'); break; + case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; + case 'State': echo $this->lang->line('gen_hamradio_state'); break; + case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; + case 'Band': echo $this->lang->line('gen_hamradio_band'); break; + } + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> + + session->userdata('user_eqsl_name') != "") { ?> + + + session->userdata('user_lotw_name') != "") { ?> + + + + + config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> + + + + + + result() as $row) { ?> + + session->userdata('user_date_format')) { + // If Logged in and session exists + $custom_date_format = $this->session->userdata('user_date_format'); + } else { + // Get Default date format from /config/cloudlog.php + $custom_date_format = $this->config->item('qso_date_format'); + } + ?> + COL_PRIMARY_KEY .'">'; ?> + + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?> + + + + session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')) { + case 'Mode': echo ''; + switch($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')) { + case 'Mode': echo ''; + + switch($this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')) { + case 'Mode': echo ''; + switch($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')) { + case 'Mode': echo ''; + switch($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')) { + case 'Mode': echo ''; + if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> + + + session->userdata('user_eqsl_name') != ""){ ?> + + + + session->userdata('user_lotw_name') != "") { ?> + + + + + + station_callsign)) { ?> + + + + config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> + + + + + +
lang->line('general_word_date'); ?>lang->line('general_word_time'); ?>lang->line('gen_hamradio_call'); ?>'; + switch($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')) { + case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break; + case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break; + case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; + case 'Country': echo $this->lang->line('general_word_country'); break; + case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'State': echo $this->lang->line('gen_hamradio_state'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; + case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; + case 'Band': echo $this->lang->line('gen_hamradio_band'); break; + } + echo ''; + switch($this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')) { + case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break; + case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break; + case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; + case 'Country': echo $this->lang->line('general_word_country'); break; + case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; + case 'State': echo $this->lang->line('gen_hamradio_state'); break; + case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; + case 'Band': echo $this->lang->line('gen_hamradio_band'); break; + } + echo ''; + switch($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')) { + case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break; + case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break; + case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; + case 'Country': echo $this->lang->line('general_word_country'); break; + case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; + case 'State': echo $this->lang->line('gen_hamradio_state'); break; + case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; + case 'Band': echo $this->lang->line('gen_hamradio_band'); break; + } + echo ''; + switch($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')) { + case 'Mode': echo $this->lang->line('gen_hamradio_mode'); break; + case 'RSTS': echo $this->lang->line('gen_hamradio_rsts'); break; + case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; + case 'Country': echo $this->lang->line('general_word_country'); break; + case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; + case 'State': echo $this->lang->line('gen_hamradio_state'); break; + case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; + case 'Band': echo $this->lang->line('gen_hamradio_band'); break; + } + echo 'QSLeQSLLoTWlang->line('gen_hamradio_station'); ?>
COL_TIME_ON); echo date($custom_date_format, $timestamp); ?>COL_TIME_ON); echo date('H:i', $timestamp); ?> + COL_CALL)); ?> + '; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; break; + case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '' . $row->COL_STX . '';}if ($row->COL_STX_STRING) { echo '' . $row->COL_STX_STRING . '';}; break; + case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; + case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; + case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; + case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; + case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; + case 'State': echo '' . ($row->COL_STATE); break; + } + echo ''; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; break; + case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '' . $row->COL_STX . '';}if ($row->COL_STX_STRING) { echo '' . $row->COL_STX_STRING . '';}; break; + case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; + case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; + case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; + case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; + case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; + case 'State': echo '' . ($row->COL_STATE); break; + } + echo ''; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; break; + case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '' . $row->COL_STX . '';}if ($row->COL_STX_STRING) { echo '' . $row->COL_STX_STRING . '';}; break; + case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; + case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; + case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; + case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; + case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; + case 'State': echo '' . ($row->COL_STATE); break; + } + echo ''; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; break; + case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '' . $row->COL_STX . '';}if ($row->COL_STX_STRING) { echo '' . $row->COL_STX_STRING . '';}; break; + case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; + case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; + case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; + case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; + case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; + case 'State': echo '' . ($row->COL_STATE); break; + } + echo ''; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; break; + case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo '' . $row->COL_STX . '';}if ($row->COL_STX_STRING) { echo '' . $row->COL_STX_STRING . '';}; break; + case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; + case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; + case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; + case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; + case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; + case 'State': echo '' . ($row->COL_STATE); break; + } + echo ' + ">▲ + ">▼ + + + + COL_EQSL_QSL_RCVD =='Y') { ?> + COL_PRIMARY_KEY); ?>" data-fancybox="images" data-width="528" data-height="336">▼ + + ▼ + + + + COL_LOTW_QSL_SENT != ''){ ?> + + + + + station_callsign; ?> + +
+ +
diff --git a/application/views/search/stored_queries.php b/application/views/search/stored_queries.php new file mode 100644 index 000000000..5f1e94948 --- /dev/null +++ b/application/views/search/stored_queries.php @@ -0,0 +1,27 @@ + + + + + + + + + + + + + id . '">'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> + +
#DescriptionQuery
' . $i++ . '' . $q->description . '' . $q->query . 'Edit'; + echo 'Delete
\ No newline at end of file diff --git a/application/views/statistics/index.php b/application/views/statistics/index.php index a1a79a949..f3017d5dd 100644 --- a/application/views/statistics/index.php +++ b/application/views/statistics/index.php @@ -1,131 +1,208 @@ - - + - + + } +
+

+ + Explore the logbook. +

-

- - Explore the logbook. -

+
+ -
- - - -
-
-
-
-
-
- -
-
-
- -
- +
+
+
+
+
+
+
+
+
+
diff --git a/application/views/user/add.php b/application/views/user/add.php index f6b9f09b5..0ab0d0c2a 100644 --- a/application/views/user/add.php +++ b/application/views/user/add.php @@ -149,6 +149,7 @@ + @@ -163,6 +164,7 @@ + @@ -177,6 +179,7 @@ + @@ -191,6 +194,7 @@ + @@ -205,6 +209,7 @@ + diff --git a/application/views/user/edit.php b/application/views/user/edit.php index 20f7c3794..39e51ba0f 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -335,6 +335,7 @@ + @@ -349,6 +350,7 @@ + @@ -363,6 +365,7 @@ + @@ -377,6 +380,7 @@ + @@ -390,6 +394,7 @@ + diff --git a/application/views/user/login.php b/application/views/user/login.php index 22ba87758..286d4dc36 100644 --- a/application/views/user/login.php +++ b/application/views/user/login.php @@ -1,24 +1,21 @@ -
+

Log in

load->view('layout/messages'); ?>
- - - - - - - - - - - -
Username
Password
- -
- + +
+ + +
+
+ + +
+
+ +
diff --git a/application/views/user/main.php b/application/views/user/main.php index 11de1b3f1..da1bd291a 100644 --- a/application/views/user/main.php +++ b/application/views/user/main.php @@ -37,7 +37,14 @@ user_id; ?>">user_name; ?> user_email; ?> config->item('auth_level'); echo $l[$row->user_type]; ?> - user_id; ?>" class="btn btn-outline-primary btn-sm"> Edit user_id; ?>" class="btn btn-danger btn-sm"> Delete + + user_id; ?>" class="btn btn-outline-primary btn-sm"> Edit + user_id) { + echo "user_id . " class=\"btn btn-danger btn-sm\"> Delete"; + } + ?> + @@ -50,4 +57,4 @@
-
\ No newline at end of file +
diff --git a/application/views/view_log/partial/log.php b/application/views/view_log/partial/log.php index 5940f84d5..86c16cb20 100644 --- a/application/views/view_log/partial/log.php +++ b/application/views/view_log/partial/log.php @@ -97,7 +97,7 @@ COL_EQSL_QSL_RCVD =='Y') { ?> - COL_PRIMARY_KEY."/".$row->COL_CALL."/".$row->COL_MODE."/".$row->COL_BAND."/".date('H', $timestamp)."/".date('i', $timestamp)."/".date('d', $timestamp)."/".date('m', $timestamp)."/".date('Y', $timestamp)); ?>" data-fancybox="images" data-width="528" data-height="336">▼ + COL_PRIMARY_KEY); ?>" data-fancybox="images" data-width="528" data-height="336">▼ diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index ec122355b..f71426749 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -14,6 +14,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -27,6 +28,7 @@ case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; } @@ -38,6 +40,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -50,6 +53,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -62,6 +66,7 @@ case 'RSTR': echo $this->lang->line('gen_hamradio_rstr'); break; case 'Country': echo $this->lang->line('general_word_country'); break; case 'IOTA': echo $this->lang->line('gen_hamradio_iota'); break; + case 'SOTA': echo $this->lang->line('gen_hamradio_sota'); break; case 'State': echo $this->lang->line('gen_hamradio_state'); break; case 'Grid': echo $this->lang->line('gen_hamradio_gridsquare'); break; case 'Band': echo $this->lang->line('gen_hamradio_band'); break; @@ -110,6 +115,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -121,6 +127,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -133,6 +140,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -144,6 +152,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -155,6 +164,7 @@ case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo '' . $row->COL_SRX . '';}if ($row->COL_SRX_STRING) { echo '' . $row->COL_SRX_STRING . '';}; break; case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; case 'IOTA': echo '' . ($row->COL_IOTA); break; + case 'SOTA': echo '' . ($row->COL_SOTA_REF); break; case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); }; break; case 'State': echo '' . ($row->COL_STATE); break; @@ -205,7 +215,7 @@ COL_EQSL_QSL_RCVD =='Y') { ?> - COL_PRIMARY_KEY."/".$row->COL_CALL."/".$row->COL_MODE."/".$row->COL_BAND."/".date('H', $timestamp)."/".date('i', $timestamp)."/".date('d', $timestamp)."/".date('m', $timestamp)."/".date('Y', $timestamp)); ?>" data-fancybox="images" data-width="528" data-height="336">▼ + COL_PRIMARY_KEY); ?>" data-fancybox="images" data-width="528" data-height="336">▼ diff --git a/assets/css/general.css b/assets/css/general.css index 40fd43be3..f5f2854ac 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -244,7 +244,6 @@ color: #ffffff; } } - /* * Timepicker alignment */ diff --git a/assets/css/superhero/overrides.css b/assets/css/superhero/overrides.css index 511862b1c..33a991cb6 100644 --- a/assets/css/superhero/overrides.css +++ b/assets/css/superhero/overrides.css @@ -7,8 +7,9 @@ */ .leaflet-tile { - filter: brightness(0.7) grayscale(0.6) !important; + filter: invert() hue-rotate(180deg) sepia(100%) hue-rotate(180deg) !important; } + path.grid-rectangle { stroke: rgba(200, 200, 200, 0.5); } @@ -19,8 +20,8 @@ span.grid-text>font { } path.grid-confirmed { - fill: rgba(144, 238, 144, 0.3) !important; - stroke: rgba(144, 238, 144, 0.3) !important; + fill: rgba(144, 238, 144, 0.4) !important; + stroke: rgba(144, 238, 144, 0.4) !important; } path.grid-worked { diff --git a/assets/js/darkmodehelpers.js b/assets/js/darkmodehelpers.js new file mode 100644 index 000000000..2afe889a3 --- /dev/null +++ b/assets/js/darkmodehelpers.js @@ -0,0 +1,41 @@ +// use closure to cache result (color is only read once) +function _getBodyBackground() { + var result = null; + function inner() { + if (result === null) { + result = $('body').css( "background-color"); + } + return result; + } + return inner; +} +getBodyBackground = _getBodyBackground(); + +// use closure to cache result (check it once is enough) +function _isDarkModeTheme() { + var result = null; + function inner() { + if (result === null) { + // TODO use better solution as soon as the themes know if they are dark or not + // check if background color is white + result = false; + var background = getBodyBackground(); + if (background != ('rgb(255, 255, 255)')) { + result = true; + } + } + return result; + } + return inner; +} +isDarkModeTheme = _isDarkModeTheme(); + +function ifDarkModeThemeReturn(darkModeValue, notDarkModeValue) { + if (isDarkModeTheme()) { + return darkModeValue; + } + if (!notDarkModeValue) { + return null; + } + return notDarkModeValue; +} diff --git a/assets/js/leaflet/L.MaidenheadColoured.js b/assets/js/leaflet/L.MaidenheadColoured.js index a12e490be..063347001 100644 --- a/assets/js/leaflet/L.MaidenheadColoured.js +++ b/assets/js/leaflet/L.MaidenheadColoured.js @@ -4,7 +4,7 @@ L.Maidenhead = L.LayerGroup.extend({ - + options: { // Line and label color color: 'rgba(255, 0, 0, 0.4)', @@ -28,7 +28,7 @@ L.Maidenhead = L.LayerGroup.extend({ this.eachLayer(map.addLayer, map); }, - + onRemove: function (map) { // remove layer listeners and elements map.off('viewreset '+ this.options.redraw, this.map); @@ -36,8 +36,8 @@ L.Maidenhead = L.LayerGroup.extend({ }, redraw: function () { - var d3 = new Array(20,10,10,10,10,10,1 ,1 ,1 ,1 ,1/24,1/24,1/24,1/24,1/24,1/240,1/240,1/240,1/240,1/240/24,1/240/24 ); - var lat_cor = new Array(0 ,8 ,8 ,8 ,10,14,6 ,8 ,8 ,8 ,1.4 ,2.5 ,3 ,3.5 ,4 ,4 ,3.5 ,3.5 ,3 ,1.8 ,1.6 ); + var d3 = new Array(20, 10, 10, 1, 1, 1, 1, 1, 1, 1, 1 / 24, 1 / 24, 1 / 24, 1 / 24, 1 / 24, 1 / 240, 1 / 240, 1 / 240, 1 / 240, 1 / 240 / 24, 1 / 240 / 24); + var lat_cor = new Array(0, 8, 8, 8, 8, 1.7, 6, 8, 8, 8, 1.4, 2.5, 3, 3.5, 4, 4, 3.5, 3.5, 3, 1.8, 1.6); var bounds = map.getBounds(); var zoom = map.getZoom(); var unit = d3[zoom]; @@ -54,10 +54,11 @@ L.Maidenhead = L.LayerGroup.extend({ var top = Math.ceil(n/unit)*unit; var bottom = Math.floor(s/unit)*unit; this.eachLayer(this.removeLayer, this); + for (var lon = left; lon < right; lon += (unit*2)) { for (var lat = bottom; lat < top; lat += unit) { var bounds = [[lat,lon],[lat+unit,lon+(unit*2)]]; - + if(grid_two.includes(this._getLocator(lon,lat)) || grid_four.includes(this._getLocator(lon,lat)) || grid_six.includes(this._getLocator(lon,lat))) { if(grid_two_confirmed.includes(this._getLocator(lon,lat)) || grid_four_confirmed.includes(this._getLocator(lon,lat)) || grid_six_confirmed.includes(this._getLocator(lon,lat))) { @@ -65,19 +66,51 @@ L.Maidenhead = L.LayerGroup.extend({ } else { this.addLayer(L.rectangle(bounds, {className: 'grid-rectangle grid-worked', color: this.options.color, weight: 1, fillOpacity: 1, fill:true, interactive: false})); } + if (zoom < 2 || zoom > 4) { + this.addLayer(this._getLabel(lon+unit-(unit/lcor),lat+(unit/2)+(unit/lcor*c))); + } + if (zoom < 3 ) { + this.addLayer(L.rectangle(bounds, {className: 'grid-rectangle', color: this.options.color, weight: 1, fill:false, interactive: false})); + } } else { - this.addLayer(L.rectangle(bounds, {className: 'grid-rectangle', color: this.options.color, weight: 1, fill:false, interactive: false})); + if (zoom < 3 || zoom > 5) { + this.addLayer(L.rectangle(bounds, {className: 'grid-rectangle', color: this.options.color, weight: 1, fill:false, interactive: false})); + } } //var pont = map.latLngToLayerPoint([lat,lon]); //console.log(pont.x); - this.addLayer(this._getLabel(lon+unit-(unit/lcor),lat+(unit/2)+(unit/lcor*c))); + if (zoom < 3 || zoom > 5) { + this.addLayer(this._getLabel(lon+unit-(unit/lcor),lat+(unit/2)+(unit/lcor*c))); + } + } + } + // Added this to print fields and field name, while still showing worked/confirmed gridsquares + if (zoom < 5 && zoom > 2) { + unit = 10; + var left = Math.floor(w / (unit * 2)) * (unit * 2); + var right = Math.ceil(e / (unit * 2)) * (unit * 2); + var top = Math.ceil(n / unit) * unit; + var bottom = Math.floor(s / unit) * unit; + for (var lon = left; lon < right; lon += (unit * 2)) { + for (var lat = bottom; lat < top; lat += unit) { + var bounds = [[lat, lon], [lat + unit, lon + (unit * 2)]]; + + this.addLayer(L.rectangle(bounds, { + className: 'grid-rectangle', + color: this.options.color, + weight: 1, + fill: false, + interactive: false + })); + this.addLayer(this._getLabel2(lon + unit - (unit / lcor), lat + (unit / 2) + (unit / lcor * c))); + } } } return this; }, - + _getLabel: function(lon,lat) { - var title_size = new Array(0 ,10,12,16,20,26,15,16,24,36,12 ,14 ,20 ,36 ,60 ,12 ,20 ,36 ,60 ,12 ,24 ); + var title_size = new Array(0, 10, 14, 16, 6, 13, 14, 16, 24, 36, 12, 14, 20, 36, 60, 12, 20, 36, 60, 12, 24); var zoom = map.getZoom(); var size = title_size[zoom]+'px'; var title = '' + this._getLocator(lon,lat) + ''; @@ -85,12 +118,12 @@ L.Maidenhead = L.LayerGroup.extend({ var marker = L.marker([lat,lon], {icon: myIcon}, clickable=false); return marker; }, - + _getLocator: function(lon,lat) { var ydiv_arr=new Array(10, 1, 1/24, 1/240, 1/240/24); var d1 = "ABCDEFGHIJKLMNOPQR".split(""); var d2 = "ABCDEFGHIJKLMNOPQRSTUVWX".split(""); - var d4 = new Array(0 ,1 ,1 ,1 ,1 ,1 ,2 ,2 ,2 ,2 ,3 ,3 ,3 ,3 ,3 ,4 ,4 ,4 ,4 ,5 ,5 ); + var d4 = new Array(0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5); var locator = ""; var x = lon; var y = lat; @@ -107,15 +140,56 @@ L.Maidenhead = L.LayerGroup.extend({ if ((i%2)==0) { locator += Math.floor(rlon/(ydiv_arr[i+1]*2)) +""+ Math.floor(rlat/(ydiv_arr[i+1])); } else { - locator += d2[Math.floor(rlon/(ydiv_arr[i+1]*2))] +""+ d2[Math.floor(rlat/(ydiv_arr[i+1]))]; + locator += d2[Math.floor(rlon/(ydiv_arr[i+1]*2))] +""+ d2[Math.floor(rlat/(ydiv_arr[i+1]))]; } } - } + } return locator; }, - - + /* + Need this for the field printing, while showing worked/confirmed grids + */ + _getLabel2: function(lon,lat) { + var title_size = new Array(0, 10, 12, 16, 20, 26, 26, 16, 24, 36, 12, 14, 20, 36, 60, 12, 20, 36, 60, 12, 24); + var zoom = map.getZoom(); + var size = title_size[zoom]+'px'; + var title = '' + this._getLocator2(lon,lat) + ''; + var myIcon = L.divIcon({className: 'my-div-icon', html: title}); + var marker = L.marker([lat,lon], {icon: myIcon}, clickable=false); + return marker; + }, + + /* + Need this for the field printing, while showing worked/confirmed grids + */ + _getLocator2: function(lon,lat) { + var ydiv_arr=new Array(10, 1, 1/24, 1/240, 1/240/24); + var d1 = "ABCDEFGHIJKLMNOPQR".split(""); + var d2 = "ABCDEFGHIJKLMNOPQRSTUVWX".split(""); + var d4 = new Array(0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5); + var locator = ""; + var x = lon; + var y = lat; + var precision = d4[map.getZoom()]; + while (x < -180) {x += 360;} + while (x > 180) {x -=360;} + x = x + 180; + y = y + 90; + locator = locator + d1[Math.floor(x/20)] + d1[Math.floor(y/10)]; + for (var i=0; i<4; i=i+1) { + if (precision > i+1) { + rlon = x%(ydiv_arr[i]*2); + rlat = y%(ydiv_arr[i]); + if ((i%2)==0) { + locator += Math.floor(rlon/(ydiv_arr[i+1]*2)) +""+ Math.floor(rlat/(ydiv_arr[i+1])); + } else { + locator += d2[Math.floor(rlon/(ydiv_arr[i+1]*2))] +""+ d2[Math.floor(rlat/(ydiv_arr[i+1]))]; + } + } + } + return locator; + }, }); diff --git a/assets/js/sections/accumulatedstatistics.js b/assets/js/sections/accumulatedstatistics.js index 0de4e902d..349a471a2 100644 --- a/assets/js/sections/accumulatedstatistics.js +++ b/assets/js/sections/accumulatedstatistics.js @@ -3,11 +3,7 @@ function accumulatePlot(form) { $(".ld-ext-right").prop('disabled', true); // using this to change color of legend and label according to background color - var background = $('body').css( "background-color"); - var color = 'grey'; - if (background != ('rgb(255, 255, 255)')) { - color = 'white'; - } + var color = ifDarkModeThemeReturn('white', 'grey'); var award = form.awardradio.value; var mode = form.mode.value; @@ -99,9 +95,9 @@ function accumulatePlot(form) { }, legend: { labels: { - fontColor: color, + fontColor: color } - }, + } } }); $(".ld-ext-right").removeClass('running'); diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index cf1b60905..68c7d5593 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -2,19 +2,11 @@ $("#callsign").focus(); // Init serial sent as 1 when loading page -$("#exch_sent").val(1); +$("#exch_serial_s").val(1); $( document ).ready(function() { restoreContestSession(); setRst($("#mode").val()); - - // Check to see what serial type is selected and set validation - if($('#serial').is(':checked')) { - set_serial_number_input_validation(); - } - if($('#other').is(':checked')) { - set_other_input_validation(); - } }); // This erases the contest logging session which is stored in localStorage @@ -23,18 +15,29 @@ function reset_contest_session() { $('.callsign-suggestions').text(""); $('#callsign').val(""); $('#comment').val(""); - $('#exch_sent').val("1"); + + $("#exch_serial_s").val("1"); + $("#exch_serial_r").val(""); + $('#exch_sent').val(""); $('#exch_recv').val(""); + $("#exch_gridsquare_r").val(""); + $("#exch_gridsquare_s").val(""); + $("#callsign").focus(); setRst($("#mode").val()); - $("#serial").prop("checked", true); + $("#exchangetype").val("None"); $("#contestname").val("Other").change(); $(".contest_qso_table_contents").empty(); localStorage.removeItem("contestid"); localStorage.removeItem("exchangetype"); - localStorage.removeItem("exchangesent"); localStorage.removeItem("qso"); + localStorage.removeItem("exchangereceived"); + localStorage.removeItem("exchangesent"); + localStorage.removeItem("serialreceived"); + localStorage.removeItem("serialsent"); + localStorage.removeItem("gridsquarereceived"); + localStorage.removeItem("gridsquaresent"); } // Storing the contestid in contest session @@ -43,11 +46,10 @@ $('#contestname').change(function() { }); // Storing the exchange type in contest session -$('input[type=radio][name=exchangeradio]').change(function() { - localStorage.setItem("exchangetype", $('input[name=exchangeradio]:checked', '#qso_input').val()); +$('#exchangetype').change(function() { + localStorage.setItem("exchangetype", $('#exchangetype').val()); }); - // realtime clock $(function($) { var options = { @@ -83,7 +85,7 @@ $(function() { }); }); -// Here we capture keystrokes fo execute functions +// Here we capture keystrokes to execute functions document.onkeyup = function(e) { // ALT-W wipe if (e.altKey && e.which == 87) { @@ -96,15 +98,61 @@ document.onkeyup = function(e) { logQso(); } else if (e.which == 27) { reset_log_fields(); - // Space to jump to either callsign or sent exchange + // Space to jump to either callsign or the various exchanges } else if (e.which == 32) { - if ($(document.activeElement).attr("id") == "callsign") { - $("#exch_recv").focus(); - return false; - } else if ($(document.activeElement).attr("id") == "exch_recv") { - $("#callsign").focus(); - return false; - } + var exchangetype = $("#exchangetype").val(); + if (exchangetype == 'Exchange') { + if ($(document.activeElement).attr("id") == "callsign") { + $("#exch_recv").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_recv") { + $("#callsign").focus(); + return false; + } + } + else if (exchangetype == 'Serial') { + if ($(document.activeElement).attr("id") == "callsign") { + $("#exch_serial_r").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_serial_r") { + $("#callsign").focus(); + return false; + } + } + else if (exchangetype == 'Serialexchange') { + if ($(document.activeElement).attr("id") == "callsign") { + $("#exch_serial_r").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_serial_r") { + $("#exch_recv").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_recv") { + $("#callsign").focus(); + return false; + } + } + else if (exchangetype == 'Serialgridsquare') { + if ($(document.activeElement).attr("id") == "callsign") { + $("#exch_serial_r").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_serial_r") { + $("#exch_gridsquare_r").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_gridsquare_r") { + $("#callsign").focus(); + return false; + } + } + else if (exchangetype == 'Gridsquare') { + if ($(document.activeElement).attr("id") == "callsign") { + $("#exch_gridsquare_r").focus(); + return false; + } else if ($(document.activeElement).attr("id") == "exch_gridsquare_r") { + $("#callsign").focus(); + return false; + } + } + } }; @@ -129,6 +177,8 @@ function reset_log_fields() { $('#callsign').val(""); $('#comment').val(""); $('#exch_recv').val(""); + $('#exch_serial_r').val(""); + $('#exch_gridsquare_r').val(""); $("#callsign").focus(); setRst($("#mode").val()); } @@ -163,11 +213,12 @@ if ($('#frequency').val() == "") } /* on mode change */ -$('.mode').change(function() { +$('#mode').change(function() { $.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) { $('#frequency').val(result); $('#frequency_rx').val(""); }); + setRst($("#mode").val()); }); /* Calculate Frequency */ @@ -179,34 +230,225 @@ $('#band').change(function() { }); }); -// Change Serial Validation when selected -$('#serial').change(function() { - if($('#serial').is(':checked')) { - set_serial_number_input_validation(); - } +$('#exchangetype').change(function(){ + var exchangetype = $("#exchangetype").val(); + setExchangetype(exchangetype); }); -// Change other serial type when selected -$('#other').change(function() { - if($('#other').is(':checked')) { - set_other_input_validation(); - } -}); - -/* - Function: set_serial_number_input_validation - Job: This sets the field input to number for validation -*/ -function set_serial_number_input_validation() { - $('#exch_sent').attr('type', 'number'); - $('#exch_recv').attr('type', 'number'); +function setExchangetype(exchangetype) { + if (exchangetype == 'None') { + $(".exchanger").hide(); + $(".exchanges").hide(); + $(".serials").hide(); + $(".serialr").hide(); + $(".gridsquarer").hide(); + $(".gridsquares").hide(); + } + else if (exchangetype == 'Exchange') { + $(".exchanger").show(); + $(".exchanges").show(); + $(".serials").hide(); + $(".serialr").hide(); + $(".gridsquarer").hide(); + $(".gridsquares").hide(); + } + else if (exchangetype == 'Serial') { + $(".exchanger").hide(); + $(".exchanges").hide(); + $(".serials").show(); + $(".serialr").show(); + $(".gridsquarer").hide(); + $(".gridsquares").hide(); + } + else if (exchangetype == 'Serialexchange') { + $(".exchanger").show(); + $(".exchanges").show(); + $(".serials").show(); + $(".serialr").show(); + $(".gridsquarer").hide(); + $(".gridsquares").hide(); + } + else if (exchangetype == 'Serialgridsquare') { + $(".exchanger").hide(); + $(".exchanges").hide(); + $(".serials").show(); + $(".serialr").show(); + $(".gridsquarer").show(); + $(".gridsquares").show(); + } + else if (exchangetype == 'Gridsquare') { + $(".exchanger").hide(); + $(".exchanges").hide(); + $(".serials").hide(); + $(".serialr").hide(); + $(".gridsquarer").show(); + $(".gridsquares").show(); + } } /* - Function: set_other_input_validation - Job: This sets the field input to text for validation -*/ -function set_other_input_validation() { - $('#exch_sent').attr('type', 'text'); - $('#exch_recv').attr('type', 'text'); -} \ No newline at end of file + Function: logQso + Job: this handles the logging done in the contesting module. + */ +function logQso() { + if ($("#callsign").val().length > 0) { + + $('.callsign-suggestions').text(""); + + var table = $('.qsotable').DataTable(); + var gridsquare = $("#exch_gridsquare_r").val(); + var vucc = ''; + + if (gridsquare.indexOf(',') != -1) { + vucc = gridsquare; + gridsquare = ''; + } + + var data = [[ + $("#start_date").val()+ ' ' + $("#start_time").val(), + $("#callsign").val().toUpperCase(), + $("#band").val(), + $("#mode").val(), + $("#rst_sent").val(), + $("#rst_recv").val(), + $("#exch_sent").val(), + $("#exch_recv").val(), + $("#exch_serial_s").val(), + $("#exch_serial_r").val(), + gridsquare, + vucc, + ]]; + + table.rows.add(data).draw(); + + var formdata = new FormData(document.getElementById("qso_input")); + $.ajax({ + url: base_url + 'index.php/qso/saveqso', + type: 'post', + data: formdata, + processData: false, + contentType: false, + enctype: 'multipart/form-data', + success: function (html) { + if (localStorage.getItem("qso") == null) { + localStorage.setItem("qso", $("#start_date").val()+ ' ' + $("#start_time").val() + ',' + $("#callsign").val().toUpperCase() + ',' + $("#contestname").val()); + } + + $('#name').val(""); + + $('#callsign').val(""); + $('#comment').val(""); + $('#exch_recv').val(""); + $('#exch_gridsquare_r').val(""); + $('#exch_serial_r').val(""); + var exchangetype = $("#exchangetype").val(); + if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') { + $("#exch_serial_s").val(+$("#exch_serial_s").val() + 1); + } + $("#callsign").focus(); + + // Store contest session + localStorage.setItem("contestid", $("#contestname").val()); + localStorage.setItem("exchangetype", $("#exchangetype").val()); + localStorage.setItem("exchangereceived", $("#exch_recv").val()); + localStorage.setItem("exchangesent", $("#exch_sent").val()); + localStorage.setItem("serialreceived", $("#exch_serial_r").val()); + localStorage.setItem("serialsent", $("#exch_serial_s").val()); + localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").val()); + localStorage.setItem("gridsquaresent", $("#exch_gridsquare_s").val()); + } + }); + } +} + +// We are restoring the settings in the contest logging form here +function restoreContestSession() { + var contestname = localStorage.getItem("contestid"); + + if (contestname != null) { + $("#contestname").val(contestname); + } + + var exchangetype = localStorage.getItem("exchangetype"); + + if (exchangetype != null) { + $("#exchangetype").val(exchangetype); + setExchangetype(exchangetype); + } + + var exchangereceived = localStorage.getItem("exchangereceived"); + if (exchangereceived != null) { + $("#exch_recv").val(exchangereceived); + } + + var exchangesent = localStorage.getItem("exchangesent"); + if (exchangesent != null) { + $("#exch_sent").val(exchangesent); + } + + var serialreceived = localStorage.getItem("serialreceived"); + if (serialreceived != null) { + $("#exch_serial_r").val(serialreceived); + } + + var serialsent = localStorage.getItem("serialsent"); + if (serialsent != null) { + $("#exch_serial_s").val(serialsent); + } + + var gridsquarereceived = localStorage.getItem("gridsquarereceived"); + if (gridsquarereceived != null) { + $("#exch_gridsquare_r").val(gridsquarereceived); + } + + var gridsquaresent = localStorage.getItem("gridsquaresent"); + if (gridsquaresent != null) { + $("#exch_gridsquare_s").val(gridsquaresent); + } + + if (localStorage.getItem("qso") != null) { + var qsodata = localStorage.getItem("qso"); + $.ajax({ + url: base_url + 'index.php/contesting/getSessionQsos', + type: 'post', + data: {'qso': qsodata,}, + success: function (html) { + var mode = ''; + + $.each(html, function(){ + if (this.col_submode == null || this.col_submode == '') { + mode = this.col_mode; + } else { + mode = this.col_submode; + } + + $(".qsotable tbody").prepend('' + + ''+ this.col_time_on + '' + + ''+ this.col_call + '' + + ''+ this.col_band + '' + + ''+ mode + '' + + ''+ this.col_rst_sent + '' + + ''+ this.col_rst_rcvd + '' + + ''+ this.col_stx_string + '' + + ''+ this.col_srx_string + '' + + ''+ this.col_stx + '' + + ''+ this.col_srx + '' + + ''+ this.col_gridsquare + '' + + ''+ this.col_vucc_grids + '' + + ''); + }); + if (!$.fn.DataTable.isDataTable('.qsotable')) { + $('.qsotable').DataTable({ + "pageLength": 25, + responsive: false, + "scrollY": "400px", + "scrollCollapse": true, + "paging": false, + "scrollX": true, + "order": [[ 0, "desc" ]] + }); + } + } + }); + } +} diff --git a/assets/js/sections/dayswithqso.js b/assets/js/sections/dayswithqso.js index 361d5ec04..23e0a8197 100644 --- a/assets/js/sections/dayswithqso.js +++ b/assets/js/sections/dayswithqso.js @@ -8,6 +8,7 @@ $.ajax({ dataDxcc.push(this.Days); }); var ctx = document.getElementById("myChartDiff").getContext('2d'); + var color = ifDarkModeThemeReturn('white', 'grey'); var myChart = new Chart(ctx, { type: 'bar', data: { @@ -24,10 +25,21 @@ $.ajax({ scales: { yAxes: [{ ticks: { - beginAtZero:true + beginAtZero:true, + fontColor: color + } + }], + xAxes: [{ + ticks: { + fontColor: color } }] }, + legend: { + labels: { + fontColor: color + } + } } }); } diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js index 43ab6412d..4dd6e239b 100644 --- a/assets/js/sections/distances.js +++ b/assets/js/sections/distances.js @@ -19,26 +19,43 @@ function distPlot(form) { if (tmp.ok == 'OK') { if (!($('#information').length > 0)) $("#distances_div").append('
'); + var color = ifDarkModeThemeReturn('white', 'grey'); var options = { chart: { type: 'column', zoomType: 'xy', - renderTo: 'graphcontainer' + renderTo: 'graphcontainer', + backgroundColor: getBodyBackground() }, title: { - text: 'Distance Distribution' + text: 'Distance Distribution', + style: { + color: color + } }, xAxis: { categories: [], crosshair: true, type: "category", min:0, - max:100 - + max:100, + labels: { + style: { + color: color + } + } }, yAxis: { title: { - text: '# QSOs' + text: '# QSOs', + style: { + color: color + } + }, + labels: { + style: { + color: color + } } }, navigator: { @@ -47,6 +64,9 @@ function distPlot(form) { labels: { formatter: function() { return this.value * '50' + ' ' + tmp.unit; + }, + style: { + color: color } } } @@ -63,6 +83,11 @@ function distPlot(form) { } } }, + legend: { + itemStyle: { + color: color + } + }, series: [] }; var myComments=[]; @@ -77,7 +102,6 @@ function distPlot(form) { options.xAxis.categories.push(this.dist); series.name = 'Number of QSOs'; series.data.push(this.count); - }); options.series.push(series); diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 99db8aeaf..be3c51a5b 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -86,7 +86,7 @@ $( document ).ready(function() { labelField: 'name', searchField: 'name', options: [], - create: false, + create: true, load: function(query, callback) { if (!query) return callback(); // Only trigger if at least 1 character is entered $.ajax({ @@ -466,6 +466,27 @@ if ($('#frequency').val() == "") }); } +/* time input shortcut */ +$('#start_time').change(function() { + var raw_time = $(this).val(); + if(raw_time.match(/^\d\[0-6]d$/)) { + raw_time = "0"+raw_time; + } + if(raw_time.match(/^[012]\d[0-5]\d$/)) { + raw_time = raw_time.substring(0,2)+":"+raw_time.substring(2,4); + $('#start_time').val(raw_time); + } +}); + +/* date input shortcut */ +$('#start_date').change(function() { + raw_date = $(this).val(); + if(raw_date.match(/^[12]\d{3}[01]\d[0123]\d$/)) { + raw_date = raw_date.substring(0,4)+"-"+raw_date.substring(4,6)+"-"+raw_date.substring(6,8); + $('#start_date').val(raw_date); + } +}); + /* on mode change */ $('.mode').change(function() { $.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) { diff --git a/assets/js/sections/timeplot.js b/assets/js/sections/timeplot.js index 8d1f1699b..4aaeef7e7 100644 --- a/assets/js/sections/timeplot.js +++ b/assets/js/sections/timeplot.js @@ -27,14 +27,19 @@ function plotTimeplotterChart(tmp) { $("#container").remove(); $("#info").remove(); $("#timeplotter_div").append('

' + tmp.qsocount + ' contacts were plotted.

'); + var color = ifDarkModeThemeReturn('white', 'grey'); var options = { chart: { type: 'column', zoomType: 'xy', - renderTo: 'container' + renderTo: 'container', + backgroundColor: getBodyBackground() }, title: { - text: 'Time Distribution' + text: 'Time Distribution', + style: { + color: color + } }, xAxis: { categories: [], @@ -42,10 +47,23 @@ function plotTimeplotterChart(tmp) { type: "category", min:0, max:47, + labels: { + style: { + color: color + } + } }, yAxis: { title: { - text: '# QSOs' + text: '# QSOs', + style: { + color: color + } + }, + labels: { + style: { + color: color + } } }, rangeSelector: { @@ -60,6 +78,11 @@ function plotTimeplotterChart(tmp) { } } }, + legend: { + itemStyle: { + color: color + } + }, series: [] }; var myComments=[]; diff --git a/install/config/config.php b/install/config/config.php index 44ff528f4..934e0d630 100644 --- a/install/config/config.php +++ b/install/config/config.php @@ -42,10 +42,12 @@ $config['display_freq'] = false; | | 'qrz_username' QRZ.com user login | 'qrz_password' QRZ.com user password +| 'use_fullname' Get full names from QRZ, may not be GDPR compliant */ $config['qrz_username'] = ""; $config['qrz_password'] = ""; +$config['use_fullname'] = false; /* |--------------------------------------------------------------------------