Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=windows-1255"
  2. pageEncoding="windows-1255"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html dir="rtl">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
  7. <link rel="stylesheet" type="text/css" href="style.css" />
  8. <title>טבלת לקוחות</title>
  9. <%
  10. JDBC.ForDataBase db = new JDBC.ForDataBase();
  11. %>
  12. </head>
  13. <body>
  14. <%
  15. if(request.getMethod().equals("POST"))
  16. {
  17. request.setCharacterEncoding("windows-1255");
  18. response.setCharacterEncoding("windows-1255");
  19. String fname = request.getParameter("fname");
  20. String lname = request.getParameter("lname");
  21. String email = request.getParameter("email");
  22. String date;
  23. String year = request.getParameter("y");
  24. String month = request.getParameter("m");
  25. String day = request.getParameter("d");
  26. date = year+"-"+month+"-"+day;
  27. String favdog = request.getParameter("animal");
  28. String gender = request.getParameter("gen");
  29. String[][] result1 = db.select("select * from customers where c_fname='"+fname+"' and c_lname='"+lname+"' and c_email='"+email+"'");
  30. if(result1.length!=0)
  31. {
  32. out.println("<h1> האימייל כבר קיים במערכת, הירשם עם אימייל אחר !</h1>");
  33. }
  34. else
  35. {
  36. 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+"')");
  37. }
  38. }
  39. %>
  40. <h1>טבלת לקוחות</h1>
  41. <table border="5" style="margin-right:auto;margin-left:auto;text-align:center" cellpadding="10">
  42. <tr>
  43. <th>ID לקוח</th>
  44. <th>שם פרטי</th>
  45. <th>שם משפחה</th>
  46. <th>אימייל</th>
  47. <th>מין</th>
  48. <th>כלב אהוב</th>
  49. <th>תאריך לידה</th>
  50. </tr>
  51. <%
  52. String[][] result = db.select("select * from customers");
  53. for(int i=0;i<result.length;i++)
  54. {
  55. out.println("<tr>");
  56. for(int j=0;j<result[0].length;j++)
  57. {
  58. out.println("<td>"+result[i][j]+"</td>");
  59. }
  60. out.println("</tr>");
  61. }
  62. %>
  63. </table>
  64. </body>
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement