function saveaj (formass) {
$.ajax({
url: formass,
type: 'post',
data: jQuery('#ajax_form').serialize(),
success: function(data) {
const obj = jQuery.parseJSON(data);
if (obj.type == 'success') {
window.location.href = obj.location;
} else if (obj.type == 'zamena') {
$('#oshhb').empty();
$('#ajax_form').html(obj.zamena);
} else if (obj.type == 'error') {
$('#oshhb').empty();
$('#oshhb').css({display:'block'});
$('#oshhb').append('<div class="errore2">'+obj.message+'</div>');
const oss11 = document.getElementById('oshhb');
setTimeout(function() { $('#oshhb').css({display:'none'}); $('#oshhb').empty(); }, 4000);
}
}
});
}
function addkomm (formass,ids,url) {
$.ajax({
url: formass,
type: 'post',
data: jQuery('#formj_'+ids).serialize(),
success: function(data) {
const obj = jQuery.parseJSON(data);
if (obj.type == 'success') {
window.location.href = url;
} else if (obj.type == 'error') {
$('#oshhb').empty();
$('#oshhb').css({display:'block'});
$('#oshhb').append('<div class="errore2">'+obj.message+'</div>');
const oss11 = document.getElementById('oshhb');
setTimeout(function() { $('#oshhb').css({display:'none'}); $('#oshhb').empty(); }, 4000);
}
}
});
}
function zaiid (ids,razd,formass) {
$.ajax({
url: formass,
type: 'post',
data: {id: ids,razd: razd},
success: function(data) {
const obj = jQuery.parseJSON(data);
if (obj.type == 'success') {
$('._3r4gwedwf').hide();
$('._nozakr').hide();
$(obj.razd).html(obj.zamena);
} else if (obj.type == 'error') {
window.location.href = obj.location;
}
}
});
}
function saveform (formass,ids) {
$.ajax({
url: formass,
type: 'post',
data: jQuery('#formj_'+ids).serialize(),
success: function(data) {
const obj = jQuery.parseJSON(data);
if (obj.type == 'success') {
window.location.href = obj.location;
} else if (obj.type == 'zamena') {
$('#oshhb').empty();
$('#formj_'+ids).html(obj.zamena);
} else if (obj.type == 'error') {
$('#oshhb').empty();
$('#oshhb').css({display:'block'});
$('#oshhb').append('<div class="errore2">'+obj.message+'</div>');
const oss11 = document.getElementById('oshhb');
setTimeout(function() { $('#oshhb').css({display:'none'}); $('#oshhb').empty(); }, 4000);
}
}
});
}
function modalls (ids,formass,forme) {
$.ajax({
url: formass,
type: 'post',
data: {id: ids},
success: function(data) {
const obj = jQuery.parseJSON(data);
if ($(forme).css('display') == "none") {
if (obj.type == 'success') {
$('._4r55h54g5').html(' ');
$('._4r55h54g5').hide();
$(forme).html(obj.zamena);
$(forme).show();
$('._4t5grwdwqw').addClass('_dop3r4t5gerw');
} else if (obj.type == 'error') {
window.location.href = obj.location;
}
} else {
$('._4r55h54g5').hide();
$('._4r55h54g5').html(' ');
$('._4t5grwdwqw').removeClass('_dop3r4t5gerw');
}
}
});
}
function okeaw (ids) {
if ($('#menuss_'+ids).css('display') == "none") {
$('._3r4gwedwf').hide();
$('#menuss_'+ids).show();
} else {
$('._3r4gwedwf').hide();
}
}
function zaamee (ids,formass,forme) {
$.ajax({
url: formass,
type: 'post',
data: {id: ids},
success: function(data) {
const obj = jQuery.parseJSON(data);
if ($(forme).css('display') == "none") {
if (obj.type == 'success') {
$('.basdef').hide();
$('.basdef').html(' ');
$(forme).html(obj.zamena);
$(forme).show();
} else if (obj.type == 'error') {
window.location.href = obj.location;
}
} else {
$('.basdef').hide();
}
}
});
}
function isss (timer) {
document.addEventListener('DOMContentLoaded', function(){
const oss11 = document.getElementById('oshhb');
oss11.style.display = 'block';
setTimeout(() => oss11.style.display = 'none', timer);
});
}