You are on page 1of 23

Week-5

Develop static pages (using Only HTML) of an online book store. The pages should

resemble: www.amazon.com. The website should consist the following pages.

a. Home page

b. Registration and user Login

c. User Profile Page

d. Books catalog

e. Shopping Cart

f. Payment By credit card

g. Order Conformation

home.html
<html>

<frameset rows="10%,5%,80%,5%" name="home">

<frame src="header.html" name="header" ></frame>

<frame src="menu.html" name="menu" scrolling="auto" ></frame>

<frameset cols="10%,*" name="content">

<frame src="sidemenu.html" name="sidemenu"></frame>

<frame src="content1.html" name="content1" scrolling="auto"></frame>

</frameset>

<frame src="footer.html" name="footer" ></frame>

</frameset></html>

header.html
<html>

<head><title>HEADER</title></head>

<body bgcolor="lightpink">

<center><img align="top" src="C:\Users\ARUN\Desktop\online book store\OBKimg.jpeg" alt="img"


width="50px" height="50px">
<marquee bgcolor="yellow" width="500" behavior="alternate"><font face="Brush Script MT" size="6"
color="green"><b><i>Online Book Store</i></b>

</font></marquee><br>

</font></center></body>

</html>

menu.html
<html><head> <title>MENU SECTION</title></head><body BGCOLOR="skyblue">

<table width="100%" ><tr><td><a href="menu.html" >HOME</a></td>&nbsp;&nbsp;

<td><a href="reganduserlogin.html" target="content1">REGISTER</a></td>&nbsp; &nbsp;

<td><a href="login.html" target="content1">USER LOGIN</a></td>&nbsp;&nbsp;

<td><a href="profile.html" target="content1">PROFILE</a></td>&nbsp;&nbsp;

<td><a href="catalogue.html" target="content1">CATALOGUE</a></td>&nbsp;&nbsp;

<td><a href="payment.html" target="content1">PAYMENT</a></td>&nbsp;&nbsp;

<td><a href="ordercon.html" target="content1">ORDER CONFORMATION</a></td>&nbsp;&nbsp;

</tr></table></body></html>

sidemenu.html
<html>

<body align="center" bgcolor="bisque"> <br>

<a href="sidemenu.html"><font size="5">HOME</font></a><br><br>

<a href="cse.html" target="content1"><font size="4">CSE</font></a><br><br>

<a href="ece.html" target="content1"><font size="4">ECE</font></a><br><br>

<a href="eee.html" target="content1"><font size="4">EEE</font></a><br><br>

<a href="mech.html" target="content1"><font size="4">MECH</font></a><br>

</body>

</html>
footer.html
<html>

<head>

<title>footer</title>

</head>

<body bgcolor="pink">

<p> <h3 align="center">copyright&copy;CSC WEBTECHNOLOGYLAB @ MLRITM </h3> </p>

</body>

</html>
reganduserlogin.html
<html>

<head>

<title>Registration Form</title>

</head>

<body bgcolor="lightyellow">

<center><font color="red" size="4" face="arial">Registration Form</font></center><br />

<form action="content1.html">

First Name(Minimum 6 characters)<font color="red">* </font>

<input type='text' id='firstname' /><br /><br />

Last Name<font color="red"><font color="red">* </font> </font> &nbsp;&nbsp;&nbsp;

<input type='text' id='lastname' /><br /><br />

EmailId<font color="red">* </font> &nbsp;&nbsp;&nbsp;

<input type='text' id='email' /><br />

<font color="red">(one e-mail id only):</font> &nbsp;&nbsp;&nbsp;

<font color="redblue">e.g.Leo123@gmail.com</font><br /><br/>

Password(minimum 6 characters)<font color="red">* </font> &nbsp;&nbsp;&nbsp;

<input type='password' id='pass'><br /><br/>

Address<font color="red">* </font> &nbsp;&nbsp;&nbsp;

<textarea rows="2" cols="20" id='addr' /></textarea> <br /> <br/>

