| Server IP : 162.214.74.102 / Your IP : 216.73.216.139 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/hering/ui/lib/jslib/ |
Upload File : |
$(document).ready(function () {
$(".progress").hide();
$("#emsg").hide();
var _url = $("#_url").val();
$("#submit").click(function (e) {
e.preventDefault();
$('#ibox_form').block({message: block_msg});
//carrega as duas urls possÃveis par ao formulario
var url_post='product_packing/add-post/msg';
if($("#id").val()!="" && $("#id").val()>0){
url_post='product_packing/edit-post/msg';
}
$.post(_url + url_post, $("#rform" ).serialize())
.done(function (data) {
setTimeout(function () {
if ($.isNumeric(data)) {
window.location = _url + 'product_packing/list/';
}
else {
$('#ibox_form').unblock();
$("#emsgbody").html(data);
$("#emsg").show("slow");
}
}, 2000);
});
});
//evento ao escolher o tipo de campo
$('#pack_type').on('change', function () {
montaForm($(this).val());
});
//aciona o montar form ao iniciar a tela
montaForm($('#pack_type').val());
function montaForm(val){
if(val=='package_box'){
$("#width").show();
$("#height").show();
$("#length").show();
$("#diameter").hide();
$("#img_pack").html("<img src='"+app_url+"/ui/theme/lrsys/img/package_box.png'/>");
}else if(val=='envelope'){
$("#width").show();
$("#height").hide();
$("#length").show();
$("#diameter").hide();
$("#img_pack").html("<img src='"+app_url+"/ui/theme/lrsys/img/envelope.png'/>");
}else if(val=='roller_cylinder'){
$("#width").hide();
$("#height").hide();
$("#length").show();
$("#diameter").show();
$("#img_pack").html("<img src='"+app_url+"/ui/theme/lrsys/img/roller_cylinder.png'/>");
}else{
$("#width").hide();
$("#height").hide();
$("#length").hide();
$("#diameter").hide();
$("#img_pack").html("");
}
}
});