kopia lustrzana https://github.com/magicbug/Cloudlog
Return macros as json
rodzic
43bacdc62a
commit
9ddcb70588
|
@ -207,6 +207,16 @@ class QSO extends CI_Controller {
|
|||
echo "Macros Saved, Press Close and lets get sending!";
|
||||
}
|
||||
|
||||
function cwmacros_json() {
|
||||
// Load model Winkey
|
||||
$this->load->model('winkey');
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
// Call settings_json from model winkey
|
||||
echo $this->winkey->settings_json($this->session->userdata('user_id'), $this->session->userdata('station_profile_id'));
|
||||
}
|
||||
|
||||
function edit_ajax() {
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
|
|
|
@ -15,6 +15,21 @@ class Winkey extends CI_Model
|
|||
}
|
||||
}
|
||||
|
||||
public function settings_json($user_id, $station_location_id)
|
||||
{
|
||||
$this->db->where('user_id', $user_id);
|
||||
$this->db->where('station_location_id', $station_location_id);
|
||||
$query = $this->db->get('cwmacros');
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
// return $query->row() as json
|
||||
return json_encode($query->row());
|
||||
} else {
|
||||
// return json with status not found
|
||||
return json_encode(array('status' => 'not found'));
|
||||
}
|
||||
}
|
||||
|
||||
public function save($data)
|
||||
{
|
||||
$this->db->where('user_id', $data['user_id']);
|
||||
|
|
Ładowanie…
Reference in New Issue