diff --git a/addItem.jsp b/addItem.jsp
new file mode 100644
index 0000000..9286e5b
--- /dev/null
+++ b/addItem.jsp
@@ -0,0 +1,41 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+ String query = "SELECT jumlah FROM cart WHERE username=? AND namabarang=?";
+ PreparedStatement st = con.prepareStatement(query);
+ st.setString(1, request.getParameter("username"));
+ st.setString(2, request.getParameter("namabarang"));
+
+ ResultSet rs = st.executeQuery();
+ if (rs.next()) {
+ query = "UPDATE cart SET jumlah=? WHERE username=? AND namabarang=?";
+ PreparedStatement st2 = con.prepareStatement(query);
+ st2.setInt(1, Integer.parseInt(request.getParameter("jumlahBarang")) + rs.getInt(1));
+ st2.setString(2, request.getParameter("username"));
+ st2.setString(3, request.getParameter("namabarang"));
+
+ st2.executeUpdate();
+ st2.clearParameters();
+ out.println("");
+ } else {
+ query = "INSERT INTO cart(namabarang, jumlah, keterangan, username) VALUES(?, ?, '', ?)";
+ PreparedStatement st2 = con.prepareStatement(query);
+ st2.setString(1, request.getParameter("namabarang"));
+ st2.setInt(2, Integer.parseInt(request.getParameter("jumlahBarang")));
+ st2.setString(3, request.getParameter("username"));
+
+ st2.executeUpdate();
+ st2.clearParameters();
+ out.println("");
+ }
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println(e.toString()); };
+%>
\ No newline at end of file
diff --git a/ajaxLoader.js b/ajaxLoader.js
new file mode 100644
index 0000000..58c6265
--- /dev/null
+++ b/ajaxLoader.js
@@ -0,0 +1,34 @@
+var xmlhttp;
+function httpRequest() {
+if (window.XMLHttpRequest)
+ {// code for IE7+, Firefox, Chrome, Opera, Safari
+ xmlhttp=new XMLHttpRequest();
+ }
+else
+ {// code for IE6, IE5
+ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
+ }
+}
+
+function loadXMLDoc(url,cfunc)
+{
+httpRequest();
+xmlhttp.onreadystatechange=cfunc;
+xmlhttp.open("GET",url,true);
+xmlhttp.send();
+}
+
+function postForm(url, cfunc, form) { // w/o button
+ httpRequest();
+ xmlhttp.onreadystatechange=cfunc;
+ xmlhttp.open("POST", url, true);
+ xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
+ var formdata = "";
+ for (var i=0;i
+<%
+ Connection con = null;
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ PreparedStatement st;
+
+ st = con.prepareStatement("SELECT namabarang FROM cart");
+
+ ResultSet rs;
+ rs = st.executeQuery();
+
+ if (rs.next())
+ response.getWriter().print(rs.getString(1));
+ else response.getWriter().print(0);
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println("Unable to connect to database."); };
+
+%>
\ No newline at end of file
diff --git a/browse.css b/browse.css
new file mode 100644
index 0000000..b2bc80c
--- /dev/null
+++ b/browse.css
@@ -0,0 +1,42 @@
+.itemView{
+ display:block;
+ float:left;
+ width:390px;
+ height:180px;
+ margin:0;
+}
+
+.itemDetail{
+ display:block;
+ position:relative;
+ float:left;
+ top:0;
+ left:10px;
+ height:160px;
+ width:220px;
+}
+
+.itemImage{
+ display:block;
+ float:left;
+ position:relative;
+ width:160px;
+ height:160px;
+ background:#333333;
+}
+
+.browseOption{
+ display:block;
+ width:100%;
+ height: 30px;
+ float:left;
+}
+
+#quantity{
+ width:40px;
+ right:20px;
+}
+
+.pagination{
+ color: #47ca86;
+}
\ No newline at end of file
diff --git a/browse.jsp b/browse.jsp
new file mode 100644
index 0000000..3d38296
--- /dev/null
+++ b/browse.jsp
@@ -0,0 +1,132 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+ String[] data = new String[8];
+ String kategori = request.getParameter("kategori");
+ String keyword = request.getParameter("keyword");
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ PreparedStatement st;
+ String key= request.getParameter("keyword");
+ String query = "SELECT * , (case when kategori like '%"+key+"%' then 1 else 0 end) + (case when nama like '%"+key+"%' then 1 else 0 end) + (case when keterangan like '%"+key+"%' then 1 else 0 end) as priority from barang where (kategori like '%"+key+"%' or nama like '%"+key+"%' or keterangan like '%"+key+"%' or harga like '%"+key+"%')";
+
+ if (!request.getParameter("kategori").equals("default")) {
+ query += " and kategori='" + request.getParameter("kategori")+"'";
+ }
+ query += " order by "+request.getParameter("sortBy")+" DESC";
+
+ /*
+ if (!request.getParameter("kategori").equals("default")) {
+ query += " and kategori="+request.getParameter("kategori");
+ }
+ query += "order by "+request.getParameter("sortBy")+" desc";*/
+
+ st = con.prepareStatement(query);
+
+ ResultSet rs;
+ rs = st.executeQuery();
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sort by :
+
+
+
+
+
+ <%
+ int temp = 0;
+ int currentIndex = Integer.parseInt(request.getParameter("currentPage"));
+ while (rs.next()) {
+ if (temp >= (currentIndex*10 - 10) && (temp < (currentIndex*10))) {
+ String s = "
";
+ s+= "
";
+ s+= "
";
+ s+= "
";
+ out.println(s);
+ }
+ temp++;
+ }
+ %>
+
+
+
+
+
+
+
+
+
+
+
+<%
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println(e.toString()); };
+%>
+
\ No newline at end of file
diff --git a/checkBarang.jsp b/checkBarang.jsp
new file mode 100644
index 0000000..dd2a622
--- /dev/null
+++ b/checkBarang.jsp
@@ -0,0 +1,35 @@
+<%--
+ Document : checkBarang
+ Created on : Nov 27, 2013, 5:10:11 PM
+ Author : Administrator
+--%>
+
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
+
+ String namab = request.getParameter("nb");
+
+ PreparedStatement st;
+
+ st = con.prepareStatement("SELECT nama_barang FROM Barang WHERE nama_barang=?");
+ st.setString(1, namab);
+
+ ResultSet rs;
+ rs = st.executeQuery();
+
+ if(rs.next()) {
+ response.getWriter().print(rs.getString(1) + " sudah terpakai");
+ } else response.getWriter().print(1);
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println("Unable to connect to database."); };
+
+%>
\ No newline at end of file
diff --git a/checkEmail.jsp b/checkEmail.jsp
new file mode 100644
index 0000000..8e6cc9d
--- /dev/null
+++ b/checkEmail.jsp
@@ -0,0 +1,30 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ String email = request.getParameter("e");
+
+ PreparedStatement st;
+
+ st = con.prepareStatement("SELECT email FROM user WHERE email=?");
+ st.setString(1, email);
+
+ ResultSet rs;
+ rs = st.executeQuery();
+
+ if(rs.next()) {
+ response.getWriter().print(rs.getString(1) + " sudah terpakai");
+ } else response.getWriter().print(1);
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println("Unable to connect to database."); };
+
+%>
\ No newline at end of file
diff --git a/checkUsername.jsp b/checkUsername.jsp
new file mode 100644
index 0000000..aceb418
--- /dev/null
+++ b/checkUsername.jsp
@@ -0,0 +1,30 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ String usr = request.getParameter("u");
+
+ PreparedStatement st;
+
+ st = con.prepareStatement("SELECT username FROM user WHERE username=?");
+ st.setString(1, usr);
+
+ ResultSet rs;
+ rs = st.executeQuery();
+
+ if(rs.next()) {
+ response.getWriter().print(rs.getString(1) + " sudah terpakai");
+ } else response.getWriter().print(1);
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println("Unable to connect to database."); };
+
+%>
\ No newline at end of file
diff --git a/completeRegistration.jsp b/completeRegistration.jsp
new file mode 100644
index 0000000..ba6e7e4
--- /dev/null
+++ b/completeRegistration.jsp
@@ -0,0 +1,36 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+
+<%
+ Connection con = null;
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ PreparedStatement st;
+ String query = "INSERT INTO user(username, password, fullname, alamat, provinsi, kota, kodepos, nohp, tipe, transaksi, email) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+
+ st = con.prepareStatement(query);
+ st.setString(1, request.getParameter("un"));
+ st.setString(2, request.getParameter("pass"));
+ st.setString(3, request.getParameter("nl"));
+ st.setString(4, request.getParameter("nh"));
+ st.setString(5, request.getParameter("al"));
+ st.setString(6, request.getParameter("prov"));
+ st.setString(7, request.getParameter("kab"));
+ st.setString(8, request.getParameter("kp"));
+ st.setString(9, "pembeli");
+ st.setInt(10, 0);
+ st.setString(11, request.getParameter("ema"));
+
+ response.getWriter().print(st);
+ st.executeUpdate();
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println(e.toString()); };
+
+%>
\ No newline at end of file
diff --git a/completeTambahBarang.jsp b/completeTambahBarang.jsp
new file mode 100644
index 0000000..ca5e77c
--- /dev/null
+++ b/completeTambahBarang.jsp
@@ -0,0 +1,36 @@
+<%--
+ Document : completeTambahBarang
+ Created on : Nov 27, 2013, 5:16:39 PM
+ Author : Administrator
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%@include file="dbconfig.jsp"%>
+<%
+ Connection con = null;
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","");
+
+ PreparedStatement st;
+ String query = "INSERT INTO Barang(nama_barang, kategori_barang, harga_barang, stok_barang) VALUES (?, ?, ?, ?)";
+
+ st = con.prepareStatement(query);
+ st.setString(1, request.getParameter("nb"));
+ st.setString(2, request.getParameter("kb"));
+ st.setString(3, request.getParameter("hb"));
+ st.setString(4, request.getParameter("sb"));
+
+ response.getWriter().print(st);
+ st.executeUpdate();
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println(e.toString()); };
+
+%>
\ No newline at end of file
diff --git a/dbconfig.jsp b/dbconfig.jsp
new file mode 100644
index 0000000..df70e27
--- /dev/null
+++ b/dbconfig.jsp
@@ -0,0 +1,42 @@
+<%--
+ Document : dbconfig
+ Created on : Nov 27, 2013, 7:44:48 PM
+ Author : Administrator
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+
+
+
+OpenNMS Asset Management:Node
+
+
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/detail.css b/detail.css
new file mode 100644
index 0000000..678c1c7
--- /dev/null
+++ b/detail.css
@@ -0,0 +1,41 @@
+.division{
+ display:inline-block;
+ width:100%;
+}
+
+#textPermintaan{
+ text-align:left;
+}
+
+#description{
+ text-align:left;
+ text-justify: inter-word;
+ display:block;
+ position:relative;
+ float:left;
+ left:20px;
+ width:500px;
+ text-indent:50px;
+}
+
+#request{
+ text-align:left;
+ display:block;
+ position:relative;
+ float:left;
+ height:160px;
+ width:300px;
+}
+
+#statistic{
+ text-align:left;
+ display:block;
+ position:relative;
+ float:left;
+ left:20px;
+ width:400px;
+}
+
+#quantity{
+ width:40px;
+}
\ No newline at end of file
diff --git a/detail.jsp b/detail.jsp
new file mode 100644
index 0000000..7594c11
--- /dev/null
+++ b/detail.jsp
@@ -0,0 +1,67 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+ String[] data = new String[8];
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ PreparedStatement st;
+ String query = "SELECT * FROM barang WHERE nama=?";
+ st = con.prepareStatement(query);
+ st.setString(1, request.getParameter("nama"));
+
+ ResultSet rs;
+ rs = st.executeQuery();
+
+ if (rs.next()) {
+
+
+%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<%= rs.getString(1)%>
+ <%= rs.getString(2)%>
+
+
+
+
+
+
+<% }
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println(e.toString()); };
+%>
+
\ No newline at end of file
diff --git a/editProfile.jsp b/editProfile.jsp
new file mode 100644
index 0000000..a75fbd2
--- /dev/null
+++ b/editProfile.jsp
@@ -0,0 +1,31 @@
+<%@ page import="java.sql.*, javax.sql.*, java.io.*, javax.naming.*" %>
+<%
+ Connection con = null;
+
+ try {
+ try {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }catch(ClassNotFoundException ce){out.println(ce);}
+
+ con = DriverManager.getConnection("jdbc:mysql://localhost/ruserba","root","");
+
+ PreparedStatement st;
+ String query = "UPDATE user SET fullname=?, password=?, alamat=?, provinsi=?, kota=?, kodepos=?, nohp=?, email=? WHERE username=?";
+ st = con.prepareStatement(query);
+ st.setString(1, request.getParameter("nl"));
+ st.setString(2, request.getParameter("pass"));
+ st.setString(3, request.getParameter("al"));
+ st.setString(4, request.getParameter("prov"));
+ st.setString(5, request.getParameter("kab"));
+ st.setString(6, request.getParameter("kp"));
+ st.setString(7, request.getParameter("nh"));
+ st.setString(8, request.getParameter("ema"));
+ st.setString(9, request.getParameter("username"));
+ out.println(st);
+ st.executeUpdate();
+
+ st.clearParameters();
+ con.close();
+ } catch (Exception e) {out.println(e.toString()); };
+
+%>
\ No newline at end of file
diff --git a/header.js b/header.js
new file mode 100644
index 0000000..dd28a06
--- /dev/null
+++ b/header.js
@@ -0,0 +1,156 @@
+var IsLogin = false;
+var currUsername;
+var LoginClicked = false;
+var NamaDepan = "Yanuar";
+var KategoriBarang = new Array();
+KategoriBarang[0] = "makanan";
+KategoriBarang[1] = "aksesoris";
+KategoriBarang[2] = "pakaian";
+KategoriBarang[3] = "furnitur";
+KategoriBarang[4] = "mainan";
+var activeUser = "";
+
+function IsLogin(){
+ currUsername=getCookie("username");
+ if (currUsername!=null && currUsername!="") {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function getUsername() {
+ return localStorage.getItem('activeUser');
+}
+
+function drawHeaderContent(){
+ document.getElementById('header').innerHTML="";
+ document.getElementById('header').innerHTML+=" ";
+ document.getElementById('header').innerHTML+="";
+ document.getElementById('header').innerHTML+="";
+
+
+ //var activeUser = "";
+ //loadXMLDoc(
+ // "isLogin.php",
+ // function() {
+ // if (xmlhttp.readyState==4) {
+ // activeUser = xmlhttp.responseText;
+ // alert(activeUser);
+ //
+ // if (activeUser != "") {
+ // document.getElementById('header').innerHTML+="";
+ // document.getElementById('header').innerHTML+="";
+ // } else {
+ // document.getElementById('header').innerHTML+="";
+ // document.getElementById('header').innerHTML+="";
+ // if (LoginClicked){
+ // drawPopupLogin();
+ // }
+ // }
+ // }
+ if (localStorage.getItem('activeUser') != "") {
+ document.getElementById('header').innerHTML+="";
+ document.getElementById('header').innerHTML+="";
+ } else {
+ document.getElementById('header').innerHTML+="";
+ document.getElementById('header').innerHTML+="";
+ if (LoginClicked){
+ drawPopupLogin();
+ }
+ }
+}
+
+function triggerPopupLogin(){
+ LoginClicked =!LoginClicked;
+ drawHeaderContent();
+}
+
+function drawPopupLogin(){
+ document.getElementById('header').innerHTML+="