Added function and button for new edge

This commit is contained in:
Andreas Kristiansen
2025-07-07 08:16:56 +02:00
parent b5be51d3b0
commit ba3aebbd28
2 changed files with 45 additions and 0 deletions

View File

@@ -40,6 +40,9 @@
<?php } ?>
</tbody>
<table>
<br />
<button onclick="createBandEdge();" class="btn btn-primary btn-sm"><i class="fas fa-plus"></i> <?= __("Add a bandedge"); ?></button>
</div>
<br/>
<p>

View File

@@ -35,6 +35,48 @@ function editBandEdge(id) {
$('#frequencyfrom_' + id).focus();
}
function createBandEdge() {
$('.addsatmode').prop("disabled", true);
BootstrapDialog.show({
title: 'Add Band Edge',
message: '',
buttons: [{
label: 'Save',
cssClass: 'btn-success',
action: function (dialogItself) {
var form = dialogItself.getModalBody().find('form')[0];
if (form.band.value == "") {
dialogItself.getModalBody().prepend('<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>Please enter a band!</div>');
}
else {
$.ajax({
url: base_url + 'index.php/band/savebandedge',
type: 'post',
data: {
'band': form.band.value,
'bandgroup': form.bandgroup.value,
'ssbqrg': form.ssbqrg.value,
'dataqrg': form.dataqrg.value,
'cwqrg': form.cwqrg.value
},
success: function (html) {
location.reload();
}
});
dialogItself.close();
}
}
}, {
label: 'Cancel',
cssClass: 'btn-danger',
action: function (dialogItself) {
dialogItself.close();
$('.addsatmode').prop("disabled", false);
}
}]
});
}
function saveChanges(id) {
$('.addsatmode').prop("disabled", false);
var frequencyfrom = $('#frequencyfrom_'+id).first().closest('td').html();