[Bands] Added a controller and a view to display bands with options
这个提交包含在:
父节点
a651a36806
当前提交
c55ea49675
共有 3 个文件被更改,包括 132 次插入 和 0 次删除
30
application/controllers/Band.php
普通文件
30
application/controllers/Band.php
普通文件
|
|
@ -0,0 +1,30 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
Handles Displaying of band information
|
||||
*/
|
||||
|
||||
class Band extends CI_Controller {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$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'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['bands'] = $this->bands->all();
|
||||
|
||||
// Render Page
|
||||
$data['page_title'] = "Bands";
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('bands/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,15 @@ class Bands extends CI_Model {
|
|||
"SAT"=>0,
|
||||
);
|
||||
|
||||
function all2() {
|
||||
$this->db->order_by('band', 'ASC');
|
||||
return $this->db->get('bands');
|
||||
}
|
||||
|
||||
function all() {
|
||||
return $this->bandslots;
|
||||
}
|
||||
|
||||
function get_worked_bands() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
<div class="container">
|
||||
|
||||
<br>
|
||||
<?php if($this->session->flashdata('message')) { ?>
|
||||
<!-- Display Message -->
|
||||
<div class="alert-message error">
|
||||
<p><?php echo $this->session->flashdata('message'); ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Bands
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">
|
||||
Using the band list you can control which bands are shown when creating a new QSO.
|
||||
</p>
|
||||
<p class="card-text">
|
||||
Active bands will be shown in the QSO "Band" drop-down, while inactive bands will be hidden and cannot be selected.
|
||||
</p>
|
||||
<div class="table-responsive">
|
||||
|
||||
<table style="width:100%" class="modetable table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="select-filter" scope="col">Band</th>
|
||||
<th class="select-filter" scope="col">Status</th>
|
||||
<th scope="col">CQ</th>
|
||||
<th scope="col">DOK</th>
|
||||
<th scope="col">DXCC</th>
|
||||
<th scope="col">IOTA</th>
|
||||
<th scope="col">SIG</th>
|
||||
<th scope="col">SOTA</th>
|
||||
<th scope="col">US Counties</th>
|
||||
<th scope="col">WAS</th>
|
||||
<th scope="col">VUCC</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($bands as $key => $band) { ?>
|
||||
<tr>
|
||||
<td><?php echo $key?></td>
|
||||
<td>Active</td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td><div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" id="customCheck1" checked><label class="custom-control-label" for="customCheck1"></label></div></td>
|
||||
<td style="text-align: center">
|
||||
<button onclick='javascript:deactivateMode()' class=' btn btn-secondary btn-sm'>Deactivate</button>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo site_url('mode/edit')?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i> Edit</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:deleteMode('');" class="btn btn-danger btn-sm" ><i class="fas fa-trash-alt"></i> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<table>
|
||||
</div>
|
||||
<br/>
|
||||
<p>
|
||||
<button onclick="createBandDialog();" class="btn btn-primary btn-sm"><i class="fas fa-plus"></i> Create a Band</button>
|
||||
<button onclick="activateAllBands();" class="btn btn-primary btn-sm">Activate All</button>
|
||||
<button onclick="deactivateAllBands();" class="btn btn-primary btn-sm">Deactivate All </button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
正在加载…
在新工单中引用