diff --git a/.gitignore b/.gitignore index 27c58390c..01d66723d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /application/config/config.php /application/logs/*.php /application/cache/* +/uploads /uploads/*.adi /uploads/*.ADI /uploads/*.tq8 diff --git a/application/config/migration.php b/application/config/migration.php index 6e6072fac..ed733d726 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 188; +$config['migration_version'] = 191; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index dcdcaafbc..a9c0efc4c 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -139,6 +139,9 @@ class adif extends CI_Controller { } public function index() { + $this->load->model('contesting_model'); + $data['contests']=$this->contesting_model->getActivecontests(); + $this->load->model('stations'); $data['page_title'] = "ADIF Import / Export"; @@ -183,6 +186,7 @@ class adif extends CI_Controller { $this->load->view('interface_assets/footer'); } else { if ($this->stations->check_station_is_accessible($this->input->post('station_profile'))) { + $contest=$this->security->xss_clean($this->input->post('contest')) ?? ''; $stopnow=false; $fdata = array('upload_data' => $this->upload->data()); ini_set('memory_limit', '-1'); @@ -222,6 +226,9 @@ class adif extends CI_Controller { $alladif=[]; while($record = $this->adif_parser->get_record()) { + if ($contest != '') { + $record['contest_id']=$contest; + } if(count($record) == 0) { break; }; diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 8c131512f..e3a4e14d4 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -373,10 +373,12 @@ class Awards extends CI_Controller { $searchphrase = str_replace('"', "", $this->security->xss_clean($this->input->post("Searchphrase"))); $band = str_replace('"', "", $this->security->xss_clean($this->input->post("Band"))); $mode = str_replace('"', "", $this->security->xss_clean($this->input->post("Mode"))); + $sat = str_replace('"', "", $this->security->xss_clean($this->input->post("Sat"))); + $orbit = str_replace('"', "", $this->security->xss_clean($this->input->post("Orbit"))); $type = $this->security->xss_clean($this->input->post('Type')); $qsl = $this->input->post('QSL') == null ? '' : $this->security->xss_clean($this->input->post('QSL')); $searchmode = $this->input->post('searchmode') == null ? '' : $this->security->xss_clean($this->input->post('searchmode')); - $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $searchmode); + $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $sat, $orbit, $searchmode); // This is done because we have two different ways to get dxcc info in Wavelog. Once is using the name (in awards), and the other one is using the ADIF DXCC. // We replace the values to make it look a bit nicer @@ -402,7 +404,18 @@ class Awards extends CI_Controller { // Render Page $data['page_title'] = "Log View - " . $type; - $data['filter'] = $type . " " . $searchphrase . " and band ".$band . " and mode ".$mode; + $data['filter'] = $type." ".$searchphrase." and band ".$band; + if ($band == 'SAT') { + if ($sat != 'All' && $sat != null) { + $data['filter'] .= " and sat ".$sat; + } + if ($orbit != 'All' && $orbit != null) { + $data['filter'] .= " and orbit type ".$orbit; + } + } + if ($mode != null && strtolower($mode) != 'all') { + $data['filter'] .= " and mode ".$mode; + } if (!empty($qsltype)) { $data['filter'] .= " and ".implode('/', $qsltype); } diff --git a/application/controllers/Bandmap.php b/application/controllers/Bandmap.php index 2e1ab3590..f93d658d6 100644 --- a/application/controllers/Bandmap.php +++ b/application/controllers/Bandmap.php @@ -44,14 +44,13 @@ class Bandmap extends CI_Controller { 'assets/js/sections/bandmap_list.js' ]; - $CI =& get_instance(); // Get Date format - if($CI->session->userdata('user_date_format')) { + if($this->session->userdata('user_date_format')) { // If Logged in and session exists - $pageData['custom_date_format'] = $CI->session->userdata('user_date_format'); + $pageData['custom_date_format'] = $this->session->userdata('user_date_format'); } else { // Get Default date format from /config/wavelog.php - $pageData['custom_date_format'] = $CI->config->item('qso_date_format'); + $pageData['custom_date_format'] = $this->config->item('qso_date_format'); } switch ($pageData['custom_date_format']) { diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 0b341f016..229e0306f 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -2,176 +2,207 @@ class Debug extends CI_Controller { - function __construct() - { - parent::__construct(); + function __construct() { + parent::__construct(); - $this->load->model('user_model'); - if (!$this->user_model->authorize(2)) { - $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); - redirect('dashboard'); - } + $this->load->model('user_model'); + if (!$this->user_model->authorize(2)) { + $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); + redirect('dashboard'); + } - $this->load->library('Permissions'); - } + $this->load->library('Permissions'); + } - /* User Facing Links to Backup URLs */ - public function index() - { - $this->load->helper('file'); + /* User Facing Links to Backup URLs */ + public function index() { + $this->load->helper('file'); - $this->load->model('MigrationVersion'); - $this->load->model('Logbook_model'); - $this->load->model('Stations'); + $this->load->model('MigrationVersion'); + $this->load->model('Logbook_model'); + $this->load->model('Stations'); - $footerData = []; - $footerData['scripts'] = ['assets/js/sections/debug.js']; + $footerData = []; + $footerData['scripts'] = ['assets/js/sections/debug.js']; - $data['stations'] = $this->Stations->all(); + $data['stations'] = $this->Stations->all(); - $data['qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id(); - if ($data['qsos_with_no_station_id']) { - $data['calls_wo_sid'] = $this->Logbook_model->calls_without_station_id(); - } + $data['qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id(); + if ($data['qsos_with_no_station_id']) { + $data['calls_wo_sid'] = $this->Logbook_model->calls_without_station_id(); + } - $data['migration_version'] = $this->MigrationVersion->getMigrationVersion(); + $data['migration_version'] = $this->MigrationVersion->getMigrationVersion(); - // Test writing to backup folder - $backup_folder = $this->permissions->is_really_writable('backup'); - $data['backup_folder'] = $backup_folder; + // Test writing to backup folder + $backup_folder = $this->permissions->is_really_writable('backup'); + $data['backup_folder'] = $backup_folder; - // Test writing to updates folder - $updates_folder = $this->permissions->is_really_writable('updates'); - $data['updates_folder'] = $updates_folder; + // Test writing to updates folder + $updates_folder = $this->permissions->is_really_writable('updates'); + $data['updates_folder'] = $updates_folder; - // Test writing to uploads folder - $uploads_folder = $this->permissions->is_really_writable('uploads'); - $data['uploads_folder'] = $uploads_folder; + // Test writing to uploads folder + $uploads_folder = $this->permissions->is_really_writable('uploads'); + $data['uploads_folder'] = $uploads_folder; - // Check if userdata config is enabled - $userdata_enabled = $this->config->item('userdata'); - $data['userdata_enabled'] = $userdata_enabled; + // Check if userdata config is enabled + $userdata_enabled = $this->config->item('userdata'); + $data['userdata_enabled'] = $userdata_enabled; - if (isset($userdata_enabled)) { - // Test writing to userdata folder if option is enabled - $userdata_folder = $this->permissions->is_really_writable('userdata'); - $data['userdata_folder'] = $userdata_folder; + if (isset($userdata_enabled)) { + // Test writing to userdata folder if option is enabled + $userdata_folder = $this->permissions->is_really_writable('userdata'); + $data['userdata_folder'] = $userdata_folder; - // run the status check and return the array to the view - $userdata_status = $this->check_userdata_status($userdata_folder); - $data['userdata_status'] = $userdata_status; - } + // run the status check and return the array to the view + $userdata_status = $this->check_userdata_status($userdata_folder); + $data['userdata_status'] = $userdata_status; + } - $data['page_title'] = "Debug"; + $data['page_title'] = "Debug"; - $this->load->view('interface_assets/header', $data); - $this->load->view('debug/index'); - $this->load->view('interface_assets/footer', $footerData); - } + $this->load->view('interface_assets/header', $data); + $this->load->view('debug/index'); + $this->load->view('interface_assets/footer', $footerData); + } - function check_userdata_status($userdata_folder) - { - $this->load->model('debug_model'); - - $status = array(); + function check_userdata_status($userdata_folder) { + $this->load->model('debug_model'); - // Check if the folder is writable - if ($userdata_folder === true) { + $status = array(); - // Check if the qsl and eqsl folders are accessible and if there is any data the user could migrate - $qsl_dir = $this->permissions->is_really_writable('assets/qslcard'); - $eqsl_dir = $this->permissions->is_really_writable('images/eqsl_card_images'); + // Check if the folder is writable + if ($userdata_folder === true) { - $flag_file = $this->debug_model->check_migrated_flag(); + // Check if the qsl and eqsl folders are accessible and if there is any data the user could migrate + $qsl_dir = $this->permissions->is_really_writable('assets/qslcard'); + $eqsl_dir = $this->permissions->is_really_writable('images/eqsl_card_images'); - if ($qsl_dir && $eqsl_dir) { + $flag_file = $this->debug_model->check_migrated_flag(); - // Check for content of the qsl card folder other than *.html files - $qsl_files = glob('assets/qslcard/*'); - $qsl_files_filtered = array_filter($qsl_files, function ($file) { - return !is_dir($file) && pathinfo($file, PATHINFO_EXTENSION) !== 'html'; - }); + if ($qsl_dir && $eqsl_dir) { - // Check for content of the eqsl card folder other than *.html files - $eqsl_files = glob('images/eqsl_card_images/*'); - $eqsl_files_filtered = array_filter($eqsl_files, function ($file) { - return !is_dir($file) && pathinfo($file, PATHINFO_EXTENSION) !== 'html'; - }); + // Check for content of the qsl card folder other than *.html files + $qsl_files = glob('assets/qslcard/*'); + $qsl_files_filtered = array_filter($qsl_files, function ($file) { + return !is_dir($file) && pathinfo($file, PATHINFO_EXTENSION) !== 'html'; + }); - // Set the status info - if (!empty($qsl_files_filtered) || !empty($eqsl_files_filtered)) { - if (!$flag_file) { - $status['btn_class'] = ''; - $status['btn_text'] = 'Migrate data now'; - } else { - $status['btn_class'] = ''; - $status['btn_text'] = 'Migration already done. Run again?'; - } - } else { - $status['btn_class'] = 'disabled'; - $status['btn_text'] = 'No data to migrate'; - } - } else { - $status['btn_class'] = 'disabled'; - $status['btn_text'] = 'No migration possible'; - } - } else { - // If the folder is not writable, we don't need to continue - $status['btn_class'] = 'disabled'; - $status['btn_text'] = 'No migration possible'; - } + // Check for content of the eqsl card folder other than *.html files + $eqsl_files = glob('images/eqsl_card_images/*'); + $eqsl_files_filtered = array_filter($eqsl_files, function ($file) { + return !is_dir($file) && pathinfo($file, PATHINFO_EXTENSION) !== 'html'; + }); - return $status; - } + // Set the status info + if (!empty($qsl_files_filtered) || !empty($eqsl_files_filtered)) { + if (!$flag_file) { + $status['btn_class'] = ''; + $status['btn_text'] = 'Migrate data now'; + } else { + $status['btn_class'] = ''; + $status['btn_text'] = 'Migration already done. Run again?'; + } + } else { + $status['btn_class'] = 'disabled'; + $status['btn_text'] = 'No data to migrate'; + } + } else { + $status['btn_class'] = 'disabled'; + $status['btn_text'] = 'No migration possible'; + } + } else { + // If the folder is not writable, we don't need to continue + $status['btn_class'] = 'disabled'; + $status['btn_text'] = 'No migration possible'; + } - public function reassign() - { - $this->load->model('Logbook_model'); - $this->load->model('Stations'); + return $status; + } - $call = xss_clean(($this->input->post('call'))); - $qsoids = xss_clean(($this->input->post('qsoids'))); - $station_profile_id = xss_clean(($this->input->post('station_id'))); + public function reassign() { + $this->load->model('Logbook_model'); + $this->load->model('Stations'); - log_message('debug', 'station_profile_id:', $station_profile_id); - // Check if target-station-id exists - $allowed = false; - $status = false; - $stations = $this->Stations->all(); - foreach ($stations->result() as $station) { - if ($station->station_id == $station_profile_id) { - $allowed = true; - } - } - if ($allowed) { - $status = $this->Logbook_model->update_station_ids($station_profile_id, $call, $qsoids); - } else { - $status = false; - } + $call = xss_clean(($this->input->post('call'))); + $qsoids = xss_clean(($this->input->post('qsoids'))); + $station_profile_id = xss_clean(($this->input->post('station_id'))); - header('Content-Type: application/json'); - echo json_encode(array('status' => $status)); - return; - } + log_message('debug', 'station_profile_id:', $station_profile_id); + // Check if target-station-id exists + $allowed = false; + $status = false; + $stations = $this->Stations->all(); + foreach ($stations->result() as $station) { + if ($station->station_id == $station_profile_id) { + $allowed = true; + } + } + if ($allowed) { + $status = $this->Logbook_model->update_station_ids($station_profile_id, $call, $qsoids); + } else { + $status = false; + } - public function migrate_userdata() - { - // Check if users logged in - $this->load->model('user_model'); - if ($this->user_model->validate_session() == 0) { - // user is not logged in - redirect('user/login'); - } else { - $this->load->model('debug_model'); - $migrate = $this->debug_model->migrate_userdata(); + header('Content-Type: application/json'); + echo json_encode(array('status' => $status)); + return; + } - if ($migrate == true) { - $this->session->set_flashdata('success', 'File Migration was successfull, but please check also manually. If everything seems right you can delete the folders "assets/qslcard" and "images/eqsl_card_images".'); - redirect('debug'); - } else { - $this->session->set_flashdata('error', 'File Migration failed. Please check the Error Log.'); - redirect('debug'); - } - } - } + public function selfupdate() { + if (file_exists('.git')) { + try { + $st=exec('touch '.realpath(APPPATH.'../').'/.maintenance'); + $st=exec('git stash push --include-untracked'); + $st=exec('git fetch'); + $st=exec('git pull'); + $st=exec('git stash pop'); + $st=exec('rm '.realpath(APPPATH.'../').'/.maintenance'); + } catch (\Throwable $th) { + log_message("Error","Error at selfupdating"); + } + } + redirect('debug'); + } + + public function wavelog_fetch() { + $a_versions=[]; + try { + $st=exec('git fetch'); // Fetch latest things from Repo. ONLY Fetch. Doesn't hurt since it isn't a pull! + $versions['branch'] = trim(exec('git rev-parse --abbrev-ref HEAD')); // Get ONLY Name of the Branch we're on + $versions['latest_commit_hash']=substr(trim(exec('git log --pretty="%H" -n1 origin'.'/'.$versions['branch'])),0,8); // fetch latest commit-hash from repo + } catch (Exception $e) { + $versions['latest_commit_hash']=''; + $versions['branch']=''; + } + header('Content-Type: application/json'); + echo json_encode($versions); + } + + public function wavelog_version() { + $commit_hash=substr(trim(exec('git log --pretty="%H" -n1 HEAD')),0,8); // Get latest LOCAL Hash + header('Content-Type: application/json'); + echo json_encode($commit_hash); + } + + public function migrate_userdata() { + // Check if users logged in + $this->load->model('user_model'); + if ($this->user_model->validate_session() == 0) { + // user is not logged in + redirect('user/login'); + } else { + $this->load->model('debug_model'); + $migrate = $this->debug_model->migrate_userdata(); + + if ($migrate == true) { + $this->session->set_flashdata('success', 'File Migration was successfull, but please check also manually. If everything seems right you can delete the folders "assets/qslcard" and "images/eqsl_card_images".'); + redirect('debug'); + } else { + $this->session->set_flashdata('error', 'File Migration failed. Please check the Error Log.'); + redirect('debug'); + } + } + } } diff --git a/application/controllers/Gridmap.php b/application/controllers/Gridmap.php index 922e987c2..c32155fb2 100644 --- a/application/controllers/Gridmap.php +++ b/application/controllers/Gridmap.php @@ -16,8 +16,9 @@ class Gridmap extends CI_Controller { $data['visitor'] = false; $data['homegrid'] = explode(',', $this->stations->find_gridsquare()); - $data['modes'] = $this->gridmap_model->get_worked_modes(); + $data['modes'] = $this->gridmap_model->get_worked_modes(); $data['bands'] = $this->bands->get_worked_bands(); + $data['orbits'] = $this->bands->get_worked_orbits(); $data['sats_available'] = $this->bands->get_worked_sats(); $data['user_default_band'] = $this->session->userdata('user_default_band'); @@ -45,13 +46,14 @@ class Gridmap extends CI_Controller { } public function getGridsjs() { - $band = $this->security->xss_clean($this->input->post('band')); - $mode = $this->security->xss_clean($this->input->post('mode')); - $qsl = $this->security->xss_clean($this->input->post('qsl')); - $lotw = $this->security->xss_clean($this->input->post('lotw')); - $eqsl = $this->security->xss_clean($this->input->post('eqsl')); - $qrz = $this->security->xss_clean($this->input->post('qrz')); + $band = $this->security->xss_clean($this->input->post('band')); + $mode = $this->security->xss_clean($this->input->post('mode')); + $qsl = $this->security->xss_clean($this->input->post('qsl')); + $lotw = $this->security->xss_clean($this->input->post('lotw')); + $eqsl = $this->security->xss_clean($this->input->post('eqsl')); + $qrz = $this->security->xss_clean($this->input->post('qrz')); $sat = $this->security->xss_clean($this->input->post('sat')); + $orbit = $this->security->xss_clean($this->input->post('orbit')); $this->load->model('gridmap_model'); $array_grid_2char = array(); @@ -70,7 +72,7 @@ class Gridmap extends CI_Controller { $grid_4char_confirmed = ""; $grid_6char_confirmed = ""; - $query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); + $query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -97,7 +99,7 @@ class Gridmap extends CI_Controller { } } - $query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); + $query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); if ($query && $query->num_rows() > 0) { foreach ($query->result() as $row) { @@ -124,7 +126,7 @@ class Gridmap extends CI_Controller { } } } - $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); + $query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { @@ -149,7 +151,7 @@ class Gridmap extends CI_Controller { } // // Confirmed Squares - $query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat); + $query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit); if ($query_vucc && $query_vucc->num_rows() > 0) { foreach ($query_vucc->result() as $row) { diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index b6b6b8ada..7d69e1e1c 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -143,10 +143,11 @@ class Labels extends CI_Controller { $offset = xss_clean($this->input->post('startat')); $grid = $this->input->post('grid') === "true" ? 1 : 0; $via = $this->input->post('via') === "true" ? 1 : 0; + $reference = $this->input->post('reference') == "true" ? 1 : 0; $this->load->model('labels_model'); $result = $this->labels_model->export_printrequestedids($ids); - $this->prepareLabel($result, true, $offset, $grid, $via); + $this->prepareLabel($result, true, $offset, $grid, $via, $reference); } public function print($station_id) { @@ -154,18 +155,19 @@ class Labels extends CI_Controller { $offset = xss_clean($this->input->post('startat')); $grid = xss_clean($this->input->post('grid') ?? 0); $via = xss_clean($this->input->post('via') ?? 0); + $reference = xss_clean($this->input->post('reference') ?? 0); $this->load->model('stations'); if ($this->stations->check_station_is_accessible($station_id)) { $this->load->model('labels_model'); $result = $this->labels_model->export_printrequested($clean_id); - $this->prepareLabel($result, false, $offset, $grid, $via); + $this->prepareLabel($result, false, $offset, $grid, $via, $reference); } else { redirect('labels'); } } - function prepareLabel($qsos, $jscall = false, $offset = 1, $grid = false, $via = false) { + function prepareLabel($qsos, $jscall = false, $offset = 1, $grid = false, $via = false, $reference = false) { $this->load->model('labels_model'); $label = $this->labels_model->getDefaultLabel(); @@ -241,9 +243,9 @@ class Labels extends CI_Controller { if ($qsos->num_rows() > 0) { if ($label->qsos == 1) { - $this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation, $grid, $via); + $this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation, $grid, $via, $reference); } else { - $this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation, $grid, $via); + $this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation, $grid, $via, $reference); } } else { $this->session->set_flashdata('message', '0 QSOs found for print!'); @@ -252,7 +254,7 @@ class Labels extends CI_Controller { $pdf->Output(); } - function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation, $grid, $via) { + function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation, $grid, $via, $reference) { $text = ''; $current_callsign = ''; $current_sat = ''; @@ -269,7 +271,7 @@ class Labels extends CI_Controller { ( ($qso->COL_BAND_RX !== $current_sat_bandrx) && ($this->pretty_sat_mode($qso->COL_SAT_MODE) !== '')) ) { // ((($qso->COL_SAT_NAME ?? '' !== $current_sat) || ($qso->COL_CALL !== $current_callsign)) && ($qso->COL_SAT_NAME ?? '' !== '') && ($col->COL_BAND_RX ?? '' !== $current_sat_bandrx))) { if (!empty($qso_data)) { - $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via); + $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via, $reference); $qso_data = []; } $current_callsign = $qso->COL_CALL; @@ -281,7 +283,7 @@ class Labels extends CI_Controller { $qso_data[] = [ 'time' => $qso->COL_TIME_ON, 'band' => $qso->COL_BAND, - 'mode' => ($qso->COL_SUBMODE ?? $qso->COL_MODE), + 'mode' => (($qso->COL_SUBMODE ?? '') == '') ? $qso->COL_MODE : $qso->COL_SUBMODE, 'rst' => $qso->COL_RST_SENT, 'mygrid' => $qso->station_gridsquare, 'via' => $qso->COL_QSL_VIA, @@ -289,11 +291,17 @@ class Labels extends CI_Controller { 'sat_mode' => $this->pretty_sat_mode($qso->COL_SAT_MODE ?? ''), 'sat_band_rx' => ($qso->COL_BAND_RX ?? ''), 'qsl_recvd' => $qso->COL_QSL_RCVD, - 'mycall' => $qso->COL_STATION_CALLSIGN + 'mycall' => $qso->COL_STATION_CALLSIGN, + 'sig' => $qso->station_sig ?? '', + 'sig_info' => $qso->station_sig_info ?? '', + 'sota' => $qso->station_sota ?? '', + 'iota' => $qso->station_iota ?? '', + 'pota' => $qso->station_pota ?? '', + 'wwff' => $qso->station_wwff ?? '' ]; } if (!empty($qso_data)) { - $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via); + $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via, $reference); } } // New begin @@ -301,7 +309,7 @@ class Labels extends CI_Controller { return(strlen($sat_mode ?? '') == 2 ? (strtoupper($sat_mode[0]).'/'.strtoupper($sat_mode[1])) : strtoupper($sat_mode ?? '')); } - function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation, $grid, $via) { + function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation, $grid, $via, $reference) { $tableData = []; $count_qso = 0; @@ -321,7 +329,7 @@ class Labels extends CI_Controller { if($count_qso == $qso_per_label){ - $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via); + $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via, $reference); $tableData = []; // reset the data $count_qso = 0; // reset the counter } @@ -329,12 +337,12 @@ class Labels extends CI_Controller { } // generate label for remaining QSOs if($count_qso > 0){ - $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via); + $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via, $reference); $preliminaryData = []; // reset the data } } - function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation,$grid=true, $via=false){ + function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation,$grid=true, $via=false, $reference = false){ $builder = new \AsciiTable\Builder(); $builder->addRows($tableData); $text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with "; @@ -355,10 +363,19 @@ class Labels extends CI_Controller { } $text.="\n"; if ($grid) { $text .= "My call: ".$qso['mycall']." Grid: ".$qso['mygrid']."\n"; } + if ($reference) { + $ref_text = ""; + $ref_avail = false; + if (!empty($qso['sig']) && !empty($qso['sig_info'])) { $ref_text .= $qso['sig'].":".$qso['sig_info']." "; $ref_avail = true;} + if (!empty($qso['sota'])) { $ref_text .= "SOTA:".$qso['sota']." "; $ref_avail = true;} + if (!empty($qso['iota'])) { $ref_text .= "IOTA:".$qso['iota']." "; $ref_avail = true;} + if (!empty($qso['pota'])) { $ref_text .= "POTA:".$qso['pota']." "; $ref_avail = true;} + if (!empty($qso['wwff'])) { $ref_text .= "WWFF:".$qso['wwff']; $ref_avail = true;} + if ($ref_avail == true) {$text .= $ref_text."\n";} + } $text .= "Thanks for the QSO".($numofqsos>1 ? 's' : ''); $text .= " | ".($qso['qsl_recvd'] == 'Y' ? 'TNX' : 'PSE')." QSL"; - $pdf->Add_Label($text,$orientation); - } + $pdf->Add_Label($text,$orientation); } // New End diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index dd48d3c98..74be8f53a 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -635,7 +635,7 @@ class Logbook extends CI_Controller { $html = ""; if(!empty($logbooks_locations_array)) { - $this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_FREQ, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, '.$this->config->item('table_name').'.COL_MY_GRIDSQUARE, '.$this->config->item('table_name').'.COL_CONTEST_ID, '.$this->config->item('table_name').'.COL_STATE, '.$this->config->item('table_name').'.COL_QRZCOM_QSO_UPLOAD_STATUS, '.$this->config->item('table_name').'.COL_QRZCOM_QSO_DOWNLOAD_STATUS, station_profile.*'); + $this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_FREQ, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, '.$this->config->item('table_name').'.COL_MY_GRIDSQUARE, '.$this->config->item('table_name').'.COL_CONTEST_ID, '.$this->config->item('table_name').'.COL_STATE, '.$this->config->item('table_name').'.COL_QRZCOM_QSO_UPLOAD_STATUS, '.$this->config->item('table_name').'.COL_QRZCOM_QSO_DOWNLOAD_STATUS, '.$this->config->item('table_name').'.COL_POTA_REF, '.$this->config->item('table_name').'.COL_IOTA, '.$this->config->item('table_name').'.COL_SOTA_REF, '.$this->config->item('table_name').'.COL_WWFF_REF, '.$this->config->item('table_name').'.COL_OPERATOR, '.$this->config->item('table_name').'.COL_COUNTRY, station_profile.*'); $this->db->from($this->config->item('table_name')); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); @@ -1289,7 +1289,7 @@ class Logbook extends CI_Controller { case 'Mode': $ret.= ''; $ret.= $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . ''; break; case 'RSTS': $ret.= '' . $row->COL_RST_SENT; if ($row->COL_STX) { $ret.= ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; $ret.=sprintf("%03d", $row->COL_STX); $ret.= '';} if ($row->COL_STX_STRING) { $ret.= ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';} $ret.= ''; break; case 'RSTR': $ret.= '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { $ret.= ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; $ret.=sprintf("%03d", $row->COL_SRX); $ret.= '';} if ($row->COL_SRX_STRING) { $ret.= ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_SRX_STRING . '';} $ret.= ''; break; - case 'Country': $ret.= '' . ucwords(strtolower(($row->COL_COUNTRY))); if ($row->end != NULL) $ret.= ' '.$ci->lang->line('gen_hamradio_deleted_dxcc').'' . ''; break; + case 'Country': $ret.= '' . ucwords(strtolower(($row->COL_COUNTRY ?? ''))); if ($row->end ?? '' != '') $ret.= ' '.$ci->lang->line('gen_hamradio_deleted_dxcc').'' . ''; break; case 'IOTA': $ret.= '' . ($row->COL_IOTA) . ''; break; case 'SOTA': $ret.= '' . ($row->COL_SOTA_REF) . ''; break; case 'WWFF': $ret.= '' . ($row->COL_WWFF_REF) . ''; break; diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 615e0c061..124e0e91d 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -93,6 +93,7 @@ class Logbookadvanced extends CI_Controller { 'assets/js/sections/itumap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/itumap_geojson.js")), 'assets/js/leaflet/L.Terminator.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/leaflet/L.Terminator.js")), 'assets/js/leaflet/geocoding.js', + 'assets/js/globe/globe.gl.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/globe/globe.gl.js")), ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Logbooks.php b/application/controllers/Logbooks.php deleted file mode 100644 index 0f8306b94..000000000 --- a/application/controllers/Logbooks.php +++ /dev/null @@ -1,176 +0,0 @@ -load->helper(array('form', 'url')); - - $this->load->model('user_model'); - if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - } - - function index() { - $this->load->model('logbooks_model'); - - $data['my_logbooks'] = $this->logbooks_model->show_all(); - - // Render Page - $data['page_title'] = "Station Logbooks"; - $this->load->view('interface_assets/header', $data); - $this->load->view('logbooks/index'); - $this->load->view('interface_assets/footer'); - } - - public function create() - { - $this->load->library('form_validation'); - - $this->form_validation->set_rules('stationLogbook_Name', 'Station Logbook Name', 'required'); - - if ($this->form_validation->run() == FALSE) - { - $data['page_title'] = "Create Station Logbook"; - $this->load->view('interface_assets/header', $data); - $this->load->view('logbooks/create'); - $this->load->view('interface_assets/footer'); - } - else - { - $this->load->model('logbooks_model'); - $this->logbooks_model->add(); - - redirect('stationsetup'); - } - } - - public function edit($id) - { - $this->load->library('form_validation'); - - $this->load->model('logbooks_model'); - $this->load->model('stations'); - - $station_logbook_id = $this->security->xss_clean($id); - - $station_logbook_details_query = $this->logbooks_model->logbook($station_logbook_id); - $data['station_locations_array'] = $this->logbooks_model->list_logbook_relationships($station_logbook_id); - - $data['station_logbook_details'] = $station_logbook_details_query->row(); - $data['station_locations_list'] = $this->stations->all_of_user(); - - $data['station_locations_linked'] = $this->logbooks_model->list_logbooks_linked($station_logbook_id); - - $data['page_title'] = "Edit Station Logbook"; - - $this->form_validation->set_rules('station_logbook_id', 'Station Logbook Name', 'required'); - - if ($this->form_validation->run() == FALSE) - { - $this->load->view('interface_assets/header', $data); - $this->load->view('logbooks/edit'); - $this->load->view('interface_assets/footer'); - } - else - { - - $data['notice'] = "Station Logbooks ".$this->security->xss_clean($this->input->post('station_logbook_name', true))." Updated"; - - if($this->input->post('SelectedStationLocation') != "") { - if($this->logbooks_model->relationship_exists($this->input->post('station_logbook_id'), $this->input->post('SelectedStationLocation')) != TRUE) { - // If no link exisits create - $this->logbooks_model->create_logbook_location_link($this->input->post('station_logbook_id'), $this->input->post('SelectedStationLocation')); - } - } else { - $this->logbooks_model->edit(); - } - - redirect('logbooks/edit/'.$this->input->post('station_logbook_id')); - } - } - - public function set_active($id) { - $this->load->model('logbooks_model'); - $this->logbooks_model->set_logbook_active($id); - $this->user_model->update_session($this->session->userdata('user_id')); - - redirect('stationsetup'); - } - - public function delete($id) { - $this->load->model('logbooks_model'); - $this->logbooks_model->delete($id); - - redirect('stationsetup'); - } - - public function delete_relationship($logbook_id, $station_id) { - $this->load->model('logbooks_model'); - $this->logbooks_model->delete_relationship($logbook_id, $station_id); - - redirect('logbooks/edit/'.$logbook_id); - } - - public function publicslug_validate() { - $this->load->model('logbooks_model'); - $result = $this->logbooks_model->is_public_slug_available($this->input->post('public_slug')); - - if($result == true) { - $data['slugAvailable'] = true; - } else { - $data['slugAvailable'] = false; - } - - $this->load->view('logbooks/components/publicSlugInputValidation', $data); - } - - public function save_publicsearch() { - $this->load->model('logbooks_model'); - $returndata = $this->logbooks_model->save_public_search($this->input->post('public_search'), $this->input->post('logbook_id')); - echo "
Public Search Settings Saved
"; - } - - public function save_publicslug() { - $this->load->model('logbooks_model'); - - $this->load->library('form_validation'); - - $this->form_validation->set_rules('public_slug', 'Public Slug', 'required|alpha_numeric'); - - if ($this->form_validation->run() == FALSE) - { - echo "
Oops! This Public Slug is unavailable
"; - echo validation_errors(); - } - else - { - $this->load->model('logbooks_model'); - $result = $this->logbooks_model->is_public_slug_available($this->input->post('public_slug')); - - - if($result == true) { - $returndata = $this->logbooks_model->save_public_slug($this->input->post('public_slug'), $this->input->post('logbook_id')); - echo "
Public Slug Saved
"; - } else { - echo "
Oops! This Public Slug is unavailable
"; - } - } - } - - public function remove_publicslug() { - $this->load->model('logbooks_model'); - - $this->logbooks_model->remove_public_slug($this->input->post('logbook_id')); - if ($this->db->affected_rows() > 0) { - echo "
Public Slug Removed
"; - } else { - echo "
Oops! This Public Slug could not be removed
"; - } - } - -} diff --git a/application/controllers/Map.php b/application/controllers/Map.php index c6d99a86c..158f7bece 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -25,4 +25,17 @@ class Map extends CI_Controller { echo json_encode(array_merge($plot_array, $station_array)); } + // Generic fonction for return Json for MAP // + public function glob_plot() { + $footerData = []; + $footerData['scripts'] = [ + 'assets/js/globe/globe.gl.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/globe/globe.gl.js")), + 'assets/js/sections/globe.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/globe.js")), + ]; + $this->load->view('interface_assets/header'); + $this->load->view('globe/index'); + $this->load->view('interface_assets/footer',$footerData); + + } + } diff --git a/application/controllers/Qsl.php b/application/controllers/Qsl.php index e1c76750c..e6ee4b678 100644 --- a/application/controllers/Qsl.php +++ b/application/controllers/Qsl.php @@ -42,15 +42,8 @@ class Qsl extends CI_Controller { public function delete() { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - $id = $this->input->post('id'); $this->load->model('Qsl_model'); - - $path = $this->Qsl_model->get_imagePath('p'); - $file = $this->Qsl_model->getFilename($id)->row(); - $filename = $file->filename; - unlink($path.'/'.$filename); - $this->Qsl_model->deleteQsl($id); } @@ -174,4 +167,4 @@ class Qsl extends CI_Controller { $this->load->view('qslcard/qslcarousel', $data); } -} \ No newline at end of file +} diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index 580e05223..6f6118d21 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -33,6 +33,48 @@ class QSO extends CI_Controller { $data['user_default_band'] = $this->session->userdata('user_default_band'); $data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true); + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'iota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_iota_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_iota_to_qso_tab'] = 0; + } + + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'sota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_sota_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_sota_to_qso_tab'] = 0; + } + + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'wwff','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_wwff_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_wwff_to_qso_tab'] = 0; + } + + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'pota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_pota_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_pota_to_qso_tab'] = 0; + } + + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'sig','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_sig_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_sig_to_qso_tab'] = 0; + } + + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'dok','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_dok_to_qso_tab'] = $qkey_opt[0]->option_value; + } else { + $data['user_dok_to_qso_tab'] = 0; + } + $this->load->library('form_validation'); $this->form_validation->set_rules('start_date', 'Date', 'required'); diff --git a/application/controllers/Satellite.php b/application/controllers/Satellite.php new file mode 100644 index 000000000..60a6180ee --- /dev/null +++ b/application/controllers/Satellite.php @@ -0,0 +1,141 @@ +load->helper(array('form', 'url')); + + $this->load->model('user_model'); + if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + } + + public function index() + { + $this->load->model('satellite_model'); + + $pageData['satellites'] = $this->satellite_model->get_all_satellites(); + + $footerData = []; + $footerData['scripts'] = [ + 'assets/js/sections/satellite.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satellite.js")), + ]; + + // Render Page + $pageData['page_title'] = "Satellites"; + $this->load->view('interface_assets/header', $pageData); + $this->load->view('satellite/index'); + $this->load->view('interface_assets/footer', $footerData); + } + + public function create() { + $data['page_title'] = "Create Satellite"; + $this->load->view('satellite/create', $data); + } + + public function createSatellite() { + $this->load->model('satellite_model'); + + $this->satellite_model->add(); + } + + public function edit() + { + $this->load->model('satellite_model'); + + $item_id_clean = $this->security->xss_clean($this->input->post('id')); + + $satellite_query = $this->satellite_model->getsatellite($item_id_clean); + + $mode_query = $this->satellite_model->getsatmodes($item_id_clean); + + $data['satellite'] = $satellite_query->row(); + $data['satmodes'] = $mode_query->result(); + + $data['page_title'] = "Edit Satellite"; + + $this->load->view('satellite/edit', $data); + } + + public function saveupdatedSatellite() { + $this->load->model('satellite_model'); + + $id = $this->security->xss_clean($this->input->post('id', true)); + $satellite['name'] = $this->security->xss_clean($this->input->post('name')); + $satellite['exportname'] = $this->security->xss_clean($this->input->post('exportname')); + $satellite['orbit'] = $this->security->xss_clean($this->input->post('orbit')); + + $this->satellite_model->saveupdatedsatellite($id, $satellite); + echo json_encode(array('message' => 'OK')); + return; + } + + public function delete() { + $id = $this->input->post('id'); + $this->load->model('satellite_model'); + $this->satellite_model->delete($id); + } + + public function deleteSatMode() { + $id = $this->input->post('id'); + $this->load->model('satellite_model'); + $this->satellite_model->deleteSatMode($id); + } + + public function saveSatellite() { + $id = $this->security->xss_clean($this->input->post('id')); + $satellite['name'] = $this->security->xss_clean($this->input->post('name')); + + $this->load->model('satellite_model'); + $this->satellite_model->saveSatellite($id, $satellite); + + header('Content-Type: application/json'); + echo json_encode(array('message' => 'OK')); + return; + } + + public function saveSatModeChanges() { + $id = $this->security->xss_clean($this->input->post('id')); + $satmode['name'] = $this->security->xss_clean($this->input->post('name')); + $satmode['uplink_mode'] = $this->security->xss_clean($this->input->post('uplink_mode')); + $satmode['uplink_freq'] = $this->security->xss_clean($this->input->post('uplink_freq')); + $satmode['downlink_mode'] = $this->security->xss_clean($this->input->post('downlink_mode')); + $satmode['downlink_freq'] = $this->security->xss_clean($this->input->post('downlink_freq')); + + $this->load->model('satellite_model'); + $this->satellite_model->saveSatelliteMode($id, $satmode); + + header('Content-Type: application/json'); + echo json_encode(array('message' => 'OK')); + return; + } + + public function addSatMode() { + $this->load->model('satellite_model'); + $inserted_id = $this->satellite_model->insertSatelliteMode(); + + header('Content-Type: application/json'); + echo json_encode(array('inserted_id' => $inserted_id)); + return; + } + + public function satellite_data() { + $this->load->model('satellite_model'); + $satellite_data = $this->satellite_model->satellite_data(); + $sat_list = array(); + foreach ($satellite_data as $sat) { + $sat_list[$sat->satellite]['Modes'][$sat->satmode][0]['Uplink_Mode'] = $sat->Uplink_Mode; + $sat_list[$sat->satellite]['Modes'][$sat->satmode][0]['Uplink_Freq'] = $sat->Uplink_Freq; + $sat_list[$sat->satellite]['Modes'][$sat->satmode][0]['Downlink_Mode'] = $sat->Downlink_Mode; + $sat_list[$sat->satellite]['Modes'][$sat->satmode][0]['Downlink_Freq'] = $sat->Downlink_Freq; + } + header('Content-Type: application/json'); + echo json_encode($sat_list, JSON_FORCE_OBJECT); + } + +} diff --git a/application/controllers/Stationsetup.php b/application/controllers/Stationsetup.php index 0d0fca6c7..4343dcf08 100644 --- a/application/controllers/Stationsetup.php +++ b/application/controllers/Stationsetup.php @@ -92,7 +92,7 @@ class Stationsetup extends CI_Controller { public function getActiveStation() { $active_loc = $this->stations->find_active(); echo json_encode($active_loc); - } + } public function setFavorite_json() { $id2fav = xss_clean($this->input->post('id2Favorite', true)); @@ -160,6 +160,61 @@ class Stationsetup extends CI_Controller { $this->load->view('stationsetup/create', $data); } + public function editContainerName() { + $this->load->model('stationsetup_model'); + $data['container'] = $this->stationsetup_model->getContainer(xss_clean($this->input->post('id', true)))->row(); + $data['page_title'] = "Edit container name"; + $this->load->view('stationsetup/edit', $data); + } + + public function saveContainerName() { + $this->load->model('stationsetup_model'); + $this->stationsetup_model->saveContainer(); + } + + public function editLinkedLocations() { + $this->load->model('logbooks_model'); + $data['station_locations_list'] = $this->stations->all_of_user(); + $station_logbook_details_query = $this->logbooks_model->logbook(xss_clean($this->input->post('id', true))); + $data['station_logbook_details'] = $station_logbook_details_query->row(); + $data['station_locations_linked'] = $this->logbooks_model->list_logbooks_linked($this->input->post('id', true)); + $data['page_title'] = "Edit lined locations"; + $this->load->view('stationsetup/linkedlocations', $data); + } + + public function editVisitorLink() { + $this->load->model('logbooks_model'); + $station_logbook_details_query = $this->logbooks_model->logbook(xss_clean($this->input->post('id', true))); + $data['station_logbook_details'] = $station_logbook_details_query->row(); + $data['station_locations_list'] = $this->stations->all_of_user(); + $data['page_title'] = "Edit visitor site"; + $this->load->view('stationsetup/visitor', $data); + } + + public function saveVisitorLink() { + $name = xss_clean($this->input->post('name', true)); + $id = xss_clean($this->input->post('id', true)); + + $this->load->model('stationsetup_model'); + $result = $this->stationsetup_model->is_public_slug_available($name); + if (!($result)) { + $current_lb4slug=$this->stationsetup_model->public_slug_exists_logbook_id($name); + if ($current_lb4slug == $id) { + $result=true; // Set to true if we want to update the SAME slug for the SAME Logbook + } + } + + if($result == true) { + $this->stationsetup_model->saveVisitorLink($id, $name); + $data['success'] = 1; + } else { + $data['success'] = 0; + $data['flashdata'] = 'Error. Link is already in use!'; + } + + echo json_encode($data); + } + public function newLocation() { $this->load->model('stations'); $this->load->model('dxcc'); @@ -178,20 +233,26 @@ class Stationsetup extends CI_Controller { $result = $this->logbooks_model->show_all()->result(); foreach ($result as $entry) { $single=(Object)[]; - $single->logbook_id=$entry->logbook_id; - $single->logbook_name=$entry->logbook_name; - $single->logbook_state=$this->lbstate2html($entry->logbook_id); - $single->logbook_edit=$this->lbedit2html($entry->logbook_id,$entry->logbook_name); - $single->logbook_delete=$this->lbdel2html($entry->logbook_id,$entry->logbook_name); - $single->logbook_link=$this->lblnk2html($entry->public_slug,$entry->logbook_name); - $single->logbook_publicsearch = $this->lbpublicsearch2html($entry->public_search); + $single->logbook_id = $entry->logbook_id; + $single->logbook_name = $this->lbname2html($entry->logbook_id, $entry->logbook_name); + $single->logbook_state = $this->lbstate2html($entry->logbook_id); + $single->logbook_edit = $this->lbedit2html($entry->logbook_id); + $single->logbook_delete = $this->lbdel2html($entry->logbook_id, $entry->logbook_name); + $single->logbook_link = $this->lblnk2html($entry->public_slug, $entry->logbook_name, $entry->logbook_id); + $single->logbook_publicsearch = $this->lbpublicsearch2html($entry->public_search, $entry->logbook_id); array_push($hres,$single); } echo json_encode($hres); } - private function lbpublicsearch2html($publicsearch) { - return ($publicsearch=='1' ? 'Enabled' : 'Disabled'); + private function lbname2html($id, $name) { + return $name . ' '; + } + + private function lbpublicsearch2html($publicsearch, $id) { + $htmret = ($publicsearch=='1' ? 'Enabled' : 'Disabled'); + $htmret .= '
'; + return $htmret; } @@ -206,28 +267,24 @@ class Stationsetup extends CI_Controller { private function lbdel2html($id, $logbook_name) { if($this->session->userdata('active_station_logbook') != $id) { - $htmret=''; + $htmret=''; } else { $htmret=''; } return $htmret; } - private function lblnk2html($public_slug, $logbook_name) { + private function lblnk2html($public_slug, $logbook_name, $id) { + $htmret = ' '; if($public_slug != '') { - $htmret=''; - } else { - $htmret=''; + $htmret .= ''; + $htmret .= ' '; } return $htmret; } - private function lbps2html($id, $logbook_name) { - return ''; - } - - private function lbedit2html($id, $logbook_name) { - return ''; + private function lbedit2html($id) { + return ''; } public function fetchLocations() { @@ -285,7 +342,7 @@ class Stationsetup extends CI_Controller { $returntext .= '' . lang('station_location_active') . '
'; } - $returntext .='' . $qso_total .' '. lang('gen_hamradio_qso') . ''; + $returntext .='' . $qso_total .' '. lang('gen_hamradio_qso') . ''; return $returntext; } @@ -318,4 +375,57 @@ class Stationsetup extends CI_Controller { return $returntext; } + public function remove_publicslug() { + $id = xss_clean($this->input->post('id',true)); + if ($id ?? '' != '') { + $this->load->model('stationsetup_model'); + $this->stationsetup_model->remove_public_slug($id); + $data['success']=1; + } else { + $data['success']=0; + $data['flashdata']='Not allowed'; + } + echo json_encode($data); + } + + public function togglePublicSearch() { + $id = xss_clean($this->input->post('id',true)); + $publicSearch = xss_clean($this->input->post('checked',true)); + if ($id ?? '' != '') { + $this->load->model('stationsetup_model'); + $this->stationsetup_model->togglePublicSearch($id, $publicSearch); + $data['success']=1; + } else { + $data['success']=0; + $data['flashdata']='Not allowed'; + } + echo json_encode($data); + } + + public function unLinkLocations() { + $containerid = xss_clean($this->input->post('containerid',true)); + $locationid = xss_clean($this->input->post('locationid',true)); + $this->load->model('stationsetup_model'); + $this->stationsetup_model->unLinkLocations($containerid, $locationid); + $data['success']=1; + echo json_encode($data); + } + + public function linkLocations() { + $containerid = xss_clean($this->input->post('containerid',true)); + $locationid = xss_clean($this->input->post('locationid',true)); + + $this->load->model('stationsetup_model'); + + if(!$this->stationsetup_model->relationship_exists($containerid, $locationid)) { + // If no link exists, create + $this->stationsetup_model->create_logbook_location_link($containerid, $locationid); + $data['success']=1; + $data['locationdata'] = $this->stationsetup_model->locationInfo($locationid)->result(); + } else { + $data['success']=0; + $data['flashdata']='Error'; + } + echo json_encode($data); + } } diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 6ff666e4a..542a4e380 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -11,7 +11,7 @@ class Update extends CI_Controller { function __construct() { parent::__construct(); - + if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') { echo "Maintenance Mode is active. Try again later.\n"; redirect('user/login'); @@ -45,7 +45,6 @@ class Update extends CI_Controller { */ public function dxcc_entities() { // Load Database connectors - $this->load->model('dxcc_entities'); // Load the cty file $xml_data = simplexml_load_file($this->make_update_path("cty.xml")); @@ -97,7 +96,6 @@ class Update extends CI_Controller { */ public function dxcc_exceptions() { // Load Database connectors - $this->load->model('dxcc_exceptions'); // Load the cty file $xml_data = simplexml_load_file($this->make_update_path("cty.xml")); @@ -139,7 +137,6 @@ class Update extends CI_Controller { */ public function dxcc_prefixes() { // Load Database connectors - $this->load->model('dxcc_prefixes'); // Load the cty file $xml_data = simplexml_load_file($this->make_update_path("cty.xml")); @@ -261,22 +258,45 @@ class Update extends CI_Controller { } public function check_missing_dxcc($all = false){ - $this->load->model('logbook_model'); - $this->logbook_model->check_missing_dxcc_id($all); + $this->load->model('user_model'); + if (!$this->user_model->authorize(99)) { + $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); + redirect('dashboard'); + } + $this->load->model('logbook_model'); + $this->logbook_model->check_missing_dxcc_id($all); } public function check_missing_continent() { + $this->load->model('user_model'); + if (!$this->user_model->authorize(99)) { + $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); + redirect('dashboard'); + } + $this->load->model('logbook_model'); $this->logbook_model->check_missing_continent(); } public function update_distances() { + $this->load->model('user_model'); + if (!$this->user_model->authorize(99)) { + $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); + redirect('dashboard'); + } + $this->load->model('logbook_model'); $this->logbook_model->update_distances(); } public function check_missing_grid($all = false){ + $this->load->model('user_model'); + if (!$this->user_model->authorize(99)) { + $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); + redirect('dashboard'); + } + $this->load->model('logbook_model'); $this->logbook_model->check_missing_grid_id($all); } diff --git a/application/controllers/User.php b/application/controllers/User.php index 4b99291cc..0c67da620 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -97,6 +97,12 @@ class User extends CI_Controller { $data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter'); $data['user_hamsat_key'] = $this->input->post('user_hamsat_key'); $data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only'); + $data['user_iota_to_qso_tab'] = $this->input->post('user_iota_to_qso_tab'); + $data['user_sota_to_qso_tab'] = $this->input->post('user_sota_to_qso_tab'); + $data['user_wwff_to_qso_tab'] = $this->input->post('user_wwff_to_qso_tab'); + $data['user_pota_to_qso_tab'] = $this->input->post('user_pota_to_qso_tab'); + $data['user_sig_to_qso_tab'] = $this->input->post('user_sig_to_qso_tab'); + $data['user_dok_to_qso_tab'] = $this->input->post('user_dok_to_qso_tab'); $data['language'] = $this->input->post('language'); $this->load->view('user/edit', $data); } else { @@ -138,6 +144,12 @@ class User extends CI_Controller { $this->input->post('language'), $this->input->post('user_hamsat_key'), $this->input->post('user_hamsat_workable_only'), + $this->input->post('user_iota_to_qso_tab'), + $this->input->post('user_sota_to_qso_tab'), + $this->input->post('user_wwff_to_qso_tab'), + $this->input->post('user_pota_to_qso_tab'), + $this->input->post('user_sig_to_qso_tab'), + $this->input->post('user_dok_to_qso_tab') )) { // Check for errors case EUSERNAMEEXISTS: @@ -515,6 +527,60 @@ class User extends CI_Controller { } } + if($this->input->post('user_iota_to_qso_tab')) { + $data['user_iota_to_qso_tab'] = $this->input->post('user_iota_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'iota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_iota_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + + if($this->input->post('user_sota_to_qso_tab')) { + $data['user_sota_to_qso_tab'] = $this->input->post('user_sota_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'sota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_sota_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + + if($this->input->post('user_wwff_to_qso_tab')) { + $data['user_wwff_to_qso_tab'] = $this->input->post('user_wwff_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'wwff','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_wwff_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + + if($this->input->post('user_pota_to_qso_tab')) { + $data['user_pota_to_qso_tab'] = $this->input->post('user_pota_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'pota','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_pota_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + + if($this->input->post('user_sig_to_qso_tab')) { + $data['user_sig_to_qso_tab'] = $this->input->post('user_sig_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'sig','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_sig_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + + if($this->input->post('user_dok_to_qso_tab')) { + $data['user_dok_to_qso_tab'] = $this->input->post('user_dok_to_qso_tab', false); + } else { + $qkey_opt=$this->user_options_model->get_options('qso_tab',array('option_name'=>'dok','option_key'=>'show'))->result(); + if (count($qkey_opt)>0) { + $data['user_dok_to_qso_tab'] = $qkey_opt[0]->option_value; + } + } + // [MAP Custom] GET user options // $options_object = $this->user_options_model->get_options('map_custom')->result(); if (count($options_object)>0) { @@ -675,6 +741,7 @@ class User extends CI_Controller { $this->form_validation->set_rules('id', 'user_id', 'required'); $data = $query->row(); + $data->page_title = "Delete User"; if ($this->form_validation->run() == FALSE) { diff --git a/application/controllers/Visitor.php b/application/controllers/Visitor.php index 73bf2a6ea..54eb7ca18 100644 --- a/application/controllers/Visitor.php +++ b/application/controllers/Visitor.php @@ -36,14 +36,6 @@ class Visitor extends CI_Controller { $this->load->model('user_model'); - // Check if users logged in - if($this->user_model->validate_session() != 0) { - // If environment is set to development then show the debug toolbar - if(ENVIRONMENT == 'development') { - $this->output->enable_profiler(TRUE); - } - } - // Check slug passed and is valid if ($this->security->xss_clean($public_slug, TRUE) === FALSE) { @@ -164,7 +156,7 @@ class Visitor extends CI_Controller { $qsos = $this->logbook_model->get_qsos('18', null, $logbooks_locations_array); // [PLOT] ADD plot // $plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result()); - + header('Content-Type: application/json; charset=utf-8'); echo json_encode($plot_array); } diff --git a/application/language/bulgarian/account_lang.php b/application/language/bulgarian/account_lang.php index 835c6d96d..7543b566c 100644 --- a/application/language/bulgarian/account_lang.php +++ b/application/language/bulgarian/account_lang.php @@ -132,3 +132,6 @@ $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; $lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; $lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; + +$lang['account_references_show'] = "Show Reference Fields on QSO Tab"; +$lang['account_show_references_on_1st_tab'] = "The enabled items will be shown on the QSO tab rather than the General tab."; diff --git a/application/language/bulgarian/contesting_lang.php b/application/language/bulgarian/contesting_lang.php index 35976bd4a..7f29801fb 100644 --- a/application/language/bulgarian/contesting_lang.php +++ b/application/language/bulgarian/contesting_lang.php @@ -27,6 +27,7 @@ $lang['contesting_btn_save_qso'] = 'Запазване на QSO'; $lang['contesting_title_callsign_suggestions'] = 'Предложения за инициали'; $lang['contesting_title_contest_logbook'] = 'Дневник на състезанието'; -$lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to'] = 'Copy received exchange to'; +$lang['contesting_copy_exch_hint'] = 'Exchange is only copied if it is matching rules for the selected field!'; diff --git a/application/language/bulgarian/filter_lang.php b/application/language/bulgarian/filter_lang.php index 38b597a6f..3cd7f18df 100644 --- a/application/language/bulgarian/filter_lang.php +++ b/application/language/bulgarian/filter_lang.php @@ -117,6 +117,7 @@ $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; $lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; +$lang['filter_actions_print_include_ref'] = "Include reference? (SIG, SOTA, POTA, IOTA, WWFF; If available in location)"; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; $lang['filter_actions_qsl_slideshow'] = 'QSL Slideshow'; diff --git a/application/language/bulgarian/general_words_lang.php b/application/language/bulgarian/general_words_lang.php index 9fec4422a..1a320dcd4 100644 --- a/application/language/bulgarian/general_words_lang.php +++ b/application/language/bulgarian/general_words_lang.php @@ -19,6 +19,7 @@ $lang['general_word_cancel'] = "Cancel"; $lang['general_word_ok'] = "OK"; $lang['general_word_show'] = "Show"; $lang['general_word_attention'] = "Attention"; +$lang['general_word_message'] = "Message"; $lang['general_word_enabled'] = "Enabled"; $lang['general_word_disabled'] = "Disabled"; $lang['general_word_export'] = "Export"; @@ -48,6 +49,7 @@ $lang['general_word_satellite_short'] = 'Сат'; $lang['general_word_notes'] = 'Бележки'; $lang['general_word_country'] = 'Държава'; $lang['general_word_city'] = 'Град'; +$lang['general_word_age'] = 'Age'; $lang['general_word_total'] = 'Общо'; $lang['general_word_year'] = 'Година'; @@ -153,6 +155,7 @@ $lang['gen_hamradio_qslvia'] = 'QSL via'; $lang['gen_hamradio_qslmsg'] = 'QSL Msg'; $lang['gen_hamradio_locator'] = 'Локатор'; $lang['gen_hamradio_transmit_power'] = 'Мощност на предавателя (W)'; +$lang['gen_hamradio_receive_power'] = 'RX Power (W)'; $lang['gen_hamradio_propagation_mode'] = 'Propagation Mode'; $lang['gen_hamradio_satellite_name'] = 'Име на сателита'; @@ -232,4 +235,5 @@ $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go сюда, чтобы создать его!'; $lang['hams_at_no_activations_found'] = 'не найдены предстоящие активации. Проверьте позже.'; +$lang['gen_add_to_contest'] = "Add QSOs to Contest"; $lang['datatables_language'] = "en-GB"; diff --git a/application/language/russian/menu_lang.php b/application/language/russian/menu_lang.php index 998a0525c..58c4cfd52 100644 --- a/application/language/russian/menu_lang.php +++ b/application/language/russian/menu_lang.php @@ -105,3 +105,6 @@ $lang['menu_forum'] = 'Форум'; $lang['menu_logout'] = 'Выход'; $lang['menu_extras'] = "Extras"; +$lang['menu_satellites'] = 'Satellites'; +$lang['menu_dx_calendar'] = 'DX Calendar'; +$lang['menu_contest_calendar'] = 'Contest Calendar'; diff --git a/application/language/spanish/account_lang.php b/application/language/spanish/account_lang.php index 118cc49a9..f9f6178ea 100644 --- a/application/language/spanish/account_lang.php +++ b/application/language/spanish/account_lang.php @@ -132,3 +132,6 @@ $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; $lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; $lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; + +$lang['account_references_show'] = "Show Reference Fields on QSO Tab"; +$lang['account_show_references_on_1st_tab'] = "The enabled items will be shown on the QSO tab rather than the General tab."; diff --git a/application/language/spanish/contesting_lang.php b/application/language/spanish/contesting_lang.php index 58d878b8c..cdfb26ef2 100644 --- a/application/language/spanish/contesting_lang.php +++ b/application/language/spanish/contesting_lang.php @@ -27,6 +27,7 @@ $lang['contesting_btn_save_qso'] = 'Guardar QSO'; $lang['contesting_title_callsign_suggestions'] = 'Indicativos sugeridos'; $lang['contesting_title_contest_logbook'] = 'Libro de guardia del concurso'; -$lang['contesting_copy_exch_to_dok'] = '¡Copiar intercambio recibido al campo DOK de la base de datos!'; +$lang['contesting_copy_exch_to'] = '¡Copiar intercambio recibido al campo'; +$lang['contesting_copy_exch_hint'] = 'Exchange is only copied if it is matching rules for the selected field!'; diff --git a/application/language/spanish/filter_lang.php b/application/language/spanish/filter_lang.php index 3468f70e7..0e681b153 100644 --- a/application/language/spanish/filter_lang.php +++ b/application/language/spanish/filter_lang.php @@ -117,6 +117,7 @@ $lang['filter_actions_print_label'] = 'Imprimir Etiqueta'; $lang['filter_actions_start_print_title'] = 'Imprimir Etiquetas'; $lang['filter_actions_print_include_via'] = "Incluir Vía"; $lang['filter_actions_start_print'] = '¿Iniciar impresión desde?'; +$lang['filter_actions_print_include_ref'] = "Include reference? (SIG, SOTA, POTA, IOTA, WWFF; If available in location)"; $lang['filter_actions_print'] = 'Imprimir'; $lang['filter_actions_qsl_slideshow'] = 'Presentación QSL'; $lang['filter_actions_delete'] = 'Eliminar'; diff --git a/application/language/spanish/general_words_lang.php b/application/language/spanish/general_words_lang.php index 01cdace95..eb0d13864 100644 --- a/application/language/spanish/general_words_lang.php +++ b/application/language/spanish/general_words_lang.php @@ -19,6 +19,7 @@ $lang['general_word_cancel'] = "Cancelar"; $lang['general_word_ok'] = "OK"; $lang['general_word_show'] = "Show"; +$lang['general_word_message'] = "Message"; $lang['general_word_attention'] = "Atención"; $lang['general_word_enabled'] = "Activado"; $lang['general_word_disabled'] = "Desactivado"; @@ -49,6 +50,7 @@ $lang['general_word_satellite_short'] = 'Sat'; $lang['general_word_notes'] = 'Notas'; $lang['general_word_country'] = 'País'; $lang['general_word_city'] = 'Ciudad'; +$lang['general_word_age'] = 'Age'; $lang['general_word_total'] = 'Total'; $lang['general_word_year'] = 'Año'; @@ -154,6 +156,7 @@ $lang['gen_hamradio_qslvia'] = 'QSL via'; $lang['gen_hamradio_qslmsg'] = 'Mensaje QSL'; $lang['gen_hamradio_locator'] = 'Localizador'; $lang['gen_hamradio_transmit_power'] = 'Potencia de transmisión (W)'; +$lang['gen_hamradio_receive_power'] = 'RX Power (W)'; $lang['gen_hamradio_propagation_mode'] = 'Modo de propagación'; $lang['gen_hamradio_satellite_name'] = 'Nombre del Satélite'; @@ -232,5 +235,6 @@ $lang['dashboard_locations_warning'] = 'No tiene localizaciones de estaciones. $lang['dashboard_logbooks_warning'] = 'No tiene libro de guardias. ¡Haga clic aquí para crear uno!'; $lang['hams_at_no_activations_found'] = 'No hay activaciones próximas. Por favor vuelve a revisar más tarde.'; +$lang['gen_add_to_contest'] = "Add QSOs to Contest"; $lang['datatables_language'] = "es-ES"; diff --git a/application/language/spanish/menu_lang.php b/application/language/spanish/menu_lang.php index 3aba2800b..786265f58 100644 --- a/application/language/spanish/menu_lang.php +++ b/application/language/spanish/menu_lang.php @@ -105,3 +105,6 @@ $lang['menu_forum'] = 'Forum'; $lang['menu_logout'] = 'Logout'; $lang['menu_extras'] = "Extras"; +$lang['menu_satellites'] = 'Satellites'; +$lang['menu_dx_calendar'] = 'DX Calendar'; +$lang['menu_contest_calendar'] = 'Contest Calendar'; diff --git a/application/language/swedish/account_lang.php b/application/language/swedish/account_lang.php index bdedbfdaf..eb77aa2d3 100644 --- a/application/language/swedish/account_lang.php +++ b/application/language/swedish/account_lang.php @@ -132,3 +132,6 @@ $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; $lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; $lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; + +$lang['account_references_show'] = "Show Reference Fields on QSO Tab"; +$lang['account_show_references_on_1st_tab'] = "The enabled items will be shown on the QSO tab rather than the General tab."; diff --git a/application/language/swedish/contesting_lang.php b/application/language/swedish/contesting_lang.php index 624c15423..bd127a0e8 100644 --- a/application/language/swedish/contesting_lang.php +++ b/application/language/swedish/contesting_lang.php @@ -27,6 +27,7 @@ $lang['contesting_btn_save_qso'] = 'Spara QSO'; $lang['contesting_title_callsign_suggestions'] = 'Signal-förslag'; $lang['contesting_title_contest_logbook'] = 'Contest loggbok'; -$lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to'] = 'Copy received exchange to'; +$lang['contesting_copy_exch_hint'] = 'Exchange is only copied if it is matching rules for the selected field!'; diff --git a/application/language/swedish/filter_lang.php b/application/language/swedish/filter_lang.php index 38b597a6f..3cd7f18df 100644 --- a/application/language/swedish/filter_lang.php +++ b/application/language/swedish/filter_lang.php @@ -117,6 +117,7 @@ $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; $lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; +$lang['filter_actions_print_include_ref'] = "Include reference? (SIG, SOTA, POTA, IOTA, WWFF; If available in location)"; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; $lang['filter_actions_qsl_slideshow'] = 'QSL Slideshow'; diff --git a/application/language/swedish/general_words_lang.php b/application/language/swedish/general_words_lang.php index d81a7f7e5..e7fac7253 100644 --- a/application/language/swedish/general_words_lang.php +++ b/application/language/swedish/general_words_lang.php @@ -19,6 +19,7 @@ $lang['general_word_not_display'] = "Not display"; $lang['general_word_show'] = "Show"; $lang['general_word_icon'] = "Icon"; +$lang['general_word_message'] = "Message"; $lang['general_word_cancel'] = "Cancel"; $lang['general_word_ok'] = "OK"; $lang['general_word_attention'] = "Attention"; @@ -50,6 +51,7 @@ $lang['general_word_satellite_short'] = 'Sat'; $lang['general_word_notes'] = 'Anteckningar'; $lang['general_word_country'] = 'Land'; $lang['general_word_city'] = 'City'; +$lang['general_word_age'] = 'Age'; $lang['general_word_total'] = 'Totalt'; $lang['general_word_day'] = "Day"; @@ -154,6 +156,7 @@ $lang['gen_hamradio_qslvia'] = 'QSL via'; $lang['gen_hamradio_qslmsg'] = 'QSL Msg'; $lang['gen_hamradio_locator'] = 'Lokator'; $lang['gen_hamradio_transmit_power'] = 'Effekt (W)'; +$lang['gen_hamradio_receive_power'] = 'RX Power (W)'; $lang['gen_hamradio_propagation_mode'] = 'Propagation Mode'; $lang['gen_hamradio_satellite_name'] = 'Satellitnamn'; @@ -232,6 +235,7 @@ $lang['dashboard_country_files_warning'] = 'You need to update country files! Go $lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; +$lang['gen_add_to_contest'] = "Add QSOs to Contest"; $lang['hams_at_no_activations_found'] = 'No upcoming activations found. Please check back later.'; $lang['datatables_language'] = "en-GB"; diff --git a/application/language/swedish/menu_lang.php b/application/language/swedish/menu_lang.php index cc47624bc..a4876c25e 100644 --- a/application/language/swedish/menu_lang.php +++ b/application/language/swedish/menu_lang.php @@ -105,3 +105,6 @@ $lang['menu_forum'] = 'Forum'; $lang['menu_logout'] = 'Logga ut'; $lang['menu_extras'] = "Extras"; +$lang['menu_satellites'] = 'Satellites'; +$lang['menu_dx_calendar'] = 'DX Calendar'; +$lang['menu_contest_calendar'] = 'Contest Calendar'; diff --git a/application/language/turkish/account_lang.php b/application/language/turkish/account_lang.php index 4880575ef..8b250f043 100644 --- a/application/language/turkish/account_lang.php +++ b/application/language/turkish/account_lang.php @@ -132,3 +132,6 @@ $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; $lang['account_hamsat_hint'] = "See your profile at https://hams.at/users/settings."; $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; $lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; + +$lang['account_references_show'] = "Show Reference Fields on QSO Tab"; +$lang['account_show_references_on_1st_tab'] = "The enabled items will be shown on the QSO tab rather than the General tab."; diff --git a/application/language/turkish/contesting_lang.php b/application/language/turkish/contesting_lang.php index 4cec65223..a876f1133 100644 --- a/application/language/turkish/contesting_lang.php +++ b/application/language/turkish/contesting_lang.php @@ -27,6 +27,7 @@ $lang['contesting_btn_save_qso'] = 'QSO\'yu kaydet'; $lang['contesting_title_callsign_suggestions'] = 'Çağrı Kodu Önerileri'; $lang['contesting_title_contest_logbook'] = 'Yarışma kayıt defteri'; -$lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to'] = 'Copy received exchange to'; +$lang['contesting_copy_exch_hint'] = 'Exchange is only copied if it is matching rules for the selected field!'; diff --git a/application/language/turkish/filter_lang.php b/application/language/turkish/filter_lang.php index 38b597a6f..3cd7f18df 100644 --- a/application/language/turkish/filter_lang.php +++ b/application/language/turkish/filter_lang.php @@ -117,6 +117,7 @@ $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; $lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; +$lang['filter_actions_print_include_ref'] = "Include reference? (SIG, SOTA, POTA, IOTA, WWFF; If available in location)"; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; $lang['filter_actions_qsl_slideshow'] = 'QSL Slideshow'; diff --git a/application/language/turkish/general_words_lang.php b/application/language/turkish/general_words_lang.php index 2e1314b92..ca74289c3 100644 --- a/application/language/turkish/general_words_lang.php +++ b/application/language/turkish/general_words_lang.php @@ -19,6 +19,7 @@ $lang['general_word_cancel'] = "Cancel"; $lang['general_word_ok'] = "OK"; $lang['general_word_show'] = "Show"; $lang['general_word_attention'] = "Attention"; +$lang['general_word_message'] = "Message"; $lang['general_word_enabled'] = "Enabled"; $lang['general_word_disabled'] = "Disabled"; $lang['general_word_export'] = "Export"; @@ -48,6 +49,7 @@ $lang['general_word_satellite_short'] = 'Uydu'; $lang['general_word_notes'] = 'Notlar'; $lang['general_word_country'] = 'Ülke'; $lang['general_word_city'] = 'City'; +$lang['general_word_age'] = 'Age'; $lang['general_word_total'] = 'Toplam'; $lang['general_word_year'] = 'Yıl'; @@ -153,6 +155,7 @@ $lang['gen_hamradio_qslvia'] = 'QSL via'; $lang['gen_hamradio_qslmsg'] = 'QSL Msg'; $lang['gen_hamradio_locator'] = 'Konum kodu'; $lang['gen_hamradio_transmit_power'] = 'Yayın Gücü (W)'; +$lang['gen_hamradio_receive_power'] = 'RX Power (W)'; $lang['gen_hamradio_propagation_mode'] = 'Yayın Mode'; $lang['gen_hamradio_satellite_name'] = 'Uydu Adı'; @@ -232,4 +235,5 @@ $lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go "\u{1F1FD}\u{1F1F0}" //REPUBLIC OF KOSOVO ); - public function get($dxcc) - { + public function get($dxcc) { + if ($dxcc ?? '' == '') { $dxcc='0'; } // Failover if Empty or NULL return $this->dxccFlags[$dxcc]; } } diff --git a/application/libraries/Hamqth.php b/application/libraries/Hamqth.php index 195d284b0..137fe5a8c 100644 --- a/application/libraries/Hamqth.php +++ b/application/libraries/Hamqth.php @@ -17,6 +17,8 @@ class Hamqth { curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $xml = curl_exec($ch); curl_close($ch); @@ -40,6 +42,8 @@ class Hamqth { curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $xml = curl_exec($ch); curl_close($ch); @@ -66,6 +70,8 @@ class Hamqth { curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $xml = curl_exec($ch); curl_close($ch); diff --git a/application/libraries/Qrz.php b/application/libraries/Qrz.php index 40fb0552b..d62d58fa8 100755 --- a/application/libraries/Qrz.php +++ b/application/libraries/Qrz.php @@ -17,6 +17,8 @@ class Qrz { curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $xml = curl_exec($ch); curl_close($ch); @@ -40,6 +42,8 @@ class Qrz { curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $xml = curl_exec($ch); curl_close($ch); @@ -65,6 +69,8 @@ class Qrz { curl_setopt($ch, CURLOPT_URL, $xml_feed_url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); $xml = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); diff --git a/application/migrations/014_migration.php b/application/migrations/014_migration.php index 5f740302a..021b9cd50 100755 --- a/application/migrations/014_migration.php +++ b/application/migrations/014_migration.php @@ -14,7 +14,7 @@ class Migration_migration extends CI_Migration { $this->db->query("ALTER TABLE cat CHANGE COLUMN uplink_mode uplink_mode varchar(255) DEFAULT NULL; # was varchar(255) NOT NULL"); $this->db->query("ALTER TABLE cat ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; # was ENGINE=InnoDB DEFAULT CHARSET=latin1"); $this->db->query("ALTER TABLE config ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; # was ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8"); - $this->db->query("ALTER TABLE dxcc ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; # was ENGINE=MyISAM DEFAULT CHARSET=utf8"); + $this->db->query("ALTER TABLE dxcc ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"); $this->db->query("ALTER TABLE dxccexceptions ENGINE=InnoDB AUTO_INCREMENT=166 DEFAULT CHARSET=utf8mb4; # was ENGINE=InnoDB AUTO_INCREMENT=166 DEFAULT CHARSET=utf8"); $this->db->query("ALTER TABLE notes ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; # was ENGINE=InnoDB DEFAULT CHARSET=latin1"); @@ -23,7 +23,7 @@ class Migration_migration extends CI_Migration { $this->db->query("ALTER TABLE station_profile ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; # was ENGINE=InnoDB DEFAULT CHARSET=latin1"); $this->db->query("ALTER TABLE timezones CHANGE COLUMN name name varchar(120) COLLATE utf8mb4_bin NOT NULL; # was varchar(120) COLLATE utf8_bin NOT NULL"); - $this->db->query("ALTER TABLE timezones ENGINE=MyISAM AUTO_INCREMENT=151 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; # was ENGINE=MyISAM AUTO_INCREMENT=151 DEFAULT CHARSET=utf8 COLLATE=utf8_bin"); + $this->db->query("ALTER TABLE timezones ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;"); $this->db->query("ALTER TABLE users CHANGE COLUMN user_callsign user_callsign varchar(32) NOT NULL COMMENT 'User''s callsign'; # was varchar(255) NOT NULL"); $this->db->query("ALTER TABLE users CHANGE COLUMN user_firstname user_firstname varchar(32) NOT NULL COMMENT 'User''s first name'; # was varchar(255) NOT NULL"); $this->db->query("ALTER TABLE users CHANGE COLUMN user_locator user_locator varchar(16) NOT NULL COMMENT 'User''s locator'; # was varchar(255) NOT NULL"); @@ -32,7 +32,7 @@ class Migration_migration extends CI_Migration { $this->db->query("ALTER TABLE users ADD COLUMN user_eqsl_qth_nickname varchar(32) DEFAULT NULL;"); - $this->db->query("ALTER TABLE users ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; # was ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1"); + $this->db->query("ALTER TABLE users ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;"); $this->db->query("CREATE TABLE IF NOT EXISTS contest_template ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, @@ -87,7 +87,6 @@ class Migration_migration extends CI_Migration { $this->db->query("ALTER TABLE ".$this->config->item('table_name')." CHANGE COLUMN COL_FREQ_RX COL_FREQ_RX bigint(13) DEFAULT NULL; # was int(11) DEFAULT NULL"); $this->db->query("ALTER TABLE ".$this->config->item('table_name')." CHANGE COLUMN COL_FREQ COL_FREQ bigint(13) DEFAULT NULL; # was int(11) DEFAULT NULL"); - // $this->db->query("ALTER TABLE ".$this->config->item('table_name')." ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; # was ENGINE=MyISAM DEFAULT CHARSET=latin1"); // Is already MyISAM $this->db->db_debug = true; } diff --git a/application/migrations/038_create_iota_tables.php b/application/migrations/038_create_iota_tables.php index 6323a4937..310af9527 100644 --- a/application/migrations/038_create_iota_tables.php +++ b/application/migrations/038_create_iota_tables.php @@ -5,7 +5,7 @@ class Migration_create_iota_tables extends CI_Migration { public function up() { // create iota table - $this->db->query("CREATE TABLE `iota` (`Tag` VARCHAR(8) NOT NULL, `Name` LONGTEXT, `Prefix` VARCHAR(16), `DXCCID` INTEGER DEFAULT 0, `Lat1` FLOAT NULL DEFAULT 0, `Lat2` FLOAT NULL DEFAULT 0, `Lon1` FLOAT NULL DEFAULT 0, `Lon2` FLOAT NULL DEFAULT 0, `Status` VARCHAR(1), `Notes` VARCHAR(50), INDEX (`DXCCID`)) ENGINE=myisam DEFAULT CHARSET=utf8;"); + $this->db->query("CREATE TABLE `iota` (`Tag` VARCHAR(8) NOT NULL, `Name` LONGTEXT, `Prefix` VARCHAR(16), `DXCCID` INTEGER DEFAULT 0, `Lat1` FLOAT NULL DEFAULT 0, `Lat2` FLOAT NULL DEFAULT 0, `Lon1` FLOAT NULL DEFAULT 0, `Lon2` FLOAT NULL DEFAULT 0, `Status` VARCHAR(1), `Notes` VARCHAR(50), INDEX (`DXCCID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $this->db->query("INSERT INTO `iota` (`Tag`, `Name`, `Prefix`, `DXCCID`, `Lat1`, `Lat2`, `Lon1`, `Lon2`, `Status`, `Notes`) VALUES ('AF-001', 'Agalega Islands', '3B6', 4, 10, 10.75, 56.25, 57, NULL, NULL);"); $this->db->query("INSERT INTO `iota` (`Tag`, `Name`, `Prefix`, `DXCCID`, `Lat1`, `Lat2`, `Lon1`, `Lon2`, `Status`, `Notes`) VALUES ('AF-002', 'Amsterdam & St Paul Islands', 'FT*Z', 10, 37.75, 39, 77.25, 77.75, NULL, NULL);"); diff --git a/application/migrations/054_add_qsl_images.php b/application/migrations/054_add_qsl_images.php index a66093d90..ab8828e59 100644 --- a/application/migrations/054_add_qsl_images.php +++ b/application/migrations/054_add_qsl_images.php @@ -9,11 +9,11 @@ class Migration_add_qsl_images extends CI_Migration { // create qsl images table $this->db->query("CREATE TABLE IF NOT EXISTS `qsl_images` (`id` integer NOT NULL auto_increment, `qsoid` int, `filename` text, primary key (id)) - ENGINE=myisam DEFAULT CHARSET=utf8;"); + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); } public function down() { $this->db->query(""); } -} \ No newline at end of file +} diff --git a/application/migrations/063_add_contest_table.php b/application/migrations/063_add_contest_table.php index 24444d077..9ff953dac 100644 --- a/application/migrations/063_add_contest_table.php +++ b/application/migrations/063_add_contest_table.php @@ -5,7 +5,7 @@ class Migration_add_contest_table extends CI_Migration { public function up() { // create contest table - $this->db->query("create table contest (id integer not null auto_increment, name varchar(256), adifname varchar(256), active integer default 1, primary key (id)) ENGINE=myisam DEFAULT CHARSET=utf8;"); + $this->db->query("create table contest (id integer not null auto_increment, name varchar(256), adifname varchar(256), active integer default 1, primary key (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $this->db->query("INSERT INTO contest (name, adifname, active) values ('Other','Other',1);"); $this->db->query("INSERT INTO contest (name, adifname, active) values ('PODXS Great Pumpkin Sprint','070-160M-SPRINT',1);"); diff --git a/application/migrations/071_add_queries_table.php b/application/migrations/071_add_queries_table.php index 7b439c836..d46e5c2f2 100644 --- a/application/migrations/071_add_queries_table.php +++ b/application/migrations/071_add_queries_table.php @@ -4,7 +4,7 @@ class Migration_add_queries_table extends CI_Migration { public function up() { - $this->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;"); + $this->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=InnoDB DEFAULT CHARSET=utf8;"); } public function down() diff --git a/application/migrations/076_theme_table.php b/application/migrations/076_theme_table.php index 15ae9047b..3bf39e478 100644 --- a/application/migrations/076_theme_table.php +++ b/application/migrations/076_theme_table.php @@ -6,7 +6,7 @@ class Migration_Theme_table extends CI_Migration { { // create themes table if (!$this->db->table_exists('themes')) { - $this->db->query("create table themes (id integer not null auto_increment, name varchar(256) not null, foldername varchar(256) not null, primary key (id)) ENGINE=myisam DEFAULT CHARSET=utf8;"); + $this->db->query("create table themes (id integer not null auto_increment, name varchar(256) not null, foldername varchar(256) not null, primary key (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $this->db->query("INSERT INTO themes (name, foldername) values ('Blue','blue');"); $this->db->query("INSERT INTO themes (name, foldername) values ('Cosmo','cosmo');"); $this->db->query("INSERT INTO themes (name, foldername) values ('Cyborg (Dark)','cyborg');"); diff --git a/application/migrations/185_harmonize_keys.php b/application/migrations/185_harmonize_keys.php index 2dbe7841a..5399163d6 100644 --- a/application/migrations/185_harmonize_keys.php +++ b/application/migrations/185_harmonize_keys.php @@ -34,7 +34,7 @@ class Migration_harmonize_keys extends CI_Migration { } public function down(){ - $this->db->query("ALTER TABLE ".$this->config->item('table_name')." ENGINE=MyISAM;"); + // $this->db->query("ALTER TABLE ".$this->config->item('table_name')." ENGINE=MyISAM;"); $this->db->query("ALTER TABLE ".$this->config->item('table_name')." CHANGE COLUMN `station_id` `station_id` INT(11) NOT NULL;"); $this->db->query("ALTER TABLE ".$this->config->item('table_name')." CHANGE COLUMN `COL_PRIMARY_KEY` `COL_PRIMARY_KEY` INT UNSIGNED NOT NULL AUTO_INCREMENT;"); $this->db->query("ALTER TABLE ".$this->config->item('table_name')." AUTO_INCREMENT=".$this->get_max_from_tbl($this->config->item('table_name'),"`COL_PRIMARY_KEY`").";"); diff --git a/application/migrations/189_satellite_table.php b/application/migrations/189_satellite_table.php new file mode 100644 index 000000000..97894f5f7 --- /dev/null +++ b/application/migrations/189_satellite_table.php @@ -0,0 +1,212 @@ +db->table_exists('satellite')) { + + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'INT', + 'constraint' => 6, + 'unsigned' => TRUE, + 'auto_increment' => TRUE, + 'null' => FALSE + ), + 'name' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'exportname' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'orbit' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + )); + $this->dbforge->add_key('id', TRUE); + + $this->dbforge->create_table('satellite'); + + $data = array( + array('name' => 'AISAT-1', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'ARISS', 'exportname' => 'ISS', 'orbit' => 'LEO'), + array('name' => 'AO-7', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'AO-27', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'AO-73', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'AO-91', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'AO-92', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'CAS-3H', 'exportname' => 'LILACSAT-2', 'orbit' => 'LEO'), + array('name' => 'CAS-4A', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'CAS-4B', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'FO-118', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TO-108', 'exportname' => 'CAS-6', 'orbit' => 'LEO'), + array('name' => 'EO-88', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'FO-29', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'FO-99', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'AO-109', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'FS-3', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'HO-107', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'HO-119', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'IO-86', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'IO-117', 'exportname' => 'GREENCUBE', 'orbit' => 'MEO'), + array('name' => 'JO-97', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'LEDSAT', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'Lilacsat-1', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'MO-112', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'NO-44', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'NO-84', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'NO-104', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'PO-101', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'QO-100', 'exportname' => '', 'orbit' => 'GEO'), + array('name' => 'RS-44', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'HO-113', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'SO-50', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'SO-121', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-1', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-2', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-3', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-4', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-5', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-6', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-7', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'TEVEL-8', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'EASAT-2', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'HADES', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'INSPIRE-SAT 7', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'UVSQ-SAT', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'XW-2A', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'XW-2B', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'XW-2C', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'XW-2D', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'XW-2F', 'exportname' => '', 'orbit' => 'LEO'), + array('name' => 'UKUBE1', 'exportname' => 'UKUBE-1', 'orbit' => 'LEO'), + array('name' => 'KEDR', 'exportname' => 'ARISSAT-1', 'orbit' => 'LEO'), + array('name' => 'TAURUS', 'exportname' => 'TAURUS-1', 'orbit' => 'LEO'), + ); + $this->db->insert_batch('satellite', $data); + } + + if (!$this->db->table_exists('satellitemode')) { + + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'INT', + 'constraint' => 6, + 'unsigned' => TRUE, + 'auto_increment' => TRUE, + 'null' => FALSE + ), + 'name' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'satelliteid' => array( + 'type' => 'INT', + 'constraint' => 6, + 'unsigned' => TRUE, + 'null' => FALSE + ), + 'uplink_mode' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'uplink_freq' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'downlink_mode' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'downlink_freq' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->add_key('callsign', TRUE); + + $this->dbforge->create_table('satellitemode'); + + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/V', id, 'PKT', '145825000', 'PKT', '145825000' FROM satellite WHERE name = 'AISAT-1';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/V', id, 'PKT', '145825000', 'PKT', '145825000' FROM satellite WHERE name = 'ARISS';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145990000', 'FM', '437800000' FROM satellite WHERE name = 'ARISS';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '432150000', 'USB', '145950000' FROM satellite WHERE name = 'AO-7';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/A', id, 'USB', '145900000', 'USB', '29450000' FROM satellite WHERE name = 'AO-7';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145850000', 'FM', '436795000' FROM satellite WHERE name = 'AO-27';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435140000', 'USB', '145960000' FROM satellite WHERE name = 'AO-73';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'FM', '435250000', 'FM', '145960000' FROM satellite WHERE name = 'AO-91';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'FM', '435250000', 'FM', '145880000' FROM satellite WHERE name = 'AO-92';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'L/V', id, 'FM', '1267350000', 'FM', '145880000' FROM satellite WHERE name = 'AO-92';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '144350000', 'FM', '437200000' FROM satellite WHERE name = 'CAS-3H';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '435220000', 'USB', '145870000' FROM satellite WHERE name = 'CAS-4A';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '435220000', 'USB', '145870000' FROM satellite WHERE name = 'CAS-4B';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'H/U', id, 'USB', '21435000', 'USB', '435505000' FROM satellite WHERE name = 'FO-118';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145820000', 'USB', '435540000' FROM satellite WHERE name = 'FO-118';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145925000', 'FM', '435600000' FROM satellite WHERE name = 'FO-118';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435280000', 'USB', '145925000' FROM satellite WHERE name = 'TO-108';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435030000', 'USB', '145975000' FROM satellite WHERE name = 'EO-88';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145950000', 'USB', '435850000' FROM satellite WHERE name = 'FO-29';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145915000', 'USB', '435895000' FROM satellite WHERE name = 'FO-99';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145875000', 'USB', '435775000' FROM satellite WHERE name = 'AO-109';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'PKT', '145840000', 'PKT', '435103000' FROM satellite WHERE name = 'FS-3';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435925000', 'USB', '145925000' FROM satellite WHERE name = 'HO-107';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145870000', 'USB', '435180000' FROM satellite WHERE name = 'HO-119';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145880000', 'FM', '435880000' FROM satellite WHERE name = 'IO-86';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/U', id, 'PKT', '435310000', 'PKT', '435310000' FROM satellite WHERE name = 'IO-117';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435110000', 'USB', '145865000' FROM satellite WHERE name = 'JO-97';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/U', id, 'PKT', '435310000', 'PKT', '435190000' FROM satellite WHERE name = 'LEDSAT';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '144350000', 'FM', '437200000' FROM satellite WHERE name = 'Lilacsat-1';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'PKT', '145987500', 'PKT', '436925000' FROM satellite WHERE name = 'MO-112';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/V', id, 'PKT', '145825000', 'PKT', '145825000' FROM satellite WHERE name = 'NO-44';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'A/U', id, 'LSB', '28120000', 'FM', '435350000' FROM satellite WHERE name = 'NO-84';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/V', id, 'PKT', '145825000', 'PKT', '145825000' FROM satellite WHERE name = 'NO-84';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'A/U', id, 'LSB', '29481500', 'FM', '435350000' FROM satellite WHERE name = 'NO-104';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'FM', '437500000', 'FM', '145900000' FROM satellite WHERE name = 'PO-101';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'S/X', id, 'USB', '2400175000', 'USB', '10489675000' FROM satellite WHERE name = 'QO-100';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145965000', 'USB', '435640000' FROM satellite WHERE name = 'RS-44';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145870000', 'USB', '435180000' FROM satellite WHERE name = 'HO-113';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145850000', 'FM', '436795000' FROM satellite WHERE name = 'SO-50';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145875000', 'FM', '436666000' FROM satellite WHERE name = 'SO-121';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-1';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-2';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-3';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-4';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-5';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-6';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-7';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '436400000' FROM satellite WHERE name = 'TEVEL-8';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145875000', 'FM', '436666000' FROM satellite WHERE name = 'EASAT-2';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145925000', 'FM', '436888000' FROM satellite WHERE name = 'HADES';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145970000', 'FM', '437410000' FROM satellite WHERE name = 'INSPIRE-SAT 7';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145905000', 'FM', '437020000' FROM satellite WHERE name = 'UVSQ-SAT';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435040000', 'USB', '145675000' FROM satellite WHERE name = 'XW-2A';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435100000', 'USB', '145675000' FROM satellite WHERE name = 'XW-2B';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435160000', 'USB', '145805000' FROM satellite WHERE name = 'XW-2C';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435220000', 'USB', '145870000' FROM satellite WHERE name = 'XW-2D';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'U/V', id, 'LSB', '435340000', 'USB', '145990000' FROM satellite WHERE name = 'XW-2F';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'LSB', '145940000', 'USB', '435070000' FROM satellite WHERE name = 'UKUBE1';"); + $this->db->query("INSERT INTO satellitemode (name, satelliteid, uplink_mode, uplink_freq, downlink_mode, downlink_freq) SELECT 'V/U', id, 'FM', '145820000', 'FREEDV', '435840000' FROM satellite WHERE name = 'TAURUS';"); + } + } + + public function down() + { + $this->dbforge->drop_table('satellite'); + $this->dbforge->drop_table('satellitemode'); + } +} diff --git a/application/migrations/190_move_to_inno.php b/application/migrations/190_move_to_inno.php new file mode 100644 index 000000000..288be2e56 --- /dev/null +++ b/application/migrations/190_move_to_inno.php @@ -0,0 +1,21 @@ +db->query("ALTER TABLE contest ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE iota ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE qsl_images ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE queries ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE themes ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE timezones ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE users ENGINE=InnoDB;"); + $this->db->query("ALTER TABLE lotw_users ENGINE=InnoDB;"); + } + + public function down(){ + // No Way back here! + } +} diff --git a/application/migrations/191_tag_1_4.php b/application/migrations/191_tag_1_4.php new file mode 100644 index 000000000..e45d11485 --- /dev/null +++ b/application/migrations/191_tag_1_4.php @@ -0,0 +1,36 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.4')); + + // Trigger Version Info Dialog + $this->db->where('option_type', 'version_dialog'); + $this->db->where('option_name', 'confirmed'); + $this->db->update('user_options', array('option_value' => 'false')); + + // Also set Version Dialog to "both" if only custom text is applied + $this->db->where('option_name', 'version_dialog'); + $this->db->where('option_value', 'custom_text'); + $this->db->update('options', array('option_value' => 'both')); + + + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.3.1')); + } +} \ No newline at end of file diff --git a/application/models/Bands.php b/application/models/Bands.php index 3b932e756..6e25b2e49 100644 --- a/application/models/Bands.php +++ b/application/models/Bands.php @@ -179,18 +179,42 @@ class Bands extends CI_Model { $location_list = "'".implode("','",$logbooks_locations_array)."'"; - // get all worked sats from database - $sql = "SELECT distinct col_sat_name FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_sat_name, '') <> '' ORDER BY col_sat_name"; + // get all worked sats from database + $sql = "SELECT distinct col_sat_name FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_sat_name, '') <> '' ORDER BY col_sat_name"; - $data = $this->db->query($sql); + $data = $this->db->query($sql); - $worked_sats = array(); - foreach($data->result() as $row){ - array_push($worked_sats, $row->col_sat_name); - } + $worked_sats = array(); + foreach($data->result() as $row){ + array_push($worked_sats, $row->col_sat_name); + } - return $worked_sats; - } + return $worked_sats; + } + + function get_worked_orbits() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return array(); + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + // get all worked orbit types from database + $sql = "SELECT DISTINCT satellite.orbit AS orbit FROM ".$this->config->item('table_name')." LEFT JOIN satellite ON COL_SAT_NAME = satellite.name WHERE station_id in (" . $location_list . ") AND COL_PROP_MODE = 'SAT' AND satellite.orbit IS NOT NULL ORDER BY orbit ASC"; + + $data = $this->db->query($sql); + + $worked_orbits = array(); + foreach($data->result() as $row){ + array_push($worked_orbits, $row->orbit); + } + + return $worked_orbits; + } function get_worked_bands_dok() { $CI =& get_instance(); diff --git a/application/models/Contesting_model.php b/application/models/Contesting_model.php index b328cc335..78e2d9bdf 100644 --- a/application/models/Contesting_model.php +++ b/application/models/Contesting_model.php @@ -13,6 +13,7 @@ class Contesting_model extends CI_Model { $contestid = $qsoarray[2]; $date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]); + if ($date == false) $date = DateTime::createFromFormat('d-m-Y H:i', $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, @@ -68,7 +69,7 @@ class Contesting_model extends CI_Model { 'exchangetype' => xss_clean($this->input->post('exchangetype', true)), 'exchangesent' => xss_clean($this->input->post('exch_sent', true)), 'serialsent' => xss_clean($this->input->post('exch_serial_s', true)), - 'copytodok' => $this->input->post('copyexchangetodok', true) == "" ? 0 : xss_clean($this->input->post('copyexchangetodok', true)), + 'copytodok' => $this->input->post('copyexchangeto', true) == "" ? 0 : xss_clean($this->input->post('copyexchangeto', true)), 'qso' => $qso, 'station_id' => $station_id, ); @@ -217,6 +218,7 @@ class Contesting_model extends CI_Model { $qsoarray = explode(',', $contest_session->qso); $date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]); + if ($date == false) $date = DateTime::createFromFormat('d-m-Y H:i', $qsoarray[0]); $date = $date->format('Y-m-d H:i:s'); $this->db->select('timediff(UTC_TIMESTAMP(),col_time_off) b4, COL_TIME_OFF'); diff --git a/application/models/Dxcc_entities.php b/application/models/Dxcc_entities.php deleted file mode 100644 index f7bba0fa3..000000000 --- a/application/models/Dxcc_entities.php +++ /dev/null @@ -1,25 +0,0 @@ -db->empty_table($table); - } - - -} diff --git a/application/models/Dxcc_exceptions.php b/application/models/Dxcc_exceptions.php deleted file mode 100644 index c22e7603b..000000000 --- a/application/models/Dxcc_exceptions.php +++ /dev/null @@ -1,24 +0,0 @@ -db->empty_table($table); - } -} \ No newline at end of file diff --git a/application/models/Dxcc_prefixes.php b/application/models/Dxcc_prefixes.php deleted file mode 100644 index 3b790e590..000000000 --- a/application/models/Dxcc_prefixes.php +++ /dev/null @@ -1,22 +0,0 @@ -db->empty_table($table); - } -} \ No newline at end of file diff --git a/application/models/Eqsl_images.php b/application/models/Eqsl_images.php index e17c90bb5..bc77d0027 100644 --- a/application/models/Eqsl_images.php +++ b/application/models/Eqsl_images.php @@ -15,6 +15,23 @@ class Eqsl_images extends CI_Model { } } + function del_image($qso_id, $user_id = null) { + // QSO belongs to station_profile. But since we have folders for Users (and therefore an extra indirect relation) we need to lookup user for station first... + $eqsl_img=$this->db->query('SELECT e.image_file,e.id, qso.station_id, s.user_id FROM `eQSL_images` e INNER JOIN '.$this->config->item('table_name').' qso ON (e.qso_id = qso.COL_PRIMARY_KEY) inner join station_profile s on (s.station_id=qso.station_id) where qso.COL_PRIMARY_KEY=?',$qso_id); + foreach ($eqsl_img->result() as $row) { + if (($user_id ?? '') == '') { // Calling as User? Check if User-id matches User-id from QSO + $user_id = $this->session->userdata('user_id'); + if ($row->user_id != $user_id) { + return "No Image"; // Image doesn't belong to user, so return + } + } + $image=$this->get_imagePath('p',$row->user_id).'/'.$row->image_file; + unlink($image); + $this->db->delete('eQSL_images', array('id' => $row->id)); + return $image; + } + } + function save_image($qso_id, $image_name) { $data = array( 'qso_id' => $qso_id, @@ -36,36 +53,37 @@ class Eqsl_images extends CI_Model { } // return path of eQsl file : u=url / p=real path - function get_imagePath($pathorurl='u') { + function get_imagePath($pathorurl='u', $user_id = null) { // test if new folder directory option is enabled $userdata_dir = $this->config->item('userdata'); - + if (isset($userdata_dir)) { $eqsl_dir = "eqsl_card"; // make sure this is the same as in Debug_model.php function migrate_userdata() - $user_id = $this->session->userdata('user_id'); - + if (($user_id ?? '') == '') { + $user_id = $this->session->userdata('user_id'); + } + // check if there is a user_id in the session data and it's not empty if ($user_id != '') { - - // create the folder - if (!file_exists(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$eqsl_dir)) { - mkdir(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$eqsl_dir, 0755, true); - } - // and return it - if ($pathorurl=='u') { - return $userdata_dir.'/'.$user_id.'/'.$eqsl_dir; - } else { - return realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$eqsl_dir; - } - } else { + // create the folder + if (!file_exists(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$eqsl_dir)) { + mkdir(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$eqsl_dir, 0755, true); + } + + // and return it + if ($pathorurl=='u') { + return $userdata_dir.'/'.$user_id.'/'.$eqsl_dir; + } else { + return realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$eqsl_dir; + } + } else { log_message('info', 'Can not get eqsl image path because no user_id in session data'); } - } else { - + } else { // if the config option is not set we just return the old path return 'images/eqsl_card_images'; } diff --git a/application/models/Eqslmethods_model.php b/application/models/Eqslmethods_model.php index 4d782f5b5..506710f2e 100644 --- a/application/models/Eqslmethods_model.php +++ b/application/models/Eqslmethods_model.php @@ -4,18 +4,29 @@ class Eqslmethods_model extends CI_Model { function mark_all_as_sent() { $data = array( - 'COL_EQSL_QSL_SENT' => 'Y', - 'COL_EQSL_QSLSDATE' => date('Y-m-d')." 00:00:00", - ); + 'COL_EQSL_QSL_SENT' => 'Y', + 'COL_EQSL_QSLSDATE' => date('Y-m-d')." 00:00:00", + ); - $this->db->group_start(); - $this->db->where('COL_EQSL_QSL_SENT', 'N'); - $this->db->or_where('COL_EQSL_QSL_SENT', 'R'); - $this->db->or_where('COL_EQSL_QSL_SENT', 'Q'); - $this->db->or_where('COL_EQSL_QSL_SENT', null); - $this->db->group_end(); - - $this->db->update($this->config->item('table_name'), $data); + $userid=$this->session->userdata('user_id'); + if ($userid ?? '' != '') { + $stations = $this->get_all_user_locations($userid); + $logbooks_locations_array = array(); + foreach ($stations->result() as $row) { + array_push($logbooks_locations_array, $row->station_id); + } + if (count($logbooks_locations_array)>0) { + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->group_start(); + $this->db->where('COL_EQSL_QSL_SENT', 'N'); + $this->db->or_where('COL_EQSL_QSL_SENT', 'R'); + $this->db->or_where('COL_EQSL_QSL_SENT', 'Q'); + $this->db->or_where('COL_EQSL_QSL_SENT', null); + $this->db->group_end(); + + $this->db->update($this->config->item('table_name'), $data); + } + } } function get_eqsl_users() { diff --git a/application/models/Gridmap_model.php b/application/models/Gridmap_model.php index 98bd829c1..582f161b1 100644 --- a/application/models/Gridmap_model.php +++ b/application/models/Gridmap_model.php @@ -2,201 +2,222 @@ class Gridmap_model extends CI_Model { - function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $logbooks_locations_array = NULL) { - if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - } - - if (!$logbooks_locations_array) { - return null; - } + function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + if ($logbooks_locations_array == NULL) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } + + if (!$logbooks_locations_array) { + return null; + } $location_list = "'".implode("','",$logbooks_locations_array)."'"; $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND FROM ' .$this->config->item('table_name') + .' LEFT JOIN `satellite` on '.$this->config->item('table_name').'.COL_SAT_NAME = satellite.name' .' WHERE station_id in (' .$location_list.') AND COL_GRIDSQUARE != ""'; - if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } - else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } - if ($mode != 'All') { + if ($mode != 'All') { $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + } - $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $qrz); - - return $this->db->query($sql); - } - - function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $logbooks_locations_array = NULL) { - if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - } - - if (!$logbooks_locations_array) { - return null; - } - - $location_list = "'".implode("','",$logbooks_locations_array)."'"; - - $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND FROM ' - .$this->config->item('table_name') - .' WHERE station_id in (' - .$location_list.') AND COL_GRIDSQUARE != ""'; - - if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } - else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } - - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } - - return $this->db->query($sql); - } - - function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $logbooks_locations_array = NULL) { - if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - } - - if (!$logbooks_locations_array) { - return null; - } - - $location_list = "'".implode("','",$logbooks_locations_array)."'"; - - $sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM ' - .$this->config->item('table_name') - .' WHERE station_id in (' - .$location_list.') AND COL_VUCC_GRIDS != ""'; - - if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } - else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } - - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } - - return $this->db->query($sql); - } - - function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $logbooks_locations_array = NULL) { - if ($logbooks_locations_array == NULL) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - } - - if (!$logbooks_locations_array) { - return null; - } - - - $location_list = "'".implode("','",$logbooks_locations_array)."'"; - - $sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM ' - .$this->config->item('table_name') - .' WHERE station_id in (' - .$location_list.') AND COL_VUCC_GRIDS != ""'; - - if ($band != 'All') { - if ($band == 'SAT') { - $sql .= " and col_prop_mode ='" . $band . "'"; - if ($sat != 'All') { - $sql .= " and col_sat_name ='" . $sat . "'"; - } - } - else { - $sql .= " and col_prop_mode !='SAT'"; - $sql .= " and col_band ='" . $band . "'"; - } - } - - if ($mode != 'All') { - $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; - } + $sql .= $this->addOrbitToQuery($orbit); $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $qrz); return $this->db->query($sql); } - // Adds confirmation to query - function addQslToQuery($qsl, $lotw, $eqsl, $qrz) { - $sql = ''; - if ($lotw == "true") { - $sql .= " or col_lotw_qsl_rcvd = 'Y'"; - } + function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + if ($logbooks_locations_array == NULL) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } - if ($qsl == "true") { - $sql .= " or col_qsl_rcvd = 'Y'"; - } + if (!$logbooks_locations_array) { + return null; + } - if ($eqsl == "true") { - $sql .= " or col_eqsl_qsl_rcvd = 'Y'"; - } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; - if ($qrz == "true") { - $sql .= " or col_qrzcom_qso_download_status = 'Y'"; - } - if ($sql != '') { - $sql=' and (1=0 '.$sql.')'; - } - if ($sql == '') { - $sql=' and 1=0'; - } - return $sql; - } + $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND FROM ' + .$this->config->item('table_name') + .' LEFT JOIN `satellite` on '.$this->config->item('table_name').'.COL_SAT_NAME = satellite.name' + .' WHERE station_id in (' + .$location_list.') AND COL_GRIDSQUARE != ""'; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + $sql .= $this->addOrbitToQuery($orbit); + + return $this->db->query($sql); + } + + function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + if ($logbooks_locations_array == NULL) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM ' + .$this->config->item('table_name') + .' LEFT JOIN `satellite` on '.$this->config->item('table_name').'.COL_SAT_NAME = satellite.name' + .' WHERE station_id in (' + .$location_list.') AND COL_VUCC_GRIDS != ""'; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + $sql .= $this->addOrbitToQuery($orbit); + + return $this->db->query($sql); + } + + function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $logbooks_locations_array = NULL) { + if ($logbooks_locations_array == NULL) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } + + if (!$logbooks_locations_array) { + return null; + } + + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM ' + .$this->config->item('table_name') + .' LEFT JOIN `satellite` on '.$this->config->item('table_name').'.COL_SAT_NAME = satellite.name' + .' WHERE station_id in (' + .$location_list.') AND COL_VUCC_GRIDS != ""'; + + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " and col_prop_mode ='" . $band . "'"; + if ($sat != 'All') { + $sql .= " and col_sat_name ='" . $sat . "'"; + } + } else { + $sql .= " and col_prop_mode !='SAT'"; + $sql .= " and col_band ='" . $band . "'"; + } + } + + if ($mode != 'All') { + $sql .= " and (col_mode ='" . $mode . "' or col_submode ='" . $mode . "')"; + } + + $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $qrz); + + $sql .= $this->addOrbitToQuery($orbit); + + return $this->db->query($sql); + } + + // Adds confirmation to query + function addQslToQuery($qsl, $lotw, $eqsl, $qrz) { + $sql = ''; + if ($lotw == "true") { + $sql .= " or col_lotw_qsl_rcvd = 'Y'"; + } + + if ($qsl == "true") { + $sql .= " or col_qsl_rcvd = 'Y'"; + } + + if ($eqsl == "true") { + $sql .= " or col_eqsl_qsl_rcvd = 'Y'"; + } + + if ($qrz == "true") { + $sql .= " or col_qrzcom_qso_download_status = 'Y'"; + } + + if ($sql != '') { + $sql=' and (1=0 '.$sql.')'; + } + + if ($sql == '') { + $sql=' and 1=0'; + } + + return $sql; + } + + // Adds confirmation to query + function addOrbitToQuery($orbit) { + $sql = ''; + if ($orbit != 'All') { + $sql .= ' AND satellite.orbit = \''.$orbit.'\''; + } + + return $sql; + } /* * Get's the worked modes from the log */ function get_worked_modes() { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - - if (!$logbooks_locations_array) { - return null; - } + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } $location_list = "'".implode("','",$logbooks_locations_array)."'"; @@ -217,8 +238,7 @@ class Gridmap_model extends CI_Model { array_push($results, $row->COL_SUBMODE); } } - - asort($results); + asort($results); return $results; } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 795aab5f1..2a8bcc6de 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -68,6 +68,12 @@ class Logbook_model extends CI_Model { $stx = null; break; } + + if ($srx_string !== null) $srx_string = trim(xss_clean($srx_string)); + if ($stx_string !== null) $stx_string = trim(xss_clean($stx_string)); + if ($srx !== null) $srx = trim(xss_clean($srx)); + if ($stx !== null) $stx = trim(xss_clean($stx)); + } else { $srx_string = null; $stx_string = null; @@ -151,12 +157,50 @@ class Logbook_model extends CI_Model { $clean_county_input = null; } - if($this->input->post('copyexchangetodok')) { - $darc_dok = $this->input->post('exch_rcvd'); - } else { - $darc_dok = $this->input->post('darc_dok'); + $darc_dok = trim(xss_clean($this->input->post('darc_dok'))); + $qso_locator = strtoupper(trim(xss_clean($this->input->post('locator')) ?? '')); + $qso_name = trim(xss_clean($this->input->post('name'))); + $qso_age = null; + $qso_state = $this->input->post('input_state_edit') == null ? '' : trim(xss_clean($this->input->post('input_state_edit'))); + $qso_rx_power = null; + + if ($this->input->post('copyexchangeto')) { + switch($this->input->post('copyexchangeto')) { + case 'dok': + $darc_dok = $srx_string; + break; + case 'locator': + // Matching 4-10 character-locator + if ( preg_match('/^[A-R]{2}[0-9]{2}([A-X]{2}([0-9]{2}([A-X]{2})?)?)?$/',$srx_string) ) { + $qso_locator = $srx_string; + } + break; + case 'name': + $qso_name = $srx_string; + break; + case 'age': + $qso_age = intval($srx_string); + break; + case 'state': + if ( preg_match('/^[A-Za-z]*$/', $srx_string) && $srx_string != "DX" ) { + $qso_state = $srx_string; + } + break; + case 'power': + $qso_rx_power = intval($srx_string); + break; + // Example for more sophisticated exchanges and their split into the db: + //case 'name/power': + // if (strlen($srx_string) == 0) break; + // $exch_pt = explode("/",$srx_string); + // $qso_name = $exch_pt[0]; + // if (count($exch_pt)>1) $qso_rx_power = intval($exch_pt[1]); + // break; + default: + } } + if ($this->input->post('qsl_sent')) { $qsl_sent = $this->input->post('qsl_sent'); } else { @@ -193,7 +237,7 @@ class Logbook_model extends CI_Model { 'COL_SUBMODE' => $submode, 'COL_RST_RCVD' => $this->input->post('rst_rcvd'), 'COL_RST_SENT' => $this->input->post('rst_sent'), - 'COL_NAME' => $this->input->post('name'), + 'COL_NAME' => $qso_name, 'COL_COMMENT' => $this->input->post('comment'), 'COL_SAT_NAME' => $this->input->post('sat_name') == null ? '' : strtoupper($this->input->post('sat_name')), 'COL_SAT_MODE' => $this->input->post('sat_mode') == null ? '' : strtoupper($this->input->post('sat_mode')), @@ -216,7 +260,7 @@ class Logbook_model extends CI_Model { 'COL_ANT_AZ' => null, 'COL_ANT_EL' => null, 'COL_A_INDEX' => null, - 'COL_AGE' => null, + 'COL_AGE' => $qso_age, 'COL_TEN_TEN' => null, 'COL_TX_PWR' => $tx_power, 'COL_STX' => $stx, @@ -229,12 +273,12 @@ class Logbook_model extends CI_Model { 'COL_MAX_BURSTS' => null, 'COL_K_INDEX' => null, 'COL_SFI' => null, - 'COL_RX_PWR' => null, + 'COL_RX_PWR' => $qso_rx_power, 'COL_LAT' => null, 'COL_LON' => null, 'COL_DXCC' => $dxcc_id, 'COL_CQZ' => $cqz, - 'COL_STATE' => $this->input->post('input_state_edit') == null ? '' : trim($this->input->post('input_state_edit')), + 'COL_STATE' => $qso_state, 'COL_CNTY' => $clean_county_input, 'COL_SOTA_REF' => $this->input->post('sota_ref') == null ? '' : trim($this->input->post('sota_ref')), 'COL_WWFF_REF' => $this->input->post('wwff_ref') == null ? '' : trim($this->input->post('wwff_ref')), @@ -299,10 +343,10 @@ class Logbook_model extends CI_Model { } // Decide whether its single gridsquare or a multi which makes it vucc_grids - if (strpos(trim(xss_clean($this->input->post('locator')) ?? ''), ',') !== false) { - $data['COL_VUCC_GRIDS'] = strtoupper(preg_replace('/\s+/', '', xss_clean($this->input->post('locator')) ?? '')); + if (strpos($qso_locator, ',') !== false) { + $data['COL_VUCC_GRIDS'] = strtoupper(preg_replace('/\s+/', '', $qso_locator)); } else { - $data['COL_GRIDSQUARE'] = strtoupper(trim(xss_clean($this->input->post('locator')) ?? '')); + $data['COL_GRIDSQUARE'] = $qso_locator; } // if eQSL username set, default SENT & RCVD to 'N' else leave as null @@ -345,13 +389,16 @@ class Logbook_model extends CI_Model { /* * Used to fetch QSOs from the logbook in the awards */ - public function qso_details($searchphrase, $band, $mode, $type, $qsl, $searchmode = null){ + public function qso_details($searchphrase, $band, $mode, $type, $qsl, $sat = null, $orbit = null, $searchmode = null){ $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); $this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC', 'left outer'); $this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer'); + if ($band == 'SAT' && $type == 'VUCC') { + $this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.col_sat_name', 'left outer'); + } switch ($type) { case 'DXCC': $this->db->where('COL_COUNTRY', $searchphrase); @@ -367,6 +414,14 @@ class Logbook_model extends CI_Model { $this->db->where("station_gridsquare like '%" . $searchphrase . "%'"); } else { $this->db->where("(COL_GRIDSQUARE like '" . $searchphrase . "%' OR COL_VUCC_GRIDS like '%" . $searchphrase ."%')"); + if ($band == 'SAT' && $type == 'VUCC') { + if ($sat != 'All' && $sat != null) { + $this->db->where("COL_SAT_NAME = '$sat'"); + } + if ($orbit != 'All' && $orbit != null) { + $this->db->where("satellite.orbit = '$orbit'"); + } + } } break; case 'CQZone': @@ -467,9 +522,7 @@ class Logbook_model extends CI_Model { $this->db->limit(500); - $result = $this->db->get($this->config->item('table_name')); - return $result; - //return $this->db->get($this->config->item('table_name')); + return $this->db->get($this->config->item('table_name')); } public function activated_grids_qso_details($searchphrase, $band, $mode){ @@ -1679,7 +1732,7 @@ class Logbook_model extends CI_Model { $this->db->join('primary_subdivisions', $this->config->item('table_name').'.COL_DXCC = primary_subdivisions.adif AND '.$this->config->item('table_name').'.COL_STATE = primary_subdivisions.state', 'left outer'); $this->db->where('COL_PRIMARY_KEY', $id); $this->db->limit(1); - + return $this->db->get(); } else { return; @@ -2144,7 +2197,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $location_list = "'".implode("','",$logbooks_locations_array)."'"; - $sql="SELECT + $sql="SELECT dx.prefix,dx.name, CASE WHEN q.col_mode = 'CW' THEN 'C' @@ -3045,14 +3098,23 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } /* Delete QSO based on the QSO ID */ - function delete($id) { - if ($this->check_qso_is_accessible($id)) { - $this->db->where('COL_PRIMARY_KEY', $id); - $this->db->delete($this->config->item('table_name')); - } else { - return; - } - } + function delete($id) { + if ($this->check_qso_is_accessible($id)) { + $this->load->model('qsl_model'); + $this->load->model('eqsl_images'); + + $this->qsl_model->del_image_for_qso($id); + $this->eqsl_images->del_image($id); + + $this->db->where('COL_PRIMARY_KEY', $id); + $this->db->delete($this->config->item('table_name')); + + $this->db->where('qsoid', $id); + $this->db->delete("oqrs"); + } else { + return; + } + } /* Used to check if the qso is already in the database */ function import_check($datetime, $callsign, $band, $mode, $station_callsign, $station_id = null) { @@ -3345,6 +3407,9 @@ function lotw_last_qsl_date($user_id) { $input_submode = $submode; } + $input_submode = (($input_submode ?? '') == '') ? null : $input_submode; // Make Sure submode is NULL if empty + $input_mode = (($input_mode ?? '') == '') ? null : $input_mode; // Make Sure mode is NULL if empty + // Check if QSO is already in the database if ($skipDuplicate != NULL) { @@ -3489,12 +3554,14 @@ function lotw_last_qsl_date($user_id) { // Sanitise RX Power if (isset($record['rx_pwr'])){ - // Check if RX_PWR is "K" which N1MM+ uses to indicate 1000W - if($record['rx_pwr'] == "K") { - $rx_pwr = 1000; - } else { - $rx_pwr = filter_var($record['rx_pwr'],FILTER_VALIDATE_FLOAT); - } + switch(strtoupper($record['rx_pwr'])) { + case 'K': $rx_pwr = 1000; break; + case 'KW': $rx_pwr = 1000; break; + case '1TT': $rx_pwr = 100; break; + case 'ETT': $rx_pwr = 100; break; + case 'NN': $rx_pwr = 99; break; + default: $rx_pwr = filter_var($record['rx_pwr'],FILTER_VALIDATE_FLOAT); + } }else{ $rx_pwr = NULL; } @@ -4026,7 +4093,7 @@ function lotw_last_qsl_date($user_id) { */ public function check_dxcc_table($call, $date){ - $csadditions = '/^P$|^R$|^A$|^M$/'; + $csadditions = '/^T$|^P$|^R$|^A$|^M$/'; $dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`, `cont`') ->where('call', $call) @@ -4116,7 +4183,7 @@ function lotw_last_qsl_date($user_id) { public function dxcc_lookup($call, $date){ - $csadditions = '/^P$|^R$|^A$|^M$/'; + $csadditions = '/^T$|^P$|^R$|^A$|^M$/'; $dxcc_exceptions = $this->db->select('`entity`, `adif`, `cqz`,`cont`') ->where('call', $call) @@ -4214,7 +4281,7 @@ function lotw_last_qsl_date($user_id) { $c = ''; $lidadditions = '/^QRP$|^LGT$/'; - $csadditions = '/^P$|^R$|^A$|^M$|^LH$/'; + $csadditions = '/^T$|^P$|^R$|^A$|^M$|^LH$/'; $noneadditions = '/^MM$|^AM$/'; # First check if the call is in the proper format, A/B/C where A and C @@ -4377,15 +4444,12 @@ function lotw_last_qsl_date($user_id) { // Manual call $d = $this->check_dxcc_table($row['COL_CALL'], $qso_date); - // Stored procedure call - //$d = $this->check_dxcc_stored_proc($row["COL_CALL"], $qso_date); - if ($d[0] != 'Not Found'){ $sql = sprintf("update %s set COL_COUNTRY = '%s', COL_DXCC='%s' where COL_PRIMARY_KEY=%d", $this->config->item('table_name'), addslashes(ucwords(strtolower($d[1]), "- (/")), $d[0], $row['COL_PRIMARY_KEY']); $this->db->query($sql); //print($sql."\n"); - printf("Updating %s to %s and %s\n
", $row['COL_PRIMARY_KEY'], ucwords(strtolower($d[1]), "- (/"), $d[0]); + // printf("Updating %s to %s and %s\n
", $row['COL_PRIMARY_KEY'], ucwords(strtolower($d[1]), "- (/"), $d[0]); $count++; } } @@ -4799,7 +4863,7 @@ function lotw_last_qsl_date($user_id) { $clean_qsoid = $this->security->xss_clean($qso_id); $sql = 'SELECT station_profile.user_id - FROM '.$this->config->item('table_name').' + FROM '.$this->config->item('table_name').' INNER JOIN station_profile ON ('.$this->config->item('table_name').'.station_id = station_profile.station_id) WHERE '.$this->config->item('table_name').'.COL_PRIMARY_KEY = ?'; @@ -4807,7 +4871,7 @@ function lotw_last_qsl_date($user_id) { $row = $result->row(); return $row->user_id; - } + } } function validateADIFDate($date, $format = 'Ymd') diff --git a/application/models/Logbooks_model.php b/application/models/Logbooks_model.php index f9fc7d794..2fa6894f6 100644 --- a/application/models/Logbooks_model.php +++ b/application/models/Logbooks_model.php @@ -67,7 +67,7 @@ class Logbooks_model extends CI_Model { // Delete logbook $this->db->where('user_id', $this->session->userdata('user_id')); $this->db->where('logbook_id', $clean_id); - $this->db->delete('station_logbooks'); + $this->db->delete('station_logbooks'); } function edit() { @@ -77,7 +77,7 @@ class Logbooks_model extends CI_Model { $this->db->where('user_id', $this->session->userdata('user_id')); $this->db->where('logbook_id', xss_clean($this->input->post('logbook_id', true))); - $this->db->update('station_logbooks', $data); + $this->db->update('station_logbooks', $data); } function set_logbook_active($id, $user_id = null) { @@ -101,7 +101,7 @@ class Logbooks_model extends CI_Model { ); $this->db->where('user_id', $user_id); - $this->db->update('users', $data); + $this->db->update('users', $data); } function logbook($id) { @@ -153,20 +153,10 @@ class Logbooks_model extends CI_Model { ); // Insert Record - $this->db->insert('station_logbooks_relationship', $data); + $this->db->insert('station_logbooks_relationship', $data); } - function relationship_exists($logbook_id, $location_id) { - $this->db->where('station_logbook_id', $logbook_id); - $this->db->where('station_location_id', $location_id); - $query = $this->db->get('station_logbooks_relationship'); - if ($query->num_rows() > 0){ - return true; - } else { - return false; - } - } function public_slug_exists($slug) { $this->db->where('public_slug', $this->security->xss_clean($slug)); @@ -294,7 +284,7 @@ class Logbooks_model extends CI_Model { // Delete relationship $this->db->where('station_logbook_id', $clean_logbook_id); $this->db->where('station_location_id', $clean_station_id); - $this->db->delete('station_logbooks_relationship'); + $this->db->delete('station_logbooks_relationship'); } public function check_logbook_is_accessible($id) { diff --git a/application/models/Qsl_model.php b/application/models/Qsl_model.php index f420b273f..38f4b3264 100644 --- a/application/models/Qsl_model.php +++ b/application/models/Qsl_model.php @@ -1,97 +1,117 @@ load->model('logbooks_model'); - $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function getQsoWithQslList() { + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $this->db->select('*'); - $this->db->from($this->config->item('table_name')); - $this->db->join('qsl_images', 'qsl_images.qsoid = ' . $this->config->item('table_name') . '.col_primary_key'); - $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->order_by("id", "desc"); + $this->db->select('*'); + $this->db->from($this->config->item('table_name')); + $this->db->join('qsl_images', 'qsl_images.qsoid = ' . $this->config->item('table_name') . '.col_primary_key'); + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->order_by("id", "desc"); - return $this->db->get(); - } + return $this->db->get(); + } - function getQslForQsoId($id) { - // Clean ID - $clean_id = $this->security->xss_clean($id); + function getQslForQsoId($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); - // be sure that QSO belongs to user - $this->load->model('logbook_model'); - if (!$this->logbook_model->check_qso_is_accessible($clean_id)) { - return; - } + // be sure that QSO belongs to user + $this->load->model('logbook_model'); + if (!$this->logbook_model->check_qso_is_accessible($clean_id)) { + return; + } - $this->db->select('*'); - $this->db->from('qsl_images'); - $this->db->where('qsoid', $clean_id); + $this->db->select('*'); + $this->db->from('qsl_images'); + $this->db->where('qsoid', $clean_id); - return $this->db->get()->result(); - } + return $this->db->get()->result(); + } - function saveQsl($qsoid, $filename) { - // Clean ID - $clean_id = $this->security->xss_clean($qsoid); + function saveQsl($qsoid, $filename) { + // Clean ID + $clean_id = $this->security->xss_clean($qsoid); - // be sure that QSO belongs to user - $this->load->model('logbook_model'); - if (!$this->logbook_model->check_qso_is_accessible($clean_id)) { - return; - } + // be sure that QSO belongs to user + $this->load->model('logbook_model'); + if (!$this->logbook_model->check_qso_is_accessible($clean_id)) { + return; + } - $data = array( - 'qsoid' => $clean_id, - 'filename' => $filename - ); + $data = array( + 'qsoid' => $clean_id, + 'filename' => $filename + ); - $this->db->insert('qsl_images', $data); + $this->db->insert('qsl_images', $data); - return $this->db->insert_id(); - } + return $this->db->insert_id(); + } - function deleteQsl($id) { - // Clean ID - $clean_id = $this->security->xss_clean($id); + function del_image_for_qso($qso_id, $user_id = null) { + // QSO belongs to station_profile. But since we have folders for Users (and therefore an extra indirect relation) we need to lookup user for station first... + $qsl_img=$this->db->query('SELECT e.filename, e.id, qso.station_id, s.user_id FROM qsl_images e INNER JOIN '.$this->config->item('table_name').' qso ON (e.qsoid = qso.COL_PRIMARY_KEY) inner join station_profile s on (s.station_id=qso.station_id) where qso.COL_PRIMARY_KEY=?',$qso_id); + foreach ($qsl_img->result() as $row) { + if (($user_id ?? '') == '') { // Calling as User? Check if User-id matches User-id from QSO + $user_id = $this->session->userdata('user_id'); + if ($row->user_id != $user_id) { + return "No Image"; // Image doesn't belong to user, so return + } + } + $image=$this->get_imagePath('p',$row->user_id).'/'.$row->filename; + unlink($image); + $this->db->delete('qsl_images', array('id' => $row->id)); + } + } - // be sure that QSO belongs to user - $this->load->model('logbook_model'); - $this->db->select('qsoid'); - $this->db->from('qsl_images'); - $this->db->where('id', $clean_id); - $qsoid = $this->db->get()->row()->qsoid; - if (!$this->logbook_model->check_qso_is_accessible($qsoid)) { - return; - } + function deleteQsl($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); - // Delete Mode - $this->db->delete('qsl_images', array('id' => $clean_id)); - } + // be sure that QSO belongs to user + $this->load->model('logbook_model'); + $this->db->select('qsoid'); + $this->db->from('qsl_images'); + $this->db->where('id', $clean_id); + $qsoid = $this->db->get()->row()->qsoid; + if (!$this->logbook_model->check_qso_is_accessible($qsoid)) { + return; + } + // We cannot call del_image_for_qso here, since this one only deletes ONE QSL-Card (Multiple QSL-Cards can belong to one QSO) + $path = $this->get_imagePath('p'); + $file = $this->getFilename($clean_id)->row(); + $filename = $file->filename; + unlink($path.'/'.$filename); + // Delete Mode + $this->db->delete('qsl_images', array('id' => $clean_id)); + } - function getFilename($id) { - // Clean ID - $clean_id = $this->security->xss_clean($id); + function getFilename($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); - // be sure that QSO belongs to user - $this->load->model('logbook_model'); - $this->db->select('qsoid'); - $this->db->from('qsl_images'); - $this->db->where('id', $clean_id); - $qsoid = $this->db->get()->row()->qsoid; - if (!$this->logbook_model->check_qso_is_accessible($qsoid)) { - return; - } + // be sure that QSO belongs to user + $this->load->model('logbook_model'); + $this->db->select('qsoid'); + $this->db->from('qsl_images'); + $this->db->where('id', $clean_id); + $qsoid = $this->db->get()->row()->qsoid; + if (!$this->logbook_model->check_qso_is_accessible($qsoid)) { + return; + } - $this->db->select('filename'); - $this->db->from('qsl_images'); - $this->db->where('id', $clean_id); + $this->db->select('filename'); + $this->db->from('qsl_images'); + $this->db->where('id', $clean_id); - return $this->db->get(); - } + return $this->db->get(); + } - function searchQsos($callsign) { - $this->load->model('logbooks_model'); - $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + function searchQsos($callsign) { + $this->load->model('logbooks_model'); + $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $this->db->select('*'); $this->db->from($this->config->item('table_name')); @@ -122,35 +142,37 @@ class Qsl_model extends CI_Model { } // return path of qsl file : u=url / p=real path - function get_imagePath($pathorurl='u') { + function get_imagePath($pathorurl='u', $user_id=null) { // test if new folder directory option is enabled $userdata_dir = $this->config->item('userdata'); - + if (isset($userdata_dir)) { $qsl_dir = "qsl_card"; // make sure this is the same as in Debug_model.php function migrate_userdata() - $user_id = $this->session->userdata('user_id'); - + if (($user_id ?? '') == '') { + $user_id = $this->session->userdata('user_id'); + } + // check if there is a user_id in the session data and it's not empty if ($user_id != '') { - - // create the folder - if (!file_exists(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$qsl_dir)) { - mkdir(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$qsl_dir, 0755, true); - } - // and return it - if ($pathorurl=='u') { - return $userdata_dir.'/'.$user_id.'/'.$qsl_dir; - } else { - return realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$qsl_dir; - } - } else { + // create the folder + if (!file_exists(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$qsl_dir)) { + mkdir(realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$qsl_dir, 0755, true); + } + + // and return it + if ($pathorurl=='u') { + return $userdata_dir.'/'.$user_id.'/'.$qsl_dir; + } else { + return realpath(APPPATH.'../').'/'.$userdata_dir.'/'.$user_id.'/'.$qsl_dir; + } + } else { log_message('info', 'Can not get qsl card image path because no user_id in session data'); } - } else { + } else { // if the config option is not set we just return the old path return 'assets/qslcard'; diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php new file mode 100644 index 000000000..dced7a992 --- /dev/null +++ b/application/models/Satellite_model.php @@ -0,0 +1,122 @@ +db->query($sql)->result(); + } + + function delete($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); + + // Delete Satellite + $this->db->delete('satellite', array('id' => $clean_id)); + } + + function deleteSatMode($id) { + // Clean ID + $clean_id = $this->security->xss_clean($id); + + // Delete Satellite + $this->db->delete('satellitemode', array('id' => $clean_id)); + } + + function saveupdatedsatellite($id, $satellite) { + $this->db->where('satellite.id', $id); + + $this->db->update('satellite', $satellite); + + return true; + } + + function saveSatelliteMode($id, $satmode) { + $this->db->where('satellitemode.id', $id); + + $this->db->update('satellitemode', $satmode); + + return true; + } + + function add() { + $data = array( + 'name' => xss_clean($this->input->post('name', true)), + 'exportname' => xss_clean($this->input->post('exportname', true)), + 'orbit' => xss_clean($this->input->post('orbit', true)), + ); + + $this->db->where('name', xss_clean($this->input->post('name', true))); + $result = $this->db->get('satellite'); + + if ($result->num_rows() == 0) { + $this->db->insert('satellite', $data); + $insert_id = $this->db->insert_id(); + + $data = array( + 'name' => xss_clean($this->input->post('modename', true)), + 'satelliteid' => $insert_id, + 'uplink_mode' => xss_clean($this->input->post('uplinkmode', true)), + 'uplink_freq' => xss_clean($this->input->post('uplinkfrequency', true)), + 'downlink_mode' => xss_clean($this->input->post('downlinkmode', true)), + 'downlink_freq' => xss_clean($this->input->post('downlinkfrequency', true)), + ); + + $this->db->insert('satellitemode', $data); + } + + } + + function getsatellite($id) { + $this->db->where('id', $id); + return $this->db->get('satellite'); + } + + function getsatmodes($id) { + $this->db->where('satelliteid', $id); + return $this->db->get('satellitemode'); + } + + function insertSatelliteMode() { + $data = array( + 'name' => xss_clean($this->input->post('name', true)), + 'satelliteid' => xss_clean($this->input->post('id', true)), + 'uplink_mode' => xss_clean($this->input->post('uplink_mode', true)), + 'uplink_freq' => xss_clean($this->input->post('uplink_freq', true)), + 'downlink_mode' => xss_clean($this->input->post('downlink_mode', true)), + 'downlink_freq' => xss_clean($this->input->post('downlink_freq', true)), + ); + $this->db->insert('satellitemode', $data); + $insert_id = $this->db->insert_id(); + return $insert_id; + } + + function satellite_data() { + $this->db->select('satellite.name AS satellite, satellitemode.name AS satmode, satellitemode.uplink_mode AS Uplink_Mode, satellitemode.uplink_freq AS Uplink_Freq, satellitemode.downlink_mode AS Downlink_Mode, satellitemode.downlink_freq AS Downlink_Freq'); + $this->db->join('satellitemode', 'satellite.id = satellitemode.satelliteid', 'LEFT OUTER'); + $query = $this->db->get('satellite'); + log_message('debug', 'SQL: '.$this->db->last_query()); + return $query->result(); + } + + function array_group_by($flds, $arr) { + $groups = array(); + foreach ($arr as $rec) { + $keys = array_map(function($f) use($rec) { return $rec[$f]; }, $flds); + $k = implode('@', $keys); + if (isset($groups[$k])) { + $groups[$k][] = $rec; + } else { + $groups[$k] = array($rec); + } + } + return $groups; + } + +} + +?> diff --git a/application/models/Stations.php b/application/models/Stations.php index 66165d953..f3e2f0438 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -202,29 +202,43 @@ class Stations extends CI_Model { $this->user_options_model->set_option('eqsl_default_qslmsg', 'key_station_id', array(xss_clean($this->input->post('station_id', true)) => $eqsl_default_qslmsg)); } - function delete($id) { + function delete($id,$force = false, $user_id = null) { // Clean ID $clean_id = $this->security->xss_clean($id); // do not delete active station - if ($clean_id === $this->find_active()) { + if ((!($force)) && ($clean_id === $this->find_active())) { return; } + + # Del options for that station_id $this->user_options_model->del_option('eqsl_default_qslmsg', 'key_station_id', array('option_key' => $id)); - // Delete QSOs - $this->db->where('station_id', $id); - $this->db->delete($this->config->item('table_name')); + // Delete Contents of log for that station_id + $this->deletelog($clean_id, $user_id); - // Delete Station Profile + // Delete Station Profile, links, contests and oqrs-requests + $this->db->query("DELETE c FROM contest_session c WHERE c.station_id =?",$clean_id); + $this->db->query("DELETE FROM oqrs WHERE station_id = ?",$clean_id); + $this->db->query("DELETE FROM station_logbooks_relationship WHERE station_location_id = ?",$clean_id); $this->db->delete('station_profile', array('station_id' => $clean_id)); } - function deletelog($id) { - // Delete QSOs - $this->db->where('station_id', $id); - $this->db->delete($this->config->item('table_name')); - } + function deletelog($id, $user_id = null) { + // Clean ID + $clean_id = $this->security->xss_clean($id); + + $this->load->model('qsl_model'); + $this->load->model('eqsl_images'); + + $qsos=$this->db->query("select COL_PRIMARY_KEY as id from ".$this->config->item('table_name')." where station_id=?",$clean_id); + foreach ($qsos->result() as $qso) { + $this->qsl_model->del_image_for_qso($qso->id, $user_id); + $this->eqsl_images->del_image($qso->id, $user_id); + } + // Delete QSOs + $this->db->query("DELETE FROM ".$this->config->item('table_name')." WHERE station_id = ?",$clean_id); + } function set_active($current, $new) { // Clean inputs diff --git a/application/models/Stationsetup_model.php b/application/models/Stationsetup_model.php new file mode 100644 index 000000000..0ea88d908 --- /dev/null +++ b/application/models/Stationsetup_model.php @@ -0,0 +1,161 @@ +security->xss_clean($id); + + $this->db->where('user_id', $this->session->userdata('user_id')); + $this->db->where('logbook_id', $clean_id); + return $this->db->get('station_logbooks'); + } + + function saveContainer() { + $data = array( + 'logbook_name' => xss_clean($this->input->post('name', true)), + ); + + $this->db->where('user_id', $this->session->userdata('user_id')); + $this->db->where('logbook_id', xss_clean($this->input->post('id', true))); + $this->db->update('station_logbooks', $data); + } + + function remove_public_slug($logbook_id) { + $this->db->set('public_slug', null); + $this->db->where('user_id', $this->session->userdata('user_id')); + $this->db->where('logbook_id', xss_clean($logbook_id)); + $this->db->update('station_logbooks'); + } + + function saveVisitorLink($id, $name) { + $this->db->set('public_slug', $name); + $this->db->where('user_id', $this->session->userdata('user_id')); + $this->db->where('logbook_id', $id); + $this->db->update('station_logbooks'); + } + + function togglePublicSearch($id, $publicSearch) { + $data = array( + 'public_search' => ($publicSearch === 'true' ? 1 : 0) + ); + + $this->db->where('user_id', $this->session->userdata('user_id')); + $this->db->where('logbook_id', $id); + $this->db->update('station_logbooks', $data); + } + + function unLinkLocations($logbook_id, $station_id) { + + // be sure that logbook belongs to user + if (!$this->check_logbook_is_accessible($logbook_id)) { + return; + } + + // be sure that station belongs to user + $this->load->model('Stations'); + if (!$this->Stations->check_station_is_accessible($station_id)) { + return; + } + + // Delete relationship + $this->db->where('station_logbook_id', $logbook_id); + $this->db->where('station_location_id', $station_id); + $this->db->delete('station_logbooks_relationship'); + } + + public function check_logbook_is_accessible($id) { + // check if logbook belongs to user + $this->db->select('logbook_id'); + $this->db->where('user_id', $this->session->userdata('user_id')); + $this->db->where('logbook_id', $id); + $query = $this->db->get('station_logbooks'); + if ($query->num_rows() == 1) { + return true; + } + return false; + } + + // Creates relationship between a logbook and a station location + function create_logbook_location_link($logbook_id, $location_id) { + // be sure that logbook belongs to user + if (!$this->check_logbook_is_accessible($logbook_id)) { + return; + } + + // be sure that station belongs to user + $this->load->model('Stations'); + if (!$this->Stations->check_station_is_accessible($location_id)) { + return; + } + + // Create data array with field values + $data = array( + 'station_logbook_id' => $logbook_id, + 'station_location_id' => $location_id, + ); + + // Insert Record + $this->db->insert('station_logbooks_relationship', $data); + } + + function relationship_exists($logbook_id, $location_id) { + $this->db->where('station_logbook_id', $logbook_id); + $this->db->where('station_location_id', $location_id); + $query = $this->db->get('station_logbooks_relationship'); + + if ($query->num_rows() > 0){ + return true; + } else { + return false; + } + } + + function public_slug_exists($slug) { + $this->db->where('public_slug', $this->security->xss_clean($slug)); + $query = $this->db->get('station_logbooks'); + + if ($query->num_rows() > 0){ + return true; + } else { + return false; + } + } + + function public_slug_exists_logbook_id($slug) { + $this->db->where('public_slug', $this->security->xss_clean($slug)); + $query = $this->db->get('station_logbooks'); + + if ($query->num_rows() > 0){ + foreach ($query->result() as $row) { + return $row->logbook_id; + } + } else { + return false; + } + } + + function is_public_slug_available($slug) { + // Clean public_slug + $clean_slug = $this->security->xss_clean($slug); + $this->db->where('public_slug', $clean_slug); + $query = $this->db->get('station_logbooks'); + + if ($query->num_rows() > 0){ + return false; + } else { + return true; + } + } + + function locationInfo($id) { + $userid = $this->session->userdata('user_id'); // Fallback to session-uid, if userid is omitted + $this->db->select('station_profile.station_profile_name, station_profile.station_callsign, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end'); + $this->db->where('user_id', $userid); + $this->db->where('station_id', $id); + $this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left outer'); + return $this->db->get('station_profile'); + } +} + +?> diff --git a/application/models/User_model.php b/application/models/User_model.php index 2639bc8cd..cd29c6e20 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -150,7 +150,8 @@ class User_Model extends CI_Model { $user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url, $user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $user_quicklog_enter, - $language, $user_hamsat_key, $user_hamsat_workable_only) { + $language, $user_hamsat_key, $user_hamsat_workable_only, $user_iota_to_qso_tab, $user_sota_to_qso_tab, + $user_wwff_to_qso_tab, $user_pota_to_qso_tab, $user_sig_to_qso_tab, $user_dok_to_qso_tab) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -210,6 +211,12 @@ class User_Model extends CI_Model { $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'map_custom','gridsquare','show','0');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','api','".xss_clean($user_hamsat_key)."');"); $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','workable','".xss_clean($user_hamsat_workable_only)."');"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','iota','show',".(xss_clean($user_iota_to_qso_tab ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','sota','show',".(xss_clean($user_sota_to_qso_tab ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','wwff','show',".(xss_clean($user_wwff_to_qso_tab ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','pota','show',".(xss_clean($user_pota_to_qso_tab ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','sig','show',".(xss_clean($user_sig_to_qso_tab ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','dok','show',".(xss_clean($user_dok_to_qso_tab ?? 'off') == "on" ? 1 : 0).");"); return OK; } else { @@ -263,6 +270,12 @@ class User_Model extends CI_Model { $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','api','".xss_clean($fields['user_hamsat_key'])."');"); $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','workable','".xss_clean($fields['user_hamsat_workable_only'])."');"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','iota','show',".(xss_clean($fields['user_iota_to_qso_tab'] ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','sota','show',".(xss_clean($fields['user_sota_to_qso_tab'] ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','wwff','show',".(xss_clean($fields['user_wwff_to_qso_tab'] ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','pota','show',".(xss_clean($fields['user_pota_to_qso_tab'] ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','sig','show',".(xss_clean($fields['user_sig_to_qso_tab'] ?? 'off') == "on" ? 1 : 0).");"); + $this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'qso_tab','dok','show',".(xss_clean($fields['user_dok_to_qso_tab'] ?? 'off') == "on" ? 1 : 0).");"); // Check to see if the user is allowed to change user levels if($this->session->userdata('user_type') == 99) { @@ -317,11 +330,25 @@ class User_Model extends CI_Model { // FUNCTION: bool delete() // Deletes a user function delete($user_id) { - if($this->exists_by_id($user_id)) { - $this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = '".$user_id."'"); + $this->load->model('Stations'); + $stations = $this->Stations->all_of_user($user_id); + foreach ($stations->result() as $row) { + $this->Stations->delete($row->station_id,true, $user_id); + } + // Delete QSOs from $this->config->item('table_name') + $this->db->query("DELETE FROM bandxuser WHERE userid = ?",$user_id); + $this->db->query("DELETE FROM api WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM cat WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM lotw_certs WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM notes WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM paper_types WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM label_types WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM queries WHERE userid = ?",$user_id); + $this->db->query("DELETE FROM station_profile WHERE user_id = ?",$user_id); + $this->db->query("DELETE FROM station_logbooks WHERE user_id = ?",$user_id); $this->db->query("delete from user_options where user_id=?",$user_id); - + $this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = ?",$user_id); return 1; } else { return 0; diff --git a/application/views/activated_gridmap/index.php b/application/views/activated_gridmap/index.php index d34749b8e..a9fa6f027 100644 --- a/application/views/activated_gridmap/index.php +++ b/application/views/activated_gridmap/index.php @@ -1,32 +1,3 @@ - - -

diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 70873d466..3264e66df 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -57,6 +57,7 @@
+
- +
+ +
diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php index 8e6e9a01a..6cb55db2c 100644 --- a/application/views/awards/cq/index.php +++ b/application/views/awards/cq/index.php @@ -6,45 +6,6 @@ height: calc(100vh - 480px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #777; -} -.legend span { - position: relative; - bottom: 3px; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; -} -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); - border-radius: 5px; - color: #555; -} -.info h4 { - margin: 0 0 5px; - color: #555; -}
diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index 6ce4d3d2d..421af55b6 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -4,32 +4,6 @@ height: calc(100vh - 500px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #777; -} -.legend span { - position: relative; - bottom: 3px; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; -}
diff --git a/application/views/awards/ffma/index.php b/application/views/awards/ffma/index.php index d86334ea4..ba4b8c7b2 100644 --- a/application/views/awards/ffma/index.php +++ b/application/views/awards/ffma/index.php @@ -1,31 +1,6 @@

diff --git a/application/views/awards/helvetia/index.php b/application/views/awards/helvetia/index.php index 873d5db20..8b685822d 100644 --- a/application/views/awards/helvetia/index.php +++ b/application/views/awards/helvetia/index.php @@ -7,48 +7,6 @@ height: calc(100vh - 500px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #555; -} -.legend span { - position: relative; - bottom: 3px; - color: #555; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; - color: #555; -} - -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); - border-radius: 5px; - color: #555; -} -.info h4 { - margin: 0 0 5px; - color: #555; -}
diff --git a/application/views/awards/iota/index.php b/application/views/awards/iota/index.php index 594a64625..54f53a851 100644 --- a/application/views/awards/iota/index.php +++ b/application/views/awards/iota/index.php @@ -4,32 +4,6 @@ height: calc(100vh - 500px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #777; -} -.legend span { - position: relative; - bottom: 3px; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; -} diff --git a/application/views/awards/rac/index.php b/application/views/awards/rac/index.php index 345b0c6de..bc5668ad5 100644 --- a/application/views/awards/rac/index.php +++ b/application/views/awards/rac/index.php @@ -7,48 +7,6 @@ height: calc(100vh - 500px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #555; -} -.legend span { - position: relative; - bottom: 3px; - color: #555; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; - color: #555; -} - -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); - border-radius: 5px; - color: #555; -} -.info h4 { - margin: 0 0 5px; - color: #555; -}
diff --git a/application/views/awards/waja/index.php b/application/views/awards/waja/index.php index 82607f38e..565db062c 100644 --- a/application/views/awards/waja/index.php +++ b/application/views/awards/waja/index.php @@ -7,48 +7,6 @@ height: calc(100vh - 500px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #555; -} -.legend span { - position: relative; - bottom: 3px; - color: #555; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; - color: #555; -} - -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); - border-radius: 5px; - color: #555; -} -.info h4 { - margin: 0 0 5px; - color: #555; -}
diff --git a/application/views/awards/was/index.php b/application/views/awards/was/index.php index 7ddbd18b4..72a7c48af 100644 --- a/application/views/awards/was/index.php +++ b/application/views/awards/was/index.php @@ -7,48 +7,6 @@ height: calc(100vh - 500px) !important; max-height: 900px !important; } -/*Legend specific*/ -.legend { - padding: 6px 8px; - font: 14px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255, 255, 255, 0.8); - line-height: 24px; - color: #555; -} -.legend h4 { - text-align: center; - font-size: 16px; - margin: 2px 12px 8px; - color: #555; -} -.legend span { - position: relative; - bottom: 3px; - color: #555; -} -.legend i { - width: 18px; - height: 18px; - float: left; - margin: 0 8px 0 0; - opacity: 0.7; - color: #555; -} - -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: white; - background: rgba(255,255,255,0.8); - box-shadow: 0 0 15px rgba(0,0,0,0.2); - border-radius: 5px; - color: #555; -} -.info h4 { - margin: 0 0 5px; - color: #555; -}
diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php index 9aa51c18f..3b63c8d49 100644 --- a/application/views/bandmap/list.php +++ b/application/views/bandmap/list.php @@ -1,47 +1,49 @@
-
-
+
+
-

+

-
-
-
-
- - - - + + result() as $row) { ?> + + + + + + + + + + + + + - - + + $bandgroup) { echo ''; - foreach($bandgroup as $band) { - echo ''."\n"; + echo '>' . $band . '' . "\n"; } echo ''; } - ?> - + ?> + +
+ +

+ + + + + + + + + + + + + + + +
/DXCCSpotter

-

- - - - - - - - - - - - - - -
/DXCCSpotter
-

- -
+
\ No newline at end of file diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index 6e44cade6..972bb64c2 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -1,6 +1,6 @@
-

+

LIVE" : " POST"); ?>
@@ -116,7 +116,7 @@
- + - +
- - -
-
-
- - -
-
+ + +
+ +
+ +
diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 3ed0a9f68..b77c53d8f 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -226,11 +226,11 @@ function echo_table_col($row, $name) { - + / - / - + / + @@ -267,27 +267,6 @@ function echo_table_col($row, $name) { - config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_rcvd != 0)) { ?> - - - - - - - - - - - - - - - - - -
- - config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_lotw_sent != 0 || $total_lotw_rcvd != 0)) { ?> @@ -309,6 +288,27 @@ function echo_table_col($row, $name) {
+ config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) && ($total_eqsl_sent != 0 || $total_eqsl_rcvd != 0)) { ?> + + + + + + + + + + + + + + + + + +
+ + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === false) && ($total_qrz_sent != 0 || $total_qrz_rcvd != 0)) { ?> diff --git a/application/views/debug/index.php b/application/views/debug/index.php index dba2c7f92..8af44a95e 100644 --- a/application/views/debug/index.php +++ b/application/views/debug/index.php @@ -204,11 +204,11 @@
- + Commit - + n/a @@ -290,7 +290,16 @@ - +
+

+ +
+
+
+ + +
+
-
\ No newline at end of file +
+ + diff --git a/application/views/globe/index.php b/application/views/globe/index.php new file mode 100644 index 000000000..39aadb1a9 --- /dev/null +++ b/application/views/globe/index.php @@ -0,0 +1 @@ +
diff --git a/application/views/gridmap/index.php b/application/views/gridmap/index.php index 5a6618656..532c9a8d0 100644 --- a/application/views/gridmap/index.php +++ b/application/views/gridmap/index.php @@ -1,32 +1,3 @@ - - -

@@ -47,8 +18,8 @@ } ?> - - style="display: none;"> ' . $sat . ''."\n"; @@ -57,6 +28,15 @@ + +
- + +
+ +
+
+
+
- +
@@ -20,4 +26,4 @@
- + \ No newline at end of file diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 110d63cbd..11eed4c3d 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -422,7 +422,13 @@ $options = json_decode($options); - +
+ + + +
diff --git a/application/views/logbookadvanced/startatform.php b/application/views/logbookadvanced/startatform.php index f30c316ea..0aac7c7b4 100644 --- a/application/views/logbookadvanced/startatform.php +++ b/application/views/logbookadvanced/startatform.php @@ -1,18 +1,24 @@
- +
- + +
+ +
+
+
+
- +
diff --git a/application/views/logbooks/components/publicSlugInputValidation.php b/application/views/logbooks/components/publicSlugInputValidation.php deleted file mode 100644 index 792038ffa..000000000 --- a/application/views/logbooks/components/publicSlugInputValidation.php +++ /dev/null @@ -1,10 +0,0 @@ -
-" name="public_slug" id="publicSlugInput" hx-post="" value="input->post('public_slug'); ?>" hx-trigger="keyup changed delay:500ms" required> - -
Looks good! input->post('public_slug'); ?> is available
- -
Please choose a public slug. input->post('public_slug'); ?> is not available
- - -
\ No newline at end of file diff --git a/application/views/logbooks/create.php b/application/views/logbooks/create.php deleted file mode 100644 index a9defc001..000000000 --- a/application/views/logbooks/create.php +++ /dev/null @@ -1,41 +0,0 @@ -
- -
- session->flashdata('message')) { ?> - -
-

session->flashdata('message'); ?>

-
- - -
-
- -
-
- session->flashdata('notice')) { ?> -
- session->flashdata('notice'); ?> -
- - - load->helper('form'); ?> - - - - -
- - - -
- - - - -
-
- -
- -
diff --git a/application/views/logbooks/edit.php b/application/views/logbooks/edit.php deleted file mode 100644 index bb4ba43c8..000000000 --- a/application/views/logbooks/edit.php +++ /dev/null @@ -1,170 +0,0 @@ -
- -
- session->flashdata('message')) { ?> - -
-

session->flashdata('message'); ?>

-
- - - session->flashdata('notice')) { ?> -
- session->flashdata('notice'); ?> -
- - - load->helper('form'); ?> - - - -
-
-
-
: logbook_name; ?>
-
-
- - -
- - logbook_name; } ?>" required> - -
- - - - -
-
-
-
- -
-
-
-
-

-


- /

-
-
-
-
- - -
- -
-
- -
-
- - -
- - public_slug != "") { ?> - - -
- -

- - -
-

-

-
-
-
-
-
- -
-
-
-
-
-
- - - result() as $row) { - $linked_stations[] = $row->station_id; - } - } - ?> - -
- - -
- - - - -
-
-
-
-
- -
-
- -
- -
- - - - - - - - - - - result() as $row) { - ?> - - - - - - - - - - - - - - - -
station_profile_name;?>station_callsign;?>station_country; if ($row->end != NULL) { echo ' '.lang('gen_hamradio_deleted_dxcc').''; } ?>
-
- -
- -
diff --git a/application/views/logbooks/index.php b/application/views/logbooks/index.php deleted file mode 100644 index d374b4f53..000000000 --- a/application/views/logbooks/index.php +++ /dev/null @@ -1,87 +0,0 @@ -
- -
- session->flashdata('message')) { ?> - -
-

session->flashdata('message'); ?>

-
- - -

- -
-
- -
-
-

-
-
- -
-
- -
-
-
- num_rows() > 0) { ?> - -
- - - - - - - - - - - - - result() as $row) { ?> - - - - - - - - - - - -
- logbook_name;?>
-
- session->userdata('active_station_logbook') != $row->logbook_id) { ?> - logbook_id; ?>" class="btn btn-outline-primary btn-sm"> - " . lang('station_logbooks_active_logbook') . ""; - }?> - - logbook_id; ?>" class="btn btn-outline-primary btn-sm"> - - session->userdata('active_station_logbook') != $row->logbook_id) { ?> - logbook_id; ?>" class="btn btn-danger btn-sm" onclick="return confirm('logbook_name; ?>');"> - - - public_slug != '') { ?> - public_slug; ?>" class="btn btn-outline-primary btn-sm" > - - - public_search == 1) { - echo "" . lang('general_word_enabled') . ""; - } else { - echo "" . lang('general_word_disabled') . ""; - } ?> -
-
- -
-
-
- - -
diff --git a/application/views/qslcard/index.php b/application/views/qslcard/index.php index 831a83678..0ba0e814b 100644 --- a/application/views/qslcard/index.php +++ b/application/views/qslcard/index.php @@ -59,7 +59,7 @@ }; echo ''; echo ''; - $timestamp = strtotime($qsl->COL_QSLRDATE); + $timestamp = strtotime($qsl->COL_QSLRDATE ?? ''); echo date($custom_date_format, $timestamp); echo ''; echo ''; diff --git a/application/views/qslcard/qslcarousel.php b/application/views/qslcard/qslcarousel.php index 40d4d132d..db62d444c 100644 --- a/application/views/qslcard/qslcarousel.php +++ b/application/views/qslcard/qslcarousel.php @@ -1,5 +1,4 @@ diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index 75cd5c41c..3f746fb78 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -86,7 +86,7 @@ echo ''; foreach($bandgroup as $band) { echo ''."\n"; } echo ''; @@ -103,7 +103,7 @@ echo ''; foreach($bandgroup as $band) { echo ''."\n"; } echo ''; diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 38d525b8d..6c3406b23 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -16,7 +16,7 @@
+ +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ +
+
+ + + +
+ +
+ +
+
+ +
+
+ + + +
+ +
+ +
+
+ +
+
+ + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ +
@@ -356,6 +433,7 @@
+
+ +
@@ -380,7 +460,9 @@
+ +
@@ -391,7 +473,9 @@
+ +
@@ -402,7 +486,9 @@
+ +
@@ -414,12 +500,16 @@
+ +
+ +
diff --git a/application/views/satellite/create.php b/application/views/satellite/create.php new file mode 100644 index 000000000..43793f8ef --- /dev/null +++ b/application/views/satellite/create.php @@ -0,0 +1,73 @@ + +
+ +
+ session->flashdata('message')) { ?> + +
+

session->flashdata('message'); ?>

+
+ + + session->flashdata('notice')) { ?> +
+ session->flashdata('notice'); ?> +
+ + + load->helper('form'); ?> + +
+
+
+ + + Satellite name +
+
+ + + If external services uses another name for the satellite, like LoTW +
+
+
+
+ + + Enter which orbit the satellite has (LEO, MEO, GEO) +
+
+ + + Enter satellite mode +
+
+
+
+ + + Enter modulation used for uplink +
+
+ + + Enter frequency (in Hz) used for uplink +
+
+
+
+ + + Enter modulation used for downlink +
+
+ + + Enter frequency (in Hz) used for downlink +
+
+ + + +
+
diff --git a/application/views/satellite/edit.php b/application/views/satellite/edit.php new file mode 100644 index 000000000..cb915e552 --- /dev/null +++ b/application/views/satellite/edit.php @@ -0,0 +1,62 @@ +
+
+ + +
+
+ + name; } ?>" required> + Satellite name +
+
+ + exportname; } ?>" required> + If external services uses another name for the satellite, like LoTW +
+
+
+
+ + orbit; } ?>" required> + Enter which orbit the satellite has (LEO, MEO, GEO) +
+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameUplink modeUplink frequencyDownlink modeDownlink frequencyEditDelete
name) ?>
+ + + + + diff --git a/application/views/satellite/index.php b/application/views/satellite/index.php new file mode 100644 index 000000000..6eaaabba9 --- /dev/null +++ b/application/views/satellite/index.php @@ -0,0 +1,63 @@ +
+ +
+ session->flashdata('message')) { ?> + +
+

session->flashdata('message'); ?>

+
+ + +

Satellites

+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + '.$sat->orbit.''; + ?> + + + + + + + +
NameExport NameOrbitModeEditDelete
satname) ?>exportname) ?>modename ?? '') ?>
+ + +
+ + diff --git a/application/views/search/search_result_ajax.php b/application/views/search/search_result_ajax.php index 18cce9d8b..553981ae6 100644 --- a/application/views/search/search_result_ajax.php +++ b/application/views/search/search_result_ajax.php @@ -1,3 +1,86 @@ +COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; + break; + case 'RSTS': + echo $row->COL_RST_SENT; if ($row->COL_STX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';}; + break; + case 'RSTR': + echo $row->COL_RST_RCVD; if ($row->COL_SRX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $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 'WWFF': + echo ($row->COL_WWFF_REF); + break; + case 'POTA': + echo ($row->COL_POTA_REF); + break; + case 'Grid': + echo strlen($row->COL_GRIDSQUARE ?? '')==0?$row->COL_VUCC_GRIDS ?? '':$row->COL_GRIDSQUARE ?? ''; break; + break; + case 'Distance': + echo ($row->COL_DISTANCE ? $row->COL_DISTANCE . ' km' : ''); + break; + case 'Band': + 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; + case 'Operator': + echo ($row->COL_OPERATOR); + break; + case 'Frequency': + if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } }; + break; + case 'State': + echo ($row->COL_STATE); + break; + case 'Operator': + echo ($row->COL_OPERATOR); + break; + case 'Location': + echo ($row->station_profile_name); + break; + case 'Name': + echo ($row->COL_NAME); + break; + default: + echo '(unknown col)'; + } +} +?>
@@ -10,84 +93,19 @@ '; - switch($this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')) { - case 'Mode': echo lang('gen_hamradio_mode'); break; - case 'RSTS': echo lang('gen_hamradio_rsts'); break; - case 'RSTR': echo lang('gen_hamradio_rstr'); break; - case 'Country': echo lang('general_word_country'); break; - case 'IOTA': echo lang('gen_hamradio_iota'); break; - case 'SOTA': echo lang('gen_hamradio_sota'); break; - case 'State': echo lang('gen_hamradio_state'); break; - case 'Grid': echo lang('gen_hamradio_gridsquare'); break; - case 'Distance': echo lang('gen_hamradio_distance'); break; - case 'Band': echo lang('gen_hamradio_band'); break; - case 'Frequency': echo lang('gen_hamradio_frequency'); break; - case 'Operator': echo lang('gen_hamradio_operator'); break; - } + echo_table_header_col($this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')); echo ''; echo ''; echo ''; echo ''; echo ''; if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> @@ -131,91 +149,16 @@ $ci =& get_instance(); session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')) { - case 'Mode': echo ''; break; - case 'RSTR': echo ''; break; - case 'Country': echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; - } - echo ''; - switch($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')) { - case 'Mode': echo ''; break; - case 'RSTR': echo ''; break; - case 'Country': echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; - } - echo ''; - - switch($this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')) { - case 'Mode': echo ''; break; - case 'RSTR': echo ''; break; - case 'Country': echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; - } - echo ''; - switch($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')) { - case 'Mode': echo ''; break; - case 'RSTR': echo ''; break; - case 'Country': echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; - } - echo ''; - switch($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')) { - case 'Mode': echo ''; break; - case 'RSTR': echo ''; break; - case 'Country': echo ''; } else { if ($row->COL_FREQ != null) { echo ' '.$ci->frequency->hz_to_mhz($row->COL_FREQ).''; } else { echo strtolower($row->COL_BAND); } } echo ''; break; - } + echo ''; if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> diff --git a/application/views/stationsetup/edit.php b/application/views/stationsetup/edit.php new file mode 100644 index 000000000..5cb049ca6 --- /dev/null +++ b/application/views/stationsetup/edit.php @@ -0,0 +1,24 @@ +
+ +
+ +
+
+ + session->flashdata('notice')) { ?> +
+ session->flashdata('notice'); ?> +
+ + + load->helper('form'); ?> + + +
+ + + You can call a container anything. +
+ + +
diff --git a/application/views/stationsetup/linkedlocations.php b/application/views/stationsetup/linkedlocations.php new file mode 100644 index 000000000..4bf17d311 --- /dev/null +++ b/application/views/stationsetup/linkedlocations.php @@ -0,0 +1,52 @@ + + +result() as $row) { + $linked_stations[] = $row->station_id; + } + } +?> + +
+ + +
+ + + + +

