diff --git a/src/main/webapp/myprofile.jsp b/src/main/webapp/myprofile.jsp index d9eb99de..4d59032c 100644 --- a/src/main/webapp/myprofile.jsp +++ b/src/main/webapp/myprofile.jsp @@ -12,6 +12,40 @@ if(session.getAttribute("isLoggedIn")!=null) { Connection con=new DBConnect().connect(getServletContext().getRealPath("/WEB-INF/config.properties")); + +String id=request.getParameter("id"); + if(id!=null && !id.equals("")) + { + Statement stmt = con.createStatement(); + ResultSet rs =null; + rs=stmt.executeQuery("select * from users where id="+id); + if(rs != null && rs.next()) + { + out.print("UserName : "+rs.getString("username")+"
"); + out.print("Email : "+rs.getString("email")+"
"); + out.print("About : "+rs.getString("about")+"
"); + + //Getting Card Details: + ResultSet rs1=stmt.executeQuery("select * from cards where id="+id); + if(rs1 != null && rs1.next()) + { + out.print("
-------------------
Card Details:
-------------------
"); + out.print("Card Number: "+rs1.getString("cardno")+"
"); + out.print("CVV: "+rs1.getString("cvv")+"
"); + out.print("Expiry Date: "+rs1.getString("expirydate")+"
"); + } + else + { + out.print("
No Card Details Found: Add Card
"); + } + } + } + else + { + out.print("ID Parameter is Missing"); + } + + String id=request.getParameter("id"); if(id!=null && !id.equals("")) @@ -62,4 +96,4 @@ else %> - <%@ include file="/footer.jsp" %> \ No newline at end of file + <%@ include file="/footer.jsp" %>