40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
|
|
$(document).ready(function() {
|
|
|
|
$(".wid-delete").click(function(event){
|
|
event.preventDefault();
|
|
var uid = $(this).attr('data-uid');
|
|
var apiid = $(this).attr('data-apiid');
|
|
var trid = '#wid-tr-' + uid + '-' + apiid;
|
|
//console.log(uid);
|
|
//console.log(apiid);
|
|
var postdata = { uid:uid, api_id:apiid};
|
|
//console.log(postdata);
|
|
//var cost;
|
|
$.ajax({
|
|
method: "POST",
|
|
url: "/engine/classes/WebAppRaiser/ajax/wid-user-delete.php",
|
|
data: postdata,
|
|
success: function(data) {
|
|
const response = JSON.parse(data);
|
|
//console.log(response);
|
|
if(response.status == 'error'){
|
|
alert(response.msg);
|
|
}
|
|
else {
|
|
alert(response.msg);
|
|
$(trid).hide();
|
|
}
|
|
},
|
|
beforeSend: function() {
|
|
//$("#cost_analice_form_submit-edit").addClass('loading');
|
|
//$("#cost_analice_form_submit-edit").html('Загрузка...');
|
|
},
|
|
complete: function() {
|
|
//$("#cost_analice_form_submit-edit").removeClass('loading');
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
}); |