-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94e645e
commit c9172fc
Showing
111 changed files
with
6,450 additions
and
0 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
Diaster Management Hackathon/WebContent/Error/temp/Connection/Controller/GetLoc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import java.sql.Connection; | ||
import java.sql.DriverManager; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.LinkedList; | ||
|
||
import javax.servlet.ServletContext; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
/** | ||
* | ||
* @author Soumyadip Chowdhury | ||
* | ||
*/ | ||
@WebServlet("/addevents") | ||
public class GetLoc extends HttpServlet { | ||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
// TODO Auto-generated method stub | ||
|
||
String name=request.getParameter("name"); | ||
String start=request.getParameter("sdate"); | ||
String end=request.getParameter("edate"); | ||
String venue=request.getParameter("venue"); | ||
String des=request.getParameter("des"); | ||
|
||
String fee=request.getParameter("fee"); | ||
String link=request.getParameter("link"); | ||
try { | ||
|
||
|
||
Class.forName("com.mysql.jdbc.Driver"); | ||
|
||
ServletContext ct=getServletContext(); | ||
|
||
Connection con=(Connection) DriverManager.getConnection(ct.getInitParameter("path"),ct.getInitParameter("user"),ct.getInitParameter("pass")); | ||
|
||
// Connection con=(Connection) DriverManager.getConnection("jdbc:mysql://node12654-getsaved.cloudjiffy.net/hackathon","root","THHrio35634"); | ||
|
||
PreparedStatement st=con.prepareStatement("INSERT INTO event(name,start,end,venue,des,fee,link) values(?,?,?,?,?,?,?)"); | ||
|
||
st.setString(1,name); | ||
st.setString(2,start); | ||
st.setString(3,end); | ||
st.setString(4,venue); | ||
st.setString(5,des); | ||
|
||
st.setString(6,fee); | ||
st.setString(7,link); | ||
|
||
int i=st.executeUpdate(); | ||
|
||
st=con.prepareStatement("INSERT INTO allevents(name,start,end,venue) values(?,?,?,?)"); | ||
|
||
st.setString(1,name); | ||
st.setString(2,start); | ||
st.setString(3,end); | ||
st.setString(4,venue); | ||
|
||
|
||
st.executeUpdate(); | ||
|
||
} catch (SQLException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} catch (ClassNotFoundException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
response.getWriter().append("Served at: ").append(request.getContextPath()); | ||
//response.sendRedirect("https://www.latlong.net/c/?lat="+latt+"&long="+longi); | ||
// https://www.google.co.in/maps/@22.5601086,88.4904909,21z | ||
|
||
response.sendRedirect("adminhome.jsp"); | ||
} | ||
|
||
|
||
} |
55 changes: 55 additions & 0 deletions
55
...er Management Hackathon/WebContent/Error/temp/Connection/Controller/Login - Copy (2).java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
import com.sun.org.apache.xpath.internal.operations.And; | ||
|
||
import Dao.Dao; | ||
|
||
|
||
/** | ||
* Servlet implementation class Login | ||
*/ | ||
public class Login extends HttpServlet { | ||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
// TODO Auto-generated method stub | ||
String user =(String)request.getParameter("user"); | ||
String pass =(String)request.getParameter("pass"); | ||
String user1="Wrong Email/Password"; | ||
Dao obj=new Dao(); | ||
int j=obj.log(user,pass); | ||
if(j==1) | ||
{ | ||
HttpSession session=request.getSession(); | ||
session.setAttribute("username",user); | ||
try { | ||
|
||
response.sendRedirect("Home.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
else{ | ||
try { | ||
|
||
HttpSession session=request.getSession(); | ||
session.setAttribute("user",user1); | ||
response.sendRedirect("Login.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
Diaster Management Hackathon/WebContent/Error/temp/Connection/Controller/Login - Copy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
import com.sun.org.apache.xpath.internal.operations.And; | ||
|
||
import Dao.Dao; | ||
|
||
|
||
/** | ||
* Servlet implementation class Login | ||
*/ | ||
public class Login extends HttpServlet { | ||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
// TODO Auto-generated method stub | ||
String user =(String)request.getParameter("user"); | ||
String pass =(String)request.getParameter("pass"); | ||
String user1="Wrong Email/Password"; | ||
Dao obj=new Dao(); | ||
int j=obj.log(user,pass); | ||
if(j==1) | ||
{ | ||
HttpSession session=request.getSession(); | ||
session.setAttribute("username",user); | ||
try { | ||
|
||
response.sendRedirect("Home.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
else{ | ||
try { | ||
|
||
HttpSession session=request.getSession(); | ||
session.setAttribute("user",user1); | ||
response.sendRedirect("Login.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
Diaster Management Hackathon/WebContent/Error/temp/Connection/Controller/Login.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
import com.sun.org.apache.xpath.internal.operations.And; | ||
|
||
import Dao.Dao; | ||
|
||
|
||
/** | ||
* Servlet implementation class Login | ||
*/ | ||
public class Login extends HttpServlet { | ||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
// TODO Auto-generated method stub | ||
String user =(String)request.getParameter("user"); | ||
String pass =(String)request.getParameter("pass"); | ||
String user1="Wrong Email/Password"; | ||
Dao obj=new Dao(); | ||
int j=obj.log(user,pass); | ||
if(j==1) | ||
{ | ||
HttpSession session=request.getSession(); | ||
session.setAttribute("username",user); | ||
try { | ||
|
||
response.sendRedirect("Home.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
else{ | ||
try { | ||
|
||
HttpSession session=request.getSession(); | ||
session.setAttribute("user",user1); | ||
response.sendRedirect("Login.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...r Management Hackathon/WebContent/Error/temp/Connection/Controller/Logout - Copy (2).java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
/** | ||
* Servlet implementation class Logout | ||
*/ | ||
@WebServlet("/Logout") | ||
public class Logout extends HttpServlet { | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
||
|
||
HttpSession session=request.getSession(); | ||
|
||
session.removeAttribute("user"); | ||
session.invalidate(); | ||
|
||
try { | ||
response.sendRedirect("Home.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Diaster Management Hackathon/WebContent/Error/temp/Connection/Controller/Logout - Copy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
/** | ||
* Servlet implementation class Logout | ||
*/ | ||
@WebServlet("/Logout") | ||
public class Logout extends HttpServlet { | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
||
|
||
HttpSession session=request.getSession(); | ||
|
||
session.removeAttribute("user"); | ||
session.invalidate(); | ||
|
||
try { | ||
response.sendRedirect("Home.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
Diaster Management Hackathon/WebContent/Error/temp/Connection/Controller/Logout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package Controller; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
/** | ||
* Servlet implementation class Logout | ||
*/ | ||
@WebServlet("/Logout") | ||
public class Logout extends HttpServlet { | ||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
||
|
||
HttpSession session=request.getSession(); | ||
|
||
session.removeAttribute("user"); | ||
session.invalidate(); | ||
|
||
try { | ||
response.sendRedirect("Home.jsp"); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.