diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..cace6a9
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..12dd01a
--- /dev/null
+++ b/.project
@@ -0,0 +1,36 @@
+
+
+ TubesWBD2alifa
+
+
+
+
+
+ org.eclipse.wst.jsdt.core.javascriptValidator
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.wst.common.project.facet.core.builder
+
+
+
+
+ org.eclipse.wst.validation.validationbuilder
+
+
+
+
+
+ org.eclipse.jem.workbench.JavaEMFNature
+ org.eclipse.wst.common.modulecore.ModuleCoreNature
+ org.eclipse.wst.common.project.facet.core.nature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.wst.jsdt.core.jsNature
+
+
diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope
new file mode 100644
index 0000000..3a28de0
--- /dev/null
+++ b/.settings/.jsdtscope
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
new file mode 100644
index 0000000..b97166e
--- /dev/null
+++ b/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..4498a90
--- /dev/null
+++ b/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container
new file mode 100644
index 0000000..3bd5d0a
--- /dev/null
+++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name
new file mode 100644
index 0000000..05bd71b
--- /dev/null
+++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
+Window
\ No newline at end of file
diff --git a/IF3110-Tubes-II b/IF3110-Tubes-II
new file mode 160000
index 0000000..37887e7
--- /dev/null
+++ b/IF3110-Tubes-II
@@ -0,0 +1 @@
+Subproject commit 37887e751ab2afeee3cb6c8a11fbcd4aa243396c
diff --git a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..254272e
--- /dev/null
+++ b/WebContent/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml
new file mode 100644
index 0000000..0393cb3
--- /dev/null
+++ b/WebContent/WEB-INF/web.xml
@@ -0,0 +1,14 @@
+
+
+ ServletFileUploadExample
+
+ editbarang.jsp
+
+
+ Location to store uploaded file
+ file-upload
+
+ c:\Users\Alifa\workspace\TubesWBD2alifa\WebContent\images\
+
+
+
\ No newline at end of file
diff --git a/WebContent/admin.jsp b/WebContent/admin.jsp
new file mode 100644
index 0000000..3ca953e
--- /dev/null
+++ b/WebContent/admin.jsp
@@ -0,0 +1,80 @@
+<%@include file="header.jsp"%>
+
+
+barang
+
+
+
+
+<%
+ /******************* dummy ******************/
+ String kategori = request.getParameter("kat");
+
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement statement = conn.createStatement();
+
+ String sql1="select * from barang where kategori = '"+kategori+"'";
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+ int i=0;
+ while (resultSet.next()) {
+ String path=resultSet.getString("path");
+ int id=resultSet.getInt("id");
+ String namabrg= resultSet.getString("namabarang");
+ int hargab=resultSet.getInt("harga");
+ if (i%2==0) {
+ %>
+
+ <%
+ %>
+ '
+ <%} else {
+ %>
+
+ <%
+ }
+ i++;
+
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+%>
+
+<% if (request.getParameter("tomboledit")!=null) {
+ %> <%
+
+} %>
+
+
+
\ No newline at end of file
diff --git a/WebContent/barang.jsp b/WebContent/barang.jsp
new file mode 100644
index 0000000..d234ab6
--- /dev/null
+++ b/WebContent/barang.jsp
@@ -0,0 +1,145 @@
+<%@include file="header.jsp"%>
+
+
+barang
+
+
+
+<%
+ /******************* dummy ******************/
+ String kategori = request.getParameter("kat");
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ String id = "0";
+ String nama = "";
+ String urut = request.getParameter("sorting");
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+ Statement statement = conn.createStatement();
+ String sql1="";
+ if (urut==null) {
+ sql1="select * from barang where kategori = '"+kategori+"'";
+ }
+ else if (urut.compareTo("nama")==0) {
+ sql1="select * from barang where kategori = '"+kategori+"' order by namabarang";
+ }else if (urut.compareTo("harga")==0) {
+ sql1="select * from barang where kategori = '"+kategori+"' order by harga";
+ }
+
+
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+ nama = ses.getAttribute("user").toString();
+ int i=0;
+ while (resultSet.next()) {
+ id = resultSet.getString("id");
+ if (i%2==0) {
+ %> <%
+ } else {
+ %> <%
+
+ }
+
+
+ i++;
+
+
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+ if (request.getParameter("addcart") != null) {
+ conn=null;
+ result=null;
+ stmt=null;
+ rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement stat2 = conn.createStatement();
+ String sql2 = "select * from barang where id='"+id+"'";
+ ResultSet resultSet2 = stat2.executeQuery(sql2);
+ int stok = 0;
+ while (resultSet2.next()) {
+ stok = resultSet2.getInt("stok");
+ }
+ int jml = Integer.parseInt(request.getParameter("jumlah"));
+ if (stok==0) {
+ %>
Maaf, stok habis<%
+ }
+ else if (jml > stok) {
+ %>
Maaf, stok tidak mencukupi, sisa stok : <%= stok %><%
+ }
+ else {
+ int idnext = 0;
+ Statement stat3 = conn.createStatement();
+ String sql3 = "select * from cart";
+ int a = 1;
+ ResultSet rs = stat3.executeQuery(sql3);
+ while (rs.next()) {
+ a++;
+ }
+ id = request.getParameter("idba");
+ String idn = Integer.toString(idnext);
+ PreparedStatement stat1 = conn.prepareStatement("insert into cart (id,user,idbarang,jumlah,beli)value(?,?,?,?,?)");
+ stat1.setInt(1, a);
+ stat1.setString(2, nama);
+ stat1.setString(3, "7");
+ stat1.setString(4, request.getParameter("jumlah"));
+ stat1.setString(5, "0");
+
+ stat1.executeUpdate();
+ %><%
+
+ }
+
+
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+
+
+%>
+
+
+
\ No newline at end of file
diff --git a/WebContent/cart.jsp b/WebContent/cart.jsp
new file mode 100644
index 0000000..bc3a343
--- /dev/null
+++ b/WebContent/cart.jsp
@@ -0,0 +1,135 @@
+<%@include file="header.jsp"%>
+
+
+cart
+
+
+
+<%
+ /************************************* dummy *********************/
+ String nama = ses.getAttribute("user").toString();
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ int i = 0;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement statement = conn.createStatement();
+ String sql1="select * from cart where user = '"+nama+"'";
+ int total= 0;
+ ResultSet resultSet = statement.executeQuery(sql1);
+
+ while (resultSet.next()) {
+ String jml = resultSet.getString("jumlah");
+ int id = resultSet.getInt("id");
+ Statement statement2 = conn.createStatement();
+ String sql2 = "select * from barang where id='"+resultSet.getString("idbarang")+"'";
+ ResultSet resultSet2 = statement2.executeQuery(sql2);
+ String idx = Integer.toString(i);
+ while (resultSet2.next()) {
+ if (resultSet.getInt("beli")==0) {
+ total += resultSet2.getInt("harga") * resultSet.getInt("jumlah");
+ %>
+
+
+ <%
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+
+ if (request.getParameter("beli") != null) {
+
+ conn=null;
+ result=null;
+ stmt=null;
+ rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+ Statement statement = conn.createStatement();
+ PreparedStatement statement2 = conn.prepareStatement("update cart set beli=1 where user = '"+nama+"'");
+ statement2.executeUpdate();
+ String sql1="select * from cart where user = '"+nama+"'";
+ ResultSet resultSet = statement.executeQuery(sql1);
+ while (resultSet.next()) {
+ Statement statement4 = conn.createStatement();
+ String sql2="select * from barang where id = '"+resultSet.getString("idbarang")+"'";
+ ResultSet resultSet2 = statement4.executeQuery(sql2);
+
+ while (resultSet2.next()) {
+ PreparedStatement statement3 = conn.prepareStatement("update barang set stok=? where id = '"+resultSet.getString("idbarang")+"'");
+ statement3.setInt(1, resultSet2.getInt("stok") - resultSet.getInt("jumlah"));
+ statement3.executeUpdate();
+ }
+
+ }
+ %><%
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+ }
+ else if (request.getParameter("update") != null) {
+ conn=null;
+ result=null;
+ stmt=null;
+ rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+ for (int j=0; j<%
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+
+%>
+
+
+
\ No newline at end of file
diff --git a/WebContent/detail.jsp b/WebContent/detail.jsp
new file mode 100644
index 0000000..2d35551
--- /dev/null
+++ b/WebContent/detail.jsp
@@ -0,0 +1,117 @@
+<%@include file="header.jsp"%>
+
+
+detail
+
+
+
+<%
+ /****************** dummy ********************/
+ String idbarang = request.getParameter("idb");
+
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ String nama = ses.getAttribute("user").toString();
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement statement = conn.createStatement();
+ String sql1="select * from barang where id = '"+idbarang+"'";
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+
+ while (resultSet.next()) {
+ %> <%
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+ if (request.getParameter("addcart") != null) {
+ idbarang = request.getParameter("idb");
+ conn=null;
+ result=null;
+ stmt=null;
+ rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement stat2 = conn.createStatement();
+ String sql2 = "select * from barang where id='"+idbarang+"'";
+
+ ResultSet resultSet2 = stat2.executeQuery(sql2);
+ int stok = 0;
+ while (resultSet2.next()) {
+ stok = resultSet2.getInt("stok");
+ }
+ int jml = Integer.parseInt(request.getParameter("jumlah"));
+
+ if (stok==0) {
+ %>Maaf, stok habis
<%
+ }
+ else if (jml > stok) {
+ %>Maaf, stok tidak mencukupi, sisa stok : <%= stok %>
<%
+ }
+ else {
+ int idnext = 0;
+ Statement stat3 = conn.createStatement();
+ String sql3 = "select * from cart";
+ int a = 1;
+ ResultSet rs = stat3.executeQuery(sql3);
+ while (rs.next()) {
+ a++;
+ }
+ String idn = Integer.toString(idnext);
+ PreparedStatement stat1 = conn.prepareStatement("insert into cart (id,user,idbarang,jumlah,beli)value(?,?,?,?,?)");
+ stat1.setInt(1, a);
+ stat1.setString(2, nama);
+ stat1.setString(3, idbarang);
+ stat1.setString(4, request.getParameter("jumlah"));
+ stat1.setString(5, "0");
+
+ stat1.executeUpdate();
+ %><%
+ }
+
+
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+
+
+
+
+
+
+%>
+
+
+
\ No newline at end of file
diff --git a/WebContent/editbarang.jsp b/WebContent/editbarang.jsp
new file mode 100644
index 0000000..cee8652
--- /dev/null
+++ b/WebContent/editbarang.jsp
@@ -0,0 +1,164 @@
+<%@include file="header.jsp"%>
+<%@ page import="javax.servlet.http.*" %>
+<%@ page import="java.io.*,java.util.*, javax.servlet.*" %>
+
+
+
+detail
+
+
+
+
+
+<%
+ /****************** dummy ********************///
+ String idbarang = request.getParameter("idbarang");
+ idbarang="11";
+ /************************************* dummy *********************/
+ String namabrg = "";
+ int hrg = 0;
+ int stock = 0;
+ String path;
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement statement = conn.createStatement();
+ String sql1="select * from barang where id = '"+idbarang+"'";
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+
+ try {
+ resultSet.last();
+ namabrg = resultSet.getString("namabarang");
+ hrg= resultSet.getInt("harga");
+ stock= resultSet.getInt("stok");
+ path=resultSet.getString("path");
+
+ %>
+ <%
+ resultSet.beforeFirst();
+ }
+ catch(Exception ex) {
+
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ Statement statement = conn.createStatement();
+ String sql1="select * from barang where id = '"+idbarang+"'";
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+
+ while (resultSet.next()) { %>
+
+
+ <%
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+%>
+
+<%
+
+ if (request.getParameter("tomboleditbrg") != null) {
+ conn=null;
+ result=null;
+ stmt=null;
+ rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ String namabarang=request.getParameter("namabarang");
+ Statement statement = conn.createStatement();
+ String sql1="select * from barang where namabarang = '"+namabarang+"'";
+ ResultSet resultSet = statement.executeQuery(sql1);
+ int jumlah;
+ try {
+ resultSet.last();
+ jumlah = resultSet.getRow();
+ resultSet.beforeFirst();
+ }
+ catch(Exception ex) {
+ jumlah=0;
+ }
+ String email=request.getParameter("email");
+
+ System.out.println(jumlah);
+
+ if (jumlah==0 || (jumlah==1 && namabarang.equals(namabrg)==true)) {
+ System.out.println(namabarang);
+ System.out.println(request.getParameter("hargabarang"));
+ System.out.println(request.getParameter("stokbarang"));
+ PreparedStatement stmt2 = conn.prepareStatement("update barang set namabarang=?,harga=?,stok=? where id = '"+idbarang+"'");
+ stmt2.setString(1, request.getParameter("namabarang"));
+ stmt2.setInt(2, Integer.parseInt(request.getParameter("hargabarang")));
+ stmt2.setInt(3, Integer.parseInt(request.getParameter("stokbarang")));
+
+ int count = stmt2.executeUpdate();
+ if (count==0) {
+ %> <%
+ } else {
+ %> <%
+ }
+ %> <%
+ } else {
+ %> <%
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+%>
+
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/editprofile.jsp b/WebContent/editprofile.jsp
new file mode 100644
index 0000000..3a66e37
--- /dev/null
+++ b/WebContent/editprofile.jsp
@@ -0,0 +1,238 @@
+<%@include file="header.jsp"%>
+
+
+Edit Profile
+
+
+
+
+
+
+<%
+ /************************************* dummy *********************/
+ String nama = "";
+ String pwd = "";
+ String namalengkap = "";
+ String telepon = "";
+ String alamat = "";
+ String kabupaten = "";
+ String provinsi = "";
+ String kodepos = "";
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ nama = ses.getAttribute("user").toString();
+ Statement statement = conn.createStatement();
+ String sql1="select * from user where username = '"+nama+"'";
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+
+ try {
+ resultSet.last();
+ pwd = resultSet.getString("password");
+ namalengkap = resultSet.getString("fullname");
+ telepon = resultSet.getString("telepon");
+ alamat = resultSet.getString("alamat");
+ kabupaten = resultSet.getString("kabupaten");
+ provinsi = resultSet.getString("provinsi");
+ kodepos = resultSet.getString("kodepos");
+
+ %>
+
+
+
+
+
+ <%
+ resultSet.beforeFirst();
+ }
+ catch(Exception ex) {
+
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+%>
+<%
+if (request.getParameter("save") != null) {
+ System.out.println(request.getParameter("kode"));
+ System.out.println(kodepos);
+ if (pwd.equals(request.getParameter("password"))
+ && namalengkap.equals(request.getParameter("namalengkap"))
+ && telepon.equals(request.getParameter("hp")) && alamat.equals(request.getParameter("almt"))
+ && kabupaten.equals(request.getParameter("kab")) && provinsi.equals(request.getParameter("prov"))
+ && kodepos.equals(request.getParameter("kode"))) {
+ %>
+ <%
+ }
+ else {
+
+ conn=null;
+ result=null;
+ stmt=null;
+ rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ PreparedStatement stmt2 = conn.prepareStatement("update user set fullname=?,password=?,alamat=?,kabupaten=?,provinsi=?,kodepos=?,telepon=? where username = '"+nama+"'");
+ stmt2.setString(1, request.getParameter("namalengkap"));
+ stmt2.setString(2, request.getParameter("password"));
+ stmt2.setString(3, request.getParameter("almt"));
+ stmt2.setString(4, request.getParameter("kab"));
+ stmt2.setString(5, request.getParameter("prov"));
+ stmt2.setString(6, request.getParameter("kode"));
+ stmt2.setString(7, request.getParameter("hp"));
+
+
+ int count = stmt2.executeUpdate();
+ if (count==0) {
+ %> <%
+ }
+ %> <%
+
+ }
+
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+}
+%>
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/header.jsp b/WebContent/header.jsp
new file mode 100644
index 0000000..6a9feeb
--- /dev/null
+++ b/WebContent/header.jsp
@@ -0,0 +1,212 @@
+<%@ page import = "javax.servlet.*"%>
+<%@ page import = "javax.servlet.http.*"%>
+<%@ page import = "java.sql.*"%>
+<%@ page import = "javax.sql.*"%>
+<%@ page import = "javax.servlet.http.Cookie"%>
+
+<% HttpSession ses = request.getSession(true); %>
+<%
+boolean is_signedin=false;
+boolean is_admin=false;
+Cookie cookie = null;
+Cookie[] cookies = null;
+// Get an array of Cookies associated with this domain
+cookies = request.getCookies();
+if( cookies != null ){
+ String usernamecookie;
+ for (int i = 0; i < cookies.length; i++){
+ cookie = cookies[i];
+ if (cookie.getName().equals("cusername")) {
+ usernamecookie=cookie.getValue();
+ ses.setAttribute("user", usernamecookie);
+ }
+ }
+}
+String user = (String)ses.getAttribute("user");
+//ses.invalidate();
+if (user==null) {
+ is_signedin=false;
+}else {
+ is_signedin=true;
+ if (user.equals("admin")) {
+ is_admin=true;
+ }
+}
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<% if (request.getParameter("submit") != null) {
+ boolean berhasil=false;
+ String username=request.getParameter("username");
+ String password=request.getParameter("password");
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ String loginmessage=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ System.out.println("Error!!!!!!" + e);
+ }
+
+
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+ PreparedStatement stmt2 = conn.prepareStatement("select * from user where username='"+username+"' and password='"+password+"'");
+ result=stmt2.executeQuery();
+ int jumlah;
+ try {
+ result.last();
+ jumlah = result.getRow();
+ result.beforeFirst();
+ }
+ catch(Exception ex) {
+ jumlah=0;
+ }
+
+ if (jumlah==1) {
+ ses.setAttribute("user", username);
+
+ // Create cookies for first and last names.
+ Cookie cusername = new Cookie("user",username);
+ Cookie cpassword = new Cookie("pass",password);
+
+ // Set expiry date after 24 Hrs for both the cookies.
+ cusername.setMaxAge(60*60*24*30);
+ cusername.setMaxAge(60*60*24*30);
+
+ // Add both the cookies in the response header.
+ response.addCookie( cusername );
+ response.addCookie( cpassword );
+
+ berhasil=true;
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+ if (berhasil==false) {
+ %> <%
+ } else {
+ %> <%
+ }
+} %>
+
diff --git a/WebContent/images/Thumbs.db b/WebContent/images/Thumbs.db
new file mode 100644
index 0000000..033f55c
Binary files /dev/null and b/WebContent/images/Thumbs.db differ
diff --git a/WebContent/images/bg.png b/WebContent/images/bg.png
new file mode 100644
index 0000000..449f757
Binary files /dev/null and b/WebContent/images/bg.png differ
diff --git a/WebContent/images/bg1.png b/WebContent/images/bg1.png
new file mode 100644
index 0000000..c308978
Binary files /dev/null and b/WebContent/images/bg1.png differ
diff --git a/WebContent/images/bg3.jpg b/WebContent/images/bg3.jpg
new file mode 100644
index 0000000..3ea277f
Binary files /dev/null and b/WebContent/images/bg3.jpg differ
diff --git a/WebContent/images/cartlogo.jpg b/WebContent/images/cartlogo.jpg
new file mode 100644
index 0000000..f9bc7dd
Binary files /dev/null and b/WebContent/images/cartlogo.jpg differ
diff --git a/WebContent/images/cartlogo.png b/WebContent/images/cartlogo.png
new file mode 100644
index 0000000..ccfa3a0
Binary files /dev/null and b/WebContent/images/cartlogo.png differ
diff --git a/WebContent/images/e86e26e299b55ddb7aaf63a7374a4f.gif b/WebContent/images/e86e26e299b55ddb7aaf63a7374a4f.gif
new file mode 100644
index 0000000..aa06b34
Binary files /dev/null and b/WebContent/images/e86e26e299b55ddb7aaf63a7374a4f.gif differ
diff --git a/WebContent/images/form_bg.jpg b/WebContent/images/form_bg.jpg
new file mode 100644
index 0000000..dc6574a
Binary files /dev/null and b/WebContent/images/form_bg.jpg differ
diff --git a/WebContent/images/gambarProduk/Buncis-Mini-300x282.jpg b/WebContent/images/gambarProduk/Buncis-Mini-300x282.jpg
new file mode 100644
index 0000000..a105993
Binary files /dev/null and b/WebContent/images/gambarProduk/Buncis-Mini-300x282.jpg differ
diff --git a/WebContent/images/gambarProduk/FA_0068-Bayam-copy-300x300.jpg b/WebContent/images/gambarProduk/FA_0068-Bayam-copy-300x300.jpg
new file mode 100644
index 0000000..6f284fb
Binary files /dev/null and b/WebContent/images/gambarProduk/FA_0068-Bayam-copy-300x300.jpg differ
diff --git a/WebContent/images/gambarProduk/FA_0071-Buncis-copy-300x300.jpg b/WebContent/images/gambarProduk/FA_0071-Buncis-copy-300x300.jpg
new file mode 100644
index 0000000..cb6f363
Binary files /dev/null and b/WebContent/images/gambarProduk/FA_0071-Buncis-copy-300x300.jpg differ
diff --git a/WebContent/images/gambarProduk/FA_0131brokoli-300x300.jpg b/WebContent/images/gambarProduk/FA_0131brokoli-300x300.jpg
new file mode 100644
index 0000000..3444193
Binary files /dev/null and b/WebContent/images/gambarProduk/FA_0131brokoli-300x300.jpg differ
diff --git a/WebContent/images/gambarProduk/GRH.jpg b/WebContent/images/gambarProduk/GRH.jpg
new file mode 100644
index 0000000..4f0e225
Binary files /dev/null and b/WebContent/images/gambarProduk/GRH.jpg differ
diff --git a/WebContent/images/gambarProduk/GRM.jpg b/WebContent/images/gambarProduk/GRM.jpg
new file mode 100644
index 0000000..d4bca01
Binary files /dev/null and b/WebContent/images/gambarProduk/GRM.jpg differ
diff --git a/WebContent/images/gambarProduk/Gucimas.jpg b/WebContent/images/gambarProduk/Gucimas.jpg
new file mode 100644
index 0000000..563e8ec
Binary files /dev/null and b/WebContent/images/gambarProduk/Gucimas.jpg differ
diff --git a/WebContent/images/gambarProduk/KRH.jpg b/WebContent/images/gambarProduk/KRH.jpg
new file mode 100644
index 0000000..a33eeea
Binary files /dev/null and b/WebContent/images/gambarProduk/KRH.jpg differ
diff --git a/WebContent/images/gambarProduk/KRM.jpg b/WebContent/images/gambarProduk/KRM.jpg
new file mode 100644
index 0000000..8ec3b99
Binary files /dev/null and b/WebContent/images/gambarProduk/KRM.jpg differ
diff --git a/WebContent/images/gambarProduk/MYRICE.jpg b/WebContent/images/gambarProduk/MYRICE.jpg
new file mode 100644
index 0000000..482de6d
Binary files /dev/null and b/WebContent/images/gambarProduk/MYRICE.jpg differ
diff --git a/WebContent/images/gambarProduk/Paru.jpg b/WebContent/images/gambarProduk/Paru.jpg
new file mode 100644
index 0000000..6dc4553
Binary files /dev/null and b/WebContent/images/gambarProduk/Paru.jpg differ
diff --git a/WebContent/images/gambarProduk/Tenderloin.jpg b/WebContent/images/gambarProduk/Tenderloin.jpg
new file mode 100644
index 0000000..103364e
Binary files /dev/null and b/WebContent/images/gambarProduk/Tenderloin.jpg differ
diff --git a/WebContent/images/gambarProduk/alpukat.jpg b/WebContent/images/gambarProduk/alpukat.jpg
new file mode 100644
index 0000000..7a96039
Binary files /dev/null and b/WebContent/images/gambarProduk/alpukat.jpg differ
diff --git a/WebContent/images/gambarProduk/bakso.jpg b/WebContent/images/gambarProduk/bakso.jpg
new file mode 100644
index 0000000..33d1ec7
Binary files /dev/null and b/WebContent/images/gambarProduk/bakso.jpg differ
diff --git a/WebContent/images/gambarProduk/bayam-merah3.jpg b/WebContent/images/gambarProduk/bayam-merah3.jpg
new file mode 100644
index 0000000..7d8aab1
Binary files /dev/null and b/WebContent/images/gambarProduk/bayam-merah3.jpg differ
diff --git a/WebContent/images/gambarProduk/blueberry-delight.jpg b/WebContent/images/gambarProduk/blueberry-delight.jpg
new file mode 100644
index 0000000..ad1513a
Binary files /dev/null and b/WebContent/images/gambarProduk/blueberry-delight.jpg differ
diff --git a/WebContent/images/gambarProduk/burgundy-drops.jpg b/WebContent/images/gambarProduk/burgundy-drops.jpg
new file mode 100644
index 0000000..5bf52bf
Binary files /dev/null and b/WebContent/images/gambarProduk/burgundy-drops.jpg differ
diff --git a/WebContent/images/gambarProduk/canteloupe-340x340.jpg b/WebContent/images/gambarProduk/canteloupe-340x340.jpg
new file mode 100644
index 0000000..c2a1d8f
Binary files /dev/null and b/WebContent/images/gambarProduk/canteloupe-340x340.jpg differ
diff --git a/WebContent/images/gambarProduk/choco-loaf.jpg b/WebContent/images/gambarProduk/choco-loaf.jpg
new file mode 100644
index 0000000..f1f38f4
Binary files /dev/null and b/WebContent/images/gambarProduk/choco-loaf.jpg differ
diff --git a/WebContent/images/gambarProduk/cotton-melting-cheese.jpg b/WebContent/images/gambarProduk/cotton-melting-cheese.jpg
new file mode 100644
index 0000000..34ecce4
Binary files /dev/null and b/WebContent/images/gambarProduk/cotton-melting-cheese.jpg differ
diff --git a/WebContent/images/gambarProduk/cotton-wheat-kismis.jpg b/WebContent/images/gambarProduk/cotton-wheat-kismis.jpg
new file mode 100644
index 0000000..c5b7035
Binary files /dev/null and b/WebContent/images/gambarProduk/cotton-wheat-kismis.jpg differ
diff --git a/WebContent/images/gambarProduk/dau-genjer-300x300.jpg b/WebContent/images/gambarProduk/dau-genjer-300x300.jpg
new file mode 100644
index 0000000..0cbd856
Binary files /dev/null and b/WebContent/images/gambarProduk/dau-genjer-300x300.jpg differ
diff --git a/WebContent/images/gambarProduk/daun-kacang-151x151.jpg b/WebContent/images/gambarProduk/daun-kacang-151x151.jpg
new file mode 100644
index 0000000..544e80b
Binary files /dev/null and b/WebContent/images/gambarProduk/daun-kacang-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/daun-katuk-151x151.jpg b/WebContent/images/gambarProduk/daun-katuk-151x151.jpg
new file mode 100644
index 0000000..c4d7245
Binary files /dev/null and b/WebContent/images/gambarProduk/daun-katuk-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/daun-ketumbar-151x151.jpg b/WebContent/images/gambarProduk/daun-ketumbar-151x151.jpg
new file mode 100644
index 0000000..8c34c9a
Binary files /dev/null and b/WebContent/images/gambarProduk/daun-ketumbar-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/daun-melinjo-151x151.jpg b/WebContent/images/gambarProduk/daun-melinjo-151x151.jpg
new file mode 100644
index 0000000..dfb828d
Binary files /dev/null and b/WebContent/images/gambarProduk/daun-melinjo-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/daun-singkong-151x151.jpg b/WebContent/images/gambarProduk/daun-singkong-151x151.jpg
new file mode 100644
index 0000000..d73e0d9
Binary files /dev/null and b/WebContent/images/gambarProduk/daun-singkong-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/dendeng.jpg b/WebContent/images/gambarProduk/dendeng.jpg
new file mode 100644
index 0000000..5fba9bd
Binary files /dev/null and b/WebContent/images/gambarProduk/dendeng.jpg differ
diff --git a/WebContent/images/gambarProduk/fuji-apel-340x340.jpg b/WebContent/images/gambarProduk/fuji-apel-340x340.jpg
new file mode 100644
index 0000000..c864d08
Binary files /dev/null and b/WebContent/images/gambarProduk/fuji-apel-340x340.jpg differ
diff --git a/WebContent/images/gambarProduk/fuyu-persimmons-151x151.jpg b/WebContent/images/gambarProduk/fuyu-persimmons-151x151.jpg
new file mode 100644
index 0000000..c46aaa4
Binary files /dev/null and b/WebContent/images/gambarProduk/fuyu-persimmons-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/hati.jpg b/WebContent/images/gambarProduk/hati.jpg
new file mode 100644
index 0000000..d2d9834
Binary files /dev/null and b/WebContent/images/gambarProduk/hati.jpg differ
diff --git a/WebContent/images/gambarProduk/iga.jpg b/WebContent/images/gambarProduk/iga.jpg
new file mode 100644
index 0000000..44a6448
Binary files /dev/null and b/WebContent/images/gambarProduk/iga.jpg differ
diff --git a/WebContent/images/gambarProduk/jeruk-navel-australia-340x340.jpg b/WebContent/images/gambarProduk/jeruk-navel-australia-340x340.jpg
new file mode 100644
index 0000000..2f16b8c
Binary files /dev/null and b/WebContent/images/gambarProduk/jeruk-navel-australia-340x340.jpg differ
diff --git a/WebContent/images/gambarProduk/lettuce_iceberg-151x151.jpg b/WebContent/images/gambarProduk/lettuce_iceberg-151x151.jpg
new file mode 100644
index 0000000..3c7766c
Binary files /dev/null and b/WebContent/images/gambarProduk/lettuce_iceberg-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/lidah.jpg b/WebContent/images/gambarProduk/lidah.jpg
new file mode 100644
index 0000000..10dbe5d
Binary files /dev/null and b/WebContent/images/gambarProduk/lidah.jpg differ
diff --git a/WebContent/images/gambarProduk/nugget.jpg b/WebContent/images/gambarProduk/nugget.jpg
new file mode 100644
index 0000000..6fe4976
Binary files /dev/null and b/WebContent/images/gambarProduk/nugget.jpg differ
diff --git a/WebContent/images/gambarProduk/otak2.jpg b/WebContent/images/gambarProduk/otak2.jpg
new file mode 100644
index 0000000..716a2dc
Binary files /dev/null and b/WebContent/images/gambarProduk/otak2.jpg differ
diff --git a/WebContent/images/gambarProduk/pepaya california-340x340.jpg b/WebContent/images/gambarProduk/pepaya california-340x340.jpg
new file mode 100644
index 0000000..6343577
Binary files /dev/null and b/WebContent/images/gambarProduk/pepaya california-340x340.jpg differ
diff --git a/WebContent/images/gambarProduk/pepino-151x151.jpg b/WebContent/images/gambarProduk/pepino-151x151.jpg
new file mode 100644
index 0000000..245110e
Binary files /dev/null and b/WebContent/images/gambarProduk/pepino-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/pisang-cavendish-banana-151x151.jpg b/WebContent/images/gambarProduk/pisang-cavendish-banana-151x151.jpg
new file mode 100644
index 0000000..0cf69a7
Binary files /dev/null and b/WebContent/images/gambarProduk/pisang-cavendish-banana-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/pisang-kepok-151x151.jpg b/WebContent/images/gambarProduk/pisang-kepok-151x151.jpg
new file mode 100644
index 0000000..a4f0860
Binary files /dev/null and b/WebContent/images/gambarProduk/pisang-kepok-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/pisang-raja-151x151.jpg b/WebContent/images/gambarProduk/pisang-raja-151x151.jpg
new file mode 100644
index 0000000..7e7a6da
Binary files /dev/null and b/WebContent/images/gambarProduk/pisang-raja-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/salak-pondok-151x151.jpg b/WebContent/images/gambarProduk/salak-pondok-151x151.jpg
new file mode 100644
index 0000000..d57b0e6
Binary files /dev/null and b/WebContent/images/gambarProduk/salak-pondok-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/siomay.jpg b/WebContent/images/gambarProduk/siomay.jpg
new file mode 100644
index 0000000..1167f82
Binary files /dev/null and b/WebContent/images/gambarProduk/siomay.jpg differ
diff --git a/WebContent/images/gambarProduk/sirsak-151x151.jpg b/WebContent/images/gambarProduk/sirsak-151x151.jpg
new file mode 100644
index 0000000..ce74ce5
Binary files /dev/null and b/WebContent/images/gambarProduk/sirsak-151x151.jpg differ
diff --git a/WebContent/images/gambarProduk/sosis.jpg b/WebContent/images/gambarProduk/sosis.jpg
new file mode 100644
index 0000000..93322fb
Binary files /dev/null and b/WebContent/images/gambarProduk/sosis.jpg differ
diff --git a/WebContent/images/gambarProduk/strawberries-340x340.jpg b/WebContent/images/gambarProduk/strawberries-340x340.jpg
new file mode 100644
index 0000000..e9f70a2
Binary files /dev/null and b/WebContent/images/gambarProduk/strawberries-340x340.jpg differ
diff --git a/WebContent/images/gambarProduk/thompson-340x340.jpg b/WebContent/images/gambarProduk/thompson-340x340.jpg
new file mode 100644
index 0000000..09d0333
Binary files /dev/null and b/WebContent/images/gambarProduk/thompson-340x340.jpg differ
diff --git a/WebContent/images/img01.jpg b/WebContent/images/img01.jpg
new file mode 100644
index 0000000..89be1df
Binary files /dev/null and b/WebContent/images/img01.jpg differ
diff --git a/WebContent/images/img03.jpg b/WebContent/images/img03.jpg
new file mode 100644
index 0000000..b560d4c
Binary files /dev/null and b/WebContent/images/img03.jpg differ
diff --git a/WebContent/images/img04.jpg b/WebContent/images/img04.jpg
new file mode 100644
index 0000000..f83c650
Binary files /dev/null and b/WebContent/images/img04.jpg differ
diff --git a/WebContent/images/itb.jpg b/WebContent/images/itb.jpg
new file mode 100644
index 0000000..b06a4d8
Binary files /dev/null and b/WebContent/images/itb.jpg differ
diff --git a/WebContent/images/logo1.png b/WebContent/images/logo1.png
new file mode 100644
index 0000000..e66e765
Binary files /dev/null and b/WebContent/images/logo1.png differ
diff --git a/WebContent/images/logo10.gif b/WebContent/images/logo10.gif
new file mode 100644
index 0000000..bc3051a
Binary files /dev/null and b/WebContent/images/logo10.gif differ
diff --git a/WebContent/images/logo11.gif b/WebContent/images/logo11.gif
new file mode 100644
index 0000000..5ffe314
Binary files /dev/null and b/WebContent/images/logo11.gif differ
diff --git a/WebContent/images/logo2.png b/WebContent/images/logo2.png
new file mode 100644
index 0000000..00cc390
Binary files /dev/null and b/WebContent/images/logo2.png differ
diff --git a/WebContent/images/logo3.gif b/WebContent/images/logo3.gif
new file mode 100644
index 0000000..f055555
Binary files /dev/null and b/WebContent/images/logo3.gif differ
diff --git a/WebContent/images/logo4.gif b/WebContent/images/logo4.gif
new file mode 100644
index 0000000..3cef18f
Binary files /dev/null and b/WebContent/images/logo4.gif differ
diff --git a/WebContent/images/logo5.gif b/WebContent/images/logo5.gif
new file mode 100644
index 0000000..4e03a32
Binary files /dev/null and b/WebContent/images/logo5.gif differ
diff --git a/WebContent/images/logo6.gif b/WebContent/images/logo6.gif
new file mode 100644
index 0000000..3e3f64c
Binary files /dev/null and b/WebContent/images/logo6.gif differ
diff --git a/WebContent/images/logo7.gif b/WebContent/images/logo7.gif
new file mode 100644
index 0000000..373b197
Binary files /dev/null and b/WebContent/images/logo7.gif differ
diff --git a/WebContent/images/logo8.gif b/WebContent/images/logo8.gif
new file mode 100644
index 0000000..68518b8
Binary files /dev/null and b/WebContent/images/logo8.gif differ
diff --git a/WebContent/images/logo9.gif b/WebContent/images/logo9.gif
new file mode 100644
index 0000000..c03e0c2
Binary files /dev/null and b/WebContent/images/logo9.gif differ
diff --git a/WebContent/index.jsp b/WebContent/index.jsp
new file mode 100644
index 0000000..61d8307
--- /dev/null
+++ b/WebContent/index.jsp
@@ -0,0 +1,150 @@
+<%@include file="header.jsp"%>
+
+
+
+
+
+ Barang Terlaris
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/logout.jsp b/WebContent/logout.jsp
new file mode 100644
index 0000000..d20eac0
--- /dev/null
+++ b/WebContent/logout.jsp
@@ -0,0 +1,41 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+
+
+
+
+Insert title here
+
+
+
+
+
+
+<%@ page import = "javax.servlet.*"%>
+<%@ page import = "javax.servlet.http.*"%>
+<%@ page import = "java.sql.*"%>
+<%@ page import = "javax.sql.*"%>
+<% HttpSession ses = request.getSession(true); %>
+<%
+
+ ses.invalidate();
+ %> <%
+
+ Cookie cookie = null;
+ Cookie[] cookies = null;
+ // Get an array of Cookies associated with this domain
+ cookies = request.getCookies();
+ if( cookies != null ){
+ for (int i = 0; i < cookies.length; i++){
+ cookie = cookies[i];
+ if((cookie.getName( )).compareTo("first_name") == 0 ){
+ cookie.setMaxAge(0);
+ response.addCookie(cookie);
+ }
+ }
+ }
+
+%>
\ No newline at end of file
diff --git a/WebContent/profile.jsp b/WebContent/profile.jsp
new file mode 100644
index 0000000..950b851
--- /dev/null
+++ b/WebContent/profile.jsp
@@ -0,0 +1,72 @@
+<%@include file="header.jsp"%>
+
+
+profile
+
+
+
+<%
+ /************************** dummy ***********************/
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ String nama = ses.getAttribute("user").toString();
+ Statement statement = conn.createStatement();
+ String sql1="select * from user where username = '"+nama+"'";
+
+ ResultSet resultSet = statement.executeQuery(sql1);
+
+ try {
+ resultSet.last();
+
+
+
+ %>
+
+
+
+
+
+ <%
+ resultSet.beforeFirst();
+ }
+ catch(Exception ex) {
+
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+
+%>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/registrasi.jsp b/WebContent/registrasi.jsp
new file mode 100644
index 0000000..93212bf
--- /dev/null
+++ b/WebContent/registrasi.jsp
@@ -0,0 +1,211 @@
+<%@include file="header.jsp"%>
+
+
+
+<%
+ if (user!=null) {
+ is_signedin=false;
+ %> <%
+ }
+%>
+
+
+
+<%
+
+ if (request.getParameter("tombolreg") != null) {
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+
+ String nama=request.getParameter("username");
+ Statement statement = conn.createStatement();
+ String sql1="select * from user where username = '"+nama+"'";
+ ResultSet resultSet = statement.executeQuery(sql1);
+ int jumlah;
+ try {
+ resultSet.last();
+ jumlah = resultSet.getRow();
+ resultSet.beforeFirst();
+ }
+ catch(Exception ex) {
+ jumlah=0;
+ }
+ String email=request.getParameter("email");
+ String sql2="select * from user where email = '"+email+"';";
+ ResultSet resultSet2 = statement.executeQuery(sql2);
+ int jumlah2;
+ try {
+ resultSet.last();
+ jumlah2 = resultSet.getRow();
+ resultSet.beforeFirst();
+ }
+ catch(Exception ex) {
+ jumlah2=0;
+ }
+
+ if (jumlah==0 && jumlah2==0) {
+ PreparedStatement stmt2 = conn.prepareStatement("insert into user (username,email,fullname,password,alamat,kabupaten,provinsi,kodepos,telepon,nokartukredit,namadikartu,dateexp,cookie_id,cookie_expire)value(?,?,?,?,?,?,?,?,?,null,null,null,null,null)");
+ stmt2.setString(1, nama);
+ stmt2.setString(2, email);
+ stmt2.setString(3, request.getParameter("namalengkap"));
+ stmt2.setString(4, request.getParameter("password"));
+ stmt2.setString(5, request.getParameter("almt"));
+ stmt2.setString(6, request.getParameter("kab"));
+ stmt2.setString(7, request.getParameter("prov"));
+ stmt2.setString(8, request.getParameter("kode"));
+ stmt2.setString(9, request.getParameter("hp"));
+ stmt2.executeUpdate();
+ ses.setAttribute("user",nama);
+
+ // Create cookies for first and last names.
+ Cookie cusername = new Cookie("user",nama);
+ Cookie cpassword = new Cookie("pass",request.getParameter("password"));
+
+ // Set expiry date after 24 Hrs for both the cookies.
+ cusername.setMaxAge(60*60*24*30);
+ cusername.setMaxAge(60*60*24*30);
+
+ // Add both the cookies in the response header.
+ response.addCookie( cusername );
+ response.addCookie( cpassword );
+ if (conn != null){
+ conn.close();
+ }
+ %> <%
+ }else {
+ %> <%
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+%>
+
+
\ No newline at end of file
diff --git a/WebContent/registrasikartu.jsp b/WebContent/registrasikartu.jsp
new file mode 100644
index 0000000..0f0dbf5
--- /dev/null
+++ b/WebContent/registrasikartu.jsp
@@ -0,0 +1,76 @@
+<%@ page import = "java.sql.*"%>
+<%@ page import = "javax.sql.*"%>
+<%@ page import = "java.util.regex.Matcher"%>
+<%@ page import = "java.util.regex.Pattern"%>
+<%@ page import = "java.util.Date.*"%>
+
+<%@include file="header.jsp"%>
+
+
+
+
+
+
+
+
+
+<%
+ if (request.getParameter("register") != null) {
+ Connection conn=null;
+ ResultSet result=null;
+ Statement stmt=null;
+ ResultSetMetaData rsmd=null;
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ out.write("Error!!!!!!" + e);
+ }
+ try {
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+ String nomor=request.getParameter("nomorkartu");
+ String nama=request.getParameter("namakartu");
+ String username=(String) ses.getAttribute("user");
+
+ Pattern pattern1= Pattern.compile("^[_0-9]{10,}$");
+ Pattern pattern2= Pattern.compile("^[_A-Za-z0-9]* [_A-Za-z0-9]*$");
+
+ Matcher m=(pattern1).matcher(nomor);
+ Matcher m2=(pattern2).matcher(nama);
+ if (m.matches()==true && m2.matches()==true) {
+
+ Statement statement = conn.createStatement();
+ PreparedStatement stmt2 = conn.prepareStatement("UPDATE user SET nokartukredit=?,namadikartu=?,dateexp=? WHERE username='"+username+"'");
+ stmt2.setString(1,nomor);
+ stmt2.setString(2,nama);
+ stmt2.setString(3,request.getParameter("tanggalexp"));
+ int row=stmt2.executeUpdate();
+ if (row==0) {
+ %><%
+ }else {
+ if (conn != null){
+ conn.close();
+ }
+ %> <%
+ }
+ } else {
+ %><%
+ }
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+%>
\ No newline at end of file
diff --git a/WebContent/response.jsp b/WebContent/response.jsp
new file mode 100644
index 0000000..eceec48
--- /dev/null
+++ b/WebContent/response.jsp
@@ -0,0 +1,13 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+
+
+
+Upload File Response
+
+
+ <%-- Using JSP EL to get message attribute value from request scope --%>
+ ${requestScope.message}
+
+
\ No newline at end of file
diff --git a/WebContent/search.jsp b/WebContent/search.jsp
new file mode 100644
index 0000000..979c32a
--- /dev/null
+++ b/WebContent/search.jsp
@@ -0,0 +1,114 @@
+<%@include file="header.jsp"%>
+
+
+
+
+
+
+
+
+<%
+ if (request.getParameter("search")!=null) {
+ String namabarang=request.getParameter("namabarang");
+ String kategori=request.getParameter("kategori");
+ System.out.println(kategori);
+ String harga=request.getParameter("harga");
+ System.out.println(harga);
+ int atas=0; int bawah=0;
+ if (harga.equals("0")) {
+ bawah=0;
+ atas=99999999;
+ } else if (harga.equals("1")) {
+ bawah=0;
+ atas=10000;
+ } else if (harga.equals("2")) {
+ bawah=10000;
+ atas=25000;
+ } else if (harga.equals("3")) {
+ bawah=25000;
+ atas=50000;
+ } else if (harga.equals("4")) {
+ bawah=50000;
+ atas=75000;
+ } else if (harga.equals("5")) {
+ bawah=75000;
+ atas=99999999;
+ }
+
+ if (kategori==null) {
+ kategori="";
+ }
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch(Exception e){
+ System.out.println("Error!!!!!!" + e);
+ }
+
+ if (namabarang!=null) {
+ try {
+ Connection conn=null;
+ ResultSet resultsearch=null;
+ Statement stmt=null;
+ conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/tubesweb",
+ "root","");
+ PreparedStatement stmt3 = conn.prepareStatement("select * from barang where UPPER(namabarang) like UPPER('%"+namabarang+"%') and harga>="+bawah+" and harga <"+atas+" and kategori like '%"+kategori+"%' ");
+ resultsearch=stmt3.executeQuery();
+ int jumlah;
+ try {
+ resultsearch.last();
+ jumlah = resultsearch.getRow();
+ resultsearch.beforeFirst();
+ }
+ catch(Exception ex) {
+ jumlah=0;
+ }
+ System.out.println("jumlah="+jumlah);
+ if (jumlah==0) {
+ %> <%
+ } else {
+ int i=0;
+ while (resultsearch.next()){
+ String path=resultsearch.getString("path");
+ int id=resultsearch.getInt("id");
+ String namabrg= resultsearch.getString("namabarang");
+ int hargab=resultsearch.getInt("harga");
+ if (i%2==0) {
+ %>
+
+ <%
+ %>
+ '
+ <%} else {
+ %>
+
+ <%
+ }
+ i++;
+ }
+
+
+ }
+
+
+ }
+ catch(SQLException e) {
+ System.out.println("Error!!!!!!" + e);
+ }
+ }
+ }
+%>
\ No newline at end of file
diff --git a/WebContent/sebelumadmin.jsp b/WebContent/sebelumadmin.jsp
new file mode 100644
index 0000000..4956d7e
--- /dev/null
+++ b/WebContent/sebelumadmin.jsp
@@ -0,0 +1,12 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+
+
+
+
+Insert title here
+
+
+
+
+
\ No newline at end of file
diff --git a/WebContent/style.css b/WebContent/style.css
new file mode 100644
index 0000000..157bb74
--- /dev/null
+++ b/WebContent/style.css
@@ -0,0 +1,100 @@
+body {
+ background: url(images/bg.png) repeat;
+ color: #000000;
+ padding: 16px;
+ margin: 18px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: left;
+ border-radius: 12px;
+}
+
+div.pagination {
+ padding: 3px;
+ margin: 3px;
+}
+
+div.pagination a {
+ padding: 2px 5px 2px 5px;
+ margin: 2px;
+ border: 1px solid #AAAADD;
+
+ text-decoration: none; /* no underline */
+ color: #000099;
+}
+div.pagination a:hover, div.pagination a:active {
+ border: 1px solid #000099;
+
+ color: #000;
+}
+div.pagination span.current {
+ padding: 2px 5px 2px 5px;
+ margin: 2px;
+ border: 1px solid #000099;
+
+ font-weight: bold;
+ background-color: #000099;
+ color: #FFF;
+ }
+div.pagination span.disabled {
+ padding: 2px 5px 2px 5px;
+ margin: 2px;
+ border: 1px solid #EEE;
+
+ color: #DDD;
+}
+
+
+#combo {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 250px;
+ height: 26px;
+ margin-top:20px;
+ margin-left: 50px;
+ color:#333333;
+ padding:3px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#formproduct1 {
+ background-color: #F29BC7;
+ color: #0f5096;
+ padding: 16px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: center;
+ border-radius: 12px;
+ height:210px;
+}
+
+#formproduct2 {
+ background-color: #FCBDD3;
+ color: #0f5096;
+ padding: 16px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: center;
+ border-radius: 12px;
+ height:210px;
+}
+
+#divproduct {
+ margin-top:10px;
+ width: 1200px;
+ margin-left: auto;
+ margin-right: auto;
+}
\ No newline at end of file
diff --git a/WebContent/styledetail.css b/WebContent/styledetail.css
new file mode 100644
index 0000000..2d11f68
--- /dev/null
+++ b/WebContent/styledetail.css
@@ -0,0 +1,127 @@
+#formdetail {
+ background-color: #F29BC7;
+ color: #871650;
+ padding: 3px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ border-radius: 12px;
+
+}
+
+#divdetail {
+ width: 1200px;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+}
+
+#formchart {
+ background-color: #BFE1F2;
+ color: #0f5096;
+ padding: 20px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ border-radius: 12px;
+
+}
+
+#divchart{
+ width: 600px;
+ margin-left: 45px;
+ margin-right: auto;
+ text-align: left;
+}
+
+#formterlaris1 {
+ background-color: #FCBDD3;
+ color: #871650;
+ padding: 20px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ border-radius: 12px;
+
+}
+
+#divterlaris1{
+ width: 830px;
+ margin-left: 5px;
+ margin-right: auto;
+ text-align: left;
+}
+
+#formterlaris2 {
+ background-color: #F29BC7;
+ color: #871650;
+ padding: 20px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ border-radius: 12px;
+
+}
+
+#divterlaris2{
+ width: 830px;
+ margin-left: 5px;
+ margin-right: auto;
+ text-align: left;
+}
+
+#formpetunjuk{
+ background-color: #da406a;
+ color: #EBEBED;
+ padding: 30px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ border-radius: 12px;
+
+}
+
+#divpetunjuk {
+ width: 50px;
+ margin-left: 5px;
+ margin-right: auto;
+ margin-top: 63px;
+ text-align: left;
+}
+
+#formpetunjuk2{
+ background-color: #F29BC7;
+ color: #871650;
+ padding: 30px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ border-radius: 12px;
+
+}
+
+#divpetunjuk2 {
+ width: 500px;
+ margin-left: 40px;
+ margin-right: auto;
+ margin-top: 63px;
+ text-align: left;
+}
\ No newline at end of file
diff --git a/WebContent/stylekartu.css b/WebContent/stylekartu.css
new file mode 100644
index 0000000..7ad6ca9
--- /dev/null
+++ b/WebContent/stylekartu.css
@@ -0,0 +1,169 @@
+
+body {
+ background: url(images/bg.png) repeat;
+ color: #000000;
+ padding: 16px;
+ margin: 18px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: left;
+ border-radius: 12px;
+}
+
+#divkartu{
+ width: 1200px;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: left;
+}
+
+#form2{
+
+ margin-top:60px;
+ margin-left:45px;
+ font-weight: bolder;
+ color: #da406a;
+ width: 1500px;
+
+}
+
+#nomor {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:40px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#namakartu {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:33px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#tanggal{
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:43px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+
+#tombolkartu{
+ -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ box-shadow:inset 0px 1px 0px 0px #ffffff;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9) );
+ background:-moz-linear-gradient( center top, #f9f9f9 5%, #e9e9e9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9');
+ background-color:#f9f9f9;
+ -webkit-border-top-left-radius:0px;
+ -moz-border-radius-topleft:0px;
+ border-top-left-radius:0px;
+ -webkit-border-top-right-radius:0px;
+ -moz-border-radius-topright:0px;
+ border-top-right-radius:0px;
+ -webkit-border-bottom-right-radius:0px;
+ -moz-border-radius-bottomright:0px;
+ border-bottom-right-radius:0px;
+ -webkit-border-bottom-left-radius:0px;
+ -moz-border-radius-bottomleft:0px;
+ border-bottom-left-radius:0px;
+ text-indent:0;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:#da406a;
+ font-family:Verdana;
+ font-size:15px;
+ font-weight:bold;
+ font-style:normal;
+ height:40px;
+ line-height:40px;
+ width:100px;
+ text-decoration:none;
+ margin-left:275px;
+ margin-top:300px;
+ text-align:center;
+ text-shadow:1px 1px 0px #ffffff;
+}
+#tombolkartu:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9) );
+ background:-moz-linear-gradient( center top, #e9e9e9 5%, #f9f9f9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9');
+ background-color:#e9e9e9;
+}
+#tombolkartu:active {
+ position:relative;
+ top:1px;
+}
+#tombolskip{
+ -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ box-shadow:inset 0px 1px 0px 0px #ffffff;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9) );
+ background:-moz-linear-gradient( center top, #f9f9f9 5%, #e9e9e9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9');
+ background-color:#f9f9f9;
+ -webkit-border-top-left-radius:0px;
+ -moz-border-radius-topleft:0px;
+ border-top-left-radius:0px;
+ -webkit-border-top-right-radius:0px;
+ -moz-border-radius-topright:0px;
+ border-top-right-radius:0px;
+ -webkit-border-bottom-right-radius:0px;
+ -moz-border-radius-bottomright:0px;
+ border-bottom-right-radius:0px;
+ -webkit-border-bottom-left-radius:0px;
+ -moz-border-radius-bottomleft:0px;
+ border-bottom-left-radius:0px;
+ text-indent:0;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:#da406a;
+ font-family:Verdana;
+ font-size:15px;
+ font-weight:bold;
+ font-style:normal;
+ height:40px;
+ line-height:40px;
+ width:100px;
+ text-decoration:none;
+ margin-left:15px;
+ margin-top:300px;
+ text-align:center;
+ text-shadow:1px 1px 0px #ffffff;
+}
+#tombolskip:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9) );
+ background:-moz-linear-gradient( center top, #e9e9e9 5%, #f9f9f9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9');
+ background-color:#e9e9e9;
+}
+#tombolskip:active {
+ position:relative;
+ top:1px;
+}
+
+
diff --git a/WebContent/stylereg.css b/WebContent/stylereg.css
new file mode 100644
index 0000000..a2dcec6
--- /dev/null
+++ b/WebContent/stylereg.css
@@ -0,0 +1,211 @@
+
+body {
+ background-color: #ACDDF2;
+ color: #000000;
+ padding: 16px;
+ margin: 18px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: left;
+ border-radius: 12px;
+}
+
+#divreg{
+
+ width: 1200px;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: left;
+}
+
+#form1{
+
+ margin-top:55px;
+ margin-left:40px;
+ font-weight: bolder;
+ color: #da406a;
+ width: 1200px;
+
+
+}
+
+#username {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:82px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#password {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:83px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#confirm {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:18px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#nama1 {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:45px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#email {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:118px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#hp {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:81px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#alamat {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:108px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#kab {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:76px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#prov {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:97px;
+ margin-bottom:10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#kode {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 350px;
+ color:#333333;
+ padding:3px;
+ margin-right:4px;
+ margin-left:85px;
+ margin-bottom:35px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#tombolreg {
+ -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ box-shadow:inset 0px 1px 0px 0px #ffffff;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9) );
+ background:-moz-linear-gradient( center top, #f9f9f9 5%, #e9e9e9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9');
+ background-color:#f9f9f9;
+ -webkit-border-top-left-radius:0px;
+ -moz-border-radius-topleft:0px;
+ border-top-left-radius:0px;
+ -webkit-border-top-right-radius:0px;
+ -moz-border-radius-topright:0px;
+ border-top-right-radius:0px;
+ -webkit-border-bottom-right-radius:0px;
+ -moz-border-radius-bottomright:0px;
+ border-bottom-right-radius:0px;
+ -webkit-border-bottom-left-radius:0px;
+ -moz-border-radius-bottomleft:0px;
+ border-bottom-left-radius:0px;
+ text-indent:0;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:#da406a;
+ font-family:Verdana;
+ font-size:15px;
+ font-weight:bold;
+ font-style:normal;
+ height:40px;
+ line-height:40px;
+ width:100px;
+ margin-left: 413px;
+ text-decoration:none;
+ text-align:center;
+ text-shadow:1px 1px 0px #ffffff;
+}
+#tombolreg:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9) );
+ background:-moz-linear-gradient( center top, #e9e9e9 5%, #f9f9f9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9');
+ background-color:#e9e9e9;
+}
+#tombolreg:active {
+ position:relative;
+ top:1px;
+}
\ No newline at end of file
diff --git a/WebContent/stylesearch.css b/WebContent/stylesearch.css
new file mode 100644
index 0000000..960d58d
--- /dev/null
+++ b/WebContent/stylesearch.css
@@ -0,0 +1,383 @@
+h {
+ margin-top:2px;
+ margin-bottom:2px;
+}
+
+#formuser{
+ background-color: #F77CD0;
+ color: #ACDDF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ text-align: left;
+ border-radius: 10px;
+ height:33px;
+
+
+}
+
+
+#cartmenu {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 14px;
+ margin-bottom: 50px;
+ font-variant: normal;
+ margin-left: 2px;
+ vertical-align:middle;
+}
+
+
+#logotroli {
+ margin-top: 5px;
+ margin-left:600px;
+ vertical-align:middle;
+}
+
+#menuuser1 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 14px;
+ margin-bottom: 50px;
+ font-variant: normal;
+ margin-left: 20px;
+
+}
+
+#menuuser2 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 14px;
+ margin-bottom: 30px;
+ margin-left: 13px;
+ font-variant: normal;
+}
+
+#welcome {
+ color: #da406a;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 12px;
+ margin-bottom: 30px;
+ font-variant: normal;
+}
+
+#menuuser3 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 14px;
+ margin-bottom: 30px;
+ margin-left: 13px;
+ font-variant: normal;
+}
+
+#menuuser4 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 14px;
+ margin-bottom: 30px;
+ font-variant: normal;
+}
+
+
+
+#formsearch {
+ background-color: #da406a;
+ color: #ACDDF2;
+ padding: 10px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: center;
+ border-radius: 12px;
+ height:170px;
+}
+
+#logo {
+ margin-top: 10px;
+ border-radius: 9px;
+}
+
+#menukategori1 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 18px;
+ margin-bottom: 15px;
+ font-variant: normal;
+ margin-top: 10px;
+}
+
+#menukategori2 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 18px;
+ margin-bottom: 15px;
+ font-variant: normal;
+ margin-top: 10px;
+}
+
+#menukategori3 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 18px;
+ margin-bottom: 15px;
+ margin-top: 10px;
+ font-variant: normal;
+}
+
+#menukategori4 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 18px;
+ margin-bottom: 15px;
+ margin-top: 10px;
+ font-variant: normal;
+}
+
+#menukategori5 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 18px;
+ margin-bottom: 15px;
+ margin-top: 10px;
+ font-variant: normal;
+}
+
+#menukategori6 {
+ color: #EBEFF2;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 18px;
+ margin-bottom: 15px;
+ font-variant: normal;
+ margin-top: 10px;
+}
+
+#divsearch {
+ width: 1200px;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+ color: #da406a;
+}
+
+#nomorbarang {
+ background-color: #D8E2F2;
+ color: #da406a;
+ font-family: helvetica;
+ font-style: bolder;
+ font-weight: normal;
+ font-size: 70px;
+ font-variant: normal;
+ text-align: left;
+ border-radius: 40px;
+ height:px;
+ width:80px;
+ margin-bottom:10px;
+}
+
+#formresult {
+ background-color: #F29BC7;
+ color: #871650;
+ padding: 16px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: center;
+ vertical-align:middle;
+ border-radius: 12px;
+ height:140px;
+ vertical-align:top;
+}
+
+
+#formresult2{
+ background-color: #FCBDD3;
+ color: #871650;
+ padding: 16px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: center;
+ vertical-align:middle;
+ border-radius: 12px;
+ height:140px;
+}
+
+#divresult {
+ width: 1200px;
+ margin-left: auto;
+ margin-right: auto;
+ vertical-align:top;
+}
+
+#namasearch {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 480px;
+ height: 26px;
+ color:#333333;
+ padding:3px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#kat {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 250px;
+ height: 26px;
+ margin-left: 10px;
+ color:#333333;
+ padding:3px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#harga {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ width: 250px;
+ color:#333333;
+ height: 26px;
+ padding:3px;
+ margin-left: 10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+#tombol2 {
+ background-image:url(images/form_bg.jpg);
+ background-repeat:repeat-x;
+ border:1px solid #d1c7ac;
+ color:#333333;
+ height: 26px;
+ padding:3px;
+ margin-left: 10px;
+ font-family:tahoma, arial, sans-serif;
+}
+
+
+body {
+ background: url(images/bg.png) repeat;
+ color: #000000;
+ padding: 16px;
+ margin: 18px;
+ font-family: helvetica;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 16px;
+ font-variant: normal;
+ line-height: 22px;
+ text-align: left;
+ border-radius: 12px;
+}
+
+#tombol{
+ -moz-box-shadow:inset 0px 13px 19px 0px #ffffff;
+ -webkit-box-shadow:inset 0px 13px 19px 0px #ffffff;
+ box-shadow:inset 0px 13px 19px 0px #ffffff;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9) );
+ background:-moz-linear-gradient( center top, #f9f9f9 5%, #e9e9e9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9');
+ background-color:#f9f9f9;
+ -webkit-border-top-left-radius:0px;
+ -moz-border-radius-topleft:0px;
+ border-top-left-radius:0px;
+ -webkit-border-top-right-radius:0px;
+ -moz-border-radius-topright:0px;
+ border-top-right-radius:0px;
+ -webkit-border-bottom-right-radius:0px;
+ -moz-border-radius-bottomright:0px;
+ border-bottom-right-radius:0px;
+ -webkit-border-bottom-left-radius:0px;
+ -moz-border-radius-bottomleft:0px;
+ border-bottom-left-radius:0px;
+ text-indent:0;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:#da406a;
+ font-family:Verdana;
+ font-size:15px;
+ font-weight:bold;
+ font-style:normal;
+ height:26px;
+ line-height:26px;
+ width:70px;
+ text-decoration:none;
+ text-align:center;
+ margin-bottom:10px;
+ margin-left:30px;
+ text-shadow:1px 1px 0px #ffffff;
+}
+#tombol:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9) );
+ background:-moz-linear-gradient( center top, #e9e9e9 5%, #f9f9f9 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9');
+ background-color:#e9e9e9;
+}
+#tombol:active {
+ position:relative;
+ top:1px;
+}
+
+.black_overlay{
+ display: none;
+ position: absolute;
+ top: 0%;
+ left: 0%;
+ width: 100%;
+ height: 100%;
+ background-color: black;
+ z-index:1001;
+ -moz-opacity: 0.8;
+ opacity:.80;
+ filter: alpha(opacity=80);
+ }
+
+ .white_content {
+ display: none;
+ position: absolute;
+ top: 25%;
+ left: 25%;
+ width: 50%;
+ height: 50%;
+ padding: 16px;
+ border: 16px;
+ background-color: #FA66A9;
+ z-index:1002;
+ overflow: auto;
+ }
diff --git a/build/classes/FileUploadServlet.class b/build/classes/FileUploadServlet.class
new file mode 100644
index 0000000..792b645
Binary files /dev/null and b/build/classes/FileUploadServlet.class differ
diff --git a/build/classes/GetHint.class b/build/classes/GetHint.class
new file mode 100644
index 0000000..4b241f8
Binary files /dev/null and b/build/classes/GetHint.class differ
diff --git a/build/classes/commons-fileupload-1.3-javadoc.jar b/build/classes/commons-fileupload-1.3-javadoc.jar
new file mode 100644
index 0000000..6f8e82e
Binary files /dev/null and b/build/classes/commons-fileupload-1.3-javadoc.jar differ
diff --git a/build/classes/commons-fileupload-1.3-sources.jar b/build/classes/commons-fileupload-1.3-sources.jar
new file mode 100644
index 0000000..32b3a5a
Binary files /dev/null and b/build/classes/commons-fileupload-1.3-sources.jar differ
diff --git a/build/classes/commons-fileupload-1.3-test-sources.jar b/build/classes/commons-fileupload-1.3-test-sources.jar
new file mode 100644
index 0000000..bec12be
Binary files /dev/null and b/build/classes/commons-fileupload-1.3-test-sources.jar differ
diff --git a/build/classes/commons-fileupload-1.3-tests.jar b/build/classes/commons-fileupload-1.3-tests.jar
new file mode 100644
index 0000000..639bb6e
Binary files /dev/null and b/build/classes/commons-fileupload-1.3-tests.jar differ
diff --git a/build/classes/commons-fileupload-1.3.jar b/build/classes/commons-fileupload-1.3.jar
new file mode 100644
index 0000000..32f2360
Binary files /dev/null and b/build/classes/commons-fileupload-1.3.jar differ
diff --git a/build/classes/commons-io-2.4-javadoc.jar b/build/classes/commons-io-2.4-javadoc.jar
new file mode 100644
index 0000000..e388f28
Binary files /dev/null and b/build/classes/commons-io-2.4-javadoc.jar differ
diff --git a/build/classes/commons-io-2.4-sources.jar b/build/classes/commons-io-2.4-sources.jar
new file mode 100644
index 0000000..f4ebc7b
Binary files /dev/null and b/build/classes/commons-io-2.4-sources.jar differ
diff --git a/build/classes/commons-io-2.4-test-sources.jar b/build/classes/commons-io-2.4-test-sources.jar
new file mode 100644
index 0000000..88ce974
Binary files /dev/null and b/build/classes/commons-io-2.4-test-sources.jar differ
diff --git a/build/classes/commons-io-2.4-tests.jar b/build/classes/commons-io-2.4-tests.jar
new file mode 100644
index 0000000..bad9e82
Binary files /dev/null and b/build/classes/commons-io-2.4-tests.jar differ
diff --git a/build/classes/commons-io-2.4.jar b/build/classes/commons-io-2.4.jar
new file mode 100644
index 0000000..90035a4
Binary files /dev/null and b/build/classes/commons-io-2.4.jar differ
diff --git a/build/classes/javaws.jar b/build/classes/javaws.jar
new file mode 100644
index 0000000..11399c4
Binary files /dev/null and b/build/classes/javaws.jar differ
diff --git a/build/classes/jce.jar b/build/classes/jce.jar
new file mode 100644
index 0000000..0fa235a
Binary files /dev/null and b/build/classes/jce.jar differ
diff --git a/build/classes/jfr.jar b/build/classes/jfr.jar
new file mode 100644
index 0000000..116882d
Binary files /dev/null and b/build/classes/jfr.jar differ
diff --git a/build/classes/jfxrt.jar b/build/classes/jfxrt.jar
new file mode 100644
index 0000000..9717c2d
Binary files /dev/null and b/build/classes/jfxrt.jar differ
diff --git a/build/classes/jsse.jar b/build/classes/jsse.jar
new file mode 100644
index 0000000..2d6d017
Binary files /dev/null and b/build/classes/jsse.jar differ
diff --git a/build/classes/mysql-connector-java-5.1.27-bin.jar b/build/classes/mysql-connector-java-5.1.27-bin.jar
new file mode 100644
index 0000000..a10268c
Binary files /dev/null and b/build/classes/mysql-connector-java-5.1.27-bin.jar differ
diff --git a/lib/commons-fileupload-1.3-javadoc.jar b/lib/commons-fileupload-1.3-javadoc.jar
new file mode 100644
index 0000000..6f8e82e
Binary files /dev/null and b/lib/commons-fileupload-1.3-javadoc.jar differ
diff --git a/lib/commons-fileupload-1.3-sources.jar b/lib/commons-fileupload-1.3-sources.jar
new file mode 100644
index 0000000..32b3a5a
Binary files /dev/null and b/lib/commons-fileupload-1.3-sources.jar differ
diff --git a/lib/commons-fileupload-1.3-test-sources.jar b/lib/commons-fileupload-1.3-test-sources.jar
new file mode 100644
index 0000000..bec12be
Binary files /dev/null and b/lib/commons-fileupload-1.3-test-sources.jar differ
diff --git a/lib/commons-fileupload-1.3-tests.jar b/lib/commons-fileupload-1.3-tests.jar
new file mode 100644
index 0000000..639bb6e
Binary files /dev/null and b/lib/commons-fileupload-1.3-tests.jar differ
diff --git a/lib/commons-fileupload-1.3.jar b/lib/commons-fileupload-1.3.jar
new file mode 100644
index 0000000..32f2360
Binary files /dev/null and b/lib/commons-fileupload-1.3.jar differ
diff --git a/lib/commons-io-2.4-javadoc.jar b/lib/commons-io-2.4-javadoc.jar
new file mode 100644
index 0000000..e388f28
Binary files /dev/null and b/lib/commons-io-2.4-javadoc.jar differ
diff --git a/lib/commons-io-2.4-sources.jar b/lib/commons-io-2.4-sources.jar
new file mode 100644
index 0000000..f4ebc7b
Binary files /dev/null and b/lib/commons-io-2.4-sources.jar differ
diff --git a/lib/commons-io-2.4-test-sources.jar b/lib/commons-io-2.4-test-sources.jar
new file mode 100644
index 0000000..88ce974
Binary files /dev/null and b/lib/commons-io-2.4-test-sources.jar differ
diff --git a/lib/commons-io-2.4-tests.jar b/lib/commons-io-2.4-tests.jar
new file mode 100644
index 0000000..bad9e82
Binary files /dev/null and b/lib/commons-io-2.4-tests.jar differ
diff --git a/lib/commons-io-2.4.jar b/lib/commons-io-2.4.jar
new file mode 100644
index 0000000..90035a4
Binary files /dev/null and b/lib/commons-io-2.4.jar differ
diff --git a/lib/javaws.jar b/lib/javaws.jar
new file mode 100644
index 0000000..11399c4
Binary files /dev/null and b/lib/javaws.jar differ
diff --git a/lib/jce.jar b/lib/jce.jar
new file mode 100644
index 0000000..0fa235a
Binary files /dev/null and b/lib/jce.jar differ
diff --git a/lib/jfr.jar b/lib/jfr.jar
new file mode 100644
index 0000000..116882d
Binary files /dev/null and b/lib/jfr.jar differ
diff --git a/lib/jfxrt.jar b/lib/jfxrt.jar
new file mode 100644
index 0000000..9717c2d
Binary files /dev/null and b/lib/jfxrt.jar differ
diff --git a/lib/jsse.jar b/lib/jsse.jar
new file mode 100644
index 0000000..2d6d017
Binary files /dev/null and b/lib/jsse.jar differ
diff --git a/lib/mysql-connector-java-5.1.27-bin.jar b/lib/mysql-connector-java-5.1.27-bin.jar
new file mode 100644
index 0000000..a10268c
Binary files /dev/null and b/lib/mysql-connector-java-5.1.27-bin.jar differ
diff --git a/src/FileUploadServlet.java b/src/FileUploadServlet.java
new file mode 100644
index 0000000..5fab2a7
--- /dev/null
+++ b/src/FileUploadServlet.java
@@ -0,0 +1,68 @@
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.MultipartConfig;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.Part;
+
+@WebServlet("/FileUploadServlet")
+@MultipartConfig(fileSizeThreshold=1024*1024*10, // 10 MB
+ maxFileSize=1024*1024*50, // 50 MB
+ maxRequestSize=1024*1024*100) // 100 MB
+public class FileUploadServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 205242440643911308L;
+
+ /**
+ * Directory where uploaded files will be saved, its relative to
+ * the web application directory.
+ */
+ private static final String UPLOAD_DIR = "uploads";
+
+ protected void doPost(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException {
+ // gets absolute path of the web application
+ String applicationPath = request.getServletContext().getRealPath("");
+ // constructs path of the directory to save uploaded file
+ String uploadFilePath = applicationPath + File.separator + UPLOAD_DIR;
+ System.out.println(uploadFilePath);
+
+ // creates the save directory if it does not exists
+ File fileSaveDir = new File(uploadFilePath);
+ if (!fileSaveDir.exists()) {
+ fileSaveDir.mkdirs();
+ }
+ System.out.println("Upload File Directory="+fileSaveDir.getAbsolutePath());
+
+ String fileName = null;
+ //Get all the parts from request and write it to the file on server
+ for (Part part : request.getParts()) {
+ fileName = getFileName(part);
+ part.write(uploadFilePath + File.separator + fileName);
+ }
+
+ request.setAttribute("message", fileName + " File uploaded successfully!");
+ getServletContext().getRequestDispatcher("/response.jsp").forward(
+ request, response);
+ }
+
+ /**
+ * Utility method to get file name from HTTP header content-disposition
+ */
+ private String getFileName(Part part) {
+ String contentDisp = part.getHeader("content-disposition");
+ System.out.println("content-disposition header= "+contentDisp);
+ String[] tokens = contentDisp.split(";");
+ for (String token : tokens) {
+ if (token.trim().startsWith("filename")) {
+ return token.substring(token.indexOf("=") + 2, token.length()-1);
+ }
+ }
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/src/GetHint.java b/src/GetHint.java
new file mode 100644
index 0000000..cf66a09
--- /dev/null
+++ b/src/GetHint.java
@@ -0,0 +1,124 @@
+
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+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 java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@WebServlet("/GetHint")
+public class GetHint extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+ PrintWriter pw;
+
+
+ public GetHint() {
+ super();
+ }
+
+ public void cekEmail(String data,String pass) {
+ String responseteks;
+ String EMAIL_PATTERN =
+ "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
+ Pattern pattern= Pattern.compile(EMAIL_PATTERN);
+ Matcher m=(pattern).matcher(data);
+ if (data.equals(pass)==false && m.matches()==true) {
+ responseteks="";
+ }else {
+ responseteks="Email tidak valid, Email tidak boleh sama dengan password";
+ }
+ pw.print(responseteks);
+
+ }
+
+ public void cekUser(String data,String pass) {
+ String responseteks;
+ String USER_PATTERN =
+ "^[_A-Za-z0-9]{5,}$";
+ Pattern pattern= Pattern.compile(USER_PATTERN);
+ Matcher m=(pattern).matcher(data);
+ if (data.equals(pass)==false && m.matches()==true) {
+ responseteks="";
+ }else {
+ responseteks="Username minimal 5 karakter";
+ }
+ pw.print(responseteks);
+ }
+
+ public void cekPassword(String data, String user) {
+ String responseteks;
+ String PASS_PATTERN =
+ "^[_A-Za-z0-9]{8,}$";
+ Pattern pattern= Pattern.compile(PASS_PATTERN);
+ Matcher m=(pattern).matcher(data);
+ if (data.equals(user)==false && m.matches()==true) {
+ responseteks="";
+ }else {
+ responseteks="Password minimal 8 karakter,tidak sama dengan username";
+ }
+ pw.print(responseteks);
+ }
+
+ public void cekConfirmPassword(String data, String pass) {
+ String responseteks;
+ if (data.equals(pass)==false ) {
+ responseteks="Harus sama dengan password";
+ }else {
+ responseteks="";
+ }
+ pw.print(responseteks);
+ }
+
+ public void cekNama(String data) {
+ String responseteks;
+ String NAME_PATTERN =
+ "^[_A-Za-z0-9]* [_A-Za-z0-9]*$";
+ Pattern pattern= Pattern.compile(NAME_PATTERN);
+ Matcher m=(pattern).matcher(data);
+ if (m.matches()==true) {
+ responseteks="";
+ }else {
+ responseteks="Minimal mengandung 1 spasi";
+ }
+ pw.print(responseteks);
+ }
+
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ if (request.getParameter("tombolreg") == null ) {
+ String data=request.getParameter("data");
+ String jenis=request.getParameter("jenis");
+
+ pw=response.getWriter();
+ response.setContentType("text/plain");
+
+ if(jenis.equals("email")) {
+ String pass=request.getParameter("pass");
+ cekEmail(data,pass);
+ }else if(jenis.equals("user")) {
+ String pass=request.getParameter("pass");
+ cekUser(data,pass);
+ }else if(jenis.equals("pass")) {
+ String user=request.getParameter("user");
+ cekPassword(data,user);
+ }else if(jenis.equals("cpass")) {
+ String pass=request.getParameter("password");
+ cekConfirmPassword(data,pass);
+ }else if (jenis.equals("nama")) {
+ cekNama(data);
+ }
+ }
+
+ }
+
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ doGet(request, response);
+ }
+
+}