| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/imobles/application/plugins/module_imobles/assets/js/ |
Upload File : |
var _url = $("#_url").val();
function filter() {
findDataSelect("#module_imobles_enterprise_id", 'module_imobles/ajax/enterprises', '');
// Advanced
$('#items_per_page').on('change', function (event) {
event.preventDefault();
var items = $(this).find('option:selected').val();
$("input[name=items_per_page]").val(items);
$('#form-filter').submit();
});
// Clear
$('#filter-clear').on('click', function (event) {
event.preventDefault();
$("#clear_filter").val(1);
$('#form-filter').submit();
});
$('body').on('click', '#filter-post', function (event) {
event.preventDefault();
$('#form-filter').submit();
});
$('body').on('click', '.dropdown-toggle', function (event) {
event.preventDefault();
$(".group-data").toggleClass("open");
});
$('body').on('click', '.dropdown-toggle', "keydown", function (e) {
if (e.which == 13 || e.which == 32) {
e.preventDefault();
$(".group-data").toggleClass("open");
}
});
}
$(function () {
filter();
$('body').find('.select_cache').on("click", function (event) {
if ($("#cache_" + $(this).data('id')).prop("checked") == true) {
$("#cache_" + $(this).data('id')).prop("checked", false);
} else {
$("#cache_" + $(this).data('id')).prop("checked", true);
}
});
$('body').find('.check_all_cache').on("click", function (event) {
if ($("#check_all_cache").prop("checked") == true) {
$("#check_all_cache").prop("checked", false);
$('body').find(".all_check_cache").prop("checked", false);
} else {
$("#check_all_cache").prop("checked", true);
$('body').find(".all_check_cache").prop("checked", true);
}
});
$('body').find('#delete_cache').on("click", function (event) {
event.preventDefault();
var selecionados = false;
$("#form_send_data").html("");
$("#form_send_data").append(
'<input type="hidden" name="type" value="cache">');
$('body').find(".all_check_cache:checked").each(function (event) {
selecionados = true;
$("#form_send_data").append(
'<input type="hidden" name="id[]" value="' + $(this).data('id') + '">'
);
});
if (selecionados) {
bootbox.dialog({
message: _L['module imobles delete caches'],
buttons: {
'cancel': {
label: "Cancelar"
},
'confirm': {
label: "Enviar",
callback: function () {
$('#view_processing').show();
$('.table-bordered').hide();
$.post(_url + "module_imobles/cache/deleteCacheBatch", $("#form_send_data").serialize())
.done(function (data) {
$('#view_processing').hide();
$('.table-bordered').show();
toastr.success(_L['module imobles delete successfull']);
// Oculto os empreendimentos na tabela
$('body').find(".all_check_cache:checked").each(function (event) {
$(this).parent().parent().hide();
});
// window.location.replace(_url + "module_imobles/caches/listAll/");
$("#check_all_cache").prop("checked", false);
});
}
}
}
});
} else {
toastr.error(_L['module imobles select one cache']);
}
});
});
$(document).ready(function ()
{
$("#state_id").on('change', function () {
buscaCity($(this).val(), "0");
});
$('#state_id').select2({theme: "bootstrap",
width: '100%'});
buscaCity($("#state_id").val(), $("#city").data("value"));
});
function buscaCity(state, valor) {
if (state) {
$.getJSON($("#_url").val() + 'ajax/city', {state_id: state}, function (j) {
var options = '<option value="0">' + $("#_msg_select_city").val() + '</option>';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].city_name + '">' + j[i].city_name + '</option>';
}
$('#city').html(options);
$('#city').select2({theme: "bootstrap",
width: '100%'});
$('#city').select2("val", valor);
});
} else {
var options = '<option value="0">' + $("#_msg_select_city").val() + '</option>';
$('#city').html(options);
$('#city').select2({theme: "bootstrap",
width: '100%'});
$('#city').select2("val", "0");
}
}