Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- if ((session.getAttribute("user") == null) || (session.getAttribute("user") == "")) {
- response.sendRedirect("login.jsp");
- }
- %>
- <%@ include file="conexion.jsp" %>
- <%--
- Document : implstprov
- Created on : Jul 30, 2014, 2:45:04 AM
- Author : Luser
- --%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Impresion de Catalogo de Proveedores...</title>
- </head>
- <body>
- <%
- conexion con = new conexion();
- String qry = "select * from tcatprov order by ccatprovcodigo";
- // out.println(qry);
- ResultSet rs = con.consulta(qry);
- if (rs.next()) {
- out.println(" <form method=\"get\" action=\"catprov.jsp\">");
- out.println("<table border=1 cellpadding=5>");
- out.println("<tr>");
- out.println("<th>Codigo</th>");
- out.println("<th>Nombre Proveedor</th>");
- out.println("</tr>");
- while(rs.next()){
- out.println("<tr><td>" + rs.getString(1) + "</td><td>" + rs.getString(2) + "</td></tr>");
- }
- out.println("</table><br><br>");
- out.println("<input type=\"submit\" value=\"Grabar\" />");
- out.println("</form>");
- }
- else {
- String wmess = "No hay registros de Proveedores..." ;
- out.println("<script type=\"text/JavaScript\">");
- out.println("alert(\""+wmess+"\")");
- out.println("window.location = \"catprov.jsp\"");
- out.println("</script>");
- }
- %>
- </body>
- </html>
- mysql> select * from tcatprov order by ccatprovcodigo;
- +------------+----------------+-----------------+
- | icatprovid | ccatprovcodigo | ccatprovnombre |
- +------------+----------------+-----------------+
- | 2 | 111 | MANUEL LOPEZ |
- | 1 | 123 | MIGUEL ENRIQUEZ |
- +------------+----------------+-----------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement