You are on page 1of 22

INTRODUCTION

An Online Jewellery Shop The main goal of this project was to create
shopping cart, which allows customers to shop and purchase the Jewellery products
online.Moreover, the project is also designed in such a way it lets managers manage
theproducts information. Customers can orders products, and they will be contacted
tofurther process the orders.

In today’s busy world, people don’t have time for their personal needs. And
the technology fast that anyone can do by sitting in a room. If someone buy a new
things , he can buy online with the help of Internet.

The application is implemented in PHP and consists of two main


components:
• Admin and
• Customer side

Admin side consists of the features such as Creating Username & Password,
Input Items, Modify Items, Delete items, Query Sale Data, Query Database’s data, and
Logout.

2.SYSTEM CONFIGURATION

2.1Hardware Specification

The hardware requirements Online Jewellery Shop are

RAM : 4 GB
MONITOR : LCD COLOR
HARD DISK : 40 GB
KEYBOARD : Multimedia Keyboard
MOUSE : Optical Buttons

2.2 Software Specification


The software specifications are

OPERATING SYSTEM : Windows 7


FRONT END : PHP&HTML
BACK END : SQLite Database
SERVER : XAMPP server

3.SOFTWARE FEATURES
3.1 FRONT END
PHP
PHP is first an interpreted scripting language (actually precompiled opcodes), free, open
source and distributed under a license authorizing the modification and redistribution.

Portability
PHP is supported on multiple operating system This is for example the case of Microsoft
Windows ™ versions as well as systems based on UNIX base (Apple Mac OS X ™, Linux or
Sun Solaris).
It will be very easy to move an application written in PHP an original Windows server to a
Linux server without having to modify (or very little).

Execution
From a performance standpoint, PHP needs a Web server to run. All pages requested by a
client will be built by the web server, depending on the parameters passed, before being
returned to the client. The diagram below illustrates the principle of operation of PHP.

Note: it would have been possible to add a database server (local or remote) in this
illustration. Then we would have two additional steps that are querying the database for PHP
and retrieving results from the SQL server.

PHP Learning
PHP is a "high level" language whose syntax is very similar to the C language syntax.
Nevertheless, the rapid control of its syntax does not mean control of its features and its
concepts. A good knowledge and advanced use of PHP Programming requires a relatively
long learning curve.

PHP language of wealth


One of PHP's strengths is its richness in terms of functionality. Indeed, it has at the origin of
more than 3,000 native features ready-guaranteeing developers to overcome additional
development time and sometimes tedious. These functions among others to treat strings, to
operate mathematically on numbers, convert dates to connect to a database system,
manipulate files present on the server ...
PHP also draws its richness from its vibrant developer community. It was estimated at 500
000 people in 2003, but it is very likely that it has surpassed one million now. Community
developers profiles are very diverse. It there's those who bring new features and version to
version libraries, those that translate the documentation in multiple languages or
programmers with more modest skills that perform opensource applications ready for use.
Among the best known, we can cite the CMS (Joomla, SPIP, Dotclear, Wordpress ...), online
sales systems (OSCommerce) Forums (PHPBB, IPB, vBulletin) frameworks (Zend
Framework, Symfony , CakePHP, Jelix) ...

PHP, a reliable and efficient language


The language has now become a reliable language, efficient and viable. It is capable of
supporting sites that sollicent millions of daily requests. Many nationally and internationally
renowned companies trust it for the development of their website. We can mention among
them IBM, Le Monde, Le Figaro, Club-Internet, Orange, Yellow Pages ... A recent report
shows that 87% of companies use PHP.

PHP, a language designed for dynamic web applications


PHP has the main function to be specially designed for producing dynamic web applications.
By definition, an "application (or page) Dynamic" is a program capable of generating a single
page based on parameters passed to it.
A PHP script can be integrated directly into a html code. Small practical example below:
First PHP program: "Hello World"

<html>
<head>
<title> Hello World PHP </title>
</head>
<body>
<p>
<?php echo 'Hello World!'; ?>
</p>
</body>
</html>

