Вы находитесь на странице: 1из 97

1

CODING
1.(ABOUT US CODING)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<div class="content">
<%@include file="leftmenu.jsp" %>
<div style="margin-left:100px;float:left;">
<table width="658" height="367" border="0" cellspacing="3">
<tr>
<th height="24" colspan="3" style="text-decoration:underline;font-size:16px;color:#FF3399;"
scope="col">About Us</th>
</tr>
<tr>
<th height="24" colspan="3" style="text-decoration:underline;font-size:16px;color:#3333FF;"
scope="col">Online Mobile Shopping Project made By...............</th>
2

</tr>
<tr>
<th width="256" scope="col">&nbsp;</th>
<th width="256" scope="col"></th>
<th width="256" height="29" scope="col"> </th>
</tr>
<tr>
<th width="256" rowspan="2" scope="col"><img src="images/u1.jpg" width="133" height="167"
/></th>
<th width="256" scope="col" style="font-size:24px;color:green;">Name : </th>
<th width="256" height="79" scope="col" style="font-size:24px;color:red;">SANDEEP KUMAR </th>
</tr>
<tr>
<th height="67" scope="col" style="font-size:24px;color:green;">RollNo : </th>
<th scope="col" style="font-size:24px;color:red;">1211414315</th>
</tr>
<tr>
<th rowspan="2" scope="col" ><img src="images/u2.jpg" width="133" height="167" /></th>
<th scope="col" style="font-size:24px;color:green;" >Name : </th>
<th height="79" scope="col" style="font-size:24px;color:red;">KSHAMA SHARMA </th>
</tr>
<tr>
<th height="67" scope="col" style="font-size:24px;color:green;">RollNo : </th>
<th scope="col" style="font-size:24px;color:red;">1311414907</th>
</tr>
<tr>
3

