Sunteți pe pagina 1din 4

<%@ page import ="myPackage.AdminU" %> <%@ page import ="myPackage.Usuario" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Agregando Registro Verificar Informacin</title> <link rel="stylesheet" href="estilo.css" type="text/css" /> <script type="text/javascript"> function valida_envia(){ //valido el tarjeta if (document.formAgregar.tarjeta.value.length==0){ alert("Falta el numero de la tarjeta") document.formAgregar.tarjeta.focus() return 0; } //valido el matricula if (document.formAgregar.matricula.value.length==0){ alert("Tiene que escribir la matricula") document.formAgregar.nombre.focus() return 0; } //valido el nombre if (document.formAgregar.nombre.value.length==0){ alert("Tiene que escribir un nombre") document.formAgregar.nombre.focus() return 0; } //valido el turno if (document.formAgregar.turno.value.length==0){ alert("Tiene que seleccionar un turno") document.formAgregar.turno.focus() return 0; } //valido el horario if (document.formAgregar.horario.value.length==0){ alert("Tiene que seleccionar el horario") document.formAgregar.horario.focus() return 0; } //valido el descanso if (document.formAgregar.descansos.value.length==0){ alert("Seleccione descansos") document.formAgregar.descansos.focus() return 0; } //valido el descanso if (document.formAgregar.telefono.value.length==0){ alert("Escriba numero de telefono") document.formAgregar.descansos.focus()

return 0; } //el formulario se envia alert("La informacin esta siendo procesada, presione Aceptar para continuar") ; document.formAgregar.submit(); } </script> <style type="text/css"> <!-ul { list-style-type: none;} .Estilo6 {color: #339933} .Estilo8 {font-size: 14px; font-weight: bold; color: #027528; } .Estilo9 {color: #027528} --> </style> </head> <body bgcolor="#CCCCCC"> <center> <center> <p> <% if (request.getParameter("nombre") != null) { String msg = "Fall la insercin"; Usuario a = new Usuario(); AdminU mc = new AdminU(); String tarjeta = request.getParameter("tarjeta"); String matricula = request.getParameter("matricula") ; String nombre = request.getParameter("nombre"); String turno = request.getParameter("turno"); String horario = request.getParameter("horario"); String descansos = request.getParameter("descansos") ; String telefono = request.getParameter("telefono"); a.setTarjeta(tarjeta); a.setMatricula(matricula); a.setNombre(nombre); a.setTurno(turno); a.setHorario(horario); a.setDescansos(descansos); a.setTelefono(telefono); msg = mc.insertar(a); %> </p> </center> <table><tr> <td colspan="2"> <% out.print(msg);%></td> </tr> <tr> <td>Tarjeta</td> <td><% out.print(tarjeta);%></td> </tr> <tr> <td>Matricula</td> <td><% out.print(matricula);%></td> </tr>

<tr> <td>Nombre</td> <td><% out.print(nombre);%></td> </tr> <tr> <td>Turno</td> <td><% out.print(turno);%></td> </tr> <tr> <td>Horario</td> <td><% out.print(horario);%></td> </tr> <tr> <td>Descansos</td> <td><% out.print(descansos);%></td> </tr> <tr> <td>Telefono</td> <td><% out.print(telefono);%></td> </tr> <tr> <td colspan="2"> <a href="registroenlinea.jsp">Agregar Nuevo Registro</a> </td> </tr> </table> <% } else { %> <div id="titleCab"> <center><p>Registro de Trabajadores</p> Atencin: Favor de llenar todos los campos requeridos.</center></div> <p>&nbsp;</p> <form action="registroenlinea.jsp" method="get" name="formAgregar"> <table align="center"> <tr> <td width="179"><span class="Estilo8">1. Datos</span></td> <td width="767">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td><span class="Estilo9">Numero de tarjeta </span></td> <td><span class="Estilo9"> <input type="text" maxlength="10" name="tarjeta" /> Ejemplo 55</span></td> </tr> <tr> <td><span class="Estilo9">Matricula</span></td> <td><input name="matricula" type="text" /></td> </tr> <tr>

<td><span class="Estilo9">Nombre completo</span></td> <td><input name="nombre" type="text" /></td> </tr> <tr> </tr> <tr> <td><span class="Estilo9">Turno</span></td> <td><input name="turno" type="text" /></td> </tr> <tr> <td><span class="Estilo9">Horario</span></td> <td><div class="Estilo9"><select name="horario" /> <option value="">Selecciona..</option> <option value="7:00 - 13:30">7:00 - 13:30</option> <option value="7:00 - 15:00">7:00 - 15:00</option> </div></td> </tr> <tr> <td><span class="Estilo9">Descansos</span></td> <td><span class="Estilo9"> <input type="text" name="descansos" /> Ejemplo D Y L, S Y D</span></td> </tr> <tr> <td><span class="Estilo9">telefono</span></td> <td><span class="Estilo9"> <input type="text" name="telefono" /> A razon de 10 Digitos</span></td> </tr> <tr> <td colspan="2"><center class="Estilo6"> <p class="Estilo9">Nota Importante: Antes de guardar la inform acin, revise que todos los campos hayan sido llenados correctamente.</p> </center></td> </tr> </table> <p> <input type="button" value="Enviar" onclick="valida_envia()"> <input type="reset" value="Limpiar" name="cLimpiar"> </p> </form> <% } %> </center> <center> <a href="success.jsp">Inicio</a> <a href="registrados.jsp">Buscar Registro (Reintentar)</a> <a href="cerrarsesion.jsp">Cerrar Sesion</a> <p>&nbsp;</p> </center> </body> </html>

S-ar putea să vă placă și