The PHP script, clearly identified by two <?php (opening) and ?> (Closing) will cause the
writing of the Hello World string between html tags after his execution on the server.
We would also have achieved the same result by using the php script:
Therefore, we deduce that PHP is able to generate HTML (and other formats), which makes
all its interest. The presentation of the generated document is then completely dependent on
past conditions and initial parameters provided. Take the example of Amazon.com mail order
site. Registered users of the site have already placed several orders will be surprised to see
each new visit on their personalized page, a list of automatically selected products that meet
the criteria of its previous purchases. Each of these actions targeted direct marketing is
unique and generated by the interests of the consumer.
PHP for other application areas
With his wealth, PHP is not necessarily limited to the editing of dynamic web pages. It can
for example be used from the command line through the use of the executable php. This use
case then allows to execute scripts directly on the machines. A PHP script would then be in
favor of the machine. We can very well imagine a PHP program that can remove a number
of files in a folder. It is even possible to couple the use of PHP with a manager like cron tasks
a Linux server.
PHP is also the ability to create heavy applications operating without server or browser. That
traditional applications, autonomous and with windows. All this is done using the PHP GTK
available at: http://gtk.php.net
Another highlight of PHP is its ability to interface easily with many relational database
management systems (RDBMS). Among them we can find MySQL, Oracle, SQLite,
MSSQL, PostgreSQL ... With these systems coupled to the PHP language, it becomes
possible to distribute applications across multiple servers (Web server + database server). The
second interest is to make it an even more dynamic application. Indeed, the data (content) of
the application is now in the database and PHP will retrieve and manipulate them (processing
strings, check in files, generation of RSS feeds .. .).

PHP limits
Despite all the qualities that we attribute to the PHP language, some flaws still exist. For
example, in the case of very large applications, it may have some weaknesses and become
unsuitable. A language such as PERL would become more appropriate. This argument,
however, is very subjective since PHP developers improve the quality and robustness of
language.

HTML

HTML is the standard markup language for creating Web pages.

 HTML stands for Hyper Text Markup Language


 HTML describes the structure of a Web page
 HTML consists of a series of elements
 HTML elements tell the browser how to display the content
 HTML elements are represented by tags

A Simple HTML Document


EXAMPLE

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

Example Explained

 The <!DOCTYPE html> declaration defines this document to be HTML5


 The <html> element is the root element of an HTML page
 The <head> element contains meta information about the document
 The <title> element specifies a title for the document
 The <body> element contains the visible page content
 The <h1> element defines a large heading
 The <p> element defines a paragraph

HTML Tags

HTML tags are element names surrounded by angle brackets:

<tagname>content goes here...</tagname>

 HTML tags normally come in pairs like <p> and </p>


 The first tag in a pair is the start tag, the second tag is the end tag
 The end tag is written like the start tag, but with a forward slash inserted before the
tag name

HTML Page Structure

Below is a visualization of an HTML page structure:

<html>
<head>
<title>Page title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration represents the document type, and helps browsers to display
web pages correctly.

It must only appear once, at the top of the page (before any HTML tags).

The <!DOCTYPE> declaration is not case sensitive.

The <!DOCTYPE> declaration for HTML5 is:

<!DOCTYPE html>

HTML Versions

Since the early days of the web, there have been many versions of HTML

Major Versions

HTML 2.0

HTML 2.0 is released in 1995 and it was the standard for website design until January 1997
and defined many core HTML features for the first time. HTML 2.0 starts supports core
HTML elements and features such as tables and forms with limited set of form elements such
as text boxes, and option buttons .

HTML 3.2

HTML 3.2 finalized by the W3C in early 1997. This version included support for creating
tables and expanded options for form elements. It also allowed web pages to include complex
mathematical equations. This version of HTML supports many presentation-focused elements
such as font, as well as early support for some scripting features.
HTML 4.01

HTML 4.01 is the current official standard. This version is very stable, having been released
in December 1999. This version added support for style sheets and scripting ability for
multimedia elements.

HTML 5
The HTML5 specification that we see today has been published as a working draft and it is
not yet final. HTML5 is still a work in progress, and all major browsers support many of the
new HTML5 elements and APIs. Its core aim have been to improve the language with
support for the latest multimedia while keeping it easily readable by humans and consistently
understood by computers and devices.

3.2 BACKEND:
SQLite Features:

Zero-Configuration

SQLite does not need to be "installed" before it is used. There is no "setup"


procedure. There is no server process that needs to be started, stopped, or configured. There
is no need for an administrator to create a new database instance or assign access permissions
to users. SQLite uses no configuration files. Nothing needs to be done to tell the system that
SQLite is running. No actions are required to recover after a system crash or power failure.
There is nothing to troubleshoot.

Server less

Most SQL database engines are implemented as a separate server process. Programs
that want to access the database communicate with the server using some kind of inter
process communication (typically TCP/IP) to send requests to the server and to receive back
results. SQLite does not work this way. With SQLite, the process that wants to access the
database reads and writes directly from the database files on disk. There is no intermediary
server process.
There are advantages and disadvantages to being server less. The main advantage is
that there is no separate server process to install, setup, configure, initialize, manage, and
troubleshoot. This is one reason why SQLite is a "zero-configuration" database engine.
Programs that use SQLite require no administrative support for setting up the database engine
before they are run. Any program that is able to access the disk is able to use an SQLite
database.

