Removed cat_status from controller and model as I believe its not used anymore if it breaks just have to rollback

pull/240/head
Peter Goodhall 2018-12-17 22:19:23 +00:00
rodzic bdc9a86426
commit 1b3d496aaa
2 zmienionych plików z 6 dodań i 66 usunięć

Wyświetl plik

@ -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);
}
}

Wyświetl plik

@ -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']);