[Contesting] Fixed so that correct gridsquare was shown in the view. Also removed some unused code in the controller.

pull/1217/head
Andreas 2021-10-07 21:42:19 +02:00
rodzic cfecaa1ce3
commit e0e80fb680
2 zmienionych plików z 12 dodań i 36 usunięć

Wyświetl plik

@ -1,16 +1,13 @@
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
This controller will contain features for contesting
This controller contains features for contesting
*/
class Contesting extends CI_Controller {
function __construct()
{
function __construct() {
parent::__construct();
$this->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');

Wyświetl plik

@ -132,7 +132,7 @@
<div style="display:none" class="form-group col-md-2 gridsquares">
<label for="exch_gridsquare_s">Gridsquare (S)</label>
<input disabled type="text" class="form-control form-control-sm" name="exch_gridsquare_s" id="exch_gridsquare_s" value="<?php echo strtoupper($_SESSION['user_locator']) ?>">
<input disabled type="text" class="form-control form-control-sm" name="exch_gridsquare_s" id="exch_gridsquare_s" value="<?php echo $my_gridsquare;?>">
</div>
<div class="form-group col-md-1">