On the other hand, a database engine that uses a server can provide better protection
from bugs in the client application - stray pointers in a client cannot corrupt memory on the
server. And because a server is a single persistent process, it is able control database access
with more precision, allowing for finer grain locking and better concurrency.

Most SQL database engines are client/server based. Of those that are server less,
SQLite is the only one that this author knows of that allows multiple applications to access
the same database at the same time.

Single Database File

An SQLite database is a single ordinary disk file that can be located anywhere in the
directory hierarchy. If SQLite can read the disk file then it can read anything in the database.
If the disk file and its directory are writable, then SQLite can change anything in the
database. Database files can easily be copied onto a USB memory stick or emailed for
sharing.

Other SQL database engines tend to store data as a large collection of files. Often
these files are in a standard location that only the database engine itself can access. This
makes the data more secure, but also makes it harder to access. Some SQL database engines
provide the option of writing directly to disk and bypassing the file system all together. This
provides added performance, but at the cost of considerable setup and maintenance
complexity.

Stable Cross-Platform Database File

The SQLite file format is cross-platform. A database file written on one machine can
be copied to and used on a different machine with a different architecture. Big-endian or
little-endian, 32-bit or 64-bit does not matter. All machines use the same file format.
Furthermore, the developers have pledged to keep the file format stable and backwards
compatible, so newer versions of SQLite can read and write older database files.

Most other SQL database engines require you to dump and restore the database when
moving from one platform to another and often when upgrading to a newer version of the
software.

Compact

When optimized for size, the whole SQLite library with everything enabled is less
than 500KiB in size (as measured on an ix86 using the "size" utility from the GNU compiler
suite.) Unneeded features can be disabled at compile-time to further reduce the size of the
library to under 300KiB if desired.

Most other SQL database engines are much larger than this. IBM boasts that its
recently released Cloud Scape database engine is "only" a 2MiB jar file - an order of
magnitude larger than SQLite even after it is compressed! Firebird boasts that its client-side
library is only 350KiB. That's as big as SQLite and does not even contain the database
engine. The Berkeley DB library from Oracle is 450KiB and it omits SQL support, providing
the programmer with only simple key/value pairs.

Manifest typing

Most SQL database engines use static typing. A data type is associated with each
column in a table and only values of that particular data type are allowed to be stored in that
column. SQLite relaxes this restriction by using manifest typing. In manifest typing, the data
type is a property of the value itself, not of the column in which the value is stored. SQLite
thus allows the user to store any value of any data type into any column regardless of the
declared type of that column. (There are some exceptions to this rule: An INTEGER
PRIMARY KEY column may only store integers. And SQLite attempts to coerce values into
the declared data type of the column when it can.)

As far as we can tell, the SQL language specification allows the use of manifest
typing. Nevertheless, most other SQL database engines are statically typed and so some
people feel that the use of manifest typing is a bug in SQLite. But the authors of SQLite feel
very strongly that this is a feature. The use of manifest typing in SQLite is a deliberate design
decision which has proven in practice to make SQLite more reliable and easier to use,
especially when used in combination with dynamically typed programming languages such as
Tcl and Python.

Variable-length records

Most other SQL database engines allocated a fixed amount of disk space for each row
in most tables. They play special tricks for handling BLOBs and CLOBs which can be of
wildly varying length. But for most tables, if you declare a column to be a VARCHAR(100)
then the database engine will allocate 100 bytes of disk space regardless of how much
information you actually store in that column.

SQLite, in contrast, use only the amount of disk space actually needed to store the
information in a row. If you store a single character in a VARCHAR (100) column, then only
a single byte of disk space is consumed. (Actually two bytes - there is some overhead at the
beginning of each column to record its data type and length.)

The use of variable-length records by SQLite has a number of advantages. It results in


smaller database files, obviously. It also makes the database run faster, since there is less
information to move to and from disk. And, the use of variable-length records makes it
possible for SQLite to employ manifest typing instead of static typing.

Readable source code

The source code to SQLite is designed to be readable and accessible to the average
programmer. All procedures and data structures and many automatic variables are carefully
commented with useful information about what they do. Boilerplate commenting is omitted.

SQL statements compile into virtual machine code

Every SQL database engine compiles each SQL statement into some kind of internal
data structure which is then used to carry out the work of the statement. But in most SQL
engines that internal data structure is a complex web of interlinked structures and objects. In
SQLite, the compiled form of statements is a short program in a machine-language like
representation. Users of the database can view this virtual machine language by prepending
the EXPLAIN keyword to a query.

