Added the ability to delete radio profiles
这个提交包含在:
父节点
7c4db8ad66
当前提交
e04e324365
共有 3 个文件被更改,包括 53 次插入 和 2 次删除
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
// Check Auth
|
||||||
|
$this->load->model('user_model');
|
||||||
|
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||||
|
|
||||||
// load the view
|
// load the view
|
||||||
$data['page_title'] = "Radio Status";
|
$data['page_title'] = "Radio Status";
|
||||||
|
|
||||||
|
|
@ -13,15 +17,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function status() {
|
function status() {
|
||||||
|
|
||||||
|
// Check Auth
|
||||||
|
$this->load->model('user_model');
|
||||||
|
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||||
|
|
||||||
$this->load->model('cat');
|
$this->load->model('cat');
|
||||||
$query = $this->cat->status();
|
$query = $this->cat->status();
|
||||||
if ($query->num_rows() > 0)
|
if ($query->num_rows() > 0)
|
||||||
{
|
{
|
||||||
echo "<tr>";
|
echo "<tr class=\"titles\">";
|
||||||
echo "<td>Radio</td>";
|
echo "<td>Radio</td>";
|
||||||
echo "<td>Frequency</td>";
|
echo "<td>Frequency</td>";
|
||||||
echo "<td>Mode</td>";
|
echo "<td>Mode</td>";
|
||||||
echo "<td>Timestamp</td>" ;
|
echo "<td>Timestamp</td>" ;
|
||||||
|
echo "<td>Options</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
foreach ($query->result() as $row)
|
foreach ($query->result() as $row)
|
||||||
{
|
{
|
||||||
|
|
@ -30,6 +40,7 @@
|
||||||
echo "<td>".$row->frequency."</td>";
|
echo "<td>".$row->frequency."</td>";
|
||||||
echo "<td>".$row->mode."</td>";
|
echo "<td>".$row->mode."</td>";
|
||||||
echo "<td>".$row->timestamp."</td>" ;
|
echo "<td>".$row->timestamp."</td>" ;
|
||||||
|
echo "<td><a href=\"".site_url('radio/delete')."/".$row->id."\" ><img src=\"".base_url()."/images/delete.png\" width=\"16\" height=\"16\" alt=\"Delete\" /></a></td>" ;
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -41,6 +52,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function frequency($id) {
|
function frequency($id) {
|
||||||
|
|
||||||
|
// Check Auth
|
||||||
|
$this->load->model('user_model');
|
||||||
|
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||||
|
|
||||||
//$this->db->where('radio', $result['radio']);
|
//$this->db->where('radio', $result['radio']);
|
||||||
$this->db->select('frequency');
|
$this->db->select('frequency');
|
||||||
$this->db->where('id', $id);
|
$this->db->where('id', $id);
|
||||||
|
|
@ -56,6 +72,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function mode($id) {
|
function mode($id) {
|
||||||
|
|
||||||
|
// Check Auth
|
||||||
|
$this->load->model('user_model');
|
||||||
|
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||||
|
|
||||||
//$this->db->where('radio', $result['radio']);
|
//$this->db->where('radio', $result['radio']);
|
||||||
$this->db->select('mode');
|
$this->db->select('mode');
|
||||||
$this->db->where('id', $id);
|
$this->db->where('id', $id);
|
||||||
|
|
@ -69,6 +90,21 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete($id) {
|
||||||
|
// Check Auth
|
||||||
|
$this->load->model('user_model');
|
||||||
|
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||||
|
|
||||||
|
$this->load->model('cat');
|
||||||
|
|
||||||
|
$this->cat->delete($id);
|
||||||
|
|
||||||
|
$this->session->set_flashdata('message', 'Radio Profile Deleted');
|
||||||
|
|
||||||
|
redirect('radio');
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
@ -57,6 +57,13 @@
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function delete($id) {
|
||||||
|
$this->db->where('id', $id);
|
||||||
|
$this->db->delete('cat');
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,17 @@
|
||||||
|
|
||||||
<h2><?php echo $page_title; ?></h2>
|
<h2><?php echo $page_title; ?></h2>
|
||||||
|
|
||||||
|
<?php if($this->session->flashdata('message')) { ?>
|
||||||
|
<!-- Display Message -->
|
||||||
|
<div class="alert-message error">
|
||||||
|
<p><?php echo $this->session->flashdata('message'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div class="row show-grid">
|
<div class="row show-grid">
|
||||||
<div class="span15">
|
<div class="span15">
|
||||||
|
|
||||||
|
<!-- Display Radio Statuses -->
|
||||||
<table class="status">
|
<table class="status">
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用