Skip to content

Commit 31879ed

Browse files
author
Burak Tağtekin
committed
Jsp Files
1 parent dea2988 commit 31879ed

File tree

9 files changed

+236
-9
lines changed

9 files changed

+236
-9
lines changed

web/Admin.jsp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: burak
4+
Date: 19.07.2017
5+
Time: 13:42
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Administration</title>
12+
</head>
13+
<body>
14+
<h2>Hello Architect</h2>
15+
<%
16+
//HttpSession UserPage = request.getSession();
17+
String type = (String)session.getAttribute("UserType");
18+
if (type.equals("Admin") ){
19+
}else{
20+
response.sendRedirect("http://localhost:8080/Project_Oscar_war_exploded/Unauthorized.jsp");
21+
}
22+
%>
23+
<h3>For Adding Yatch Owner Please Enter</h3><br>
24+
<br>
25+
<h3>For Adding User Please Enter</h3><<br>
26+
<br>
27+
28+
29+
</body>
30+
</html>

web/Control.jsp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<%@ page import="Sub.Data" %>
2+
<%@ page import="java.sql.Statement" %>
3+
<%@ page import="java.sql.PreparedStatement" %>
4+
<%@ page import="java.sql.ResultSet" %><%--
5+
Created by IntelliJ IDEA.
6+
User: burak
7+
Date: 19.07.2017
8+
Time: 10:01
9+
To change this template use File | Settings | File Templates.
10+
--%>
11+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
12+
<html>
13+
<head>
14+
<title>Log-in or OUT</title>
15+
</head>
16+
<body>
17+
<%
18+
String KullanıcıAdi = request.getParameter("Username");//Burası Okey
19+
String KullanıcıParola = request.getParameter("Password");//Burası Okey
20+
%>
21+
22+
<%
23+
String Username;
24+
String Password;
25+
String Autho;
26+
Data data = new Data();
27+
Statement statement = null;
28+
if (KullanıcıAdi != null && KullanıcıParola.length()>0) {
29+
try {
30+
statement = data.baglanti().createStatement();
31+
ResultSet resultSet = statement.executeQuery("SELECT * FROM User");
32+
while (resultSet.next()) {
33+
Username = resultSet.getString("Username");
34+
Password = resultSet.getString("Password");
35+
Autho = resultSet.getString("Authority");
36+
if (KullanıcıAdi.equalsIgnoreCase(Username) && Password.equals(KullanıcıParola)) {
37+
out.println("Basarılı Giris Yaptınız<br>");
38+
out.println("Anasayfaya yönlendiriliyorsunuz Sayın:" + KullanıcıAdi + "<br>");
39+
//String url = "http://localhost:8080/Project_Oscar_war_exploded/index.jsp";
40+
if (Autho.equals("Admin")){
41+
response.sendRedirect("http://localhost:8080/Project_Oscar_war_exploded/Admin.jsp");
42+
//HttpSession UserPage = request.getSession(true);
43+
session.setAttribute("UserType",Autho);
44+
break;
45+
}else if (Autho.equals("Employee")){
46+
response.sendRedirect("http://localhost:8080/Project_Oscar_war_exploded/Workers/Staff.jsp");
47+
session.setAttribute("UserType",Autho);
48+
break;
49+
}else if (Autho.equals("Normal") || Autho.equals(null)){
50+
//HttpSession UserPage = request.getSession(true);
51+
session.setAttribute("UserType",Autho);
52+
break;
53+
}//response.sendRedirect(url);
54+
break;
55+
} else {
56+
57+
}
58+
}
59+
session.setAttribute("UserName", KullanıcıAdi);
60+
session.setAttribute("UserPass", KullanıcıParola);
61+
62+
} catch (Exception e) {
63+
out.println(e);
64+
}
65+
}else{
66+
out.println("Parola Alanı Boş Kalamaz");
67+
out.println(
68+
"<form action = Login.jsp method = post>" +
69+
"<input type = submit name = WrongLogin value = LoginEkranınaGeriDön>" +
70+
"</form> "
71+
);
72+
}
73+
%>
74+
75+
</body>
76+
</html>

