diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 920d15839..a80ef2c2c 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -656,7 +656,7 @@ class Logbook extends CI_Controller { if (!empty($logbooks_locations_array) && $query->num_rows() > 0) { $html .= "
| Date | "; $html .= "Callsign | "; diff --git a/application/controllers/Lookup.php b/application/controllers/Lookup.php index 86e953614..35990fb0a 100644 --- a/application/controllers/Lookup.php +++ b/application/controllers/Lookup.php @@ -27,30 +27,40 @@ class Lookup extends CI_Controller { } public function search() { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $location_list = "'".implode("','",$logbooks_locations_array)."'"; $this->load->model('lookup_model'); - $this->load->model('bands'); - - $data['bands'] = $this->bands->get_worked_bands(xss_clean($this->input->post('type'))); $data['type'] = xss_clean($this->input->post('type')); - $data['dxcc'] = xss_clean($this->input->post('dxcc')); - $data['was'] = xss_clean($this->input->post('was')); - $data['sota'] = xss_clean($this->input->post('sota')); - $data['grid'] = xss_clean($this->input->post('grid')); - $data['iota'] = xss_clean($this->input->post('iota')); - $data['cqz'] = xss_clean($this->input->post('cqz')); - $data['wwff'] = xss_clean($this->input->post('wwff')); - $data['location_list'] = $location_list; - $data['result'] = $this->lookup_model->getSearchResult($data); + if ($data['type'] == "lotw") { + $this->load->model('logbook_model'); + $data['callsign'] = xss_clean($this->input->post('lotw')); + $data['lotw_lastupload'] = $this->logbook_model->check_last_lotw($data['callsign']); + + $this->load->view('lookup/lotwuser', $data); + } else { + $this->load->model('bands'); + + $data['bands'] = $this->bands->get_worked_bands(xss_clean($this->input->post('type'))); + + + $data['dxcc'] = xss_clean($this->input->post('dxcc')); + $data['was'] = xss_clean($this->input->post('was')); + $data['sota'] = xss_clean($this->input->post('sota')); + $data['grid'] = xss_clean($this->input->post('grid')); + $data['iota'] = xss_clean($this->input->post('iota')); + $data['cqz'] = xss_clean($this->input->post('cqz')); + $data['wwff'] = xss_clean($this->input->post('wwff')); + $data['location_list'] = $location_list; + + $data['result'] = $this->lookup_model->getSearchResult($data); + $this->load->view('lookup/result', $data); + } - $this->load->view('lookup/result', $data); } public function scp() { @@ -131,11 +141,11 @@ class Lookup extends CI_Controller { public function get_state_list() { $this->load->library('subdivisions'); - + $dxcc = xss_clean($this->input->post('dxcc')); $states_result = $this->subdivisions->get_state_list($dxcc); $subdivision_name = $this->subdivisions->get_primary_subdivision_name($dxcc); - + if ($states_result->num_rows() > 0) { $states_array = $states_result->result_array(); $result = array( @@ -150,7 +160,7 @@ class Lookup extends CI_Controller { echo json_encode(array('status' => 'No States for this DXCC in Database')); } } - + public function get_county() { $json = []; diff --git a/application/controllers/Update.php b/application/controllers/Update.php index d0c4acece..b355b0342 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -30,27 +30,14 @@ class Update extends CI_Controller { } - /* - * Create a path to a file in the updates folder, respecting the datadir - * configuration option. - */ - private function make_update_path($path) { - $path = "updates/" . $path; - $datadir = $this->config->item('datadir'); - if(!$datadir) { - return $path; - } - return $datadir . "/" . $path; - } - /* * Load the dxcc entities */ public function dxcc_entities() { - // Load Database connectors - // Load the cty file - $xml_data = simplexml_load_file($this->make_update_path("cty.xml")); + // Load the cty file + $this->load->library('Paths'); + $xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml")); //$xml_data->entities->entity->count(); @@ -98,9 +85,10 @@ class Update extends CI_Controller { * Load the dxcc exceptions */ public function dxcc_exceptions() { - // Load Database connectors - // Load the cty file - $xml_data = simplexml_load_file($this->make_update_path("cty.xml")); + + // Load the cty file + $this->load->library('Paths'); + $xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml")); $count = 0; $a_data=[]; @@ -139,9 +127,10 @@ class Update extends CI_Controller { * Load the dxcc prefixes */ public function dxcc_prefixes() { - // Load Database connectors + // Load the cty file - $xml_data = simplexml_load_file($this->make_update_path("cty.xml")); + $this->load->library('Paths'); + $xml_data = simplexml_load_file($this->paths->make_update_path("cty.xml")); $count = 0; $a_data=[]; @@ -180,59 +169,63 @@ class Update extends CI_Controller { // Updates the DXCC & Exceptions from the Club Log Cty.xml file. public function dxcc() { + $this->load->library('Paths'); + // set the last run in cron table for the correct cron id $this->load->model('cron_model'); - $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); - $this->update_status("Downloading file"); + $this->update_status("Downloading file"); - // give it 10 minutes... - set_time_limit(600); + // give it 10 minutes... + set_time_limit(600); - // Load Migration data if any. - $this->load->library('migration'); - $this->fix_migrations(); - $this->migration->latest(); + // Load Migration data if any. + $this->load->library('migration'); + $this->fix_migrations(); + $this->migration->latest(); - // Download latest file. - $url = "https://cdn.clublog.org/cty.php?api=608df94896cb9c5421ae748235492b43815610c9"; + // Download latest file. + $url = "https://cdn.clublog.org/cty.php?api=608df94896cb9c5421ae748235492b43815610c9"; - $gz = gzopen($url, 'r'); - if ($gz === FALSE) { - $this->update_status("FAILED: Could not download from clublog.org"); - log_message('error', 'FAILED: Could not download exceptions from clublog.org'); - return; - } + $gz = gzopen($url, 'r'); + if ($gz === FALSE) { + $this->update_status("FAILED: Could not download from clublog.org"); + log_message('error', 'FAILED: Could not download exceptions from clublog.org'); + return; + } - $data = ""; - while (!gzeof($gz)) { - $data .= gzgetc($gz); - } - gzclose($gz); + $data = ""; + while (!gzeof($gz)) { + $data .= gzgetc($gz); + } + gzclose($gz); - if (file_put_contents($this->make_update_path("cty.xml"), $data) === FALSE) { - $this->update_status("FAILED: Could not write to cty.xml file"); - return; - } + if (file_put_contents($this->paths->make_update_path("cty.xml"), $data) === FALSE) { + $this->update_status("FAILED: Could not write to cty.xml file"); + return; + } - // Clear the tables, ready for new data - $this->db->empty_table("dxcc_entities"); - $this->db->empty_table("dxcc_exceptions"); - $this->db->empty_table("dxcc_prefixes"); - $this->update_status(); + // Clear the tables, ready for new data + $this->db->empty_table("dxcc_entities"); + $this->db->empty_table("dxcc_exceptions"); + $this->db->empty_table("dxcc_prefixes"); + $this->update_status(); - // Parse the three sections of the file and update the tables - $this->db->trans_start(); - $this->dxcc_entities(); - $this->dxcc_exceptions(); - $this->dxcc_prefixes(); - $this->db->trans_complete(); + // Parse the three sections of the file and update the tables + $this->db->trans_start(); + $this->dxcc_entities(); + $this->dxcc_exceptions(); + $this->dxcc_prefixes(); + $this->db->trans_complete(); - $this->update_status("DONE"); + $this->update_status("DONE"); } public function update_status($done=""){ + $this->load->library('Paths'); + if ($done != "Downloading file"){ // Check that everything is done? if ($done == ""){ @@ -246,18 +239,18 @@ class Update extends CI_Controller { $html = $done."....||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PHP Version | -+ | + = 0) { + echo phpversion()." OK"; + } else { + echo phpversion()." Deprecated"; + } + ?> + | |||||||||||||||||||||||||||||||||||||
| - - | - datetime->show ?? "true") == "true") { - echo '' . lang('general_word_datetime') . ' | '; - } ?> - de->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_de') . ' | '; - } ?> - dx->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_dx') . ' | '; - } ?> - mode->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_mode') . ' | '; - } ?> - rsts->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_rsts') . ' | '; - } ?> - rstr->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_rstr') . ' | '; - } ?> - band->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_band') . ' | '; - } ?> - myrefs->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_myrefs') . ' | '; - } ?> - refs->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_refs') . ' | '; - } ?> - name->show ?? "true") == "true") { - echo '' . lang('general_word_name') . ' | '; - } ?> - qslvia->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_qslvia') . ' | '; - } ?> - qsl->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_qsl') . ' | '; - } ?> - session->userdata('user_eqsl_name') != "" && ($options->eqsl->show ?? "true") == "true"){ - echo 'eQSL | '; - } ?> - session->userdata('user_lotw_name') != "" && ($options->lotw->show ?? "true") == "true"){ - echo 'LoTW | '; - } ?> - qslmsg->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_qslmsg') . ' | '; - } ?> - dxcc->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_dxcc') . ' | '; - } ?> - state->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_state') . ' | '; - } ?> - cqzone->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_cq_zone') . ' | '; - } ?> - ituzone->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_itu_zone') . ' | '; - } ?> - iota->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_iota') . ' | '; - } ?> - pota->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_pota') . ' | '; - } ?> - operator->show ?? "true") == "true") { - echo '' . lang('gen_hamradio_operator') . ' | '; - } ?> - comment->show ?? "true") == "true") { - echo '' . lang('general_word_comment') . ' | '; - } ?> -
|---|
| / | @@ -61,13 +61,13 @@ function echo_table_col($row, $name) { case 'SOTA': echo ' | ' . ($row->COL_SOTA_REF) . ' | '; break; case 'WWFF': echo '' . ($row->COL_WWFF_REF) . ' | '; break; case 'POTA': echo '' . ($row->COL_POTA_REF) . ' | '; break; - case 'Grid': - $ci->load->library('qra'); + case 'Grid': + $ci->load->library('qra'); echo '' . ($ci->qra->echoQrbCalcLink($row->COL_MY_GRIDSQUARE, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE)) . ' | '; break; case 'Distance': echo '' . ($row->COL_DISTANCE ? $row->COL_DISTANCE . ' km' : '') . ' | '; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo ''.$row->COL_SAT_NAME.' | '; } else { echo strtolower($row->COL_BAND); } echo ''; break; - case 'Frequency': - $ci->load->library('frequency'); + case 'Frequency': + $ci->load->library('frequency'); echo ''; if($row->COL_SAT_NAME != null) { echo ''.$row->COL_SAT_NAME.' | '; } else { if($row->COL_FREQ != null) { echo $ci->frequency->hz_to_mhz($row->COL_FREQ); } else { echo strtolower($row->COL_BAND); } } echo ''; break; case 'State': echo '' . ($row->COL_STATE) . ' | '; break; case 'Operator': echo '' . ($row->COL_OPERATOR) . ' | '; break; diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 7671ffc5c..39cdc4e43 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -694,7 +694,13 @@ -
|---|