msg = new HashMap<>();
14 | // msg.put("To","+917387495145");
15 | // msg.put("From","7066441446");
16 | // msg.put("Body","Ahoy! from Twilio!");
17 | //
18 | // factory.create(msg);
19 | //
20 | // }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/db/utils/DbConnection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.db.utils;
7 |
8 | import com.mysql.jdbc.Connection;
9 | import java.sql.DriverManager;
10 | import java.sql.SQLException;
11 |
12 | /**
13 | *
14 | * @author amit
15 | */
16 | public class DbConnection {
17 |
18 | final static String DB_NAME = "pizza_shop_db";
19 | final static String CONNECTION_URL = "jdbc:mysql://localhost:3306/" + DB_NAME;
20 | final static String USERNAME = "amit";
21 | final static String PASSWORD = "root";
22 |
23 | public static Connection init() throws ClassNotFoundException, SQLException {
24 | Class.forName("com.mysql.jdbc.Driver");
25 | return (Connection) DriverManager.getConnection(CONNECTION_URL, USERNAME, PASSWORD);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WebContent/CSS/tab.css:
--------------------------------------------------------------------------------
1 |
2 |
46 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pizzashop
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.wst.jsdt.core.javascriptValidator
10 |
11 |
12 |
13 |
14 | org.eclipse.jdt.core.javabuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.common.project.facet.core.builder
20 |
21 |
22 |
23 |
24 | org.eclipse.wst.validation.validationbuilder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.jem.workbench.JavaEMFNature
31 | org.eclipse.wst.common.modulecore.ModuleCoreNature
32 | org.eclipse.wst.common.project.facet.core.nature
33 | org.eclipse.jdt.core.javanature
34 | org.eclipse.wst.jsdt.core.jsNature
35 |
36 |
37 |
--------------------------------------------------------------------------------
/WebContent/check.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="com.db.utils.DbConnection"%>
2 | <%@ page import ="java.sql.*" %>
3 | <%
4 | String user = request.getParameter("uname");
5 | String pwd = request.getParameter("pass");
6 | String fname = request.getParameter("fname");
7 | String lname = request.getParameter("lname");
8 | String email = request.getParameter("email");
9 | try {
10 | Connection con = DbConnection.init();
11 |
12 | Statement st = con.createStatement();
13 | String q;
14 | ResultSet rs;
15 |
16 | int i = st.executeUpdate("insert ignore into members(first_name, last_name, email, uname, password) values ('" + fname + "','" + lname + "','" + email + "','" + user + "','" + pwd + "')");
17 | if (i > 0) {
18 | session.setAttribute("userid", user);
19 | response.sendRedirect("success.jsp");
20 |
21 | } else {
22 | response.sendRedirect("index.jsp");
23 |
24 | }
25 |
26 | } catch (SQLException se) {
27 | //Handle errors for JDBC
28 | se.printStackTrace();
29 | } catch (Exception e) {
30 | //Handle errors for Class.forName
31 | e.printStackTrace();
32 | }
33 |
34 | %>
--------------------------------------------------------------------------------
/WebContent/login.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="com.db.utils.DbConnection"%>
2 | <%@ page import ="java.sql.*"
3 | %>
4 | <%
5 | String userid = request.getParameter("uname");
6 | String pwd = request.getParameter("pass");
7 | Connection con = DbConnection.init();
8 | Statement st = con.createStatement();
9 | ResultSet rs;
10 |
11 | rs = st.executeQuery("select * from members where uname='" + userid + "' and password='" + pwd + "'");
12 | if (rs.next()) {
13 | session.setAttribute("userid", userid);
14 | response.sendRedirect("success.jsp");
15 | } else {
16 | %>
17 |
18 |
19 |
20 | Tomato
21 |
22 |
23 |
24 |
30 |
33 |
34 | !
35 | Wrong Username or Password.
36 | If you do not redirect within 5 seconds click here
37 |
40 |
41 |
42 | <%
43 | }
44 | %>
--------------------------------------------------------------------------------
/WebContent/thank.html:
--------------------------------------------------------------------------------
1 |
68 |
92 |
93 |
--------------------------------------------------------------------------------
/WebContent/register.jsp:
--------------------------------------------------------------------------------
1 | <%@page contentType="text/html" pageEncoding="UTF-8"%>
2 |
3 |
4 |
5 |
6 |
7 | Registration
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/WebContent/thank.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 | <%@ page import="Demo.MinPath"%>
5 | <%
6 | if ((session.getAttribute("userid") == null) || (session.getAttribute("userid") == "")) {
7 |
8 | %>
9 |
10 | 
11 | You must logged in first.
12 | Please Login
13 |
14 | <% } else {
15 |
16 | %>
17 |
85 |
110 |
111 |
112 | Thank you for making Order.....
113 | It will delivered to you within next 10 minutes...
114 |
115 |
116 |
117 |