//javascript $(function(){ $("#t_foto1").on("change", function(){ /* Limpiar vista previa */ $("#vista-previa").html(''); var archivos = document.getElementById('t_foto1').files;//alert(archivos); var navegador = window.URL || window.webkitURL; /* Recorrer los archivos */ for(x=0; x 6598034)//450*450 { $("#vista-previa").append("

El archivo "+name+" supera el máximo permitido 6.29Mb

"); } else if(type != 'image/jpeg' && type != 'image/jpg' && type != 'image/png' && type != 'image/gif') { $("#vista-previa").append("

El archivo "+name+" no es del tipo de imagen permitida.

"); } else { var objeto_url = navegador.createObjectURL(archivos[x]); $("#vista-previa").append(""); } } }); }); //////////////////////////// $(document).ready(function() { var base_url= variablejs; //alert(base_url); $('#t_fecha_nac').datepicker( { showOn: 'both', dateFormat: 'dd/mm/yy', numberOfMonths: 1, dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'], monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'], monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], showOtherMonths: true, showButtonPanel: true, changeMonth: true, changeYear: true, buttonImage:base_url+'assets/_obs/images/icons/calendar.png', buttonImageOnly: true, }); }); //////////////////////////////////////////////////////////////////////////////////////////////////////////// $(document).ready(function() { var base_url= variablejs; $("#t_departamento").change(function() { $("#t_departamento option:selected").each(function() { valordepartamento = $('#t_departamento').val(); $.post(base_url+"establecimientoscontr/llenar_provincias", { valordepartamento : valordepartamento }, function(data) { $("#t_provincia").html(data); //////////// $.post(base_url+"establecimientoscontr/llenar_municipios", { valorprovincia : 0 }, function(data) { $("#t_municipio").html(data); }); /////////////// }); }); }) }); $(document).ready(function() { var base_url= variablejs; $("#t_provincia").change(function() { $("#t_provincia option:selected").each(function() { provincia = $('#t_provincia').val(); $.post(base_url+"establecimientoscontr/llenar_municipios", { valorprovincia : provincia }, function(data) { $("#t_municipio").html(data); }); }); }) }); ///////////////////////////// ////////////////////////////////////////////////////////////aparezcan campos////// function especificar(sel) { if (sel.value=="PRIVADA" || sel.value=="MIXTA"){ $("#t_especificar").val("") divC = document.getElementById("especi"); divC.style.display = ""; }else{ $("#t_especificar").val("") divC = document.getElementById("especi"); divC.style.display="none"; } } function especificar_cargo(sel) { if (sel.value==53){ divC = document.getElementById("especif"); divC.style.display = ""; $("#t_cargo_new").attr('required','required'); $("#t_cargo_new").val(""); }else{ divC = document.getElementById("especif"); divC.style.display="none"; $("#t_cargo_new").removeAttr('required'); $("#t_cargo_new").val("") } } function mostrar_pobt(){ var cadena=""; var base_url= variablejs; var rows = document.getElementsByName('poblacion[]'); var selectedRows = []; for (var i = 0, l = rows.length; i < l; i++) { if (rows[i].checked) { cadena=cadena+','+rows[i].value; } } $.post(base_url+"establecimientoscontr/llenar_poblacion_tipo", { valor_pob_tipo : cadena }, function(data) { $("#l_PobTipo").html(data); }); $.post(base_url+"establecimientoscontr/limpiar_poblacion_tipo", { valor_pob_tipo : cadena }, function(data) { $("#l_PobTipoList").html(data); }); } function soloNumeros(e) { var key = window.Event ? e.which : e.keyCode return ((key >= 48 && key <= 57) || (key==8)) } function sololetras(e){ tecla = (document.all) ? e.keyCode : e.which; // 2 if (tecla==8) return true; // 3 patron =/^([a-z \xc0-\xff]+)$/i; // 4 te = String.fromCharCode(tecla); // 5 return patron.test(te); // 6 } function mostrar_h2() { var base_url= variablejs; $("#h1 option:selected").each(function() { hora = $('#h1').val(); $.post(base_url+"establecimientoscontr/llenar_horarios1", { valor_hora : hora }, function(data) { $("#h2").html(data); }); }); } function mostrar_h3() { var base_url= variablejs; $("#h2 option:selected").each(function() { hora = $('#h2').val(); $.post(base_url+"establecimientoscontr/llenar_horarios1", { valor_hora : hora }, function(data) { $("#h3").html(data); }); }); } function mostrar_h4() { /* if (sel.value=="") {$('.h4 option[value=""]').attr("selected", "selected"); $(".h4").attr('disabled','disabled'); } else $(".h4").removeAttr('disabled'); */ var base_url= variablejs; $("#h3 option:selected").each(function() { hora = $('#h3').val(); $.post(base_url+"establecimientoscontr/llenar_horarios1", { valor_hora : hora }, function(data) { $("#h4").html(data); }); }); if(hora=="") $("#h4").removeAttr('required'); else $("#h4").attr('required','required'); } //javascript function noretroceso(){ window.location.hash="no-back-button"; window.location.hash="Again-No-back-button" //chrome window.onhashchange=function(){window.location.hash="no-back-button";} } ////////////////////////////////////////////////////////////////////////////////////////////////////////////