core/api/modules/lk/p006_mod.js

74 lines
2.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$('.userOption').click(function(event) {
var tip = $(this).data('tip');
if($(this).is(":checked")) {
var a = 1;
$('.a-' + tip).removeClass('hidden');
$('.a-' + tip).addClass('d-flex');
}else{
var a = 0;
$('.a-' + tip).addClass('hidden');
$('.a-' + tip).removeClass('d-flex');
}
$.ajax({
type: 'POST',
url: '/act/lk',
data: 'act=userOption&tip=' + tip + '&a=' + a,
success: function(data) {/*p006ResultLD(data)*/}
});
})
function hideResult(id){
$(id).addClass("hidden");
return 1;
}
function p006ResultLD(txt){
txt='';
$("#p006-result").removeClass("hidden");
setTimeout("hideResult('#p006-result')", 10000);
}
/* ----------------------------------------------------------------------
10.10.2022
Сохранение личной информации (p006)
---------------------------------------------------------------------- */
$('#btnSave-p006').click(function(event) {
var familiya = $("#familiya").val();
var imya = $("#imya").val();
var otchestvo = $("#otchestvo").val();
var tel = $("#tel").val();
var email = $("#email").val();
$.ajax({
type: 'POST',
url: '/act/lk',
data: 'act=btnSave-p006&familiya=' + familiya + '&imya=' + imya + '&otchestvo=' + otchestvo + '&tel=' + tel + '&email=' + email,
success: function(data) {p006ResultLD(data)}
});
});
/* ----------------------------------------------------------------------
15.10.2022
Сохранение личной информации о городе (p006)
---------------------------------------------------------------------- */
$('#btnSave-p006-city').click(function(event) {
var city = $("#sel-children-city").val();
var region = $("#sel-parent-region").val();
$.ajax({
type: 'POST',
url: '/act/lk',
data: 'act=btnSave-p006-city&city=' + city + '&region=' + region,
success: function(data) {p006ResultLD(data)}
});
});
/* ----------------------------------------------------------------------
15.10.2022
Селект
---------------------------------------------------------------------- */
$("#sel-children-city").chained("#sel-parent-region");