mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
format code
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
Handles Displaying of band information
|
||||
@@ -6,17 +6,18 @@
|
||||
|
||||
class Band extends CI_Controller {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2) || !clubaccess_check(9)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
if (!$this->user_model->authorize(2) || !clubaccess_check(9)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['bands'] = $this->bands->get_all_bands_for_user();
|
||||
@@ -28,8 +29,7 @@ class Band extends CI_Controller {
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function edges()
|
||||
{
|
||||
public function edges() {
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['bands'] = $this->bands->get_all_bandedges_for_user();
|
||||
@@ -47,8 +47,7 @@ class Band extends CI_Controller {
|
||||
}
|
||||
|
||||
// API endpoint to get band edges for the logged-in user
|
||||
public function get_user_bandedges()
|
||||
{
|
||||
public function get_user_bandedges() {
|
||||
$this->load->model('bands');
|
||||
|
||||
// Get region parameter from query string, default to 1 (IARU Region 1)
|
||||
@@ -63,8 +62,7 @@ class Band extends CI_Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
public function create() {
|
||||
$this->load->model('bands');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -86,8 +84,7 @@ class Band extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
public function edit() {
|
||||
$this->load->model('bands');
|
||||
|
||||
$item_id_clean = $this->input->post('id');
|
||||
@@ -98,7 +95,7 @@ class Band extends CI_Controller {
|
||||
|
||||
$data['page_title'] = __("Edit Band");
|
||||
|
||||
$this->load->view('bands/edit', $data);
|
||||
$this->load->view('bands/edit', $data);
|
||||
}
|
||||
|
||||
public function saveupdatedband() {
|
||||
@@ -111,92 +108,92 @@ class Band extends CI_Controller {
|
||||
$band['dataqrg'] = $this->input->post('dataqrg', true);
|
||||
$band['cwqrg'] = $this->input->post('cwqrg', true);
|
||||
|
||||
$this->bands->saveupdatedband($id, $band);
|
||||
$this->bands->saveupdatedband($id, $band);
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
public function delete() {
|
||||
$id = $this->input->post('id', true);
|
||||
$id = $this->input->post('id', true);
|
||||
$userid = $this->session->userdata('user_id');
|
||||
$this->load->model('bands');
|
||||
$this->bands->delete($id, $userid);
|
||||
}
|
||||
|
||||
public function activate() {
|
||||
$id = $this->input->post('id', true);
|
||||
$this->load->model('bands');
|
||||
$this->bands->activate($id);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
$id = $this->input->post('id', true);
|
||||
$this->load->model('bands');
|
||||
$this->bands->activate($id);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
|
||||
public function deactivate() {
|
||||
$id = $this->input->post('id', true);
|
||||
$this->load->model('bands');
|
||||
$this->bands->deactivate($id);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
public function deactivate() {
|
||||
$id = $this->input->post('id', true);
|
||||
$this->load->model('bands');
|
||||
$this->bands->deactivate($id);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
|
||||
public function activateall() {
|
||||
$this->load->model('bands');
|
||||
$this->bands->activateall();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
|
||||
public function deactivateall() {
|
||||
$this->load->model('bands');
|
||||
$this->bands->deactivateall();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
$this->load->model('bands');
|
||||
$this->bands->activateall();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function saveBand() {
|
||||
$id = $this->input->post('id', true);
|
||||
$band['status'] = $this->input->post('status', true);
|
||||
$band['cq'] = $this->input->post('cq', true);
|
||||
$band['dok'] = $this->input->post('dok', true);
|
||||
$band['dxcc'] = $this->input->post('dxcc', true);
|
||||
$band['helvetia'] = $this->input->post('helvetia', true);
|
||||
$band['iota'] = $this->input->post('iota', true);
|
||||
$band['jcc'] = $this->input->post('jcc', true);
|
||||
$band['pota'] = $this->input->post('pota', true);
|
||||
$band['rac'] = $this->input->post('rac', true);
|
||||
$band['sig'] = $this->input->post('sig', true);
|
||||
$band['sota'] = $this->input->post('sota', true);
|
||||
$band['uscounties'] = $this->input->post('uscounties', true);
|
||||
$band['wap'] = $this->input->post('wap', true);
|
||||
$band['wapc'] = $this->input->post('wapc', true);
|
||||
$band['was'] = $this->input->post('was', true);
|
||||
$band['wwff'] = $this->input->post('wwff', true);
|
||||
$band['vucc'] = $this->input->post('vucc', true);
|
||||
$band['waja'] = $this->input->post('waja', true);
|
||||
public function deactivateall() {
|
||||
$this->load->model('bands');
|
||||
$this->bands->deactivateall();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->load->model('bands');
|
||||
$this->bands->saveBand($id, $band);
|
||||
public function saveBand() {
|
||||
$id = $this->input->post('id', true);
|
||||
$band['status'] = $this->input->post('status', true);
|
||||
$band['cq'] = $this->input->post('cq', true);
|
||||
$band['dok'] = $this->input->post('dok', true);
|
||||
$band['dxcc'] = $this->input->post('dxcc', true);
|
||||
$band['helvetia'] = $this->input->post('helvetia', true);
|
||||
$band['iota'] = $this->input->post('iota', true);
|
||||
$band['jcc'] = $this->input->post('jcc', true);
|
||||
$band['pota'] = $this->input->post('pota', true);
|
||||
$band['rac'] = $this->input->post('rac', true);
|
||||
$band['sig'] = $this->input->post('sig', true);
|
||||
$band['sota'] = $this->input->post('sota', true);
|
||||
$band['uscounties'] = $this->input->post('uscounties', true);
|
||||
$band['wap'] = $this->input->post('wap', true);
|
||||
$band['wapc'] = $this->input->post('wapc', true);
|
||||
$band['was'] = $this->input->post('was', true);
|
||||
$band['wwff'] = $this->input->post('wwff', true);
|
||||
$band['vucc'] = $this->input->post('vucc', true);
|
||||
$band['waja'] = $this->input->post('waja', true);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
$this->load->model('bands');
|
||||
$this->bands->saveBand($id, $band);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
|
||||
public function saveBandAward() {
|
||||
$award = $this->input->post('award', true);
|
||||
$status = $this->input->post('status', true);
|
||||
|
||||
$this->load->model('bands');
|
||||
$this->bands->saveBandAward($award, $status);
|
||||
$this->bands->saveBandAward($award, $status);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function saveBandUnit() {
|
||||
$unit = $this->input->post('unit', true);
|
||||
@@ -206,7 +203,7 @@ class Band extends CI_Controller {
|
||||
$band = $this->bands->getband($band_id)->row()->band;
|
||||
|
||||
$this->user_options_model->set_option('frequency', 'unit', array($band => $unit));
|
||||
$this->session->set_userdata('qrgunit_'.$band, $unit);
|
||||
$this->session->set_userdata('qrgunit_' . $band, $unit);
|
||||
}
|
||||
|
||||
public function deletebandedge() {
|
||||
@@ -226,7 +223,7 @@ class Band extends CI_Controller {
|
||||
$frequencyto = $this->input->post('frequencyto', true);
|
||||
$mode = $this->input->post('mode', true);
|
||||
if ((is_numeric($frequencyfrom)) && (is_numeric($frequencyfrom))) {
|
||||
$overlap=$this->bands->check4overlapEdges($id, $frequencyfrom, $frequencyto, $mode);
|
||||
$overlap = $this->bands->check4overlapEdges($id, $frequencyfrom, $frequencyto, $mode);
|
||||
if (!($overlap)) {
|
||||
$this->bands->saveBandEdge($id, $frequencyfrom, $frequencyto, $mode);
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
|
||||
Reference in New Issue
Block a user