The use of a virtual machine in SQLite has been a great benefit to the library's
development. The virtual machine provides a crisp, well-defined junction between the front-
end of SQLite (the part that parses SQL statements and generates virtual machine code) and
the back-end (the part that executes the virtual machine code and computes a result.) The
virtual machine allows the developers to see clearly and in an easily readable form what
SQLite is trying to do with each statement it compiles, which is a tremendous help in
debugging.

. 4.PROJECT DESCRIPTION
4.1.OVERVIEW OF THE PROJECT

8.CONCLUSION

While developing the system a conscious effort has been made to create and
develop a software package, making use of available tools, techniques and resources –
that would generate a proper System While making the system, an eye has been kept on
making it as user-friendly, as cost-effective and as flexible as possible. As such one may
hope that the system will be acceptable to any user and will adequately meet his/her
needs. As in case of any system development processes where there are a number of
shortcomings, there have been some shortcomings in the development of this system
also. The project is still under modification.
9.FUTURE ENHANCEMENTS
This application avoids the manual work and the problems concern with it. It is an easy way
to obtain the information regarding the various jewellery information that is present in the
online web site. Well I and my team members have worked hard in order to present an
improved web site better than the existing one’s regarding the information about the various
activities. Still, we found out that the project can be done in a better way.

Primarily, when we request information about a particular jewellery it just jewellery


name and jewellery id, etc available. So, after getting the information we can get access to the
jewellery company web site just by a click on the jewellery name. The next enhancement that
we can add the searching option.

We can directly search to the particular jewellery company from this web site .These are the
two enhancements that we could think of at present In the future I want to Enhanced my
project with the admin part of online jewellery shopping. Add more jewellery types in my
carat lane web-site. Make it user-friendly environment. Adding more security level in my
website.

10.APPENDICES
1.SAMPLE SOURCE CODE

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>BB Jewellery :: Login Screen</title>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script>
$('#btnClose').click(function(e) {
$('#loginDiv').hide(0);
});
</script>
</head>
<body>
<form id="ajaxform" method="post" action="processlogin.php">
<div id="login_center_main" style="text-align:center">
<div id="closeLogin" style="text-align:right;">
<a href="#">
<img src="image/close.jpg" width="10%" height="10%" id="btnClose"
/></a>
</div>
<div id="inputDivLogin">
<div id="LoginLabel"><b>Username</b></div>
<div id="LoginInput"><input type="text" name="txtusername"
class="Logintextboxes"/></div>

</div>
<br />
<div id="inputDivLogin">
<div id="LoginLabel"><b>Password</b></div>
<div id="LoginInput"><input type="password"
name="txtpassword" class="Logintextboxes"/></div>
</div>
<br />
<div id="inputDivLoginControl">
<div>
<input id="btnSignin" class="LoginButton" type="submit" value="Sign
in" />
<input class="LoginButton" id="btnClear" type="reset" value="Clear" />
</div>
</div>
</div>
</form>
</body></html>

1.2 INDEX

<?php
$start = microtime(true);
session_start(); // start a session
if (isset($_SESSION['user_id'])) { // check if session user_id is set
$userid = $_SESSION['user_id']; //if it is set, assign the value to the variable
$userid
}
else { // if it is not set
$userid = ""; // assign a null value to $userid
}
echo "User ID: " . $userid; //print it on screen.
?>
<?php
$_SESSION['code'] = rand(); // assign a random value to
$_SESSION['code']
$code = $_SESSION['code']; // then assign the value to $code
echo "<br />Code: " . $code; // print the value of $code
?>
<?php
// User is already logged in.
if (isset($_SESSION['username'])) { //check if session username is set
$User = $_SESSION['username']; // if it is, assign the value to $User
}
else {
$User = ""; // else $User will be null
}
?>

<!-- Head1 Part Start-->


<?php include("head1.html");?>
<!-- Head1 Part End-->
<!-- Top Part Start-->
<?php
if($User != "")
{
include("top_links2.php");
}
else
{
include("top_links.php");
}
?>
<!-- Top Part End-->

<!-- Main Div Tag Start-->


<div id="wrapper">

<!-- Header Part Start-->


<?php
if($User != "")
{
include("header2.php");
}
else
{
include("header.php");
}
?>
<!-- Header Part Start-->
<!-- Middle Part Start-->
<!-- Section Start-->
<?php include("section.html"); ?>
<!--Section End-->
<!--Middle Part End-->

<!--Random Featured Product Start-->