web/Exception.jsp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
String key = entry.getKey();
3434
List<String>values = entry.getValue();
3535
%>
36-
<%=values%>
36+
<h2><%out.print(key);%></h2>
37+
<h3><%=values%></h3>
3738
<input type=checkbox name=anahtar value=<%=key%>>Choose ME!!<br>
3839
<%
3940
}
@@ -43,7 +44,7 @@
4344

4445

4546

46-
<input type="submit" value="Sender" name="SubmitYatches">
47+
<input type="submit" value="Sender" name="SubmitYatches"><br>
4748
</form>
4849
</body>
4950
</html>

web/LogOut.jsp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: burak
4+
Date: 19.07.2017
5+
Time: 14:40
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Log Out</title>
12+
</head>
13+
<body>
14+
<%
15+
session.invalidate();
16+
response.sendRedirect("http://localhost:8080/Project_Oscar_war_exploded/index.jsp");
17+
%>
18+
19+
</body>
20+
</html>

web/Login.jsp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: burak
4+
Date: 19.07.2017
5+
Time: 09:51
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Login</title>
12+
</head>
13+
<body>
14+
<h2>Login Sayfası</h2>
15+
<
16+
<form action="Control.jsp" method="post">
17+
Username:<br>
18+
<input type="text" name = "Username"><br>
19+
Password:<br>
20+
<input type="password" name="Password"><br>
21+
<input type="submit" name="submitloginscreen">
22+
</form>
23+
</body>
24+
</html>

web/Unauthorized.jsp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: burak
4+
Date: 19.07.2017
5+
Time: 14:05
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Unauthorized</title>
12+
</head>
13+
<body>
14+
<h1>Nice Try But Not Good Enought</h1>
15+
<%String type = (String)session.getAttribute("UserType");
16+
out.println("<h2>"+type+"</h2>");
17+
%>
18+
</body>
19+
</html>

web/Workers/Staff.jsp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: burak
4+
Date: 19.07.2017
5+
Time: 13:46
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Staff Page</title>
12+
</head>
13+
<body>
14+
<h2>Hello Employee</h2>
15+
<%
16+
//HttpSession UserPage = request.getSession();
17+
String type = (String)session.getAttribute("UserType");
18+
if (type.equals("Employee")){
19+
}else{
20+
response.sendRedirect("http://localhost:8080/Project_Oscar_war_exploded/Unauthorized.jsp");
21+
}
22+
%>
23+
24+
</body>
25+
</html>

web/WrongPassword.jsp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: burak
4+
Date: 19.07.2017
5+
Time: 12:04
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Password Required</title>
12+
</head>
13+
<body>
14+
<h3>Lütfen Parola Giriniz</h3>
15+
<%
16+
String URL = "http://localhost:8080/Project_Oscar_war_exploded/Login.jsp";
17+
wait(4000);
18+
response.sendRedirect(URL);
19+
%>
20+
21+
</body>
22+
</html>

web/index.jsp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
<head>
2121
<title>Main Page</title>
2222
</head>
23-
<body>
24-
25-
26-
<form action="/Exception.jsp" method="post"></form>>
23+
<body><h3>Hoşgeldiniz <%=session.getAttribute("UserName")
24+
%></h3>
25+
------------------------------------
26+
<h2>Rezervasyon İçin Tarih Seçin</h2>
27+
<form action="/Exception.jsp" method="post"></form>
2728
<table width="500" border="1">
28-
2929
<form action="/Project_Oscar_war_exploded/Exception.jsp" method="post" id="index" name = "index">
3030
Start Date:<br>
3131
<input type="date" name="StartDate" value="StartDate"><br>
@@ -42,6 +42,16 @@
4242
%>
4343
</table>
4444
</form>
45-
46-
</body>
45+
<br>
46+
<br>
47+
<form action="Login.jsp" method="post">
48+
<legend>Login Olmak İçin Tıklayın</legend><br>
49+
<br>
50+
<input type="submit" name="sendLoginPage" value="Login">
51+
</form>
52+
<form action="LogOut.jsp" method="post">
53+
<legend>Çıkış için</legend><br>
54+
<input type="submit" name="logout">
55+
</form>
56+
</body>
4757
</html>

0 commit comments

Comments
 (0)