<th height="67" scope="col" style="font-size:24px;color: deepskyblue;" colspan="3"
align="center">Students of MCA Final Year.............</th>
</tr>
</table>
</div>`
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>














4


2. (ADD USER CODING)

<%--
Document : adduser
Created on : Aug 17, 2014, 11:11:09 AM
Author : SANDEEP KUMAR
--%>

<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null,pr2=null;
ResultSet rs=null,rs1=null,rs2;
String url = "com.mysql.jdbc.Driver";

String fname = request.getParameter("fname");
String lname = request.getParameter("lname");
String emailid = request.getParameter("emailid");
String password = request.getParameter("password");
5

String gender = request.getParameter("gender");
String dob = request.getParameter("dob");
String contactno = request.getParameter("contactno");
String address = request.getParameter("address");
String city = request.getParameter("city");
String pincode = request.getParameter("pincode");
String state = request.getParameter("state");
String country = request.getParameter("country");


String conn = "jdbc:mysql://localhost:3306/oms";
String query1="insert into
user(fname,lname,emailid,password,gender,dob,contactno,address,city,pincode,s
tate,country) values(?,?,?,?,?,?,?,?,?,?,?,?)";
String query2="insert into login(user,pwd) values(?,?)";
try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(query1);
pr.setString(1,fname);
6

pr.setString(2,lname);
pr.setString(3,emailid);
pr.setString(4,password);
pr.setString(5,gender);
pr.setString(6,dob);
pr.setString(7,contactno);
pr.setString(8,address);
pr.setString(9,city);
pr.setString(10,pincode);
pr.setString(11,state);
pr.setString(12,country);

int i = pr.executeUpdate();
pr1 = con.prepareStatement(query2);
pr1.setString(1,fname);
pr1.setString(2,password);
int j = pr1.executeUpdate();
if(i==1 && j==1)
{
response.sendRedirect("confirm.jsp");
}
else
7

{
response.sendRedirect("registrationfrm.jsp");
}
}
catch(Exception e) {
}
%>















8

3. (CART CODING)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null,pr2=null;
ResultSet rs=null,rs1=null,rs2=null;
int tamt=0;
String url = "com.mysql.jdbc.Driver";
String mid = request.getParameter("CID");
9

String conn = "jdbc:mysql://localhost:3306/oms";
String query1="select mid,catid,mname,company,mimage,oprice from
mobileinfo where mid =?";
String query2="insert into tempcart
(mid,mname,mimage,company,qnty,price,tprice) values (?,?,?,?,?,?,?)";
String sql="select * from tempcart";
//String q="select cat_name from category where cat_id=?";

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(query1);
pr.setString(1,mid);
rs=pr.executeQuery();

pr1 = con.prepareStatement(query2);

while(rs.next())
{
pr1.setString(1,rs.getString(1));
10

pr1.setString(2,rs.getString(3));
pr1.setString(3,rs.getString(5));
pr1.setString(4,rs.getString(4));
pr1.setInt(5,1);
pr1.setInt(6,rs.getInt(6));
pr1.setInt(7,rs.getInt(6));
int i = pr1.executeUpdate();
// out.print("inserted");

}
pr2 = con.prepareStatement(sql);
rs2=pr2.executeQuery();
%>

<div class="content3">

<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;">
<table width="754" height="30" border="1" cellspacing="3"
align="center">
<tr align="center">
11

<td width="740" height="25" style="font-size:20px;color:#CC0099;text-
decoration:underline;" colspan="7">Shopping Cart</td>
</tr>
<tr>
<td width="94" height="15" align="center" scope="col"><div
align="center" class="style4">Item</div></td>
<td width="239"><div align="center" class="style4">Mobile
Name </div></td>
<td width="74"><div align="center"
class="style4">Company</div></td>
<td width="74"><div align="center"
class="style4">Quantity</div></td>
<td width="72"><div align="center"
class="style4">Price</div></td>
<td width="80"><div align="center"
class="style4">SubTotal</div></td>
<td width="74"><div align="center"></div></td>
</tr>
</table>
<table width="754" height="94" border="1" cellspacing="3">
<% while(rs2.next())
{ %>
<tr>
12

<td width="94" height="86" align="center" scope="col"><img
src="<%=rs2.getString(3) %>" width="46" height="70" /></td>
<td width="239" style="font-size:16px;color:#3300FF;"
><%=rs2.getString(2) %></td>
<td width="74" align="center"><%=rs2.getString(4) %> </td>

<td width="74" align="center"><input type="text" name="qnty" value="<%=
rs2.getInt(5) %>" style="width:50px;"/> <br/><!-- <a
href="changeqnty.jsp?CQID=<%= rs2.getString(1) %>"> --> <a href="#">
Change</a> </td>

<td width="72"><%=rs2.getInt(6) %></td> <% tamt=tamt +
rs2.getInt(6); %>
<td width="80"><%= rs2.getInt(5) * rs2.getInt(6) %></td>
<td width="74"><div align="center" style="font-size:16px;"><a
href="delete.jsp?DID=<%= rs2.getString(1) %>"> delete </a></div></td>
</tr>
<% } %>
</table>
<table width="754" height="40" border="1" cellspacing="3"
align="center">
<tr align="">
<td width="740" height="25" style="font-size:20px;color:#0000FF;text-
decoration:none;" colspan="3"><div align="right">Total Price : <%
out.print(tamt); %> <a href="paymentfrm.jsp?TAMT=<%=tamt %>" style="text-
13

decoration:none;"> <input type="submit" name="Submit" value="Place Order"
/> </a> </div> </td>
</tr>
</table>
</div>
</div>
<%@include file="footer.jsp" %>
<% }catch(Exception e) {} %>
</div>
</div>


</body>

</html>







14

4. ( CHANGEQUANTITY CODING)

<%--
Document : delete
Created on : Aug 16, 2014, 11:18:19 PM
Author : Rahul
--%>
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null,pr2=null;
ResultSet rs=null,rs1=null,rs2;
String url = "com.mysql.jdbc.Driver";
String id = request.getParameter("CQID");
int qnt = Integer.parseInt(request.getParameter("qnty"));
String conn = "jdbc:mysql://localhost:3306/oms";
int p =0;
String query1="update tempcart set tprice = ? where mid =?";
String q2="select mid,oprice from tempcart where mid=?";
try
15

{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(q2);
pr.setString(1,id);
rs=pr.executeQuery();
while(rs.next())
{
p = rs.getInt(2);

}
pr1 = con.prepareStatement(query1);
pr1.setInt(1,p*qnt );
pr1.setString(2,id);
pr1.executeUpdate();
//response.sendRedirect("cart.jsp");
RequestDispatcher rd = request.getRequestDispatcher("cart.jsp");
rd.forward(request, response);
}
catch(Exception e) {
} %>
16

5. (CONFIRM CODING)

<%--
Document : confirm
Created on : Aug 17, 2014, 12:02:51 PM
Author : sandeep kumar,kshama sharma
--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
<script type='text/javascript' src='js/jquery-1.3.2.min.js'>
</script>
</head>
<body>
<div id="main_container">
<%@include file="header.jsp" %>
<div class="content1" style="height:400px;">
17

<div align="center">
<table width="600" border="0" cellspacing="3" align="center">
<tr>
<th style="font-size:32px;color:#FF0099;"> <u>You have Successfully
Registered</u> </th>
</tr>
<tr>
<td height="300" align="center"><img
src="images/lavndr.rs.gif_480_480_0_64000_0_1_0.gif" width="370"
height="290" /></td>
</tr>
<tr>
<td height="30" align="center" style="font-size:24px;"><a href="index.jsp"> Go
To Login Page </a></td>
</tr>
</table>
</div>
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>

18

6. (CONFIRM PAYMENT CODING )

<%--
Document : confirm
Created on : Aug 17, 2014, 12:02:51 PM
Author : SANDEEP KUMAR
--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
<script type='text/javascript' src='js/jquery-1.3.2.min.js'>
</script>
</head>
<body>
<div id="main_container">
<%@include file="header.jsp" %>
<div class="content1" style="height:400px;">
19

<div align="center">
<table width="600" border="0" cellspacing="3" align="center">
<tr>
<th style="font-size:32px;color:#FF0099;"> <u>Your Payment have been
Received</u> </th>
</tr>
<tr>
<td height="300" align="center"><img
src="images/lavndr.rs.gif_480_480_0_64000_0_1_0.gif" width="370"
height="290" /></td>
</tr>
<tr>
<td height="30" align="center" style="font-size:24px;"><a href="signout.jsp">
Go To Login Page </a></td>
</tr>
</table>
</div>
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>

20

7. (dbconnection coding)
<%@page import="java.sql.*" %>
<%!

public class DBConnection1 {
public Connection getDBConnection() {
Connection connection;
try {
Class.forName("com.mysql.jdbc.Driver");
connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/oms","root","root");
return connection;
} catch (Exception e) {
return null;
}//try catch closed
}//getDBConnection() closed
}//class closed
%>




21

8. (delete coding)
<%--
Document : delete
Created on : Aug 16, 2014, 11:18:19 PM
Author : SANDEEP KUMAR
--%>
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null,pr2=null;
ResultSet rs=null,rs1=null,rs2;
String url = "com.mysql.jdbc.Driver";
String id = request.getParameter("DID");
String conn = "jdbc:mysql://localhost:3306/oms";
String query1="delete from tempcart where mid =?";
try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

22

pr = con.prepareStatement(query1);
pr.setString(1,id);
pr.executeUpdate();
response.sendRedirect("cart.jsp");

}
catch(Exception e) {
}
%>
%>












23


9. (edit user coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>

<% Connection con=null;
PreparedStatement pr=null,pr1=null;
ResultSet rs=null,rs1=null;
String url = "com.mysql.jdbc.Driver";
24

String uid = String.valueOf( session.getAttribute("username"));
String conn = "jdbc:mysql://localhost:3306/oms";

String query1="select
fname,lname,emailid,password,gender,dob,contactno,address,city,pincode,state,
country from user where fname=?";

//String q="select cat_name from category where cat_id=?";

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(query1);
pr.setString(1,uid);
rs=pr.executeQuery();
while(rs.next())
{
%>

<div class="content">
25

<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;">

<table width="500" border="1" cellspacing="3" align="center"
style="height:450px;" >
<form action="saveuser.jsp" method="post" >
<tr>
<td width="150" colspan="2" height="45" style="font-
size:24px;color:#FF3300;" align="center"><u>Edit User Account</u></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">&nbsp;</div></td>
<td width="350"><div align="center" style="font-size:16px;color: #0000FF;">
<input type="hidden" name="fname" value="<%=rs.getString(1)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Last Name </div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;" >
<input type="text" name="lname" value="<%=rs.getString(2)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
26

<td><div align="center" style="font-size:16px;">Email id </div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="emailid" value="<%=rs.getString(3)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">&nbsp;</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="hidden" name="password" value="<%=rs.getString(4)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Gender</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="gender" value="<%=rs.getString(5)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Date Of Birth </div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="dob" value="<%=rs.getString(6)%>"
style="width:250px;" /></div></td>
</tr>
27

<tr>
<td><div align="center" style="font-size:16px;">Contact No. </div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="contactno" value="<%=rs.getString(7)%>"
style="width:250px;" maxlength="10"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Address</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="address" value="<%=rs.getString(8)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">City</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="city" value="<%=rs.getString(9)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Pincode</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="pincode" value="<%=rs.getString(10)%>"
style="width:250px;" maxlength="6"/></div></td>
28

</tr>
<tr>
<td><div align="center" style="font-size:16px;">State</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="state" value="<%=rs.getString(11)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Country</div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;">
<input type="text" name="country" value="<%=rs.getString(12)%>"
style="width:250px;"/></div></td>
</tr>
<tr>
<td colspan="2"><div align="center" style="font-size:16px;"><input
type="submit" value="Save" />
</div></td>
</tr>
</form>
</table>
<% } }catch(Exception e) {} %>
</div>
</div>
29

<%@include file="footer.jsp" %>
</div>
</body>

</html>


10. (footer coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
<script type='text/javascript' src='js/jquery-1.3.2.min.js'>
</script>
</head>
<body>
<div class="footer">
<div class="left_footer"> <img src="images/logo1.jpg" alt="" width="170"
height="49"/> </div>
30

<div class="center_footer"> Online Mobile Shopping. All Rights Reserved 2014
<br />
<a href="#"><img src="images/csscreme.jpg" alt="css" border="0" /></a><br
/>
<img src="images/payment.gif" alt="" /> </div>
<div class="right_footer"> <a href="#">contact us</a> <a
href="aboutus.jsp">about us</a> </div>
</div>
</body>
</html>



11. (header coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
<script type='text/javascript' src='js/jquery-1.3.2.min.js'>
</script>
31

<script type="text/javascript">
var imgs =
['images/1.jpg','images/2.jpg','images/3.png','images/4.png','images/5.jpg'];
var cnt = imgs.length;

$(function() {
setInterval(Slider, 3000);
});

function Slider() {
$('#imageSlide').fadeOut("slow", function() {
$(this).attr('src', imgs[(imgs.length++) % cnt]).fadeIn("slow");
});
}
</script>
</head>
<body>
<div id="header">
<div class="top_bar">
<table align="center">
<tr>
<td width="500" align="justify">
32

<img src="images/logo1.jpg" />
</td>
<td align="right">
<%

HttpSession ses = request.getSession();
if(!(ses.getAttribute("username")==null))
{
out.print("Welcome " + ses.getAttribute("username"));



%>
/ <a href="signout.jsp" onclick="window.forward(-1)">signout </a>

<% }
else
{
%>
<a href="index.jsp"> <a href="index.jsp">Sign in</a> / <a
href="registrationfrm.jsp">Sign Up </a>
<% } %>
33

</td>
</tr>
</table>
</div>
<div class="pic">
<img id="imageSlide" alt="" src="" width="1000" height="250" />
</div>
<div>
<ul class="menu">
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<%

HttpSession ses1 = request.getSession();
if(!(ses1.getAttribute("username")==null))
{

%>
<li><a href="homepage.jsp" style="font-size:18px;"> Home</a></li>
&nbsp;&nbsp;&nbsp;
<li><a href="myaccount.jsp" style="font-size:18px;"> MyAccount</a></li>
&nbsp;&nbsp;&nbsp;
34

<li><a href="cart.jsp" style="font-size:18px;"> MyCart</a></li>
&nbsp;&nbsp;&nbsp;
<li><a href="sitemap.jsp" style="font-size:18px;"> SiteMap</a></li>
&nbsp;&nbsp;&nbsp;
<li><a href="aboutus.jsp" style="font-size:18px;"> About Us</a></li>
<li> <div style="float:right;"> <%@ page import="java.util.Date" %>
Today is: <%= new Date() %> </div> </li>
<% }
else
{
%>




<li><a href="index.jsp" style="font-size:18px;"> Home</a></li>
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<li><a href="aboutus.jsp" style="font-size:18px;">About Us</a></li>
<li> <div style="float:right;"> <%@ page import="java.util.Date" %>
Today is: <%= new Date() %> </div> </li>

<% } %>
35

</ul>

</div>
</div>
</body>
</html>



12. (home page coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
36

<div class="content">

<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;">
<table width="754" height="473" border="1" cellspacing="3">
<tr>
<th width="256" height="395" scope="col"><img src="images/apple/apple-
iphone-5s1.jpeg" width="191" height="400" /></th>
<th width="256" scope="col"><img src="images/samsung/samsung-galaxy-
grand-2.jpeg" width="191" height="400" /></th>
<th width="252" scope="col"><img src="images/home/nokia-lumia-lumia-
625.jpeg" width="221" height="400" /></th>
</tr>
<tr align="center" style="font-size:14px;color:#0099FF;">
<td height="33"> apple-iphone-5s</td>
<td>samsung-galaxy-grand 2</td>
<td>nokia-lumia-625</td>
</tr>
<tr style="font-size:16px;color:#FF0033;">
<td height="33"><div style="float:left;">Price: 41000 </div> <div
align="center" style="float:right;"> <a href="mobiledetails.jsp?MID=<%="ap03"
%>" style="text-decoration:none;"> <input type="submit" name="Submit"
value="View Details" /></a></div></td>
37

<td><div style="float:left;">Price: 25399 </div> <div align="center"
style="float:right;"> <a href="mobiledetails.jsp?MID=<%= "sm01"%>" style="text-
decoration:none;"> <input type="submit" name="Submit" value="View Details"
/> </a></div></td>
<td><div style="float:left;">Price: 12499 </div> <div align="center"
style="float:right;"> <a href="mobiledetails.jsp?MID=<%= "nk02"%>" style="text-
decoration:none;"> <input type="submit" name="Submit" value="View Details"
/> </a></div></td>
</tr>
</table>
</div>
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>



13. (index coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
38

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
<script type='text/javascript' src='js/jquery-1.3.2.min.js'>
</script>
</head>
<body>
<div id="main_container">
<%@include file="header.jsp" %>
<div class="content1">
<div align="center">

<table width="500" cellspacing="2" height="240">
<form action="login.jsp" method="get">
<tr>
<td align="center" colspan="2" style="font-size:24px;color:#FF0099;">
<u>LOGIN</u> </td>
</tr>
<tr>
<td width="257" align="center"> Username </td>
<td width="231"> <input type="text" name="user" /></td>
</tr>
39

<tr>
<td align="center"> Password </td><td> <input type="password"
name="password" /></td>
</tr>
<tr>
<td align="center" colspan="2"> <input type="submit" name="Login"
value="Login" />
</td>
</tr>
<tr>
<td align="left" colspan="2"><a href="#"> Forgot Your Password ? </a>
</td>
</tr>
</form>

</table>
</div>
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>
40

14. (left menu coding)
<%--
Document : leftmenu
Created on : Aug 14, 2014, 6:51:46 PM
Author : SANDEEP KUMAR,KSHAMA SHARMA
--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>

<div class="left_content">
<div class="title_box">Categories</div>
<ul class="left_menu">
<li class="odd"><a href="mobilehome.jsp?ID=<%="nk"%>">
41

Nokia</a></li>
<li class="even"><a href="mobilehome.jsp?ID=<%="ap"%>">Apple</a></li>
<li class="odd"><a
href="mobilehome.jsp?ID=<%="sm"%>">Samsung</a></li>
<li class="even"><a href="mobilehome.jsp?ID=<%="so"%>">Sony</a></li>
<li class="odd"><a
href="mobilehome.jsp?ID=<%="mx"%>">Micromax</a></li>
<li class="even"><a
href="mobilehome.jsp?ID=<%="bb"%>">BlackBerry</a></li>
<li class="odd"><a
href="mobilehome.jsp?ID=<%="kb"%>">Karbonn</a></li>
<li class="even"><a href="mobilehome.jsp?ID=<%="lg"%>">LG</a></li>
<li class="odd"><a
href="mobilehome.jsp?ID=<%="mt"%>">Motorola</a></li>
</ul>
</div>

</body>

</html>



42


15. (login coding)
<%--
Document : login
Created on : Aug 15, 2014, 11:05:59 AM
Author : sandeep kumar,kshama sharma
--%>

<%@page import="java.util.Vector" %>
<%@page import="javax.swing.*" %>
<%@page import="javax.servlet.*" %>
<%@page import="java.sql.*" %>
<%@include file="DBConnection.jsp" %>

<%
String user = request.getParameter("user");
String pwd = request.getParameter("password");

DBConnection1 db = new DBConnection1();
Statement stmt = db.getDBConnection().createStatement();

ResultSet rs1=null;
43

String qry = "select * from login where user='"+user+"' and pwd
='"+pwd+"'";
String query1="delete from tempcart";
rs1=stmt.executeQuery(qry);

if(rs1.next())
{
HttpSession ses = request.getSession(true);
ses.setAttribute("username",user);
//JOptionPane.showMessageDialog(null,"You are Successfully
Login","Welcome",JOptionPane.OK_OPTION);
stmt.executeUpdate(query1);
response.sendRedirect("homepage.jsp");
}
else
{
response.sendRedirect("index.jsp");
}
%>



44

16. (mobile details coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>
<body>

<div id="main_container">
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null;
ResultSet rs=null,rs1=null;
String url = "com.mysql.jdbc.Driver";
String mid = request.getParameter("MID");
String conn = "jdbc:mysql://localhost:3306/oms";
45

String query1="select
mid,catid,mname,company,mimage,pcamera,scamera,imemory,ememory,ram,hd
,screen,flash,resolution,os,processor,color,mprice,oprice from mobileinfo where
mid =?";

//String q="select cat_name from category where cat_id=?";

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(query1);
pr.setString(1,mid);
rs=pr.executeQuery();
while(rs.next())
{
%>


<div class="content">
<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;">
46

<table width="754" height="473" border="1" cellspacing="3">
<tr>
<td width="256" height="395" scope="col" align="center"><img src="<%=
rs.getString(5) %>" width="225" height="450" /></td>
<td width="400">
<div align="center">
<table width="341" border="1" cellspacing="3">
<tr>
<th colspan="2" scope="col" style="font-size:18px;color:#6600FF;"><%=
rs.getString(3) %></th>
</tr>
<tr>
<td width="306" colspan="2">&nbsp;</td>
</tr>
<tr>
<td width="163"><span class="style2">Company </span></td>
<td width="159" align="center"><%= rs.getString(4) %></td>
</tr>
<tr>
<td><span class="style2">Primary Camera </span></td>
<td align="center"><%= rs.getString(6) %></td>
</tr>
47

<tr>
<td><span class="style2">Secondary Camera </span></td>
<td align="center"><%= rs.getString(7) %></td>
</tr>
<tr>
<td><span class="style2">Internal Memory </span></td>
<td align="center"><%= rs.getString(8) %></td>
</tr>
<tr>
<td><span class="style2">Expandable Memory </span></td>
<td align="center"><%= rs.getString(9) %></td>
</tr>
<tr>
<td><span class="style2">RAM</span></td>
<td align="center"><%= rs.getString(10) %></td>
</tr>
<tr>
<td><span class="style2">HD Recording </span></td>
<td align="center"><%= rs.getString(11) %></td>
</tr>
<tr>
<td><span class="style2">Screen Size </span></td>
48

<td align="center"><%= rs.getString(12) %> inch.</td>
</tr>
<tr>
<td>Flash</td>
<td align="center"><%= rs.getString(13) %></td>
</tr>
<tr>
<td>Resolution</td>
<td align="center"><%= rs.getString(14) %></td>
</tr>
<tr>
<td>OS</td>
<td align="center"><%= rs.getString(15) %></td>
</tr>
<tr>
<td>Processor</td>
<td align="center"><%= rs.getString(16) %></td>
</tr>
<tr>
<td><span class="style2">Color</span></td>
<td align="center"><%= rs.getString(17) %></td>
</tr>
49

<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td><span class="style2">Market Price </span></td>
<td align="center" style="text-decoration:line-through;text-decoration-
color:red;"><%= rs.getInt(18) %> </td>
</tr>
<tr>
<td><span class="style2">Our Price </span></td>
<td align="center"><%= rs.getInt(19) %></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="center"><a href="cart.jsp?CID=<%= rs.getString(1) %>"
style="text-decoration:none;"><input type="submit" value="Add to Cart"
/></a></td>
</tr>
</table>


50


</div>



</td>
</tr>
</table>
</div>
</div>
<%
} }catch(Exception e) {}
%>
<%@include file="footer.jsp" %>

</div>
</div>


</body>

</html>
51


17. (mobile home coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null,pr2=null;
ResultSet rs=null,rs1=null,rs2;
String url = "com.mysql.jdbc.Driver";
String id = request.getParameter("ID");
52

String conn = "jdbc:mysql://localhost:3306/oms";
String query1="select mid,catid,mname,mimage,oprice from mobileinfo where
catid =?";
String query2="select mid,catid,mname,mimage,oprice from mobileinfo where
catid =?";
String query3="select mid,catid,mname,mimage,oprice from mobileinfo where
catid =?";

//String q="select cat_name from category where cat_id=?";

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(query1);
pr.setString(1,id);
rs=pr.executeQuery();

pr1 = con.prepareStatement(query2);
pr1.setString(1,id);
rs1=pr1.executeQuery();

53

pr2 = con.prepareStatement(query3);
pr2.setString(1,id);
rs2=pr2.executeQuery();

%>

<div class="content">
<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;">
<table width="754" height="473" border="1" cellspacing="3">

<tr>
<%
int i=0;
while(rs.next())
{
i++;

%>
<% if(i==1)
{

54

%>
<th width="255" height="395" scope="col"><img
src="<%=rs.getString(4)%>" width="191" height="400" /></th>
<% }
else if(i==2)
{
%>
<th width="255" scope="col"><img src="<%=rs.getString(4)%>"
width="191" height="400" /></th>
<% }
else if(i==3)
{
%>
<th width="254" scope="col"><img src="<%=rs.getString(4)%>"
width="221" height="400" /></th>
<% }}
%>
</tr>

<tr align="center" style="font-size:14px;color:#0099FF;">
<%
int j=0;
while(rs1.next())
55

{
j++;


%>
<% if(j==1)
{

%>
<td height="33"> <%=rs1.getString(3) %></td>
<% }
else if(j==2)
{
%>
<td><%=rs1.getString(3) %></td>
<% }
else if(j==3)
{
%>
<td><%=rs1.getString(3) %></td>
<% } } %>
</tr>
56

<tr style="font-size:16px;color:#FF0033;">
<%
int k=0;
while(rs2.next())
{
k++;


%>
<% if(k==1)
{

%>
<td height="33"><div style="float:left;">Price: <%=rs2.getInt(5) %> </div>
<div align="center" style="float:right;"> <a
href="mobiledetails.jsp?MID=<%=rs2.getString(1) %>" style="text-
decoration:none;"> <input type="submit" name="Submit" value="View Details"
/></a></div></td>
<% }
else if(k==2)
{
%>
57

<td><div style="float:left;">Price: <%=rs2.getInt(5) %> </div> <div
align="center" style="float:right;"> <a
href="mobiledetails.jsp?MID=<%=rs2.getString(1) %>" style="text-
decoration:none;"> <input type="submit" name="Submit" value="View Details"
/> </a></div></td>
<% }
else if(k==3)
{
%>
<td><div style="float:left;">Price: <%=rs2.getInt(5) %> </div> <div
align="center" style="float:right;"> <a
href="mobiledetails.jsp?MID=<%=rs2.getString(1) %>" style="text-
decoration:none;"> <input type="submit" name="Submit" value="View Details"
/> </a></div></td>
<% }} %>
</tr>
</table>
</div>
<% }catch(Exception e) {} %>
</div>

<%@include file="footer.jsp" %>
</div>
</div>
58



</body>

</html>


18. (my account coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
59

<%@include file="DBConnection.jsp" %>

<% Connection con=null;
PreparedStatement pr=null,pr1=null;
ResultSet rs=null,rs1=null;
String url = "com.mysql.jdbc.Driver";
String uid = String.valueOf( session.getAttribute("username"));
String conn = "jdbc:mysql://localhost:3306/oms";

String query1="select
fname,lname,emailid,password,gender,dob,contactno,address,city,pincode,state,
country from user where fname=?";

//String q="select cat_name from category where cat_id=?";

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");

pr = con.prepareStatement(query1);
pr.setString(1,uid);
60

rs=pr.executeQuery();
while(rs.next())
{
%>

<div class="content">
<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;">
<table width="500" border="1" cellspacing="3" align="center"
style="height:450px;" >
<tr>
<td width="150" colspan="2" height="45" style="font-
size:24px;color:#FF3300;" align="center"><u>My Account Information</u></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">First Name </div></td>
<td width="350"><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(1) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Last Name </div></td>
<td><div align="center" style="font-size:16px;color: #0000FF;"
><%=rs.getString(2) %></div></td>
61

</tr>
<tr>
<td><div align="center" style="font-size:16px;">Email id </div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(3) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Password</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(4) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Gender</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(5) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Date Of Birth </div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(6) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Contact No. </div></td>
62

<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(7) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Address</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(8) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">City</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(9) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">Pincode</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(10) %></div></td>
</tr>
<tr>
<td><div align="center" style="font-size:16px;">State</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(11) %></div></td>
</tr>
63

<tr>
<td><div align="center" style="font-size:16px;">Country</div></td>
<td><div align="center" style="font-size:16px;color:
#0000FF;"><%=rs.getString(12) %></div></td>
</tr>
<tr>
<td colspan="2"><div align="center" style="font-size:16px;"><a
href="edituser.jsp">Edit User Info</a>
</div></td>
</tr>
</table>
<% } }catch(Exception e) {} %>
</div>
</div>
<%@include file="footer.jsp" %>
</div>
</body>

</html>



64


19. (payment coding)
<%--
Document : payment
Created on : Aug 18, 2014, 12:29:46 PM
Author : sandeep kumar, kshama sharma
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null,pr2=null;
ResultSet rs=null,rs1=null;
DBConnection1 db = new DBConnection1();
Statement stmt = db.getDBConnection().createStatement();

String url = "com.mysql.jdbc.Driver";
String uid = String.valueOf(session.getAttribute("username"));
String conn = "jdbc:mysql://localhost:3306/oms";
65

String query1="insert into
bill(uname,emailid,contactno,address,city,pincode,state,country,card,cardno,emo
nth,eyear,cvv,tamt) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
//String query1="select fname,contactno,address,city,pincode,state,country
from user where fname=?";
String query2="select mid,mname,mimage,company,qnty,price,tprice from
tempcart";
// String query3="insert into order
(uname,mid,mname,mimage,company,qnty,price,tprice)values(?,?,?,?,?,?,?,?)";
//String q="select cat_name from category where cat_id=?";
String query3="delete from tempcart";
try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");


pr = con.prepareStatement(query1);
pr.setString(1,request.getParameter("uname"));
pr.setString(2,request.getParameter("emailid"));
pr.setString(3,request.getParameter("contactno"));
pr.setString(4,request.getParameter("address"));
pr.setString(5,request.getParameter("city"));
66

pr.setString(6,request.getParameter("pincode"));
pr.setString(7,request.getParameter("state"));
pr.setString(8,request.getParameter("country"));
pr.setString(9,request.getParameter("card"));
pr.setString(10,request.getParameter("cardno"));
pr.setString(11,request.getParameter("emonth"));
pr.setString(12,request.getParameter("eyear"));
pr.setString(13,request.getParameter("cvv"));
pr.setInt(14,Integer.parseInt(request.getParameter("tamt")));

pr.executeUpdate();
stmt.executeUpdate(query3);

/* pr1 = con.prepareStatement(query2);

rs=pr1.executeQuery();
while(rs.next())
{
// out.print("bye");
// pr2 = con.prepareStatement("query3");
// out.print("bye");
pr2 = con.prepareStatement(query3);
67

pr2.setString(1,uid);
pr2.setString(2,rs.getString(1));
pr2.setString(3,rs.getString(2));
pr2.setString(4,rs.getString(3));
pr2.setString(5,rs.getString(4));
pr2.setInt(6,Integer.parseInt(rs.getString(5)));
pr2.setInt(7,Integer.parseInt(rs.getString(6)));
pr2.setInt(8,Integer.parseInt(rs.getString(7)));
pr2.executeUpdate();
pr2.close();
/* out.print(uid);
out.print(rs.getString(1));
out.print(rs.getString(2));
out.print(rs.getString(3));
out.print(rs.getString(4));
out.print(Integer.parseInt(rs.getString(5)));
out.print(Integer.parseInt(rs.getString(6)));
out.print(Integer.parseInt(rs.getString(7))); */

response.sendRedirect("confirmpayment.jsp");
}
catch(Exception e){}
68


%>


20. (payment from coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>
<% Connection con=null;
PreparedStatement pr=null,pr1=null;
69

ResultSet rs=null,rs1=null;
String url = "com.mysql.jdbc.Driver";
String uid = String.valueOf(session.getAttribute("username"));
int amt = Integer.parseInt(request.getParameter("TAMT"));
String conn = "jdbc:mysql://localhost:3306/oms";

String query1="select
fname,contactno,address,city,pincode,state,country,emailid from user where
fname=?";

//String q="select cat_name from category where cat_id=?";

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");
pr = con.prepareStatement(query1);
pr.setString(1,uid);
rs=pr.executeQuery();
while(rs.next())
{
%>
70

<div class="content">

<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;margin-left:150px;">
<table width="512" border="1" cellspacing="3" align="center">
<form action="payment.jsp" method="get">
<tr>
<th colspan="2" scope="col" style="font-size:20px;">PAYMENT</th>
</tr>

<tr>
<th colspan="2" scope="col">&nbsp;</th>
</tr>
<tr>
<td>USERNAME</td>
<td width="300px"><input type="text" name="uname" width="300px;"
value="<%= rs.getString(1) %>"/></td>
</tr>
<tr>
<td>EMAIL ID </td>
<td><input type="text" name="emailid" width="300px;" value="<%=
rs.getString(8) %>" /></td>
71

</tr>
<tr>
<td>CONTACT NO </td>
<td><input type="text" name="contactno" width="300px;" value="<%=
rs.getString(2) %>" /></td>
</tr>
<tr>
<td>ADDRESS</td>
<td><input type="text" name="address" width="300px;" value="<%=
rs.getString(3) %>"/></td>
</tr>
<tr>
<td>CITY</td>
<td><input type="text" name="city" width="300px;" value="<%= rs.getString(4)
%>"/></td>
</tr>
<tr>
<td>PINCODE</td>
<td><input type="text" name="pincode" width="300px;" value="<%=
rs.getString(5) %>"/></td>
</tr>
<tr>
<td>STATE</td>
72

<td><input type="text" name="state" width="300px;" value="<%=
rs.getString(6) %>"/></td>
</tr>
<tr>
<td>COUNTRY</td>
<td><input type="text" name="country" width="300px;" value="<%=
rs.getString(7) %>"/></td>
</tr>
<% } %>
<tr>
<td>TRANSACTION CARD </td>
<td><input name="card" type="radio" value="Debit Card" />
Debit Card
<input name="card" type="radio" value="Credit Card" />
Credit Card
<input name="card" type="radio" value="ATM" />
ATM </td>
</tr>
<tr>
<td>CARD NO. </td>
<td><input type="text" name="cardno" maxlength="19" width="200px"/></td>
</tr>
73

<tr>
<td>EXPIRY DATE </td>
<td><select name="emonth">
<option value="">mm</option>
<option value="jan">jan</option>
<option value="feb">feb</option>
<option value="mar">mar</option>
<option value="apr">apr</option>
<option value="may">may</option>
<option value="jun">jun</option>
<option value="jul">jul</option>
<option value="aug">aug</option>
<option value="sep">sep</option>
<option value="oct">oct</option>
<option value="nov">nov</option>
<option value="dec">dec</option>
</select>
<select name="eyear">
<option value="">yy</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
74

<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
</select> </td>
</tr>
<tr>
<td>CVV</td>
<td><input type="text" name="cvv" maxlength="3" /></td>
</tr>
<tr>
<td>TOTAL AMOUNT </td>
<td><input type="text" name="tamt" maxlength="3" value="<%=amt %>"
/></td>
</tr>
<tr>
<th colspan="2" scope="col"></th>
</tr>
<tr>
<td height="25" colspan="2"><div align="center">
<input type="submit" name="Submit" value="Confirm" />
</div></td>
75

</tr>
</form>
</table>
</div>
</div>
<%} catch(Exception e){} %>
<%@include file="footer.jsp" %>
</div>
</body>
</html>


21. (registration from coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

76

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<div class="content">
<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;">
<table width="754" height="473" border="1" cellspacing="3">
<tr>
<td width="256" height="395" scope="col" align="center">
<div align="center">
<form method="post" action="adduser.jsp">
<table width="341" border="0" cellspacing="3">
<tr>
<th colspan="2" scope="col" style="font-size:16px;color:#6600FF;"><u>USER
REGISTRATION </u></th>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>

<tr>
<td width="163">First Name * </td>
77

<td width="159" align="center"> <input type="text" name="fname" /></td>
</tr>
<tr>
<td>Last Name * </td>
<td align="center"><input type="text" name="lname" /></td>
</tr>
<tr>
<td>Email id * </td>
<td align="center"><input type="text" name="emailid" /></td>
</tr>
<tr>
<td>Password * </td>
<td align="center"><input type="password" name="password"
maxlength="8"/></td>
</tr>
<tr>
<td>Gender</td>
<td align="center"><input type="radio" name="gender" value="male" />Male
<input type="radio" name="gender" value="Female" />Female </td>
</tr>
<tr>
<td>Date of Birth (dd/mm/yyyy)</td>
78

<td align="center"><input type="text" name="dob" /></td>
</tr>
<tr>
<td>Contact No. </td>
<td align="center"><input type="text" name="contactno" maxlength="10"
/></td>
</tr>
<tr>
<td>Address</td>
<td align="center"><input type="text" name="address" /></td>
</tr>
<tr>
<td>City</td>
<td align="center"><input type="text" name="city" /></td>
</tr>
<tr>
<td>Pin code </td>
<td align="center"><input type="text" name="pincode" maxlength="6"/> </td>
</tr>
<tr>
<td>State</td>
<td align="center"><input type="text" name="state" /></td>
79

</tr>
<tr>
<td>Country</td>
<td align="center"><select name="country" style="width:142px;">
<option value="India"> India </option>
<option value="USA"> USA </option>
<option value="Australia"> Australia </option>
<option value="Pakistan"> Pakistan </option>
</select></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>

<tr>
<td colspan="2" align="center"><a href="#" style="text-
decoration:none;"><input type="submit" value="Add"
/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;<a href="#" style="text-decoration:none;"><input
type="submit" value="Cancel" /></a> </td>
</tr>
</table>

80

</form>

</div>



</td>
</tr>
</table>
</div>
</div>

<%@include file="footer.jsp" %>

</div>
</div>


</body>

</html>

81


22. (save user coding)
<%--
Document : saveuser
Created on : Aug 17, 2014, 10:39:00 PM
Author : sandeep kumar,kshama sharma
--%>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@include file="DBConnection.jsp" %>

<% Connection con=null;
PreparedStatement pr=null,pr1=null;
ResultSet rs=null,rs1=null;
String url = "com.mysql.jdbc.Driver";
String uid = String.valueOf(session.getAttribute("username"));
String conn = "jdbc:mysql://localhost:3306/oms";
String query2="delete from user where fname=?";
String query1="insert into
user(fname,lname,emailid,password,gender,dob,contactno,address,city,pincode,s
tate,country) values(?,?,?,?,?,?,?,?,?,?,?,?)";

82

//String q="select cat_name from category where cat_id=?";
out.print("Hi");

try
{
Class.forName(url);
con = DriverManager.getConnection(conn,"root","root");
out.print(uid);
pr1 = con.prepareStatement(query2);
pr1.setString(1,uid);
int j= pr1.executeUpdate();
out.print(uid);
/*if(j==1)
{out.print("Hi");}
else
{
out.print("not deleted");
} */

String fname = request.getParameter("fname");
String lname = request.getParameter("lname");
String emailid = request.getParameter("emailid");
83

String password = request.getParameter("password");
String gender = request.getParameter("gender");
String dob = request.getParameter("dob");
String contactno = request.getParameter("contactno");
String address = request.getParameter("address");
String city = request.getParameter("city");
String pincode = request.getParameter("pincode");
String state = request.getParameter("state");
String country = request.getParameter("country");

pr = con.prepareStatement(query1);
pr.setString(1,fname);
pr.setString(2,lname);
pr.setString(3,emailid);
pr.setString(4,password);
pr.setString(5,gender);
pr.setString(6,dob);
pr.setString(7,contactno);
pr.setString(8,address);
pr.setString(9,city);
pr.setString(10,pincode);
pr.setString(11,state);
84

pr.setString(12,country);

int i = pr.executeUpdate();

if(i==1)
{
response.sendRedirect("myaccount.jsp");
}
else
{
response.sendRedirect("homepage.jsp");
}
}
catch(Exception e) {

}
%>





85

23. (sign out coding)
<%--
Document : signout
Created on : Aug 15, 2014, 12:28:26 PM
Author : sandeep kumar and kshama sharma
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
HttpSession ses = request.getSession(false);
if (ses != null)
{
if(ses.getAttribute("username")!=null)
{
ses.removeAttribute("username");
ses.invalidate();
response.setHeader("Cache-Control","no-cache");
//HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the
proxy server
86

response.setHeader("Cache-Control","no-store"); //HTTP 1.1
}
}

response.sendRedirect("index.jsp");
%>


24. (sitemap coding)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Online Mobile Shopping </title>
<link rel="stylesheet" href="oms.css" type="text/css" />
</head>

<body>
<div id="main_container">
<%@include file="header.jsp" %>
<div class="content">
87

<%@include file="leftmenu.jsp" %>
<div style="margin-left:25px;float:left;">
<table width="754" height="170" border="0" cellspacing="3">
<tr>
<th width="256" height="24" scope="col" style="text-
decoration:underline;font-size:16px;color:#FF3399;" colspan="3">Sitemap</th>

</tr>
<tr>
<th width="256" height="152" scope="col"><a
href="mobilehome.jsp?ID=<%="ap"%>" style="text-decoration:none;"><img
src="images/company/apple.jpg" width="110" height="66" /></a></th>
<th width="256" scope="col"><a href="mobilehome.jsp?ID=<%="nk"%>"
style="text-decoration:none;"><img src="images/company/Nokia.jpg"
width="120" height="70" /></a></th>
<th width="252" scope="col"><a href="mobilehome.jsp?ID=<%="sm"%>"
style="text-decoration:none;"><img src="images/company/sam.jpg" width="110"
height="66" /></a></th>
</tr>
<tr>
<th width="256" height="152" scope="col"><a
href="mobilehome.jsp?ID=<%="mx"%>" style="text-decoration:none;"><img
src="images/company/micro.jpg" width="110" height="66" /></a></th>
88

<th width="256" scope="col"><a href="mobilehome.jsp?ID=<%="bb"%>"
style="text-decoration:none;"><img src="images/company/black.jpg"
width="167" height="40" /></a></th>
<th width="252" scope="col"><a href="mobilehome.jsp?ID=<%="so"%>"
style="text-decoration:none;"><img src="images/company/sony.jpg"
width="110" height="66" /></a></th>
</tr>
<tr>
<th width="256" height="152" scope="col"><a
href="mobilehome.jsp?ID=<%="kb"%>" style="text-decoration:none;"><img
src="images/company/karbon.jpg" width="110" height="66" /></a></th>
<th width="256" scope="col"><a href="mobilehome.jsp?ID=<%="lg"%>"
style="text-decoration:none;"><img src="images/company/lg.jpg" width="110"
height="66" /></a></th>
<th width="252" scope="col"><a href="mobilehome.jsp?ID=<%="mt"%>"
style="text-decoration:none;"><img src="images/company/moto.jpg"
width="152" height="84" /></a></th>
</tr>
</table>
</div>
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>
89

25. (oms coding)
#menu_tab{
width:1000px;
height:50px;
background-color:#fff;
}
.left_menu_corner{
width:9px;
height:50px;
float:left;
background:url(images/menu_left.gif) no-repeat center;
}
.right_menu_corner{
width:9px;
height:50px;
float:left;
background:url(images/menu_right.gif) no-repeat center;
}
.t2
{
font-size:32px;
color:darkblue;
90

}
ul.menu {
list-style-type:none; float:left; display:block; width:1000px;
margin:0px; padding:0px;background:url(images/menu_bg.gif) repeat-x;}

ul.menu li {
display:inline;
font-size:11px;
font-weight:bold;
line-height:50px;
}
.divider {
display:inline;
width:2px;
height:50px;
float:left;
background:url(images/menu_divider.gif) no-repeat center;
}

body
{
background:url(images/bg.jpg) no-repeat #fff center top;
91

padding:0;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
margin:0px auto auto auto;
color:#000;
}
.top_bar{
width:1000px;
font:Arial, Helvetica, sans-serif;
font-size:18px;
height:70px;
background-color:#CCCCCC;
color:#3300CC;
}
.top_bar1{
width:1000px;
font:Arial, Helvetica, sans-serif;
font-size:18px;
height:200px;
background-color:#CCCCCC;
color:#3300CC;
}
92

.pic
{
height:250px;
width:1000px;
margin:auto;
background-image:url(images/ban.jpg);
}
#header{
width:1000px;
height:380px;
background-position:0px 0px;
margin:auto;
}
.content{
width:1000px;
height:500px;
background-position:0px 0px;
border: 2px solid black;
margin-left:0px;
margin-top:0px;
}
.content3{
93

width:1000px;
height:auto;
background-position:0px 0px;
border: 2px solid black;
margin-left:0px;
margin-top:0px;
}
.content1{
width:1000px;
height:250px;
background-position:0px 0px;
border: 2px solid black;
margin:auto;
}
.t
{
border:2px double #FF0000;
}
#main_container{
width:1000px;
height:auto;
margin:auto;
94

padding:0px;
}
.footer{
margin-top:10px;
width:1000px;
clear:both;
height:65px;
background:url(images/footer_bg.gif) repeat-x top;
}
.left_footer{
float:left;
width:300px;
padding:5px 0 0 10px;
}
.right_footer{
float:right;
padding:15px 30px 0 0;
}
.right_footer a{
padding:0 0 0 7px;
text-decoration:none;
color: #666666;
95

}
.right_footer a:hover{
text-decoration:underline;
}

.center_footer{
float:left;
width:200px;
text-align:center;
color:#666666;
padding:10px 0 0 60px;
}
.left_content{
width:196px;
float:left;
}
ul.left_menu li{
margin:5px 0 0 -30px;;
list-style:none;
}
ul.left_menu li.odd a{
96

width:166px;height:40px;display:block;background:url(images/checked.png) no-
repeat left #dad0d0; background-position:5px 5px;border-bottom:1px #FFFFFF
solid;
text-decoration:none;color:#504b4b;padding:0 0 0 30px; line-height:25px;margin-
left:0px;
}
ul.left_menu li.even a{
width:166px;height:40px;display:block;background:url(images/checked.png) no-
repeat left #eee6e6;background-position:5px 5px;border-bottom:1px #FFFFFF
solid;
text-decoration:none;color:#504b4b;padding:0 0 0 30px; line-height:25px;margin-
left:0px;
}
ul.left_menu li.even a:hover, ul.left_menu li.odd a:hover{
background:url(images/checked.png) no-repeat left #7bbcc7;
color:#FFFFFF;background-position:5px 5px;
}

.title_box{
width:196px;
height:30px;
margin:5px 0 0 10px;
background:url(images/menu_title_bg.gif) no-repeat center;
text-align:center;
97

font-size:13px;
font-weight:bold;
color:#fff;
line-height:30px;
}

Вам также может понравиться