diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 0452150c..1c501c2e 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -13,7 +13,7 @@ */ $config['app_name'] = "Cloudlog"; -$config['app_version'] = "1.1"; +$config['app_version'] = "1.5"; $config['directory'] = "logbook"; $config['callbook'] = "hamqth"; // Options are hamqth or qrz diff --git a/application/controllers/radio.php b/application/controllers/radio.php index 74ba5474..5e2acadf 100644 --- a/application/controllers/radio.php +++ b/application/controllers/radio.php @@ -66,7 +66,21 @@ { foreach ($query->result() as $row) { - echo $row->frequency; + if( $row->frequency == "0") { + $this->db->select('uplink_freq'); + $this->db->where('id', $id); + $query = $this->db->get('cat'); + + if ($query->num_rows() > 0) + { + foreach ($query->result() as $row) + { + echo strtoupper($row->uplink_freq); + } + } + } else { + echo $row->frequency; + } } } } @@ -78,7 +92,7 @@ if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } //$this->db->where('radio', $result['radio']); - $this->db->select('mode'); + $this->db->select('mode, radio, uplink_mode'); $this->db->where('id', $id); $query = $this->db->get('cat'); @@ -86,7 +100,68 @@ { foreach ($query->result() as $row) { - echo strtoupper($row->mode); + if($row->radio != "SatPC32") { + echo strtoupper($row->mode); + } else { + echo strtoupper($row->uplink_mode); + } + } + } + } + + function satname($id) { + + // Check Auth + $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->db->where('radio', $result['radio']); + $this->db->select('sat_name'); + $this->db->where('id', $id); + $query = $this->db->get('cat'); + + if ($query->num_rows() > 0) + { + foreach ($query->result() as $row) + { + echo strtoupper($row->sat_name); + } + } + } + + function satmode($id) { + + // Check Auth + $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->db->where('radio', $result['radio']); + $this->db->select('uplink_freq, downlink_freq'); + $this->db->where('id', $id); + $query = $this->db->get('cat'); + + if ($query->num_rows() > 0) + { + foreach ($query->result() as $row) + { + + if ($row->uplink_freq > 144000000 && $row->uplink_freq < 147000000) { + $uplink_mode = "V"; + } elseif ($row->uplink_freq > 432000000 && $row->uplink_freq < 438000000) { + $uplink_mode = "U"; + } elseif ($row->uplink_freq > 28000000 && $row->uplink_freq < 30000000) { + $uplink_mode = "A"; + } + + if ($row->downlink_freq > 144000000 && $row->downlink_freq < 147000000) { + $downlink_mode = "V"; + } elseif ($row->downlink_freq > 432000000 && $row->downlink_freq < 438000000) { + $downlink_mode = "U"; + } elseif ($row->downlink_freq > 28000000 && $row->downlink_freq < 30000000) { + $downlink_mode = "A"; + } + + echo $uplink_mode."/".$downlink_mode; } } } diff --git a/application/models/cat.php b/application/models/cat.php index 7c65aadc..1ec8f0c3 100644 --- a/application/models/cat.php +++ b/application/models/cat.php @@ -15,27 +15,59 @@ if ($query->num_rows() > 0) { - // Update the record - foreach ($query->result() as $row) - { - $radio_id = $row->id; - - $data = array( - 'frequency' => $result['frequency'], - 'mode' => $result['mode'] - ); + if($result['radio'] == "SatPC32") { + // Update the record + foreach ($query->result() as $row) + { + $radio_id = $row->id; + + $data = array( + 'sat_name' => $result['sat_name'], + 'downlink_freq' => $result['downlink_freq'], + 'uplink_freq' => $result['uplink_freq'], + 'downlink_mode' => $result['downlink_mode'], + 'uplink_mode' => $result['uplink_mode'], + ); - $this->db->where('id', $radio_id); - $this->db->update('cat', $data); + $this->db->where('id', $radio_id); + $this->db->update('cat', $data); + } + } else { + // Update the record + foreach ($query->result() as $row) + { + $radio_id = $row->id; + + $data = array( + 'frequency' => $result['frequency'], + 'mode' => $result['mode'], + ); + + $this->db->where('id', $radio_id); + $this->db->update('cat', $data); + } } } else { // Add a new record - $data = array( - 'radio' => $result['radio'], - 'frequency' => $result['frequency'], - 'mode' => $result['mode'] - ); + if($result['radio'] == "SatPC32") { + $data = array( + 'radio' => $result['radio'], + 'frequency' => $result['frequency'], + 'mode' => $result['mode'], + 'sat_name' => $result['sat_name'], + 'downlink_freq' => $result['downlink_freq'], + 'uplink_freq' => $result['uplink_freq'], + 'downlink_mode' => $result['downlink_mode'], + 'uplink_mode' => $result['uplink_mode'], + ); + } else { + $data = array( + 'radio' => $result['radio'], + 'frequency' => $result['frequency'], + 'mode' => $result['mode'] + ); + } $this->db->insert('cat', $data); diff --git a/application/views/qso/index.php b/application/views/qso/index.php index ce9253bf..a1240da7 100644 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -209,12 +209,12 @@
Sat Name | -+ | |
Sat Mode | -+ |