kopia lustrzana https://github.com/magicbug/Cloudlog
Added Radio Status at /radio/;
rodzic
3488a57513
commit
8fba801c40
|
@ -4,12 +4,40 @@
|
|||
|
||||
public function index()
|
||||
{
|
||||
|
||||
// load the view
|
||||
$data['page_title'] = "Radio Status";
|
||||
|
||||
$this->load->view('layout/header', $data);
|
||||
$this->load->view('radio/index');
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
||||
function status() {
|
||||
$this->load->model('cat');
|
||||
print_r($this->cat->status());
|
||||
$query = $this->cat->status();
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>Radio</td>";
|
||||
echo "<td>Frequency</td>";
|
||||
echo "<td>Mode</td>";
|
||||
echo "<td>Timestamp</td>" ;
|
||||
echo "</tr>";
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>".$row->radio."</td>";
|
||||
echo "<td>".$row->frequency."</td>";
|
||||
echo "<td>".$row->mode."</td>";
|
||||
echo "<td>".$row->timestamp."</td>" ;
|
||||
echo "</tr>";
|
||||
}
|
||||
} else {
|
||||
echo "<tr>";
|
||||
echo "<td colspan=\"4\">No CAT Interfaced radios found.</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function frequency($id) {
|
||||
|
|
|
@ -44,22 +44,9 @@
|
|||
|
||||
function status() {
|
||||
//$this->db->where('radio', $result['radio']);
|
||||
$this->db->limit(1);
|
||||
$query = $this->db->get('cat');
|
||||
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
$data = array(
|
||||
'radio' => $row->radio,
|
||||
'frequency' => $row->frequency,
|
||||
'mode' => $row->mode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
return $query;
|
||||
}
|
||||
|
||||
/* Return list of radios */
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui-1.8.12.custom.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.shortkeys.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/bootstrap-dropdown.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>js/bootstrap-tabs.js"></script>
|
||||
|
@ -54,6 +52,7 @@
|
|||
<a href="#" class="dropdown-toggle">Admin</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?php echo site_url('user');?>" title="Users">Users</a></li>
|
||||
<li><a href="<?php echo site_url('radio');?>" title="Backup">Radios</a></li>
|
||||
<li><a href="<?php echo site_url('backup');?>" title="Backup">Backup</a></li>
|
||||
<li><a href="<?php echo site_url('adif/import');?>" title="ADIF Import">ADIF Import</a></li>
|
||||
<li><a href="<?php echo site_url('adif/export');?>" title="ADIF Export">ADIF Export</a></li>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
setInterval(function() {
|
||||
// Get Mode
|
||||
$.get('radio/status/', function(result) {
|
||||
//$('.status').append(result);
|
||||
$('.status').html(result);
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<div class="row show-grid">
|
||||
<div class="span15">
|
||||
|
||||
<table class="status">
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
Ładowanie…
Reference in New Issue