From d9d1b428fa04a8092e4574229d42925eeefcdc62 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 28 May 2024 17:16:57 +0100 Subject: [PATCH] formatted code better --- application/models/Logbook_model.php | 70 ++--- application/views/components/hamsat/table.php | 295 +++++++++--------- 2 files changed, 184 insertions(+), 181 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index f0a9cce3..570f5063 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -165,7 +165,7 @@ class Logbook_model extends CI_Model $qso_rx_power = null; if ($this->input->post('copyexchangeto')) { - switch($this->input->post('copyexchangeto')) { + switch ($this->input->post('copyexchangeto')) { case 'dok': $darc_dok = $srx_string; break; @@ -184,13 +184,13 @@ class Logbook_model extends CI_Model case 'power': $qso_rx_power = $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_power = $exch_pt[1]; - // 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_power = $exch_pt[1]; + // break; default: } } @@ -2059,32 +2059,32 @@ class Logbook_model extends CI_Model function check_if_grid_4char_worked_in_logbook($grid, $StationLocationsArray = null, $band = null) { - if ($StationLocationsArray == null) { - $CI = &get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - } else { - $logbooks_locations_array = $StationLocationsArray; - } - - $this->db->select('COL_GRIDSQUARE'); - $this->db->where_in('station_id', $logbooks_locations_array); - $this->db->group_start(); - $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4)); - $this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4)); - $this->db->group_end(); - - if ($band != null && $band != 'SAT') { - $this->db->where('COL_BAND', $band); - } else if ($band == 'SAT') { - // Where col_sat_name is not empty - $this->db->where('COL_SAT_NAME !=', ''); - } - $this->db->limit('2'); - - $query = $this->db->get($this->config->item('table_name')); - - return $query->num_rows(); + if ($StationLocationsArray == null) { + $CI = &get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + } else { + $logbooks_locations_array = $StationLocationsArray; + } + + $this->db->select('COL_GRIDSQUARE'); + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->group_start(); + $this->db->like('SUBSTRING(COL_GRIDSQUARE, 1, 4)', substr($grid, 0, 4)); + $this->db->or_like('SUBSTRING(COL_VUCC_GRIDS, 1, 4)', substr($grid, 0, 4)); + $this->db->group_end(); + + if ($band != null && $band != 'SAT') { + $this->db->where('COL_BAND', $band); + } else if ($band == 'SAT') { + // Where col_sat_name is not empty + $this->db->where('COL_SAT_NAME !=', ''); + } + $this->db->limit('2'); + + $query = $this->db->get($this->config->item('table_name')); + + return $query->num_rows(); } @@ -3489,7 +3489,7 @@ class Logbook_model extends CI_Model $rx_pwr = $record['rx_pwr']; } else { $rx_pwr = null; - $my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (".$record['rx_pwr'].") is not a number
"; + $my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (" . $record['rx_pwr'] . ") is not a number
"; } } } else { diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 2efd23c2..f7461e72 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -2,153 +2,156 @@

Hamsat - Satellite Rovers

This data is from https://hams.at/. - +

-
- Private feed key empty. Please set the feed key in your profile. -
+
+ Private feed key empty. Please set the feed key in your profile. +
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateTimeCallsignCommentSatelliteModeGridsquare(s)Workable
- session->userdata('user_date_format')) { - // If Logged in and session exists - $custom_date_format = $this->session->userdata('user_date_format'); - } else { - // Get Default date format from /config/wavelog.php - $custom_date_format = $this->config->item('qso_date_format'); - } - - ?> - - - - - - - load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $CI->load->model('logbook_model'); - $call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT"); - if ($call_worked != 0) { - echo "".$rove['callsign'].""; - } else { - echo $rove['callsign']; - } - ?> - - - "> - - - logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT"); - if ($worked != 0) { - echo " " . $grid . ""; - } else { - echo " " . $grid . ""; - } - } - ?> - - - - No"; - } - } else { - echo "Unknown"; - } - ?> - Track - - Sked - -
- + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateTimeCallsignCommentSatelliteModeGridsquare(s)Workable
+ session->userdata('user_date_format')) { + // If Logged in and session exists + $custom_date_format = $this->session->userdata('user_date_format'); + } else { + // Get Default date format from /config/wavelog.php + $custom_date_format = $this->config->item('qso_date_format'); + } + + ?> + + + + + + + load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $CI->load->model('logbook_model'); + $call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT"); + if ($call_worked != 0) { + echo "" . $rove['callsign'] . ""; + } else { + echo $rove['callsign']; + } + ?> + + + "> + + + logbook_model->check_if_grid_4char_worked_in_logbook($grid, null, "SAT"); + if ($worked != 0) { + echo " " . $grid . ""; + } else { + echo " " . $grid . ""; + } + } + ?> + + + + No"; + } + } else { + echo "Unknown"; + } + ?> + Track + + Sked + +
+ - + \ No newline at end of file