From 1b3d496aaab7a47acefb284bc0c3aca1418bba95 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 17 Dec 2018 22:19:23 +0000 Subject: [PATCH] Removed cat_status from controller and model as I believe its not used anymore if it breaks just have to rollback --- application/controllers/Api.php | 40 +++++---------------------------- application/models/Cat.php | 32 -------------------------- 2 files changed, 6 insertions(+), 66 deletions(-) diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 6b85efca..14f3a7d5 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -2,6 +2,12 @@ class API extends CI_Controller { + // Do absolutely nothing + function index() + { + } + + /* TODOs - Search Callsign (Return Json) @@ -34,22 +40,6 @@ class API extends CI_Controller { } - // Do absolutely nothing - function index() - { - header("Location: ".$this->config->item('base_url')); - //load the model and get results - /* - $this->load->model('logbook_model'); - $data['data'] = array(); - - // load the view - //$this->load->view('layout/header'); - $this->load->view('api/index', $data); - //$this->load->view('layout/footer'); - */ - } - function help() { $this->load->model('user_model'); @@ -377,22 +367,4 @@ class API extends CI_Controller { echo json_encode($arr); } - - function cat_status () { - header('Content-type: application/json'); - - $this->load->model('cat'); - - // Decode JSON and store - $obj = json_decode(file_get_contents("php://input"), true); - - // Store Result to Database - $this->cat->cat_status($obj); - - // Return Message - - $arr = array('status' => 'success'); - - echo json_encode($arr); - } } diff --git a/application/models/Cat.php b/application/models/Cat.php index 1ec8f0c3..4536d4d7 100644 --- a/application/models/Cat.php +++ b/application/models/Cat.php @@ -74,38 +74,6 @@ } } - - function cat_status($result) { - - $this->db->where('profile_name', $result['profile_name']); - $query = $this->db->get('cat'); - - if ($query->num_rows() > 0) - { - // Update the record - foreach ($query->result() as $row) - { - $radio_id = $row->id; - - $data = array( - 'profile_name' => $result['profile_name'], - 'profile_url' => $result['profile_url'] - ); - - $this->db->where('id', $radio_id); - $this->db->update('cat', $data); - } - } else { - // Add a new record - $data = array( - 'profile_name' => $result['profile_name'], - 'profile_url' => $result['profile_url'] - ); - - $this->db->insert('cat', $data); - - } - } function status() { //$this->db->where('radio', $result['radio']);