Minor Project On E-Commerce: Master of Computer Science (M.SC) Information Technology (May 2010)
Minor Project On E-Commerce: Master of Computer Science (M.SC) Information Technology (May 2010)
Minor Project On E-Commerce: Master of Computer Science (M.SC) Information Technology (May 2010)
commerce
Electroshop.com
(An Online computer h/w and s/w shop)
2
ACKNOWLEDGEMENT
Last but not the least, I express my gratitude to all the faculty members,
my parents, friends and College for providing the infrastructure, the kind
blessings of who made me strong during ups and downs while
accomplishing the task in time.
3
CERTIFICATE
The matter embedded in this project work has’t been submitted earlier
for the award of any other Degree or Diploma .
He worked with utmost dedication and zeal. I wish him all the best.
4
A little bit about Ecommerce
Unless you have been living under a rock for the last few years, you have
probably heard about e-commerce. And you have heard about it from several
different angles. You may have:
• heard about all of the companies that offer e-commerce because you have
been bombarded by their TV and radio ads
• read all of the news stories about the shift to e-commerce and the hype
that has developed around e-commerce companies
• seen the huge valuations that Web companies get in the stock market,
even when they don't make a profit
• purchased something on the Web, so you have direct personal experience
with e-commerce.
5
About the project
This project is based on ecommerce application in real life. The project focuses
on online shopping of computers hardware and softwares. People can access the
website through a domain name and can order products at the comfort of sitting
at home and just ordering product needed at a few clicks.
The project also has an ADMIN panel that allows the administrator of the
website to add categories and products to the website as well as change the
information on pages like contact us, about us etc. The administrator also has
the ability to send newsletters to the visitor of the website who have subscribed
for the newsletters.
This project has been named “Electroshop.com”. The Electroshop displays the
well formatted layout of the website that is a user friendly interface and easy to
understand and use. The well formatted layout with proper positioning of
categories and products as well as use of good graphics will make the user feel
good and increase the chances of conversion of user to customer.
Best efforts have been put in to make the website look awesome and full of
features. Features like searching have also been added.
SYSTEM REQUIREMENTS
• 32 MB or Higher RAM
6
FRONTEND
7
SCREENSHOTS
HOME PAGE
8
DETAIL PAGE
9
CODING
config.php
<?php
$linkdb = mysql_connect("localhost", "root", "");
if(!mysql_select_db("ecommerce")) die(mysql_error());
?>
header.php
<?php
include("config.php");
?>
<!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=windows-1252" />
<title>Electronix Store</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="main_container">
<div class="top_bar">
<div class="top_search">
<div class="search_text"><a href="#">Advanced Search</a></div>
<form action="search.php" method="post"><input type="text" class="search_input"
name="search" />
<input type="image" src="images/search.gif" class="search_bt"/></form>
</div>
<div class="languages">
10
<div class="lang_text">Languages:</div>
<a href="#" class="lang"><img src="images/en.gif" alt="" title="" border="0" /></a>
<a href="#" class="lang"><img src="images/de.gif" alt="" title="" border="0" /></a>
</div>
</div>
<div id="header">
<div id="logo">
<a href="index.php"><img src="images/logo.png" alt="" title="" border="0"
width="237" height="140" /></a>
</div>
</div>
<div id="main_content">
<div id="menu_tab">
<div class="left_menu_corner"></div>
<ul class="menu">
<li><a href="index.php" class="nav1"> Home </a></li>
<li class="divider"></li>
<li><a href="index.php?all=1" class="nav2">View All Products</a></li>
<li class="divider"></li>
<li><a href="aboutus.php" class="nav4">About Us</a></li>
<li class="divider"></li>
<li><a href="contact.php" class="nav6">Contact Us</a></li>
<li class="divider"></li>
</ul>
<div class="right_menu_corner"></div>
</div>
<div><br /></div>
index.php
<?php
include("header.php");
include("leftbar.php");
?>
<div class="center_content">
<div class="center_title_bar">Latest Products</div>
<?php
if($_REQUEST['all']==1)
{
$products = mysql_query("select * from products order by id desc");
}
11
else
{
$products = mysql_query("select * from products order by id desc limit 9");
}
while($prodata = mysql_fetch_array($products))
{
?>
<div class="prod_box">
<div class="top_prod_box"></div>
<div class="center_prod_box">
<div class="product_title"><a href="detail.php?pid=<?php echo $prodata['id']; ?
>"><?php echo $prodata['name']; ?></a></div>
<div class="product_img"><a href="detail.php?pid=<?php echo $prodata['id']; ?
>"><img src="media/<?php echo $prodata['image']; ?>" alt="" title="" border="0"
/></a></div>
<div class="prod_price"><span class="reduce"><?php echo
$prodata['original_price']; ?>$</span> <span class="price"><?php echo
$prodata['discounted_price']; ?>$</span></div>
</div>
<div class="bottom_prod_box"></div>
<div class="prod_details_tab">
<a href="#"><img src="images/cart.gif" alt="" title="" border="0" class="left_bt"
/></a>
<a href="detail.php?pid=<?php echo $prodata['id']; ?>"
class="prod_details">details</a>
</div>
</div>
<?php
}
?>
</div>
<?php
include("rightbar.php");
include("footer.php");
?>
aboutus.php
<?php
include("header.php");
include("leftbar.php");
?>
<div class="center_content">
<div class="center_title_bar">About Us</div>
<div class="prod_box_big">
<div class="top_prod_box_big"></div>
12
<div class="center_prod_box_big">
<div style="text-align:left; padding-left:40px; font-size:12px; font-weight:bold; background-
color:#f7f3f3;"><br />
<?php
$contactcon = mysql_fetch_array(mysql_query("select * from settings where
name='aboutus'"));
echo $contactcon['value'];
?>
</div>
</div>
<div class="bottom_prod_box_big"></div>
</div>
</div>
<?php
include("rightbar.php");
include("footer.php");
?>
category.php
<?php
include("header.php");
include("leftbar.php");
?>
<div class="center_content">
<div class="center_title_bar">Latest <?php
$catget = $_REQUEST['catid'];
$cat = mysql_fetch_array(mysql_query("select * from categories where id=".$catget));
echo $cat['name'];
?></div>
<?php
$catz = $_REQUEST['catid'];
$products = mysql_query("select * from products where cat_id=".$catz);
while($prodata = mysql_fetch_array($products))
{
?>
<div class="prod_box">
<div class="top_prod_box"></div>
<div class="center_prod_box">
<div class="product_title"><a href="detail.php?pid=<?php echo $prodata['id']; ?
>"><?php echo $prodata['name']; ?></a></div>
<div class="product_img"><a href="detail.php?pid=<?php echo $prodata['id']; ?
>"><img src="media/<?php echo $prodata['image']; ?>" alt="" title="" border="0"
/></a></div>
13
<div class="prod_price"><span class="reduce"><?php echo
$prodata['original_price']; ?>$</span> <span class="price"><?php echo
$prodata['discounted_price']; ?>$</span></div>
</div>
<div class="bottom_prod_box"></div>
<div class="prod_details_tab">
<a href="#"><img src="images/cart.gif" alt="" title="" border="0" class="left_bt"
/></a>
<a href="detail.php?pid=<?php echo $prodata['id']; ?>"
class="prod_details">details</a>
</div>
</div>
<?php
}
?>
</div>
<?php
include("rightbar.php");
include("footer.php");
?>
contact.php
<?php
include("header.php");
include("leftbar.php");
?>
<div class="center_content">
<div class="center_title_bar">Contact Us</div>
<div class="prod_box_big">
<div class="top_prod_box_big"></div>
<div class="center_prod_box_big">
<div class="contact_form">
<div class="form_row">
<label class="contact"><strong>Name:</strong></label>
<input type="text" class="contact_input" />
</div>
<div class="form_row">
<label class="contact"><strong>Email:</strong></label>
<input type="text" class="contact_input" />
</div>
14
<div class="form_row">
<label class="contact"><strong>Phone:</strong></label>
<input type="text" class="contact_input" />
</div>
<div class="form_row">
<label class="contact"><strong>Company:</strong></label>
<input type="text" class="contact_input" />
</div>
<div class="form_row">
<label class="contact"><strong>Message:</strong></label>
<textarea class="contact_textarea" ></textarea>
</div>
<div class="form_row">
<a href="#" class="contact">send</a>
</div>
</div>
</div>
<div style="text-align:left; padding-left:40px; font-size:12px; font-weight:bold; background-
color:#f7f3f3;"><br />
<?php
$contactcon = mysql_fetch_array(mysql_query("select * from settings where
name='contactus'"));
echo $contactcon['value'];
?>
</div>
<div class="bottom_prod_box_big"></div>
</div>
</div>
<?php
include("rightbar.php");
include("footer.php");
?>
detail.php
<?php
include("header.php");
include("leftbar.php");
$pid = $_REQUEST['pid'];
$products = mysql_fetch_array(mysql_query("select * from products where id=".$pid));
?>
<div class="center_content">
<div class="center_title_bar"><?php echo $products['name']; ?></div>
15
<div class="prod_box_big">
<div class="top_prod_box_big"></div>
<div class="center_prod_box_big">
<div class="product_img_big">
<img src="media/<?php echo $products['image']; ?>" alt="" title="" border="0" />
</div>
<div class="details_big_box">
<div class="product_title_big"><?php echo $products['name_extended']; ?
></div>
<div class="specifications">
Availability : <span class="blue"><?php echo $products['availability']; ?
></span><br />
footer.php
</div>
<div class="footer">
<div class="left_footer">
<img src="images/footer_logo.png" alt="" title="" width="170" height="49"/>
</div>
16
<div class="center_footer"><br />
All Rights Reserved 2010<br />
</div>
<div class="right_footer">
<a href="index.php">HOME</a>
<a href="contact.php">CONTACT US</a>
</div>
</div>
</div>
</body>
</html><?php
$hits = mysql_query("update settings set value=value+1 where name='hits'");
?>
leftbar.php
<div class="left_content">
<div class="title_box">Categories</div>
<ul class="left_menu">
<?php
$catresult = mysql_query("select * from categories");
$i=0;
while($catres = mysql_fetch_array($catresult))
{
echo "<li class='";
if($i%2==0)
{
echo "odd";
}
else
{
echo "even";
}
echo "'><a href='category.php?catid=".$catres['id']."'>".$catres['name']."</a></li>";
$i++;
}
?>
</ul>
<?php
$randomproduct = mysql_fetch_array(mysql_query("select * from products order by
RAND() limit 0,1"));
?>
17
<div class="border_box">
<div class="product_title"><a href="detail.php?pid=<?php echo
$randomproduct['id']; ?>"><?php echo $randomproduct['name']; ?></a></div>
<div class="product_img"><a href="detail.php?pid=<?php echo
$randomproduct['id']; ?>"><img src="media/<?php echo $randomproduct['image']; ?>"
alt="" title="" border="0" /></a></div>
<div class="prod_price"><span class="reduce"><?php echo
$randomproduct['original_price']; ?>$</span> <span class="price"><?php echo
$randomproduct['discounted_price']; ?>$</span></div>
</div>
<div class="title_box">Newsletter</div>
<div class="border_box">
<input type="text" name="newsletter" class="newsletter_input" value="your
email"/>
<a href="#" class="join">join</a>
</div>
<br />
</div>
rightbar.php
<div class="right_content">
<div class="shopping_cart">
<div class="cart_title">Shopping cart</div>
<div class="cart_details">
0 items <br />
<span class="border_cart"></span>
Total: <span class="price">0$</span>
</div>
</div>
<?php
$newproduct = mysql_fetch_array(mysql_query("select * from products order by id desc
limit 1"));
?>
18
<div class="product_img"><a href="detail.php?pid=<?php echo $newproduct['id']; ?
>"><img src="media/<?php echo $newproduct['image']; ?>" alt="" title="" border="0"
/></a></div>
<div class="prod_price"><span class="reduce"><?php echo
$newproduct['original_price']; ?>$</span> <span class="price"><?php echo
$newproduct['discounted_price']; ?>$</span></div>
</div>
<div class="title_box">Manufacturers</div>
<ul class="left_menu">
<li class="odd"><a href="search.php?search=sony">Sony</a></li>
<li class="even"><a href="search.php?search=samsung">Samsung</a></li>
<li class="odd"><a href="search.php?search=daewoo">Daewoo</a></li>
<li class="even"><a href="search.php?search=lg">LG</a></li>
<li class="odd"><a href="search.php?search=fuji">Fujitsu Siemens</a></li>
<li class="even"><a href="search.php?search=motorola">Motorola</a></li>
<li class="odd"><a href="search.php?search=philips">Phillips</a></li>
<li class="even"><a href="search.php?search=gigabyte">Gigabyte</a></li>
</ul>
</div>
search.php
<?php
include("header.php");
include("leftbar.php");
?>
<div class="center_content">
<div class="center_title_bar"><?php
echo $_REQUEST['search'];
?> products</div>
<?php
$catz = $_REQUEST['search'];
$products = mysql_query("select * from products where name like '%$catz%'");
while($prodata = mysql_fetch_array($products))
{
?>
<div class="prod_box">
<div class="top_prod_box"></div>
<div class="center_prod_box">
<div class="product_title"><a href="detail.php?pid=<?php echo $prodata['id']; ?
>"><?php echo $prodata['name']; ?></a></div>
<div class="product_img"><a href="detail.php?pid=<?php echo $prodata['id']; ?
>"><img src="media/<?php echo $prodata['image']; ?>" alt="" title="" border="0"
/></a></div>
19
<div class="prod_price"><span class="reduce"><?php echo
$prodata['original_price']; ?>$</span> <span class="price"><?php echo
$prodata['discounted_price']; ?>$</span></div>
</div>
<div class="bottom_prod_box"></div>
<div class="prod_details_tab">
<a href="#"><img src="images/cart.gif" alt="" title="" border="0" class="left_bt"
/></a>
<a href="detail.php?pid=<?php echo $prodata['id']; ?>"
class="prod_details">details</a>
</div>
</div>
<?php
}
?>
</div>
<?php
include("rightbar.php");
include("footer.php");
?>
style.css
body
{
background:url(images/bg.jpg) no-repeat #fff center top;
padding:0;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
margin:0px auto auto auto;
color:#000;
}
p{
padding:2px;
margin:0px;
}
#main_container{
width:1000px;
height:auto;
margin:auto;
padding:0px;
}
.top_bar{
width:1000px;
height:38px;
background-color:#4a4a4a;
}
.top_search{
width:370px;
height:32px;
20
margin:0px 20px 0 0;
_margin:0px 10px 0 0;
float:right;
background:url(images/top_search_bg.gif) no-repeat center;
}
input.search_input{
width:182px;
height:18px;
float:left;
margin:5px 0 0 0 ;
border:1px solid #dbdbdb;
border-bottom-color:#ffffff;
border-right-color:#ffffff;
}
.search_text{
float:left;
width:110px;
padding:8px 0 0 15px;
color:#999999;
}
.search_text a{
text-decoration:none;
color:#999999;
}
.search_bt{
float:left;
padding:2px 0 0 15px;
}
.languages{
float:right;
width:150px;
padding:8px 0 0 0;
}
.lang_text{
float:left;
padding:0 5px 0 0;
color:#b3adad;
}
a.lang{
display:block;
float:left;
padding:0 5px 0 5px;
}
#header{
width:1000px;
height:173px;
background:url(images/header_bg.jpg) no-repeat center;
background-position:0px 0px;
margin:auto;
}
21
#logo{
float:left;
padding:15px;
}
.oferte_content{
width:600px;
height:164px;
float:left;
padding:0 0 0 50px;
}
.top_divider{
float:left;
width:1px;
height:164px;
}
.oferta{
width:538px;
float:left;
padding:15px 30px 0 30px;
}
.oferta_img{
float:left;
padding:0 0 10px 0;
}
.oferta_title{
font-size:15px;
color:#b72c24;
font-weight:bold;
}
.oferta_details{
width:400px;
float:left;
padding:0 0 0 30px;
}
.oferta_text{
padding:5px 0 5px 0;
font-size:12px;
color:#FFFFFF;
text-align:justify;
line-height:15px;
}
a.details{
width:83px;
height:21px;
display:block;
float:right;
margin:5px 0 0 0;
padding-left:5px;
background:url(images/details_bt_bg.gif) no-repeat center;
text-align:center;
22
line-height:21px;
text-decoration:none;
color:#000000;
}
div.oferta_pagination {
clear:both;
padding:10px 0 0 0;
_padding:0px 0 0 0;
margin:5px;
text-align:center;
float:left;
font-size:10px;
}
div.oferta_pagination a {
width:22px;
height:22px;
display:block;
float:left;
margin:0 0 0 5px;
_margin:0 0 0 3px;
line-height:23px;
text-align:center;
background:url(images/pag_bg.gif) no-repeat center;
text-decoration:none;
color:#9d8b8b;
}
div.oferta_pagination a:hover, div.pagination a:active {
width:22px;
height:22px;
display:block;
float:left;
line-height:23px;
text-align:center;
background:url(images/pag_bg_a.gif) no-repeat center;
text-decoration:none;
color:#ad1614;
}
div.oferta_pagination span.current {
width:22px;
height:22px;
display:block;
float:left;
line-height:23px;
text-align:center;
background:url(images/pag_bg_a.gif) no-repeat center;
text-decoration:none;
color:#ad1614;
}
23
#main_content{
clear:both;
}
/*---------------- menu tab----------------------*/
#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;
}
ul.menu {
list-style-type:none; float:left; display:block; width:982px;
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;
}
ul.menu li.divider {
display:inline;
width:2px;
height:50px;
float:left;
background:url(images/menu_divider.gif) no-repeat center;
}
a.nav1:link, a.nav1:visited {
display:block; float:left; padding:0px 8px 0px 22px; margin:0 14px 0 14px;height:50px;text-
decoration:none; background:url(images/home.png) no-repeat left; color:#676d77;}
a.nav2:link, a.nav2:visited {
display:block; float:left; padding:0px 8px 0px 22px; margin:0 14px 0 14px;height:50px;text-
decoration:none; background:url(images/services.png) no-repeat left; color:#676d77;}
a.nav3:link, a.nav3:visited {
display:block; float:left; padding:0px 8px 0px 22px; margin:0 14px 0 14px;height:50px;text-
decoration:none; background:url(images/favs.png) no-repeat left; color:#676d77;}
a.nav4:link, a.nav4:visited {
24
display:block; float:left; padding:0px 8px 0px 22px; margin:0 14px 0 14px;height:50px;text-
decoration:none; background:url(images/user_add.png) no-repeat left; color:#676d77;}
a.nav5:link, a.nav5:visited {
display:block; float:left; padding:0px 8px 0px 22px; margin:0 14px 0 14px;height:50px;text-
decoration:none; background:url(images/car.png) no-repeat left; color:#676d77;}
a.nav6:link, a.nav6:visited {
display:block; float:left; padding:0px 8px 0px 22px; margin:0 14px 0 14px;height:50px;text-
decoration:none; background:url(images/contact-new.png) no-repeat left; color:#676d77;}
li.currencies{
width:180px;
float:left;
padding:0 0 0 15px;
_padding:12px 0 0 15px;
color:#676d77;
font-size:11px;
font-weight:bold;
}
/*----------------crumb_navigation-------------*/
.crumb_navigation{
width:980px;
height:15px;
padding:5px 10px 0 20px;
color:#333333;
background:url(images/navbullet.png) no-repeat left;
background-position:5px 6px;
}
.crumb_navigation a{
color:#0fa0dd;
text-decoration:underline;
}
span.current{
color:#0fa0dd;
}
/*-------------left_content------------------*/
.left_content{
width:196px;
float:left;
}
.title_box{
width:196px;
height:30px;
margin:5px 0 0 0;
background:url(images/menu_title_bg.gif) no-repeat center;
text-align:center;
25
font-size:13px;
font-weight:bold;
color:#fff;
line-height:30px;
}
/*--------left menu---------*/
ul.left_menu{
width:196px;
padding:0px;
margin:0px;
list-style:none;
}
ul.left_menu li{
margin:0px;
list-style:none;
}
ul.left_menu li.odd a{
width:166px;height:25px;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;
}
ul.left_menu li.even a{
width:166px;height:25px;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;
}
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;
}
.border_box{
width:194px;
height:auto;
text-align:center;
border:1px #6da6b1 solid;
}
.product_title{
color:#ea2222;
padding:5px 0 5px 0;
font-weight:bold;
}
.product_title a{
text-decoration:none;
color:#ea2222;
padding:5px 0 5px 0;
font-weight:bold;
}
.product_title a:hover{
color:#064E5A;
26
}
.product_img{
padding:5px 0 5px 0;
}
.prod_price{
padding:5px 0 5px 0;
}
span.reduce{
color:#999999;
text-decoration:line-through;
}
span.price{
color:#ea2222;
}
/*----------newsletter--------------*/
input.newsletter_input{
width:160px;
height:16px;
border:1px #ddd9d9 solid;
margin:10px 0 5px 0;
font-size:12px;
padding:3px;
color:#999999;
}
a.join{
width:17px;
display:block;
margin:5px 0 5px 140px;
_margin:5px 0 5px 130px;
background:url(images/blue-add.png) no-repeat left;
padding:0 0 0 20px;
text-decoration:none;
color:#1c4a52;
}
/*center content--------------------------*/
.center_content{
width:585px;
float:left;
padding:5px 10px;
}
.center_title_bar{
width:520px;
height:33px;
float:left;
padding:0 0 0 40px;
margin:0 0 0 12px;
_margin:0 0 0 6px;
line-height:33px;
27
font-size:12px;
color:#847676;
font-weight:bold;
background:url(images/bar_bg.gif) no-repeat center;
}
/*----------------------right content--------------*/
.right_content{
width:196px;
float:left;
padding:5px 0 0 0;
}
.shopping_cart{
width:195px;
height:84px;
text-align:center;
background:url(images/cart_bg.gif) no-repeat center;
}
.cart_title{
font-size:12px;
font-size:12px;
color:#847676;
font-weight:bold;
padding:8px 0 0 0;
}
.cart_details{
width:115px;
float:left;
padding:5px 0 0 15px;
text-align:left;
}
.cart_icon{
float:left;
padding:5px 0 0 5px;
}
span.border_cart{
width:100px;
height:1px;
margin:3px 0 3px 0;
display:block;
border-top:1px #999999 dashed;
}
/*---------prod_box----------*/
.prod_box{
width:173px;
height:auto;
float:left;
padding:10px 10px 10px 11px;
}
.top_prod_box{
28
width:173px;height:12px;background:url(images/product_box_top.gif) no-repeat center
bottom;float:left; padding:0px; margin:0px;
}
.bottom_prod_box{
width:173px;height:10px;background:url(images/product_box_bottom.gif) no-repeat center
top;float:left;padding:0px; margin:0px;
}
.center_prod_box{
width:173px;height: auto;background:url(images/product_box_center.gif) repeat-y;float:left;
text-align:center;padding:0px; margin:0px;
}
.prod_details_tab{
width:173px;
height:31px;
float:left;
background:url(images/products_details_bg.gif) no-repeat center;
margin:3px 0 0 0;
}
img.left_bt{
float:left;
padding:6px 0 0 6px;
}
a.prod_details{
width:25px;
display:block;
float:left;
background:url(images/square-blue-add.gif) no-repeat left;
padding:0 0 0 20px;
margin:7px 0 0 38px;
_margin:6px 0 0 35px;
text-decoration:none;
color:#0fa0dd;
}
/*---------prod_box_big----------*/
.prod_box_big{
width:554px;
height:auto;
float:left;
padding:10px 10px 10px 15px;
}
.top_prod_box_big{
width:554px;height:12px;background:url(images/details_box_top.gif) no-repeat center
bottom;float:left; padding:0px; margin:0px;
}
.bottom_prod_box_big{
width:554px;height:12px;background:url(images/details_box_bottom.gif) no-repeat center
top;float:left;padding:0px; margin:0px;
}
.center_prod_box_big{
29
width:554px;height: auto;background:url(images/details_box_center.gif) repeat-y;float:left;
text-align:center;padding:0px; margin:0px;
}
.product_img_big{
width:170px;
padding:5px 0 5px 10px;
float:left;
}
.details_big_box{
width:345px;
float:left;
padding:0 0 0 15px;
text-align:left;
}
.product_title_big{
color:#ea2222;
padding:5px 0 5px 0;
font-weight:bold;
font-size:14px;
}
.specifications{
font-size:12px;
font-weight:bold;
line-height:18px;
}
.thumbs{
padding:8px 5px 8px 5px;
border:1px #DFD1D1 solid;
margin:3px 0 0 0;
}
.thumbs a{
padding:3px;
}
.prod_price_big{
padding:5px 0 5px 0;
font-size:16px;
}
span.reduce{
color:#999999;
text-decoration:line-through;
}
span.price{
color:#ea2222;
}
a.addtocart{
width:76px;
height:27px;
display:block;
float:left;
background:url(images/addtocart.gif) no-repeat left;
30
padding:0 0 0 33px;
text-decoration:none;
line-height:27px;
color:#1c4a52;
}
a.compare{
width:76px;
height:27px;
display:block;
float:left;
margin:0 0 0 10px;
background:url(images/compare.gif) no-repeat left;
padding:0 0 0 33px;
text-decoration:none;
line-height:27px;
color:#1c4a52;
}
span.blue{
color:#5F9FAB;
}
/*---------------contact_form------------------*/
.contact_form{
width:355px;
float:left;
padding:0px 0 0 75px;
}
.form_row{
width:335px;
clear:both;
padding:10px 0 10px 0;
_padding:5px 0 5px 0;
color:#a53d17;
}
label.contact{
width:75px;
float:left;
font-size:12px;
text-align:right;
padding:4px 5px 0 0;
color: #333333;
}
input.contact_input{
width:253px;
height:18px;
background-color:#fff;
color:#999999;
border:1px #DFDFDF solid;
float:left;
}
textarea.contact_textarea{
31
width:253px;
height:50px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color: #999999;
background-color:#fff;
border:1px #DFDFDF solid;
float:left;
}
a.contact{
width:99px;
height:27px;
display:block;
float:right;
margin:0 0 0 10px;
background:url(images/contact_bt.gif) no-repeat left;
padding:0 0 0 10px;
text-decoration:none;
line-height:27px;
color:#1c4a52;
}
/*--------------footer----------------*/
.footer{
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;
}
.right_footer a:hover{
text-decoration:underline;
}
.center_footer{
float:left;
width:200px;
text-align:center;
32
color:#666666;
padding:10px 0 0 60px;
}
BACKEND
(ADMIN AREA)
Username : admin
Password : admin123
33
SCREENSHOTS
LOGIN PAGE
34
ADD CATEGORY
35
ADD PRODUCT
36
SEND NEWSLETTER
37
CODING
index.php
<?php
include("../config.php");
include("password.php");
include("login.php");
if($_REQUEST['page']=='')
{
$page='home';
}
else
{
$page=$_REQUEST['page'];
}
include($page.".php");
?>
login.php
<?php
$username=$_POST['username'];
$password=$_POST['password'];
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
session_start();
if(($username==$uname)&&($password==$upass))
{
$_SESSION['login'] = 'true';
}
else
{
if($_SESSION['login']=='true')
38
{
}
else
{
header("Location: loginform.php");
}
}
?>
loginform.php
<form style="padding:160px; border:1px solid" action="index.php" name="login"
method="post">
USERNAME : <input type="text" value="" name="username" /><br /><br />
PASSWORD : <input type="password" value="" name="password" /><br /><br />
<input type="submit" value="Log In" />
</form>
aboutus.php
<?php include("header.php"); ?>
<td style="padding-top:20px;" width="80%" valign="top">
<?php
if(isset($_REQUEST['update']))
{
$message = addslashes($_REQUEST['message']);
mysql_query("update settings set value='$message' where name='aboutus'");
echo "<font color=red><b>Updated Successfully</b></font><br /><br />";
}
?>
39
?>
</textarea>
</td>
</tr>
<tr>
<td colspan="2" height="30" width="10%" style="border:1px solid #CCCCCC; font-
weight:bold; text-align:center; padding:10px"><input type="submit" value="Update"
name="update" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
addproduct.php
<?php include("header.php"); ?>
<td width="100%" valign="top" style="padding:20px">
<?php
if(isset($_REQUEST['submit']))
{
$name=$_REQUEST['name'];
$category=$_REQUEST['category'];
$extended_name=$_REQUEST['extended_name'];
$availability=$_REQUEST['availability'];
$guarantee=$_REQUEST['guarantee'];
$delivery=$_REQUEST['delivery'];
$shipping_cost=$_REQUEST['shipping_cost'];
$original_price=$_REQUEST['original_price'];
$discounted_price=$_REQUEST['discounted_price'];
$image=$_REQUEST['image'];
$description=$_REQUEST['description'];
mysql_query("insert into products
(cat_id,name,name_extended,availability,guarantee,delivery,shipping_cost,original_price,dis
counted_price,image,description)
values($category,'$name','$extended_name','$availability','$guarantee','$delivery','$shipping_
cost',$original_price,$discounted_price,'$image','$description')");
echo "<font color=red><b>Product Added Successfully</b></font><br /><br />";
}
?>
40
<form name="addproduct" action="" method="get"><input type="hidden" name="page"
value="addproduct" /><input type="hidden" name="domain" value="<?=$domain ?>" />
<table width="100%" border="1" cellpadding="1" cellspacing="5">
<tr>
<td width="89" height="30">Category</td>
<td width="9" height="30"> </td>
<td height="30"><select name="category">
<?php
$data = mysql_query("select * from categories");
while($catdata = mysql_fetch_array($data))
{
?>
</select>
</td>
</tr>
<tr>
<td width="89" height="30">Name</td>
<td width="9" height="30"> </td>
<td height="30"><input type="text" name="name" /></td>
</tr>
<tr>
<td height="30">Extended Name</td>
<td height="30"> </td>
<td height="30"><input type="text" name="extended_name" /></td>
</tr>
<tr>
<td height="30">Availability</td>
<td height="30"> </td>
<td height="30"><input type="text" name="availability" /></td>
</tr>
<tr>
<td height="30">Guarantee</td>
<td height="30"> </td>
<td height="30"><input type="text" name="guarantee" /></td>
</tr>
<tr>
<td height="30">Delivery</td>
<td height="30"> </td>
<td height="30"><input type="text" name="delivery" /></td>
</tr>
<tr>
<td height="30">Shipping Cost</td>
<td height="30"> </td>
<td height="30"><input type="text" name="shipping_cost" /></td>
</tr>
<tr>
41
<td height="30">Original Price</td>
<td height="30"> </td>
<td height="30"><input type="text" name="original_price" /></td>
</tr>
<tr>
<td height="30">Discounted Price</td>
<td height="30"> </td>
<td height="30"><input type="text" name="discounted_price" /></td>
</tr>
<tr>
<td height="30">Image</td>
<td height="30"> </td>
<td height="30"><input type="text" name="image" /></td>
</tr>
<tr>
<td height="30">Description</td>
<td height="30"> </td>
<td height="30"><textarea name="description" cols="40" rows="6"></textarea></td>
</tr>
<tr>
<td height="30"> </td>
<td height="30"> </td>
<td height="30"><input type="submit" name="submit" value="Submit" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
emailsubscribers.php
<?php include("header.php"); ?>
<td style="padding-top:20px;" width="80%" valign="top">
<?php
if(isset($_REQUEST['sendemail']))
{
$message = $_REQUEST['message'];
42
$subject = $_REQUEST['subject'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:[email protected]' . "\r\n";
$headers .= 'Return-Path:[email protected]'. "\r\n";
$headers .= 'Reply-To:[email protected]'. "\r\n";
while($getsubsr = mysql_fetch_array($getsubs))
{
$to=$getsubsr['email'];
if(mail($to,$subject,$message,$headers))
{
echo "Your mail has been sent sucessfully to ". $to;
}
}
}
?>
43
</tr>
</table>
</body>
</html>
header.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Admin Control Panel</title>
<link type="text/css" href="style.css" rel="stylesheet" />
<style type="text/css">
<!--
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" colspan="3" bgcolor="#CCCCCC"><span class="style1">Admin
Control Panel</span></td>
</tr>
<tr>
<td width="15%" height="548" valign="top">
<?php include("leftpanel.php"); ?>
</td>
<td width="1%"> </td>
home.php
<?php include("header.php"); ?>
<?php
$products = mysql_num_rows(mysql_query("select id from products"));
$categories = mysql_num_rows(mysql_query("select id from categories"));
$hits = mysql_fetch_array(mysql_query("select * from settings where name='hits'"));
?>
<td width="84%" valign="top">
<p> </p>
<p>Total Products : <?php echo $products; ?></p>
<p>Total Categories : <?php echo $categories; ?></p>
<p>Total Hits : <?php echo $hits['value']; ?></p>
</td>
</tr>
44
</table>
</body>
</html>
leftpanel.php
<table width="200" border="1" cellpadding="5" cellspacing="0">
<tr>
<td><a href="?page=home">Statistics</a></td>
</tr>
<tr>
<td><a href="?page=addcategories">Add a Category</a></td>
</tr>
<tr>
<td><a href="?page=addproduct">Add a Product</a></td>
</tr>
<tr>
<td><a href="?page=subscribers">Subscribers</a></td>
</tr>
<tr>
<td><a href="?page=emailsubscribers">Send Newsletters</a></td>
</tr>
<tr height="10">
<td></td>
</tr>
<tr bgcolor="#CCCCCC">
<td>Edit Pages</td>
</tr>
<tr>
<td><a href="?page=contactus">Contact Us Page</a></td>
</tr>
<tr>
<td><a href="?page=aboutus">About Us Page</a></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><a href="logout.php">Logout</a></td>
</tr>
</table>
logout.php
<?
session_start();
$_SESSION['login'] = 'false';
45
session_destroy();
?>
password.php
<?php
$uname = "admin";
$upass = "admin123";
?>
style.css
td
{
border:0px solid #CCCCCC;
text-align:left;
font-family:Geneva, Arial, Helvetica, sans-serif;
font-size:12px;
}
td a
{
text-decoration:none;
color:#990000;
font-family:Geneva, Arial, Helvetica, sans-serif;
text-transform:uppercase;
padding:4px;
}
td a:hover
{
text-decoration:none;
color:#FF0000;
font-family:Geneva, Arial, Helvetica, sans-serif;
text-transform:uppercase;
background-color:#CCCCCC;
}
subscribers.php
<?php include("header.php"); ?>
<td width="100%" valign="top" style="padding:20px;">
46
<td height="30" width="40%" style="border:1px solid #CCCCCC; font-weight:bold;
text-align:center;">EMAIL</td>
<td height="30" width="25%" style="border:1px solid #CCCCCC; font-weight:bold;
text-align:center;">VERIFIED</td>
<td height="30" width="25%" style="border:1px solid #CCCCCC; font-weight:bold;
text-align:center;">SUBSCRIBE</td>
</tr>
<?php
$page = 0;
$page1 = 0;
$start=0;
if(isset($_REQUEST['pag']))
{
$page = $_REQUEST['pag'];
$page1 = $_REQUEST['pag'];
$start=5*$_REQUEST['pag'];
}
$fetcch=mysql_query("select * from subscribers limit $start, 5");
while($result=mysql_fetch_array($fetcch))
{
?>
<tr>
<td height="30" style="border:1px solid #CCCCCC; text-align:center;"><?php echo
$result['id']; ?></td>
<td height="30" style="border:1px solid #CCCCCC; text-align:center;"><?php echo
$result['email']; ?></td>
<td height="30" style="border:1px solid #CCCCCC; text-align:center;"><?php echo
$result['verified']; ?></td>
<td height="30" style="border:1px solid #CCCCCC; text-align:center;"><?php echo
$result['subscribe']; ?></td>
</tr>
<?php
}
?>
<tr>
<td height="30" colspan="2"> </td>
</tr>
<tr>
<td height="30" colspan="2" style="border:1px solid #CCCCCC; font-weight:bold;
text-align:center;"><?php
if($start==0)
{
}
else
{
$page = $page-1;
echo "<a href='?page=subscribers&pag=".$page."'>PREVIOUS</a>";
}
47
?>
</td>
<td height="30" colspan="2" style="border:1px solid #CCCCCC; font-weight:bold;
text-align:center;">
<?php
$start=$start+5;
if(mysql_num_rows(mysql_query("select * from subscribers limit $start,
5")))
{
$page1 = $page1+1;
echo "<a href='?page=subscribers&pag=".$page1."'>NEXT</a>";
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
addcategories.php
<?php
if(isset($_REQUEST['submit']))
{
$category=$_REQUEST['name'];
mysql_query("insert into categories (name) values('$category')");
echo "<font color=red><b>Product Added Successfully</b></font><br /><br />";
}
?>
48
<td height="30"> </td>
<td height="30"> </td>
<td height="30"><input type="submit" name="submit" value="Add Category" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
DATABASE STRUCTURE
Categories Table
49
Products Table
50
TESTING
Testing is the major quality control measure used during software development. Its basic
function is to detect error in the software. During requirement analysis & design, the
output is a document that is usually textual and non-executable. After the coding phase
computer program are can be executed for testing purposes. This implies testing not only
has to uncover error introduced during coding, but also error introduced during the
previous phases. Thus the goal of testing is to uncover requirement, design and coding
The starting point of testing is a Unit Testing. In this a module is tested separately and is
often performed by the coder himself simultaneously along with the coding of the
module. The purpose is to exercise different part of the module code to detect coding
errors. After this the modules are gradually integrated to subsystem, which are the
integrated to eventually form the entire system. During integration of the modules,
integration testing is performed to detect design error by focusing on the testing the
After the system is put together, system testing is performed. Here the system is tested
against the system requirements to see if all the requirements are met and if the system
demonstrate to the client, on the real-life data of the client, the operation of the system.
51
Testing is an extremely critical and time-consuming activity. It requires proper planning
of the overall testing process. Frequently the testing process starts with a test plan that
identifies all the test related activities that must be performed and specifies the schedule,
allocate the resources, and specifies guidelines for testing. The test plan specifies
conditions that should be tested, different units to be tested, and the manner in which the
modules will be integrated together. Then the different tests units, a test case specification
document is produced, which list all the different test cases, together with the expected
outputs. During the testing of the unit, the specified test cases are executed and the actual
result is compared with the expected output. The final output of the testing phase is the
test report and the error reports ( on of each unit tested). Each test report contains the set
of test cases and the result of executing the code with these test cases. The error report
describes the error encountered and the action taken to remove the errors.
We have used two ways for system testing. In the first way we myself tested the system.
We tested each phase one by one. In each phase we checked line-by-line coding and after
then we prepared a dry run for each phase to check the logical errors. When we felt that
It does not mean that we have removed all the problems of the system. But any problem is
52
BIBLIOGRAPHY
• WEBSITES www.google.com,
www.php.net,
www.html.com
53