Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=windows-1255"
- pageEncoding="windows-1255"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html dir="rtl">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>טבלת לקוחות</title>
- <%
- JDBC.ForDataBase db = new JDBC.ForDataBase();
- %>
- </head>
- <body>
- <%
- if(request.getMethod().equals("POST"))
- {
- request.setCharacterEncoding("windows-1255");
- response.setCharacterEncoding("windows-1255");
- String fname = request.getParameter("fname");
- String lname = request.getParameter("lname");
- String email = request.getParameter("email");
- String date;
- String year = request.getParameter("y");
- String month = request.getParameter("m");
- String day = request.getParameter("d");
- date = year+"-"+month+"-"+day;
- String favdog = request.getParameter("animal");
- String gender = request.getParameter("gen");
- String[][] result1 = db.select("select * from customers where c_fname='"+fname+"' and c_lname='"+lname+"' and c_email='"+email+"'");
- if(result1.length!=0)
- {
- out.println("<h1> האימייל כבר קיים במערכת, הירשם עם אימייל אחר !</h1>");
- }
- else
- {
- int k=db.insertUpdateDelete("insert into customers(c_fname,c_lname,c_email,c_gender,c_favdog,c_birth) values('"+fname+"','"+lname+"','"+email+"','"+gender+"','"+favdog+"','"+date+"')");
- }
- }
- %>
- <h1>טבלת לקוחות</h1>
- <table border="5" style="margin-right:auto;margin-left:auto;text-align:center" cellpadding="10">
- <tr>
- <th>ID לקוח</th>
- <th>שם פרטי</th>
- <th>שם משפחה</th>
- <th>אימייל</th>
- <th>מין</th>
- <th>כלב אהוב</th>
- <th>תאריך לידה</th>
- </tr>
- <%
- String[][] result = db.select("select * from customers");
- for(int i=0;i<result.length;i++)
- {
- out.println("<tr>");
- for(int j=0;j<result[0].length;j++)
- {
- out.println("<td>"+result[i][j]+"</td>");
- }
- out.println("</tr>");
- }
- %>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement