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 $data['page_title'] = "Radio Status"; $this->load->view('layout/header', $data); $this->load->view('radio/index'); $this->load->view('layout/footer'); } 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'); $query = $this->cat->status(); if ($query->num_rows() > 0) { echo ""; echo "Radio"; echo "Frequency"; echo "Mode"; echo "Timestamp" ; echo "Options"; echo ""; foreach ($query->result() as $row) { echo ""; echo "".$row->radio.""; echo "".$row->frequency.""; echo "".$row->mode.""; echo "".$row->timestamp."" ; echo "id."\" >\"Delete\"" ; echo ""; } } else { echo ""; echo "No CAT Interfaced radios found."; echo ""; } } 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->select('frequency'); $this->db->where('id', $id); $query = $this->db->get('cat'); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { echo $row->frequency; } } } 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->select('mode'); $this->db->where('id', $id); $query = $this->db->get('cat'); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { echo strtoupper($row->mode); } } } 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'); } } ?>