Commit 23173433 authored by Fabian Dewantara Santonie's avatar Fabian Dewantara Santonie 🕊

Memperbaiki input hobi pada inputData

parent 173c53a8
...@@ -47,41 +47,20 @@ public class inputData extends HttpServlet { ...@@ -47,41 +47,20 @@ public class inputData extends HttpServlet {
String hobiBuku = request.getParameter("hobiBuku"); String hobiBuku = request.getParameter("hobiBuku");
String hobiBadminton = request.getParameter("hobiBadminton"); String hobiBadminton = request.getParameter("hobiBadminton");
String hobiLainnya = request.getParameter("hobiLainnya"); String hobiLainnya = request.getParameter("hobiLainnya");
String hobi = ""; if(hobiBerenang==null) {
try { hobiBerenang="";
if (hobiBerenang.equals("Berenang")) {
hobi = hobi + hobiBerenang +" ";
}
}
catch (Exception e) {
}
try {
if (hobiBuku.equals("Membaca_Buku")) {
hobi = hobi + hobiBuku +" ";
}
} }
catch (Exception e) { if(hobiFutsal==null) {
} hobiFutsal="";
try {
if (hobiFutsal.equals("Futsal")) {
hobi = hobi + hobiFutsal +" ";
} }
if(hobiBuku==null) {
hobiBuku="";
} }
catch (Exception e) { if(hobiBadminton==null) {
} hobiBadminton="";
try {
if (hobiBadminton.equals("Badminton")) {
hobi = hobi + hobiBadminton +" ";
}
}
catch (Exception e) {
}
try {
if (hobiLainnya.equals("Lainnya")) {
hobi = hobi + hobiLainnya +" ";
}
} }
catch (Exception e) { if(hobiLainnya==null) {
hobiLainnya="";
} }
st.setString(1, request.getParameter("id")); st.setString(1, request.getParameter("id"));
st.setString(2, request.getParameter("nama")); st.setString(2, request.getParameter("nama"));
...@@ -89,7 +68,7 @@ public class inputData extends HttpServlet { ...@@ -89,7 +68,7 @@ public class inputData extends HttpServlet {
st.setString(4, request.getParameter("tempat_lahir")); st.setString(4, request.getParameter("tempat_lahir"));
st.setString(5, request.getParameter("tanggal_lahir")); st.setString(5, request.getParameter("tanggal_lahir"));
st.setString(6, request.getParameter("jenis_kelamin")); st.setString(6, request.getParameter("jenis_kelamin"));
st.setString(7, request.getParameter("hobi")); st.setString(7, hobiBerenang+" "+hobiFutsal+" "+hobiBuku+" "+hobiBadminton+" "+hobiLainnya);
st.setString(8, request.getParameter("email")); st.setString(8, request.getParameter("email"));
st.setString(9, request.getParameter("anak_ke")); st.setString(9, request.getParameter("anak_ke"));
st.setString(10, request.getParameter("pendidikan_terakhir")); st.setString(10, request.getParameter("pendidikan_terakhir"));
......
...@@ -11,9 +11,24 @@ ...@@ -11,9 +11,24 @@
<title>Insert title here</title> <title>Insert title here</title>
</head> </head>
<body> <body>
<div align="right"> <nav class="navbar navbar-expand-lg navbar-light bg-light">
<a href="Login.jsp"><button class="btn btn-primary">Logout</button></a> <div class="container-fluid">
</div> <a class="navbar-brand">Selamat Datang ${nama}</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="mahasiswaBaru.jsp">Tambah Data</a>
</li>
</ul>
<div align="right">
<a href="Login.jsp"><button class="btn btn-primary">Logout</button></a>
</div>
</div>
</div>
</nav>
<div align="center"> <div align="center">
<table class="table table-striped" border="2"> <table class="table table-striped" border="2">
<tr> <tr>
...@@ -50,7 +65,6 @@ ...@@ -50,7 +65,6 @@
</tr> </tr>
<%}%> <%}%>
</table> </table>
<a href="mahasiswaBaru.jsp"><button class="btn btn-primary">Tambah Data</button></a>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment