mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
save the band unit and write it in session and user_options
This commit is contained in:
@@ -155,4 +155,15 @@ class Band extends CI_Controller {
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
return;
|
||||
}
|
||||
|
||||
public function saveBandUnit() {
|
||||
$unit = $this->security->xss_clean($this->input->post('unit'));
|
||||
$band_id = $this->security->xss_clean($this->input->post('band_id'));
|
||||
|
||||
$this->load->model('bands');
|
||||
$band = $this->bands->getband($band_id)->row()->band;
|
||||
|
||||
$this->user_options_model->set_option('frequency', 'unit', array($band => $unit));
|
||||
$this->session->set_userdata('qrgunit_'.$band, $unit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,12 @@ $('.bandtable tfoot').on('click', 'input[type="checkbox"]', function() {
|
||||
saveBandAward(clickedaward, status);
|
||||
});
|
||||
|
||||
$('.unitselect').change(function() {
|
||||
var selectedValue = $(this).val();
|
||||
var bandId = $(this).closest('td').attr('class').split('_')[1];
|
||||
saveBandUnit(selectedValue, bandId);
|
||||
});
|
||||
|
||||
function saveBandAward(award, status) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/band/saveBandAward',
|
||||
@@ -230,3 +236,16 @@ function saveBand(id) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveBandUnit(unit, band_id) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/band/saveBandUnit',
|
||||
type: 'post',
|
||||
data: {
|
||||
'band_id': band_id,
|
||||
'unit': unit
|
||||
},
|
||||
success: function(html) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user