mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
get state list in lookup
This commit is contained in:
@@ -129,4 +129,26 @@ class Lookup extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function get_state_list() {
|
||||
$this->load->library('subdivisions');
|
||||
|
||||
$dxcc = $this->input->post('dxcc');
|
||||
$states_result = $this->subdivisions->get_state_list($dxcc);
|
||||
$subdivision_name = $this->subdivisions->get_primary_subdivision_name($dxcc);
|
||||
|
||||
if ($states_result->num_rows() > 0) {
|
||||
$states_array = $states_result->result_array();
|
||||
$result = array(
|
||||
'status' => 'ok',
|
||||
'subdivision_name' => $subdivision_name,
|
||||
'data' => $states_array
|
||||
);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
} else {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('status' => 'No States for this DXCC in Database'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user