<div class="box mb0" id="randomfeatured">
<div class="box-heading-1"><span>Random
Featured</span></div>
<div class="box-content-1">
<div class="box-product-1" >
<?php
// Included configuration file in our
code.
include("randomfeatured.php");
?>
</div>
</div>
</div>
<!--Random Featured Product End-->

<!--Special Promo Banner Start-->


<div class="box-promo" id="box-promo">
<div class="box-heading-1"><span>PROMO ON
FEATURED ITEMS</span></div>
<div id="banner0" class="banner">
<div style="display:block;"><img
src="image/addBanner-940x145.jpg" alt="Special Offers" title="Special Offers"
/></div>
</div>
</div>
<!--Special Promo Banner End-->
<!--Coming Soon Product Start-->
<div class="box-heading-1" id="soon">
<div class="box-heading-1"><span>Coming
Soon</span></div>
<div id="carousel0">
<ul class="jcarousel-skin-opencart">
<!--Coming Soon Product End-->

<!--Carousel Start-->
<?php
// Included configuration file in our
code.
include("comingsoon.php");
?>

</ul>
</div>
</div>
<!--Carousel End-->

<!--Footer Part Start-->


<?php include("footer.php");?>
<!--Footer Part End-->
</div>
<!-- Main Div Tag End-->

<!--Flexslider Javascript Part Start-->


<?php include("flexslider.php");?>
<!--Flexslider Javascript Part End-->
<?php
$end = microtime(true);
$elapsed = $end - $start;
echo "Procedure 1 = {$elapsed} seconds";
?>
</body>
</html>

1.3 HEADER
<header id="headerWrapper">
<div id="header">
<div id="logo">
<a href="index-1.php"><img src="image/logo.png"
title="BB Jewellery Logo" alt="Our Logo" /></a>';
</div>

<div id="welcome"> Welcome visitor <a href="#"


onClick="showLogin();">Login</a> or <a href="register.html">Sign Up</a>. </div>

<div id="loginDiv" class="LoginDiv">


</div>
</div>
<!-- Main Navigation Start-->
<?php include("navigation.php");?>
<!-- Main Navigation End-->
<div id="SearchDiv" class="SearchDiv">
</div>
</header>

8.4 BACKEND
<?php
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
}
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>

<?php

include("includes/mysqli_connection.php");
$sql = "SELECT COUNT(*) FROM cart WHERE cust_id =
$userid AND checkout = 'n'";
$query = (mysqli_query($db_conx,$sql));
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
$countrows = $rows;
$totalquantity = 0;
$subtotal = 0;
$totalamount = 0;
$vat = 0.15;
$delivery = 500;
$selectproducts = "SELECT * FROM cart , jewellery WHERE
cart.cust_id = $userid AND jewellery.id = cart.jewel_id AND checkout = 'n'";
$query = mysqli_query($db_conx, $selectproducts);
for($loop = 0; $loop < $countrows; $loop++)
{
while($row = mysqli_fetch_array($query,
MYSQLI_ASSOC))
{
$jewelid = $row["jewel_id"];
$qty = $row["qty"];
$userid = $row["cust_id"];
$checkout = $row["checkout"];
$prodname = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = $row["price"];
$desc = $row["descr"];
$width="150px";
$height="150px";
$amount = ($qty * $price);
$amount = round($amount);
if (round($amount*10) == $amount*10 &&
round($amount)!=$amount) $amount = "$amount"."0"; //to avoid prices like 17.5
- write 17.50 instead
{
if (round($amount) == $amount) //add .00
{
$amount = "$amount".".00";
}
}
$totalquantity = $totalquantity + $qty;
$subtotal = $subtotal + $amount;
$vat = round(0.15 * $subtotal);
$totalamount = ($subtotal + $vat + $delivery);
}
}
?>
<!-- Header Part Start-->
<header id="headerWrapper">
<div id="header">
<div id="logo">
<a href="index-1.php"><img
src="image/logo.png" title="BB Jewellery Logo" alt="Our Logo" /></a>
</div>
<!-- Mini Cart Start-->
<div id="cart">
<div class="heading"><a href="cart.php"><span
id="cart-total"><?php echo $countrows;?> item(s) - Rs <?php echo
$totalamount;?></span></a></div>

</div>
<!-- Mini Cart End-->
<?php
// Display Username
echo '<div id="welcome"> Welcome <b>' . $User .
'</b> || <a href="logout.php">Log Out</a></div>';
?>
</div>

<!-- Main Navigation Start-->


<?php include("navigation.php");?>
<!-- Main Navigation End-->

<div id="SearchDiv" class="SearchDiv">

</div>
</header>
<!-- Header Part End-->

You might also like