Refactor Adif controller for code style and readability
Improved code formatting and consistency in the Adif controller by updating brace placement, indentation, and spacing. Enhanced readability and maintainability without changing core logic or functionality.
这个提交包含在:
父节点
22b67fb925
当前提交
04ccd0809c
共有 1 个文件被更改,包括 71 次插入 和 67 次删除
|
|
@ -1,6 +1,7 @@
|
|||
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class adif extends CI_Controller {
|
||||
class adif extends CI_Controller
|
||||
{
|
||||
|
||||
/* Controls ADIF Import/Export Functions */
|
||||
|
||||
|
|
@ -10,11 +11,15 @@ class adif extends CI_Controller {
|
|||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$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'); }
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
/* Shows Export Views */
|
||||
public function export() {
|
||||
public function export()
|
||||
{
|
||||
|
||||
$data['page_title'] = "ADIF Export";
|
||||
|
||||
|
|
@ -65,7 +70,8 @@ class adif extends CI_Controller {
|
|||
$this->load->view('adif/data/exportsat', $data);
|
||||
}
|
||||
|
||||
public function export_custom() {
|
||||
public function export_custom()
|
||||
{
|
||||
// Set memory limit to unlimited to allow heavy usage
|
||||
ini_set('memory_limit', '-1');
|
||||
|
||||
|
|
@ -87,14 +93,14 @@ class adif extends CI_Controller {
|
|||
|
||||
|
||||
if ($this->input->post('markLotw') == 1) {
|
||||
foreach ($data['qsos']->result() as $qso)
|
||||
{
|
||||
foreach ($data['qsos']->result() as $qso) {
|
||||
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function mark_lotw() {
|
||||
public function mark_lotw()
|
||||
{
|
||||
// Set memory limit to unlimited to allow heavy usage
|
||||
ini_set('memory_limit', '-1');
|
||||
|
||||
|
|
@ -103,8 +109,7 @@ class adif extends CI_Controller {
|
|||
|
||||
$data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id);
|
||||
|
||||
foreach ($data['qsos']->result() as $qso)
|
||||
{
|
||||
foreach ($data['qsos']->result() as $qso) {
|
||||
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
|
||||
}
|
||||
|
||||
|
|
@ -122,13 +127,13 @@ class adif extends CI_Controller {
|
|||
|
||||
$this->load->view('adif/data/exportall', $data);
|
||||
|
||||
foreach ($data['qsos']->result() as $qso)
|
||||
{
|
||||
foreach ($data['qsos']->result() as $qso) {
|
||||
$this->adif_data->mark_lotw_sent($qso->COL_PRIMARY_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('stations');
|
||||
|
||||
$data['page_title'] = "ADIF Import / Export";
|
||||
|
|
@ -145,7 +150,8 @@ class adif extends CI_Controller {
|
|||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function import() {
|
||||
public function import()
|
||||
{
|
||||
$this->load->model('stations');
|
||||
$data['station_profile'] = $this->stations->all_of_user();
|
||||
log_message("debug", "Started ADIF Import");
|
||||
|
|
@ -188,8 +194,7 @@ class adif extends CI_Controller {
|
|||
$this->adif_parser->initialize();
|
||||
$custom_errors = "";
|
||||
$alladif = [];
|
||||
while($record = $this->adif_parser->get_record())
|
||||
{
|
||||
while ($record = $this->adif_parser->get_record()) {
|
||||
if (count($record) == 0) {
|
||||
break;
|
||||
};
|
||||
|
|
@ -209,11 +214,11 @@ class adif extends CI_Controller {
|
|||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('adif/import_success');
|
||||
$this->load->view('interface_assets/footer');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function dcl() {
|
||||
public function dcl()
|
||||
{
|
||||
$this->load->model('stations');
|
||||
$data['station_profile'] = $this->stations->all_of_user();
|
||||
|
||||
|
|
@ -248,8 +253,7 @@ class adif extends CI_Controller {
|
|||
$this->adif_parser->initialize();
|
||||
$error_count = array(0, 0, 0);
|
||||
$custom_errors = "";
|
||||
while($record = $this->adif_parser->get_record())
|
||||
{
|
||||
while ($record = $this->adif_parser->get_record()) {
|
||||
if (count($record) == 0) {
|
||||
break;
|
||||
};
|
||||
|
|
|
|||
正在加载…
在新工单中引用