diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index 527d251e..69ae43c4 100644 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -43,29 +43,30 @@ class QSO extends CI_Controller { { // Add QSO // $this->logbook_model->add(); - //change to create_qso function as add and create_qso duplicate functionality - $this->logbook_model->create_qso(); - + //change to create_qso function as add and create_qso duplicate functionality + $this->logbook_model->create_qso(); + // Store Basic QSO Info for reuse - // Put data in an array first, then call set_userdata once. - // This solves the problem of CI dumping out the session - // cookie each time set_userdata is called. - // For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/ - // $qso_data = [ - // 18-Jan-2016 - make php v5.3 friendly! - $qso_data = array( - 'band' => $this->input->post('band'), - 'freq' => $this->input->post('freq'), - 'mode' => $this->input->post('mode'), - 'sat_name' => $this->input->post('sat_name'), - 'sat_mode' => $this->input->post('sat_mode'), - 'radio' => $this->input->post('radio'), - 'station_profile_id' => $this->input->post('station_profile') - ); - // ]; + // Put data in an array first, then call set_userdata once. + // This solves the problem of CI dumping out the session + // cookie each time set_userdata is called. + // For more info, see http://bizhole.com/codeigniter-nginx-error-502-bad-gateway/ + // $qso_data = [ + // 18-Jan-2016 - make php v5.3 friendly! + $qso_data = array( + 'band' => $this->input->post('band'), + 'freq' => $this->input->post('freq_display'), + 'freq_rx' => $this->input->post('freq_display_rx'), + 'mode' => $this->input->post('mode'), + 'sat_name' => $this->input->post('sat_name'), + 'sat_mode' => $this->input->post('sat_mode'), + 'radio' => $this->input->post('radio'), + 'station_profile_id' => $this->input->post('station_profile') + ); + // ]; - $this->session->set_userdata($qso_data); - + $this->session->set_userdata($qso_data); + // Get last 16 qsos $data['query'] = $this->logbook_model->last_custom('16'); @@ -81,74 +82,6 @@ class QSO extends CI_Controller { } } - /* - Function: manual - Usage: Post QSO Logging - */ - - public function manual() - { - - $this->load->model('cat'); - $this->load->model('logbook_model'); - $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'); } - - - $data['notice'] = false; - $data['radios'] = $this->cat->radios(); - $data['query'] = $this->logbook_model->last_custom('16'); - - $this->load->library('form_validation'); - - $this->form_validation->set_rules('start_date', 'Date', 'required'); - $this->form_validation->set_rules('start_time', 'Time', 'required'); - $this->form_validation->set_rules('callsign', 'Callsign', 'required'); - - if ($this->form_validation->run() == FALSE) - { - $data['page_title'] = "Add QSO"; - - $this->load->view('layout/header', $data); - $this->load->view('qso/manual'); - $this->load->view('layout/footer'); - } - else - { - // Add QSO - $this->logbook_model->create_qso(); - - // Store Basic QSO Info for reuse - //$qso_data = [ - // 18-Jan-2016 - make php v5.3 friendly! - $qso_data = array( - 'band' => $this->input->post('band'), - 'freq' => $this->input->post('freq'), - 'mode' => $this->input->post('mode'), - 'sat_name' => $this->input->post('sat_name'), - 'sat_mode' => $this->input->post('sat_mode'), - 'radio' => $this->input->post('radio') - ); - //]; - - $this->session->set_userdata($qso_data); - - // Get last Ten QSOs - $data['query'] = $this->logbook_model->last_ten(); - - // Set Any Notice Messages - $data['notice'] = "QSO Added"; - - // Load view to create another contact - $data['page_title'] = "Manual QSO"; - - $this->load->view('layout/header', $data); - $this->load->view('qso/manual'); - $this->load->view('layout/footer'); - } - } - - function edit() { $this->load->model('logbook_model'); diff --git a/application/controllers/Radio.php b/application/controllers/Radio.php index fae31806..c2cb6940 100644 --- a/application/controllers/Radio.php +++ b/application/controllers/Radio.php @@ -61,7 +61,11 @@ } - function frequency($id) { + function frequency_downlink($id) { + return $this->frequency($id, true); + } + + function frequency($id, $downlink = false) { // Check Auth $this->load->model('user_model'); @@ -77,19 +81,25 @@ foreach ($query->result() as $row) { if( $row->frequency == "0") { - $this->db->select('uplink_freq'); + $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) + foreach ($query->result() as $row) { - echo strtoupper($row->uplink_freq); + if ($downlink) + echo strtoupper($row->downlink_freq); + else + echo strtoupper($row->uplink_freq); } } } else { - echo $row->frequency; + if ($downlink) + echo ""; + else + echo strtoupper($row->frequency); } } } @@ -168,7 +178,9 @@ { foreach ($query->result() as $row) { - + $uplink_mode = ""; + $downlink_mode = ""; + if ($row->uplink_freq > 144000000 && $row->uplink_freq < 147000000) { $uplink_mode = "V"; } elseif ($row->uplink_freq > 432000000 && $row->uplink_freq < 438000000) { diff --git a/application/views/qso/manual.php b/application/views/qso/manual.php deleted file mode 100644 index 9a6cec42..00000000 --- a/application/views/qso/manual.php +++ /dev/null @@ -1,530 +0,0 @@ - - - - - - - - - - -
| Date | -Time | -Call | -Mode | -Sent | -Recv | -Band | -COL_TIME_ON); echo date('d/m/y', $timestamp); ?> | -COL_TIME_ON); echo date('H:i', $timestamp); ?> | -COL_PRIMARY_KEY; ?>">COL_CALL); ?> | -COL_MODE; ?> | -COL_RST_SENT; ?> | -COL_RST_RCVD; ?> | - COL_SAT_NAME != null) { ?> -COL_SAT_NAME; ?> | - -COL_BAND; ?> | - - - - -