Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tugasAkhir_dioHarvandy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Harvandy
tugasAkhir_dioHarvandy
Commits
972021c6
Commit
972021c6
authored
Mar 25, 2022
by
Dio Harvandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perbaikan Tampilan-tampilan
parent
1f5a8742
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
29 deletions
+30
-29
Login.java
src/main/java/com/tugasakhir/web/Login.java
+14
-13
editDataMahasiswa.jsp
src/main/webapp/WEB-INF/editDataMahasiswa.jsp
+3
-4
tambahDataMahasiswa.jsp
src/main/webapp/WEB-INF/tambahDataMahasiswa.jsp
+3
-4
tampilDataMahasiswa.jsp
src/main/webapp/WEB-INF/tampilDataMahasiswa.jsp
+10
-8
No files found.
src/main/java/com/tugasakhir/web/Login.java
View file @
972021c6
...
...
@@ -34,7 +34,7 @@ public class Login extends HttpServlet {
*/
protected
void
doGet
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
HttpSession
session
=
request
.
getSession
(
false
);
if
(
request
.
getParameter
(
"logout"
)
!=
null
)
{
if
(
request
.
getParameter
(
"logout"
)
!=
null
||
session
!=
null
)
{
session
.
invalidate
();
response
.
sendRedirect
(
request
.
getContextPath
());
}
...
...
@@ -51,19 +51,20 @@ public class Login extends HttpServlet {
Statement
stmt
=
(
Statement
)
con
.
createStatement
();
ResultSet
rs
=
stmt
.
executeQuery
(
"select * from tbl_user where email = '"
+
request
.
getParameter
(
"email"
).
toString
()+
"' and password = "
+
request
.
getParameter
(
"password"
));
rs
.
next
();
response
.
setContentType
(
"text/html;charset=UTF-8"
);
PrintWriter
out
=
response
.
getWriter
();
String
emailRes
=
request
.
getParameter
(
"email"
).
toString
();
String
passwordRes
=
request
.
getParameter
(
"password"
).
toString
();
if
(
passwordRes
.
equals
(
rs
.
getString
(
"password"
))
&&
emailRes
.
equals
(
rs
.
getString
(
"email"
)))
{
HttpSession
session
=
request
.
getSession
(
true
);
session
.
putValue
(
"nama"
,
rs
.
getString
(
"nama"
));
session
.
putValue
(
"email"
,
rs
.
getString
(
"email"
));
response
.
sendRedirect
(
request
.
getContextPath
()+
"/datamahasiswa"
);
request
.
getParameter
(
"email"
).
toString
()+
"' and password = '"
+
request
.
getParameter
(
"password"
)+
"'"
);
if
(
rs
.
next
())
{
// String emailRes = request.getParameter("email").toString();
// String passwordRes = request.getParameter("password").toString();
// if(passwordRes.equals(rs.getString("password")) && emailRes.equals(rs.getString("email"))) {
HttpSession
session
=
request
.
getSession
(
true
);
session
.
putValue
(
"nama"
,
rs
.
getString
(
"nama"
));
session
.
putValue
(
"email"
,
rs
.
getString
(
"email"
));
response
.
sendRedirect
(
request
.
getContextPath
()+
"/datamahasiswa"
);
}
else
{
response
.
setContentType
(
"text/html;charset=UTF-8"
);
PrintWriter
out
=
response
.
getWriter
();
out
.
println
(
"<hmtl>"
);
out
.
println
(
"<head>"
);
out
.
println
(
"<title>Login Gagal</title>"
);
...
...
@@ -71,7 +72,7 @@ public class Login extends HttpServlet {
out
.
println
(
"<body>"
);
out
.
println
(
"<h1 style='text-align: center;'>Login Gagal</h1>"
);
out
.
println
(
"<h3 style='text-align: center;'>Email atau Password Anda Salah</h3>"
);
out
.
println
(
"<h3 style='text-align: center;'><a href='
i
ndex.jsp'>Kembali</a></h3>"
);
out
.
println
(
"<h3 style='text-align: center;'><a href='
I
ndex.jsp'>Kembali</a></h3>"
);
out
.
println
(
"</body>"
);
out
.
println
(
"</hmtl>"
);
}
...
...
src/main/webapp/WEB-INF/editDataMahasiswa.jsp
View file @
972021c6
...
...
@@ -10,12 +10,11 @@
<title>
Edit Data Mahasiswa
</title>
</head>
<body>
<ul
class=
"nav justify-content-end navbar-light bg-light"
>
<
li
class=
"nav-item
"
>
<ul
class=
"nav
bar navbar-expand-lg
justify-content-end navbar-light bg-light"
>
<
div
class=
"nav-item
"
>
<a
class=
"nav-link"
onclick=
"return confirm('Logout?');"
href=
"login?logout=1"
><%=
session
.
getAttribute
(
"email"
)
%>
<i
class=
"fa fa-sign-out"
aria-hidden=
"true"
></i></a>
</
li
>
</
div
>
</ul>
<p
class=
"text-center"
></p>
<div
class=
"container"
>
<div
class=
"card m-auto"
>
<div
class=
"card-header"
>
...
...
src/main/webapp/WEB-INF/tambahDataMahasiswa.jsp
View file @
972021c6
...
...
@@ -10,12 +10,11 @@
<title>
Tambah Data Mahasiswa
</title>
</head>
<body>
<ul
class=
"nav justify-content-end navbar-light bg-light"
>
<
li
class=
"nav-item
"
>
<ul
class=
"nav
bar navbar-expand-lg
justify-content-end navbar-light bg-light"
>
<
div
class=
"nav-item
"
>
<a
class=
"nav-link"
onclick=
"return confirm('Logout?');"
href=
"login?logout=1"
><%=
session
.
getAttribute
(
"email"
)
%>
<i
class=
"fa fa-sign-out"
aria-hidden=
"true"
></i></a>
</
li
>
</
div
>
</ul>
<p
class=
"text-center"
></p>
<div
class=
"container"
>
<div
class=
"card m-auto"
>
<div
class=
"card-header"
>
...
...
src/main/webapp/WEB-INF/tampilDataMahasiswa.jsp
View file @
972021c6
...
...
@@ -15,19 +15,20 @@
<style
type=
"text/css"
>
td
{
border
:
1px
solid
;
text-align
:
center
;
}
</style>
<title>
Data Mahasiswa
</title>
</head>
<body>
<ul
class=
"nav justify-content-end navbar-light bg-light"
>
<li
class=
"nav-item"
>
<ul
class=
"navbar navbar-expand-lg justify-content-end navbar-light bg-light"
>
<a
href=
"datamahasiswa"
class=
"navbar-brand text-muted"
>
Data Mahasiswa
</a>
|
<div
class=
"nav-item "
>
<a
class=
"nav-link"
onclick=
"return confirm('Logout?');"
href=
"login?logout=1"
><%=
session
.
getAttribute
(
"email"
)
%>
<i
class=
"fa fa-sign-out"
aria-hidden=
"true"
></i></a>
</
li
>
</
div
>
</ul>
<p
class=
"text-center"
>
${pesan}
</p>
<a
href=
"datamahasiswa"
class=
"nav-link"
><h4
class=
"text-muted text-center"
>
Data Mahasiswa
</h4></a>
<div
class=
"table-responsive-xxl"
>
<table
class=
"table table-sm table-striped table-hover"
style=
"width: 95%; margin: auto;"
>
<thead>
...
...
@@ -46,7 +47,7 @@
<th
style=
"text-align: center;"
scope=
"col"
width=
"5px"
>
Nama Panggilan
</th>
<th
style=
"text-align: center; width: 8%;"
scope=
"col"
>
Tempat Lahir
</th>
<th
style=
"text-align: center; width: 8%;"
scope=
"col"
>
Tanggal Lahir
</th>
<th
style=
"text-align: center;"
scope=
"col"
width=
"5px"
>
Jenis Kelamin
</th>
<th
style=
"text-align: center;"
scope=
"col"
>
Jenis Kelamin
</th>
<th
style=
"text-align: center; width: 9%;"
scope=
"col"
>
Hobi
</th>
<th
style=
"text-align: center; width: 10%;"
scope=
"col"
>
Email
</th>
<th
style=
"text-align: center;"
scope=
"col"
width=
"5px"
>
Anak Ke
</th>
...
...
@@ -58,9 +59,10 @@
<tbody>
<%
List
<
Mahasiswa
>
mhsList
=
(
ArrayList
<
Mahasiswa
>
)
request
.
getAttribute
(
"mhsList"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"dd MMMM yyyy"
,
new
Locale
(
"id"
,
"ID"
));
int
no
=
1
;
for
(
Mahasiswa
mhs
:
mhsList
){
String
[]
hobi
=
mhs
.
getHobi
().
split
(
";"
);
%>
<tr>
<td
scope=
"row"
><%=
mhs
.
getId
()
%></td>
<td
scope=
"row"
><%=
no
%></td>
<td><%=
mhs
.
getNama
()
%></td>
<td><%=
mhs
.
getNamaPanggilan
()
%></td>
<td><%=
mhs
.
getTempatLahir
()
%></td>
...
...
@@ -74,7 +76,7 @@
<td
style=
"text-align: center;"
><a
href=
"editdatamahasiswa?id=
<%=
mhs
.
getId
()
%>
"
class=
"btn btn-sm btn-warning"
><i
class=
"fa fa-pencil"
aria-hidden=
"true"
></i></a>
<a
href=
"deletedatamahasiswa?id=
<%=
mhs
.
getId
()
%>
"
class=
"btn btn-sm btn-danger"
onclick=
"return confirm('Delete This Item?');"
><i
class=
"fa fa-trash"
aria-hidden=
"true"
></i></a></td>
</tr>
<%
}
%>
<%
no
++;
}
%>
</tbody>
</table>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment