From e0e80fb6806a1ef577e0e14ed609dd9c0f2da11e Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:42:19 +0200 Subject: [PATCH] [Contesting] Fixed so that correct gridsquare was shown in the view. Also removed some unused code in the controller. --- application/controllers/Contesting.php | 46 ++++++-------------------- application/views/contesting/index.php | 2 +- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index b9996ccb..6beb4edf 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -1,16 +1,13 @@ lang->load('contesting'); @@ -18,47 +15,28 @@ class Contesting extends CI_Controller { if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } - public function index() - { - + public function index() { $this->load->model('cat'); $this->load->model('stations'); - $this->load->model('logbook_model'); - $this->load->model('user_model'); $this->load->model('modes'); $this->load->model('contesting_model'); - $data['active_station_profile'] = $this->stations->find_active(); - $data['notice'] = false; - $data['stations'] = $this->stations->all(); + $data['my_gridsquare'] = $this->stations->find_gridsquare(); $data['radios'] = $this->cat->radios(); $data['modes'] = $this->modes->active(); $data['contestnames'] = $this->contesting_model->getActivecontests(); - - $this->load->library('form_validation'); + $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'); - $data['page_title'] = "Contest Logging"; - - $this->load->view('interface_assets/header', $data); - $this->load->view('contesting/index'); - $this->load->view('interface_assets/footer'); - - - //setcookie("radio", $qso_data['radio'], time()+3600*24*99); - //setcookie("station_profile_id", $qso_data['station_profile_id'], time()+3600*24*99); - - //$this->session->set_userdata($qso_data); - - // If SAT name is set make it session set to sat - if($this->input->post('sat_name')) { - $this->session->set_userdata('prop_mode', 'SAT'); - } + $data['page_title'] = "Contest Logging"; + $this->load->view('interface_assets/header', $data); + $this->load->view('contesting/index'); + $this->load->view('interface_assets/footer'); } public function getSessionQsos() { @@ -73,8 +51,7 @@ class Contesting extends CI_Controller { return json_encode($data); } - public function create() - { + public function create() { $this->load->model('Contesting_model'); $this->load->library('form_validation'); @@ -104,8 +81,7 @@ class Contesting extends CI_Controller { $this->load->view('interface_assets/footer'); } - public function edit($id) - { + public function edit($id) { $this->load->library('form_validation'); $this->load->model('Contesting_model'); diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index f9f76c66..2519e03a 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -132,7 +132,7 @@