update delete database option

This commit is contained in:
2020-12-22 16:41:58 +07:00
parent fc0f2ccc0f
commit d0f17afc39
4 changed files with 42 additions and 4 deletions

View File

@@ -287,12 +287,30 @@ common.success = function (id) {
$("#" + id).addClass("has-success").removeClass("has-error");
$("#" + id).find(".help-block").addClass("hidden");
};
common.reset = function (e) {
common.resetForm = function (e) {
common.modalBlock(true);
$.ajax({
url: $(e).attr("href"),
type: 'POST',
success: function (data) {
common.modalBlock(false);
common.modalOpen(data.form, false, data.title);
},
error: function (jqXHR, textStatus, errorThrown) {
common.modalBlock(false);
common.ajaxError();
}
});
};
common.reset = function (e, deleteDB) {
if (confirm("Bạn có chắc chắn muốn reset thiết bị về cấu hình mặc định không?")) {
common.modalBlock(true);
$.ajax({
url: $(e).attr("href"),
url: $(e).attr("data-href"),
type: 'POST',
data: {
deleteDB: deleteDB
},
success: function (data) {
window.location = data;
},