From e83e7340f53e3f9955acce390910024e05a0afe7 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 8 Nov 2020 10:46:08 +0100 Subject: [PATCH] [Contest logging] Started work on the logging form. --- application/controllers/Contesting.php | 44 ++++- application/models/Contesting_model.php | 9 + application/views/contesting/index.php | 163 ++++++++++++++++++ application/views/interface_assets/header.php | 2 + 4 files changed, 215 insertions(+), 3 deletions(-) create mode 100644 application/models/Contesting_model.php create mode 100644 application/views/contesting/index.php diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index 622274067..f6dbeca13 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -9,8 +9,46 @@ if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Contesting extends CI_Controller { - public function index() + public function index() { - echo 'Functions to come'; - } + + $this->load->model('cat'); + $this->load->model('stations'); + $this->load->model('logbook_model'); + $this->load->model('user_model'); + $this->load->model('modes'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + + $data['active_station_profile'] = $this->stations->find_active(); + $data['notice'] = false; + $data['stations'] = $this->stations->all(); + $data['radios'] = $this->cat->radios(); + $data['dxcc'] = $this->logbook_model->fetchDxcc(); + $data['modes'] = $this->modes->active(); + + + $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'); + } + + } } \ No newline at end of file diff --git a/application/models/Contesting_model.php b/application/models/Contesting_model.php new file mode 100644 index 000000000..22ced12ad --- /dev/null +++ b/application/models/Contesting_model.php @@ -0,0 +1,9 @@ + +

+
+ +
+
+ +
+ + +
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + +
+ +
+ +
+
+

Callsign Suggestions

+ +
+
+ +
+

Logbook (for this session)

+ +
+ +
+ +
+ + + + + + + + + + + + +
Date/TimeCallModeRST sRST rExch SExch RBand
+
+
+
+ + + + + + diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index ec4156b1b..b09b7920e 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -68,6 +68,8 @@ Post QSO + Contest logging + View QSL