Mobile No<font color="red">* </font> &nbsp;&nbsp;&nbsp;

<input type='text' id='mobileno' /><br />

Gender: <input type='radio' name="gender">male

<input type='radio' name="gender">female<br/><br />

<input type='Submit' value='submit' />

<input type='Reset' value='reset' />

</form> </body> </html>


login.html
<html>
<body bg color="pink">
<basefont face="Cambria" size="4"> <br>
<center> <font face="Brush Script MT" size="7" color="purple">
<b>Enter Login Details:</b>
</font> </center>
<form name="f1" method="post" action="content1.html">
<table align="center" width="100" height="150" cellspacing=”15”>
<tr><td><b>Login ID:</b></td>
<td><input type="text" name="t1"></td>
</tr> <tr> <td><b>Password:</b></td>
<td><input type="password" name="t2"></td>
</tr>
<tr align="center">
<td><input type="submit" name="b1" value="Submit"></td>
<td><input type="reset" name="b2" value="Reset"></td> </tr>
</table> </form> </basefont> </body> </html>
profile.html
<html><head><title>profile</title></head>

<body bgcolor="lightyellow">

<a href="content1.html">HOME</a><br><br>

First Name:G<br>

Last Name:ARUN<br>

EmailId:arunk766526@gmail.com<br>

Address:ECIL-HYDERABAD<br>

Mobile No:9999123412<br>

Gender:MALE <br></body></html>
catalogue.html
<html>

<head>

<title> Catalogue </title>

</head>

<body bgcolor="lightyellow">

<a href="content1.html">HOME</a><br><br>

<form action="ordercon.html">

<table border="1" width="100%">

<tr>

<td>

<img src= "C:\Users\ARUN\Desktop\online book store\wtbook.jpg" width=100 height=100/>

</td>

<td> Book: Web Technologies <br> Author: Uttam K. Roy <br> Publication:Oxford

University Press</td> <td>531 &nbsp;&nbsp;&nbsp;</td>

<td> <input type="submit" value="Add to cart"/></td> </tr>

<tr>

<td> <img src="C:\Users\ARUN\Desktop\online book store\pp.jpeg" width=100 height=100/></td>

<td> Book: PHP & MySQL Web Development <br> Author:Luke Welling & Laura

Thompson <br> Publication:PEARSON</td> <td> 898 &nbsp;&nbsp;&nbsp; </td>

<td> <input type="submit" value="Add to cart"/></td> </tr>

</table> </form>

</body> </html>
payment.html

<html>

<head><title>PAYMENT</title></head>

<body bgcolor="lightyellow">

<a href="content1.html">HOME</a><br><br>

<form name="myform">

<div align="center"><pre>

LOGINID :<input type="text" name="id"><br>

PASSWORD :<input type="password" name="pwd"><br>

AMOUNT :<input type="text"name="amount"><br>

CREDITCARDNUMBER :<input type="PASSWORD"name="num"><br></pre><br><br>

</div>

<br><br>

<div align="center">

<input type="submit" value="submit">&nbsp;&nbsp;&nbsp;&nbsp;

<input type="reset" value="clear" >

</form>

</body>

</html>
ordercon.html
<html>
<head><title>order conformation</title></head>
<body bgcolor="lightyellow">
<center>
<pre><strong>
<b>Your order Is Conformed
</strong></pre>
<h2><b>THANK YOU...Visit Again</h2>
</center>
</body>
</html>
cse.html
<html> <head><title>CSE</title></head>

<body bgcolor="plum"> <center><font color="purple"><h1>Computer Science and


Engineering</h1></font></center>

<br> <table align="center" target="content1">

<tr><td>Text Books</td> <td> <select >

<option value="select the book" selected>Select the book

<option value="C&Ds">C&Ds

<option value="Ads">Ads

<option value="Java">Java

<option value="Oracle">Oracle

<option value="Ms SQL Server">Ms SQL Server

<option value="MySql">MySql

</select> </td></tr>

