| 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/leo/application/plugins/module_imobles/assets/js/ |
Upload File : |
var _url = $("#_url").val();
function filter() {
// Situation
$('#filter-status a').on('click', function (event) {
event.preventDefault();
var situation = $(this).data('val');
$("input[name=status]").val(situation);
$('#form-filter').submit();
});
// 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();
$("input[name=search]").val('');
$("input[name=status]").val('');
$("#neighborhoods").val('');
$("#city_id").val('');
$("#source").val('');
$("#enterprise_type").val('');
$("#module_imobles_enterprise_id").val('');
$("#crawler_type_id").val('');
$('#form-filter').submit();
});
$('#module_imobles_enterprise_id').on('change', function (event) {
event.preventDefault();
$('#form-filter').submit();
});
findDataSelect("#module_imobles_enterprise_id", 'module_imobles/ajax/enterprises', '');
$('#crawler_type_id').on('change', function (event) {
event.preventDefault();
$('#form-filter').submit();
});
findDataSelect("#crawler_type_id", 'module_imobles/ajax/crawler', '');
}
$(function () {
filter();
$('body').find('.select_listing').on("click", function (event) {
if ($("#listing_" + $(this).data('id')).prop("checked") == true) {
$("#listing_" + $(this).data('id')).prop("checked", false);
} else {
$("#listing_" + $(this).data('id')).prop("checked", true);
}
});
$('body').find('.check_all').on("click", function (event) {
if ($("#check_all").prop("checked") == true) {
$("#check_all").prop("checked", false);
$('body').find(".all_check_listing").prop("checked", false);
} else {
$("#check_all").prop("checked", true);
$('body').find(".all_check_listing").prop("checked", true);
}
});
$('body').find('#review_listings').on("click", function (event) {
event.preventDefault();
var selecionados = false;
$("#form_send_data").html("");
$("#form_send_data").append(
'<input type="hidden" name="type" value="listing">');
$('body').find(".all_check_listing:checked").each(function (event) {
selecionados = true;
$("#form_send_data").append(
'<input type="hidden" name="id[]" value="' + $(this).data('enterprise-id') + '">'
);
});
if (selecionados) {
// bootbox.dialog({
// message: _L['module imobles review listings'],
// buttons: {
// 'cancel': {
// label: "Cancelar"
// },
// 'confirm': {
// label: "Enviar",
// callback: function () {
// $('#listing_view_processing').show();
// $('.table-bordered').hide();
// $.post(_url + "module_imobles/crawler/CheckListings", $("#form_send_data").serialize())
// .done(function (data) {
// var data = JSON.parse(data);
// console.log(data);
// });
// }
// }
// }
// });
$.post(_url + "module_imobles/typeunity/viewReviewListing", $("#form_send_data").serialize())
.done(function (data) {
$("body").unblock();
$("#form_send_data").html("");
$("#form_send_data").append(
'<input type="hidden" name="type" value="listing">');
$('body').find(".all_check_listing:checked").each(function (event) {
selecionados = true;
$("#form_send_data").append(
'<input type="hidden" name="id[]" value="' + $(this).data('id') + '">'
);
});
var $modal2 = $('#ajax-modal');
$modal2.html(data);
$modal2.modal();
$modal2.find("#other_id").select2({
theme: "bootstrap",
placeholder: '',
});
$modal2.find('#submit-review-enteprise').on("click", function (event) {
$("body").block({message: block_msg});
//VERIFICA PARA ADICIONAR O ID DO SELECIONADO AQUI
val = "";
if ($modal2.find('.entreprise_radio_selected:checked').val() >= 1) {
val = $modal2.find('.entreprise_radio_selected:checked').val();
}
if ($modal2.find('.entreprise_radio_selected:checked').val() == -1) {
if ($modal2.find('#other_id').val() > 0) {
val = $modal2.find('#other_id').val();
}
}
if (val != "") {
$("#form_send_data").append(
'<input type="hidden" name="enterprise_id" value="' + val + '">'
);
}
$.post(_url + "module_imobles/crawler/CheckListings", $("#form_send_data").serialize())
.done(function (data) {
$("body").unblock();
var data = JSON.parse(data);
$modal2.modal("hide");
window.location.replace(_url + "module_imobles/listings/listAll/");
});
});
$modal2.find('.table').on("click", 'td', function (event) {
if (event.target.tagName != 'INPUT' && $(this).find(".entreprise_radio_selected")) {
if ($(this).find(".entreprise_radio_selected").prop("checked") == false) {
$(this).find(".entreprise_radio_selected").prop("checked", true).trigger("change");
}
}
});
});
} else {
toastr.error(_L['select one listing']);
}
});
$('body').find(".popoverDetailListing").popover({
trigger: 'manual',
placement: 'top',
container: 'body',
html: true
});
$('body').find(".popoverDetailListing").on('show.bs.popover', function (event) {
// do something…
$('body').find(".popover").remove();
});
$(document).on('click', function (event) {
$('body').find(".popover").remove();
});
$(document).on('mouseover', '.popoverDetailListing', function () {
$('body').find(".popover").remove();
$('.popoverDetailListing_' + $(this).data("id")).popover('show');
});
$(document).on('mouseleave', '.popover', function () {
$('body').find(".popover").remove();
});
$('body').find('.bxslider').bxSlider({
mode: 'horizontal',
moveSlides: 1,
slideMargin: 10,
infiniteLoop: true,
slideWidth: 215,
minSlides: 1,
maxSlides: 1,
speed: 800,
});
$('body').find('.desactive_listing').on("click", function (event) {
event.preventDefault();
var id = $(this).data('id');
var tr = $(this).closest('tr');
var dialog = bootbox.confirm({
message: _L['module_imobles desactive listing?'] + "<br/>" + $(this).data("text"),
buttons: {
confirm: {
label: _L['Yes'],
className: "btn-primary"
},
cancel: {
label: _L['No'],
className: "btn-danger"
}
},
callback: function (result) {
if (result == true) {
$("body").block({message: block_msg});
$.post(_url + "module_imobles/typeunity/desactive_listing", {id: id})
.done(function (retorno) {
var data = JSON.parse(retorno);
$("body").unblock();
if (data.status == "OK") {
tr.remove();
datatableSearch.ajax.reload(null, false);
toastr.success(data.msg);
} else {
toastr.error(data.msg);
}
});
} else {
dialog.modal('hide');
return false;
}
}
});
});
});