+ +
'; - switch($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')) { - case 'Mode': echo lang('gen_hamradio_mode'); break; - case 'RSTS': echo lang('gen_hamradio_rsts'); break; - case 'RSTR': echo lang('gen_hamradio_rstr'); break; - case 'Country': echo lang('general_word_country'); break; - case 'IOTA': echo lang('gen_hamradio_iota'); break; - case 'State': echo lang('gen_hamradio_state'); break; - case 'SOTA': echo lang('gen_hamradio_sota'); break; - case 'Grid': echo lang('gen_hamradio_gridsquare'); break; - case 'Distance': echo lang('gen_hamradio_distance'); break; - case 'Band': echo lang('gen_hamradio_band'); break; - case 'Frequency': echo lang('gen_hamradio_frequency'); break; - case 'Operator': echo lang('gen_hamradio_operator'); break; - } + echo_table_header_col($this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')); echo ''; - switch($this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')) { - case 'Mode': echo lang('gen_hamradio_mode'); break; - case 'RSTS': echo lang('gen_hamradio_rsts'); break; - case 'RSTR': echo lang('gen_hamradio_rstr'); break; - case 'Country': echo lang('general_word_country'); break; - case 'IOTA': echo lang('gen_hamradio_iota'); break; - case 'SOTA': echo lang('gen_hamradio_sota'); break; - case 'State': echo lang('gen_hamradio_state'); break; - case 'Grid': echo lang('gen_hamradio_gridsquare'); break; - case 'Distance': echo lang('gen_hamradio_distance'); break; - case 'Band': echo lang('gen_hamradio_band'); break; - case 'Frequency': echo lang('gen_hamradio_frequency'); break; - case 'Operator': echo lang('gen_hamradio_operator'); break; - } + echo_table_header_col($this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')); echo ''; - switch($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')) { - case 'Mode': echo lang('gen_hamradio_mode'); break; - case 'RSTS': echo lang('gen_hamradio_rsts'); break; - case 'RSTR': echo lang('gen_hamradio_rstr'); break; - case 'Country': echo lang('general_word_country'); break; - case 'IOTA': echo lang('gen_hamradio_iota'); break; - case 'SOTA': echo lang('gen_hamradio_sota'); break; - case 'State': echo lang('gen_hamradio_state'); break; - case 'Grid': echo lang('gen_hamradio_gridsquare'); break; - case 'Distance': echo lang('gen_hamradio_distance'); break; - case 'Band': echo lang('gen_hamradio_band'); break; - case 'Frequency': echo lang('gen_hamradio_frequency'); break; - case 'Operator': echo lang('gen_hamradio_operator'); break; - } + echo_table_header_col($this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')); echo ''; - switch($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')) { - case 'Mode': echo lang('gen_hamradio_mode'); break; - case 'RSTS': echo lang('gen_hamradio_rsts'); break; - case 'RSTR': echo lang('gen_hamradio_rstr'); break; - case 'Country': echo lang('general_word_country'); break; - case 'IOTA': echo lang('gen_hamradio_iota'); break; - case 'SOTA': echo lang('gen_hamradio_sota'); break; - case 'State': echo lang('gen_hamradio_state'); break; - case 'Grid': echo lang('gen_hamradio_gridsquare'); break; - case 'Distance': echo lang('gen_hamradio_distance'); break; - case 'Band': echo lang('gen_hamradio_band'); break; - case 'Frequency': echo lang('gen_hamradio_frequency'); break; - case 'Operator': echo lang('gen_hamradio_operator'); break; - } + echo_table_header_col($this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')); 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 ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';} echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_SRX_STRING . '';} echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; - case 'IOTA': echo '' . ($row->COL_IOTA); break; - 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': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$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); }; break; - case 'State': echo '' . ($row->COL_STATE); break; - case 'Operator': echo '' . ($row->COL_OPERATOR); break; - case 'Frequency': echo ''; if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } 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 ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';} echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_SRX_STRING . '';} echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; - case 'IOTA': echo '' . ($row->COL_IOTA); break; - 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': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$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); }; break; - case 'State': echo '' . ($row->COL_STATE); break; - case 'Operator': echo '' . ($row->COL_OPERATOR); break; - case 'Frequency': echo ''; if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } 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 ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';} echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_SRX_STRING . '';} echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; - case 'IOTA': echo '' . ($row->COL_IOTA); break; - 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': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$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); }; break; - case 'State': echo '' . ($row->COL_STATE); break; - case 'Operator': echo '' . ($row->COL_OPERATOR); break; - case 'Frequency': echo ''; if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } 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 ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';} echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_SRX_STRING . '';} echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; - case 'IOTA': echo '' . ($row->COL_IOTA); break; - 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': echo ''; echo strlen($row->COL_GRIDSQUARE ?? '')==0?$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); }; break; - case 'State': echo '' . ($row->COL_STATE); break; - case 'Operator': echo '' . ($row->COL_OPERATOR); break; - case 'Frequency': echo ''; if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } 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 ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_STX_STRING . '';} echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo ' COL_CONTEST_ID:"n/a").'" class="badge text-bg-light">' . $row->COL_SRX_STRING . '';} echo '' . ucwords(strtolower(($row->COL_COUNTRY)));; break; - case 'IOTA': echo '' . ($row->COL_IOTA); break; - 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': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$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); }; break; - case 'State': echo '' . ($row->COL_STATE); break; - case 'Operator': echo '' . ($row->COL_OPERATOR); break; - case 'Frequency': echo ''; if($row->COL_SAT_NAME != null) { echo ''; if ($row->COL_FREQ != null) { echo ' '.$row->COL_SAT_NAME.''; } else { echo $row->COL_SAT_NAME; } echo ''; + echo_table_col($row, $this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')); + echo ''; + echo_table_col($row, $this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')); + echo ''; + echo_table_col($row, $this->session->userdata('user_column3')==""?'RSTR':$this->session->userdata('user_column3')); + echo ''; + echo_table_col($row, $this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4')); + echo ''; + echo_table_col($row, $this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')); echo '
+ + + + + + + + + + result() as $row) { + ?> + + + + + + + +
station_profile_name;?>station_callsign;?>station_country; if ($row->end != NULL) { echo ' '.lang('gen_hamradio_deleted_dxcc').''; } ?> +
diff --git a/application/views/stationsetup/stationsetup.php b/application/views/stationsetup/stationsetup.php index 3fdeb647d..ae32b59d4 100644 --- a/application/views/stationsetup/stationsetup.php +++ b/application/views/stationsetup/stationsetup.php @@ -20,6 +20,7 @@

+ num_rows() > 0) { ?>
@@ -28,16 +29,16 @@ - + Linked locations - + Visitor site result() as $row) { ?> - logbook_name;?> + logbook_name;?> session->userdata('active_station_logbook') != $row->logbook_id) { ?> @@ -46,33 +47,34 @@ }?> - logbook_id; ?>" - class="btn btn-outline-primary btn-sm"> - + session->userdata('active_station_logbook') != $row->logbook_id) { ?> - public_slug != '') { ?> public_slug; ?>" class="btn btn-outline-primary btn-sm"> + public_search == 1) { - echo "" . lang('general_word_enabled') . ""; - } else { - echo "" . lang('general_word_disabled') . ""; - } ?> + echo "" . lang('general_word_enabled') . "";?> +
+ " . lang('general_word_disabled') . ""; ?> +
+ diff --git a/application/views/stationsetup/visitor.php b/application/views/stationsetup/visitor.php new file mode 100644 index 000000000..77b04e5a0 --- /dev/null +++ b/application/views/stationsetup/visitor.php @@ -0,0 +1,21 @@ + +

+


+ /

+
+
+
+
+ + + +
+
+ + public_slug != "") { ?> + + + diff --git a/application/views/update/index.php b/application/views/update/index.php index 6dee15bfe..283d179cb 100644 --- a/application/views/update/index.php +++ b/application/views/update/index.php @@ -25,7 +25,7 @@
Check for DXCC Data Updates
- +
Status:
@@ -37,14 +37,17 @@ You can choose to check just the QSOs in the logbook that are missing DXCC metadata or to re-check the entire logbook and update existing metadata as well, in case it has changed.

-

Check QSOs missing DXCC data

-

Re-check all QSOs in logbook

+

Check QSOs missing DXCC data

+
+

Re-check all QSOs in logbook

+
Apply Continent Data to Logbook

This function can be used to update QSO continent information for all QSOs in Wavelog missing that information.

-

Check QSOs missing continent data

+

Check QSOs missing continent data

+