revert : ps
This commit is contained in:
parent
9386566bf4
commit
47d49099ab
@ -43,6 +43,7 @@ class Configurationctrl extends BaseController
|
|||||||
|
|
||||||
$data['userRecords'] = $this->configmodel->Configlisting();
|
$data['userRecords'] = $this->configmodel->Configlisting();
|
||||||
|
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Config Listing';
|
$this->global['pageTitle'] = 'Config Listing';
|
||||||
|
|
||||||
$this->loadViews("configlisting", $this->global, $data, NULL);
|
$this->loadViews("configlisting", $this->global, $data, NULL);
|
||||||
|
|||||||
@ -193,9 +193,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<a onclick="confirmDeleteConfig(event)"
|
<a onclick="confirmDeleteConfig(event)"
|
||||||
data-key="<?php echo $con->Key; ?>"
|
href="<?php echo base_url() . 'configurationctrl/deleteConfig?ConfigID=' . $record->Config_ID; ?>"
|
||||||
data-code="<?php echo $con->Config_ID; ?>"
|
|
||||||
href="<?php echo base_url() . 'activeInactiveConfigValue?key=' . $con->Key . '&value=0'; ?>"
|
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="<?php echo $record->Config_ID ?> - Click here to Delete Config Details">
|
title="<?php echo $record->Config_ID ?> - Click here to Delete Config Details">
|
||||||
<i class="fas fa-trash" data-toggle="tooltip" title="Click here to Delete the Config Value"></i>
|
<i class="fas fa-trash" data-toggle="tooltip" title="Click here to Delete the Config Value"></i>
|
||||||
@ -347,55 +345,10 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// function confirmDeleteConfig(event) {
|
|
||||||
// let result = confirm("Do You want to delete this configuration ?");
|
|
||||||
// if (result) { return; } else { event.preventDefault(); }
|
|
||||||
// }
|
|
||||||
|
|
||||||
function confirmDeleteConfig(event) {
|
function confirmDeleteConfig(event) {
|
||||||
event.preventDefault(); // Prevent default link action
|
let result = confirm("Do You want to delete this configuration ?");
|
||||||
|
if (result) { return; } else { event.preventDefault(); }
|
||||||
let key_id = $(event.currentTarget).data('key');
|
}
|
||||||
let code_value = $(event.currentTarget).data('code');
|
|
||||||
|
|
||||||
if (code_value == 'C023') {
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: "<?php echo base_url('getPONOcreatedBasedOnConfig'); ?>",
|
|
||||||
data: { key_id: key_id },
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(data) {
|
|
||||||
|
|
||||||
let content = "Do you want to delete this configuration?";
|
|
||||||
|
|
||||||
if (data.length > 0) {
|
|
||||||
content += "\n\nCreated PONO's are - ";
|
|
||||||
|
|
||||||
data.forEach(function(item) {
|
|
||||||
content += "\n- " + item.PONO;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
let result = confirm(content);
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
window.location.href = event.currentTarget.href; // Proceed with deletion
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
console.log("Error occurred: ", error);
|
|
||||||
},
|
|
||||||
complete: function() {
|
|
||||||
console.log('AJAX call completed.');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
let result = confirm("Do you want to delete this configuration?");
|
|
||||||
if (result) {
|
|
||||||
window.location.href = event.currentTarget.href; // Proceed with deletion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function confirmReActivateConfig(event) {
|
function confirmReActivateConfig(event) {
|
||||||
let result = confirm("Do You want to Re activate deleted configuration ?");
|
let result = confirm("Do You want to Re activate deleted configuration ?");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user