$(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 : '
' + '
' + '
' + '
' + '
', login : function() { $(this.form).dialog({ bgiframe : true, minHeight : 200, width : 340, resizable : false, modal : true, title : 'Login', buttons : { 'Enviar' : function() { $.post('/admin/usuario.php', {act : 'login', usuario : $('#usuario').val(), contrasena : $('#contrasena').val()}, function(data) { if (data.stderr.error) { var msg = ''; $.each(data.stderr.info, function(i, value) { msg = msg + '

' + 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?

'; $(msg).dialog( { bgiframe : true, minHeight : 120, width : 340, resizable : false, modal : true, title : 'Reservar', buttons : { 'Ok' : function() { if ($('#admin_msg').hasClass('error')) { setTimeout("window.location.reload()"); } else { $.post('/admin/usuario.php', {act : 'reservar', idturno : idturno, idred : idred}, function(data) { if (data.stderr.error) { var msg = ''; $.each(data.stderr.info, function(i, value) { msg = msg + '

' + value + '

'; }); mensaje.error('#admin_msg', msg); } else { setTimeout("window.location.reload()"); } }, 'json'); } } } }); }, cancelres : function() { var msg = '

¿Desea cancelar la reserva?

'; $(msg).dialog( { bgiframe : true, minHeight : 120, width : 340, resizable : false, modal : true, title : 'Cancelar la reserva', buttons : { 'Ok' : function() { $.post('/admin/usuario.php', {act : 'cancelres'}, function(data) { if (data.stderr.error) { var msg = ''; $.each(data.stderr.info, function(i, value) { msg = msg + '

' + value + '

'; }); mensaje.error('#admin_msg', msg); } else { setTimeout("window.location.reload()"); } }, 'json'); } } }); } }; e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


DESARROLLO DE UN ENTORNO DE PRÁCTICAS PARA REDES MULTISERVICIO

: Martín Redondo, Alberto Jesús
: Ingeniería Telecomunicación
Contenido del proyecto:
Directorio raíz  >  ARCHIVOS  >  redes  >  js  >  func_varias.js