kopia lustrzana https://github.com/magicbug/Cloudlog
[Advanced search] When saving a query, we add this to the dropdown.
rodzic
d71ba5a0c6
commit
0717fa74ff
|
@ -54,8 +54,6 @@ class Search extends CI_Controller {
|
|||
if(isset($_POST['search'])) {
|
||||
$result = $this->fetchQueryResult($_POST['search'], false);
|
||||
echo json_encode($result->result_array());
|
||||
} else {
|
||||
echo "Noooooooob";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,18 +67,13 @@ class Search extends CI_Controller {
|
|||
if(isset($_POST['search'])) {
|
||||
$data['results'] = $this->fetchQueryResult($_POST['search'], false);
|
||||
$this->load->view('search/search_result_ajax', $data);
|
||||
} else {
|
||||
echo "Noooooooob";
|
||||
}
|
||||
}
|
||||
|
||||
function export_to_adif() {
|
||||
if(isset($_POST['search'])) {
|
||||
$data['qsos'] = $this->fetchQueryResult($_POST['search'], false);
|
||||
|
||||
$this->load->view('adif/data/exportall', $data);
|
||||
} else {
|
||||
echo "Noooooooob";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,9 +105,9 @@ class Search extends CI_Controller {
|
|||
);
|
||||
|
||||
$this->db->insert('queries', $data);
|
||||
|
||||
} else {
|
||||
echo "Noooooooob";
|
||||
$last_id = $this->db->insert_id();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('id' => $last_id, 'description' => xss_clean($_POST['description'])));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ $('#btn-save').on('click', function() {
|
|||
$.post( "<?php echo site_url('search/save_query');?>", { search: JSON.stringify(resultquery, null, 2), description: $(".getqueryname").val() })
|
||||
.done(function( data ) {
|
||||
alert('Query saved!');
|
||||
$('#querydropdown').append( new Option(data.description, data.id) ); // We add the saved query to the dropdown
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Ładowanie…
Reference in New Issue