$(document).ready(function() { $('tr:even').css('background-color', '#FFE7AC'); $('.datepicker').datepicker({ dateFormat : 'yy-mm-dd', firstDay : 1 }); $('input[type=reset], input[type=submit]').click(function() { $(this).parents('form').find('.input_info').remove(); $(this).parents('form').find('.input_error').remove(); $(this).parents('form').find('input').removeClass('invalid'); $(this).parents('form').find('select').removeClass('invalid'); }); $('input[name="default"]').click(function() { if ($(this).attr('checked') == true) { $(this).parent().prevAll().children('input').attr('disabled', 'disabled'); } else { $(this).parent().prevAll().children('input').removeAttr('disabled'); } }); $.cookie('cookies', 'TRUE'); if (!$.cookie('cookies')) { $('#msg').addClass('alert').html('La página que estás viendo requiere para su funcionamiento el uso de cookies. Es necesario que las habilite.'); } else { $.cookie('cookies', null); } }); // Ventanas externas var ventanas = { ventana : null, abrir : function(url, titulo, opciones) { this.ventana = window.open(url, titulo, opciones); if (window.focus) { this.ventana.focus(); } } }; // Mensajes var mensaje = { info : function(div, msg) { this.mostrar(div, msg, 'info'); }, alert : function(div, msg) { this.mostrar(div, msg, 'alert'); }, error : function(div, msg) { this.mostrar(div, msg, 'error'); }, mostrar : function(div, msg, clase) { $(div).fadeTo(200, 0.1, function() { $(this).removeClass().addClass(clase).html(msg).fadeTo(900, 1); }); } }; // Acciones del usuario var usuario = { form : '
' + value + '
'; }); mensaje.error('#admin_msg', msg); } else { mensaje.info('#admin_msg', '' + data.stdout + '
'); setTimeout("window.location.reload()"); } }, 'json'); } } }); }, logout : function() { $.post('/admin/usuario.php', {act : 'logout'}, function() { document.location = ''; }); }, reservar : function(idturno, idred) { var msg = '¿Desea reservar este turno?
' + value + '
'; }); mensaje.error('#admin_msg', msg); } else { setTimeout("window.location.reload()"); } }, 'json'); } } } }); }, cancelres : function() { var msg = '¿Desea cancelar la reserva?
' + value + '
'; }); mensaje.error('#admin_msg', msg); } else { setTimeout("window.location.reload()"); } }, 'json'); } } }); } };