<tr> <td>Quantity</td>

<td><input type="text" id="q"></td>

</tr> <tr> <td></td>

<td> <form method=post action="ordercon.html">

<input type="submit" value=ok />

</form> </td> </tr>

</table> <center> <pre> Cost of one book is"500" + shipping "100" </pre>

</center> </body> </html>


ece.html
<html> <body bgcolor="Plum">

<h1><font color="blue">Electronics and Communication Engineering</font></h1>

<h2> <ul> <li>Digital Circuits</li> <li>Signals and Systems</li> <li>Digital Communication</li>

</ul> </h2>

</body> </html>

eee.html
<html> <body bgcolor="Plum">

<h1><font color="blue">Electrical and Electronics Engineering</font></h1>

<h2> <ul type="square">

<li>Concepts in Electric Circuits</li>

<li>Introduction to Electronic Engineering</li>

<li>Electrical Power</li>

</ul> </h2> </body> </html>


mech.html
<html> <body bgcolor="Plum">
<h1><font color="blue">Mechanical Engineering</font></h1>
<h2> <ol type="I">
<li>Theory of Machines</li>
<li>Automation and Robotics</li>
<li>Engineering Fluid Mechanics</li> </ol>
</h2> </body> </html>
Week-7
Create and save an XML document on the server, which contains 10
users information.

Write a program, which takes User Id as an input and returns the


user details by taking the user information from the XML document.

emp.xml
<employees>

<employee id="111">

<firstName>Amar</firstName>

<lastName>chandra</lastName>

<location>India</location>

</employee>

<employee id="222">

<firstName>Arun</firstName>

<lastName>kumar</lastName>

<location>Canada</location>

</employee>

<employee id="333">

<firstName>Bala</firstName>

<lastName>Kiran</lastName>

<location>Ukraine</location>

</employee>

<employee id="444">

<firstName>Bhanu</firstName>

<lastName>Chandra</lastName>

<location>India</location>

</employee>

<employee id="555">
<firstName>Cyril</firstName>

<lastName>Kumar</lastName>

<location>Russia</location>

</employee>

<employee id="666">

<firstName>Dharani</firstName>

<lastName>Mathew</lastName>

<location>UK</location>

</employee>

<employee id="777">

<firstName>Jagadesh</firstName>

<lastName>Chandra</lastName>

<location>Norway</location>

</employee>

<employee id="888">

<firstName>Vishnu</firstName>

<lastName>vardhan</lastName>

<location>Russia</location>

</employee>

<employee id="999">

<firstName>David</firstName>

<lastName>Feezor</lastName>

<location>USA</location>

</employee>

<employee id="1000">

<firstName>Sunder</firstName>

<lastName>Feezor</lastName>

<location>Canada</location>

</employee>

</employees>
ReadXML.java
import org.w3c.dom.*;

import javax.xml.parsers.*;

import java.io.*;

import java.util.Scanner;

public class ReadXML {

public static void main(String a[]) throws Exception{

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();

//Build Document

Document document = builder.parse(new File("C:/Users/ARUN/Desktop/wtlabexp7/emp.xml"));

//Normalize the XML Structure; It's just too

document.getDocumentElement().normalize();

//Here comes the root node

Element root = document.getDocumentElement();

//Get all employees

NodeList nList = document.getElementsByTagName("employee");

System.out.println("Enter Employee Id:");

Scanner s=new Scanner(System.in);

String id=s.next();

for (int temp = 0; temp <nList.getLength(); temp++)

Node node = nList.item(temp);

if (node.getNodeType() == Node.ELEMENT_NODE)

Element eElement = (Element) node;

if(eElement.getAttribute("id").equals(id)){

System.out.println("First Name : "+


eElement.getElementsByTagName("firstName").item(0).getTextContent());
System.out.println("Last Name:" +
eElement.getElementsByTagName("lastName").item(0).getTextContent());

System.out.println("Location:"
+eElement.getElementsByTagName("location").item(0).getTextContent());

Output:

You might also like