Sie sind auf Seite 1von 118

Table of Contents

Page No.

Chapter 1. Introduction

1) Introduction to the System 4


2) Problem Definition 4
3) Aim 4
4) Objective 4
5) Goal 5
6) Need of System 5

Chapter 2. Hardware and Software requirement

1) Introduction 7
2) System environment 7
3) Software requirement 8
4) Hardware requirements 8

Chapter 3. System Analysis

1) Purpose 9
2) Project Scope 9
3) Existing System 9
4) Proposed System 9
5) System Description 10

Page 1
Chapter 4.Implementation issues

1) PHP 11
2) AJAX 13
3) Cascading style sheet(CSS) 16
System Description
Chapter 5. System Design
1) Introduction 21
2) Conceptual Design 22
3) ER-Diagram 23
4) Logical Design 23
5) Physical Design 24
6) Data Flow Diagram of “Online Tourism Guide”
24

Chapter 6.User Screens 25-32

Chapter 7.Coding 33-113

Chapter 8. Conclusion
7) Features of “Online Tourism Guide” 114
8) Benefits Accrued from “Online Tourism Guide” 114
9) Limitations of “Online Tourism Guide” 115

Bibliography

Page 2
CHAPTER # 1

Introduction
Contents:

 Introduction
 Problem Definition
 Aim
 Objective
 Goal
 Need of System

Page 3
Introduction to the System:
The Online Tourism Guide is a java based website that helps the tourists in
exploring and planning to visit places according to city and kind of place. This
website plans the tour such that the user can save more time in exploring
maximum places rather than wasting time in reaching his destinations.

Initially, it takes the information about the city and kind of place, the
user want to visit. Then it will show the list of places of attractions of
that place from which the user can opt the places of his choice

according to his priority. .

Aim:
“Help tourist to search places and increase tourism”.

Objective:
This website is very useful to all the people who love to travel in planning
a time efficient trips where he or she can save time to visit new places
rather than getting lost in an unaware place.

Page 4
CHAPTER #2
Hardware and
Software
Requirements

Contents:

Introduction
 System environment
 Software requirement
 Hardware requirements

Page 5
Introduction:
In this chapter we mentioned the software and hardware requirements, which
are necessary for successfully running this system. The major element in
building systems is selecting compatible hardware and software. The system
analyst has to determine what software package is best for the “Online
Tourism Guide System” and, where software is not an issue, the kind of
hardware and peripherals needed for the final conversion.
System Environment:
After analysis, some resources are required to convert the abstract system into
the real one. All the resources, which accomplish a robust
The hardware and software selection begins with requirement analysis,
followed by a request for proposal and vendor evaluation.

Software and real system, are identified. According to the provided functional
specification all the technologies and its capacities are identified. Basic
functions and procedures and methodologies are prepared to implement. Some
of the Basic requirements such as hardware and software are described as
follows: -
Hardware and Software Specification
Software Requirements:

 Operating System : Window 7/8/10 or Linux

 Netbeans

 MYSQL

 Glassfish Server/Apache Tomcat Server

Hardware Requirements:

 Processor - 2.0 GHz or above.

 2 GB RAM or more.

 160 GB or more Hard Disk Drive.

Page 6
CHAPTER # 3
System Analysis

Contents:

Purpose
 Project Scope
 Existing System
 Proposed System
 System Overview

Page 7
Purpose:
This website is very useful to all the people who love to travel in planning a time
efficient trips where he or she can save time to visit new places rather than getting
lost in an unaware place.

Project Scope:
The project has a wide scope, as it is not intended to a particular organization. This
project is going to develop generic software, which can be applied by any businesses
organization. More over it provides facility to its customer. Also the software is going
to provide a huge amount of summary data.

Proposed System:
For people who want the trip planned entirely, who don’t want to use the
filtering method of pen and paper or trace filtering tour guide helps them
completely. The tour guide is a website that helps vacation goers plan out
where to go and what to see based on their interests.

System Overview:
The key features required in the system are as follows:

 Login: The ADMIN has all the rights in the software including updating
the status of his site. The fields in login are username and password. If
the username and password are correct then it is directed to admin home
page.

 New user: This module is for the users who do not have their account.
Here user is no need to create an account to login. User can search places
by selecting city and kind of place.

 Places: This module has information regarding the places such as its
name, image, description, rating , location , kindofplace etc.The ADMIN
has the authority to Add, Delete, Update etc. The USER can only view
the places.

Page 8
 Search: This module helps the user to ease his search based on his city
and kindofplace.

CHAPTER # 4
Implementation issues
4.1 JSP
Definition of JSP:

JavaServer Pages (JSP) is a technology used to develop interactive Web pages.


JSP was developed by Sun Microsystems and is an improved version of Java
servlets.
JSP may be developed in a simplified manner and has a wide range of
applications. As with most server-based technologies, JSP separates business
logic from the presentation layer.

JSPs are normal HTML pages with embedded Java code. To process a JSP file,
developers need a JSP engine, which is connected to a Web server. The JSP
page is then compiled into a servlet, which is handled by the servlet engine.
This phase is known as translation. The servlet engine then loads the servlet
class and executes it to create dynamic HTML, which is then sent to the
browser.

4.2 HTML

Page 9
HTML (Hypertext Markup Language) is the set of markup symbols or
codes inserted in a file intended for display on a World Wide
Web browser page. The markup tells the Web browser how to display a
Web page's words and images for the user. Each individual markup code is
referred to as an element (but many people also refer to it as a tag). Some
elements come in pairs that indicate when some display effect is to begin
and when it is to end.

4.3 CASCADING STYLE SHEET(CSS)

What are Cascading Style Sheets?


Cascading Style Sheets (CSS) are a collection of rules we use to define and modify web
pages. CSS are similar to styles in Word. CSS allow Web designers to have much more
control over their pages look and layout. For instance, you could create a style that defines
the body text to be Verdana, 10 point. Later on, you may easily change the body text to Times
New Roman, 12 point by just changing the rule in the CSS. Instead of having to change the
font on each page of your website, all you need to do is redefine the style on the style sheet,
and it will instantly change on all of the pages that the style sheet has been applied to. With
HTML styles, the font change would be applied to each instance of that font and have to be
changed in each spot.

CSS can control the placement of text and objects on your pages as well as the look of those
objects.

HTML information creates the objects (or gives objects meaning), but styles describe how the
objects should appear. The HTML gives your page structure, while the CSS creates the

Page 10
“presentation”. An external CSS is really just a text file with a .css extension. These files can
be created with Dreamweaver, a CSS editor, or even Notepad.

The best practice is to design your web page on paper first so you know where you will want
to use styles on your page. Then you can create the styles and apply them to your page.

Css Rules
A Style Sheet is made up of Rules. A Rule is one or more properties that will be applied to
one or more elements. Each rule will have a selector and a definition. A Style Sheet can be
collection of Styles; however, a style sheet could have just one style.

A style rule consists of a selector and the properties or attributes of that selector that are to be
affected. These properties or attributes are contained within curly brackets and called the
style definition. For example in the style rule: h2 {color: red; font-family: Arial ;}, h2 is
the selector and the rest (within the curly brackets) is the style definition. The standards of the
style rules are that each attribute is followed by a colon (:) followed by the value for that
attribute. Then each set (of attribute and value) is followed by a semicolon (;). Several style
attributes can be assigned at one time to a tag or selector or multiple tags. For example you
could specify the font family and color of all the heading tags at once (with a comma between
each one) and then give each one a separate size in a different rule.
Several tags being defined at once:

h1,h2,h3,h4 {
color: #ff3300;
font-family: Arial;
}
Then define the size of this one tag separately:

h1{
font-size: 160%;
}

To define a style using Dreamweaver, you can either redefine the predefined tags such as the
Heading 1 tag, Heading 2 tag, the paragraph tag, etc. or define a custom style that you create.

Page 11
The tag or the custom style is the selector. One custom style is called a class. Classes can be
used many times. Another custom style is an ID. An ID is similar to a class, but it can only
be used once. You can also create specific styles by combining selectors. For example you
could set up a sidebar for News and specify that only paragraph text within that section
should be a particular color or size.
.news p {
font-size: 80%;
color: blue;
}

CSS Styles

There are three kinds of Styles: Inline, Embedded (or Internal), and External (or Linked).
One or more types of styles can be used for each web page.

Inline styles are very similar to HTML styles in that they are placed in the <body> of your
document and good for only that one instance. The style definition must be marked by
<style= attributes:values;> tags. This type is not commonly used because they are specific
to each instance and would be time consuming to change and could not be used for other
pages in your site.

Embedded / Internal styles are placed in the <head> of your document with the tag
<style type=”text/css”> tags.
The selector and the definition will be enclosed by comment markers <!-- --> and end with
</style> and will be good for the whole page. Comment markers are good for documentation
or to hide information from older browsers.

An External (Linked) Style Sheet is a totally separate document from the HTML document
and can be linked to and utilized by many pages. Create the link in this manner:
<link rel="stylesheet" type="text/css"
href="full/path/to/stylesheet.css">
This is telling the browser that the link relates to a CSS style sheet, it is in text and the path to
the sheet follows the href tag.

Page 12
The external style sheet contains no HTML tags. HTML tags in a style sheet can cause it to
not function properly. It even has it’s own comment tag :
/* CSS Comment */

Using External Style Sheets takes advantage of one of the most powerful features of CSS
which is the ability to make changes to the style and have it immediately change all of your
web pages. For example if you have a particular color scheme that needs to be changed you
would just have to change the properties in the style sheet and all of the pages linked to that
sheet would be changed. Also if you create a style and reuse it several times you shrink the
size of your file. Therefore, the External style sheet is the type of style sheet used most
often.

Javascript

JavaScript is a programming languagecommonly used in web development. It


was originally developed by Netscape as a means to add dynamic and
interactive elements to websites. While JavaScript is influenced byJava,
the syntax is more similar to C and is based on ECMAScript, a scripting
language developed by Sun Microsystems.
JavaScript is a client-side scripting language, which means the source code is
processed by the client's web browser rather than on the web server. This means
JavaScript functions can run after a webpage has loaded without
COMMUNICATING with the server. For example, a JavaScript function may
check a web form before it is submitted to make sure all the required fields have
been filled out. The JavaScript code can produce an error message before any
information is actually transmitted to the server.
Like server-side scripting languages, such as PHP and ASP, JavaScript code can
be inserted anywhere within the HTML of a webpage. However, only

Page 13
the output of server-side code is displayed in the HTML, while JavaScript code
remains fully visible in the source of the webpage. It can also be referenced in a
separate .JS file, which may also be viewed in a browser.

CHAPTER # 5
System Design

Contents:
 Use case diagram
 Class Diagram
 Sequence Diagram
 Data flow diagram

Page 14
Use Case Diagram:

 Use case diagram consists of use cases and actors and shows the interaction
between them. The key points are:

 The main purpose is to show the interaction between the use cases and the
actor.

 To represent the system requirement from user’s perspective.

 The use cases are the functions that are to be performed in the module.

Manage Places

Manage City


Manage
ADMIN Category
SYSTEM

Manage
Contacts

Use Case Diagram between ADMIN and SYSTEM:

Page 15
Fig.5.1

View Places

Give Feedback

View Map

USER Fig.5.2
Send Query SYSTEM

Use Case Diagram between USER and SYSTEM:

Page 16
Class Diagram:

Fig.5.3

Page 17
Sequence Diagram For Administrator:-

Page 18
Login Application Database

Login
:Request

:Validate()
:executeQuery()

Administrator Response
Show Result

Success:hide() Failed:show()

Fig.5.4

Sequence Diagram For User:-

Page 19
Fig.5.5

Activity Diagram

Data Flow Diagram


A Data Flow Diagram (DFD) is a graphical representation of the "flow" of data
through an Information System. A data flow diagram can also be used for the

Page 20
visualization of Data Processing. It is common practice for a designer to draw a
context-level DFD first which shows the interaction between the system and
outside entities. This context-level DFD is then "exploded" to show more detail
of the system being modeled.

A DFD represents flow of data through a system. Data flow diagrams are
commonly used during problem analysis. It views a system as a function that
transforms the input into desired output. A DFD shows movement of data
through the different transformations or processes in the system.

Dataflow diagrams can be used to provide the end user with a physical idea of
where the data they input ultimately has an effect upon the structure of the
whole system from order to dispatch to restock how any system is developed
can be determined through a dataflow diagram. The appropriate register saved
in database and maintained by appropriate authorities.

Data Flow Diagram Notation

Function

File/Database

Input/output

Flow

Data Flow Diagram of the Shopping Site

Level 0

Input Output
Admin/User
Page 21
System Database
Level1

Enter the site

Authenticate
User

Check Display errors


whether
Admin or
customer
Customer Admin

View product Buy product Check Verify


products customer

Products Customer details

Entity Relationship Diagrams (ER-Diagrams):


An entity-relationship (ER) diagram is a specialized graphic that illustrates the
interrelationships between entities in a database. ER diagrams often use
symbols to represent three different types of information. Boxes are commonly
used to represent entities. Diamonds are normally used to represent
relationships and ovals are used to represent attributes

An entity-relationship model (ERM) in software engineering is an


abstract and conceptual representation of data. Entity-relationship modeling is a
relational schema database modeling method, used to produce a type of
conceptual schema or semantic data model of a system, often a relational
database, and its requirements in a top-down fashion.

Symbols used in this E-R Diagram:

Page 22
Entity: Entity is a “thing” in the real world with an independent existence. An
entity may be an object with a physical existence such as person, car or
employee. Entity symbol is as follows

Attribute: Attribute is a particular property that describes the entity. Attribute


symbol is

Relationship: Relationship will be several implicit relationships among various


entity types whenever an attribute of one entity refers to another entity type
some relationship exits. Relationship symbol is:
Key attributes: An entity type usually has an attribute whose values are
distinct for each individual entity in the collection. Such an attribute is called
key attribute. Key attribute symbol is as follows

-Table - Primary Key -Link


-Fields -Relationship M: N-Cardinality Relation

Page 23
ProID LoginID
DOJ
ProNam
e
Passwor
d
Product Reque Member
ProCom st
p MNam
e
ProCat
Price
dob PhoneN
o
Place Order
User Name Passwor
d OrdNo

Check the
Login Login ID Order Detail
LoginID

Qty Proid

Req. New
Member

Name Addres
s
Registration
Passwor City
d
State
EMail

Phone Pin code

Country

Page 24
Page 25
CHAPTER # 6
User Screens and Report
Output screens

HOME PAGE

Page 26
ABOUT US PAGE

Page 27
FIND PLACES PAGE

Page 28
CUSTOMER HOME PAGE

Page 29
ADMIN HOME PAGE

Page 30
Manage Cakes Page

Page 31
Manage Chocolates Page

Page 32
Manage Electronics Page

Page 33
Manage Flowers Page

Page 34
Manage Fashion Page

Page 35
Manage Occassion

Page 36
Manage Home and Living Page

Page 37
Manage Toys and Gifts

Page 38
Feedback

Page 39
About Us

Page 40
Contact US

Page 41
Manage Booking

View Cakes

Page 42
Page 43
View Electronics Page

Page 44
View Flowers Page

Page 45
Fill Booking Information

Page 46
Page 47
CHAPTER # 7
Coding

ADMIN PAGE CODING


<?php
@session_start();
include_once '..\dbconfig.php';
$lmsg='';
if( verifyrole('Admin')==false ) { header('Location:login.php'); }
$un=fetchusername();
$role='Anonymous';
$role=fetchrole();
$lmsg.="Welcome $un ($role) ";
if($un=='Guest') {
$lmsg.='<br/>Existing User<a href=login.php>Login</a>';
$lmsg.='<br/>New user<a href=signup.php>Signup</a>';
}
else

Page 48
{
$lmsg.='<br/><a href=logout.php>logout</a>';
}
?>
<html>
<?php

if(file_exists('head_temp.php')) { include_once 'head_temp.php'; }

?>
</head><body>

<?php if(file_exists('top_temp.php')) { include_once 'top_temp.php'; } ?>


<div align="center">
<h1>
Admin Section </h1>
</div>
<?php if(file_exists('bottom_temp.php')) { include_once 'bottom_temp.php'; } ?>

Page 49
LOGIN CODING
<html>
<?php
@session_start();
$lmsg="";
include_once('../dbconfig.php');
if(
isset($_REQUEST['signin']))
{
$u=$_REQUEST['uname'];
$p=$_REQUEST['upwd'];
if(isset($_REQUEST['rem']))
$r="yes";
else
$r="no";
$n=verifyuserff($u,$p,$r);
if($n==1)
{
$page=rolepage();
header("Location:$page");
}
else
{
header("Location:failure.php");
}
Page 50
}

if(file_exists('head_temp.php')) { include_once 'head_temp.php'; }

?>
</head><body>

<?php if(file_exists('top_temp.php')) { include_once 'top_temp.php'; } ?>


<div align="center">
<form method="post">
<table border=0 cellspacing=4 width=450 align=center cellpadding=4 height=400>
<tr>
<td width=450 COLSPaN=2 align=center><b>SignIn Form</b></td>
</tr>
<tr>
<td width=225>Enter username (email) </td>
<td width=225><input type=text name=uname id=uname maxlength=45 /></td>
</tr>
<tr>
<td width=225>Enter password </td>
<td width=225><input type=password name=upwd id=upwd /></td>
</tr>
<tr>
<td width=225>Remember Me </td>
<td width=225><input type=checkbox name=rem id=rem value=yes /></td>
</tr>
<tr>
<td width=450 colspan=2 align=center><input type=submit name=signin id=signin
value=signin />
</td>
</tr>
<tr><td colspan=2 height=300>&nbsp;</td></tr>
</table>
</form>
Page 51
</div>
<?php if(file_exists('bottom_temp.php')) { include_once 'bottom_temp.php'; } ?>

ADMIN HOME PAGE CODING

<html>
<head>
<?php
include "header.php"; ?>
</head>
<body>
<?php include "top.php"; ?>
<div>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<?php
/*
on authentic page, only valid users of website can visit
strangers(anonymous) are not allowed
*/
Page 52
@session_start();
include_once "dbconfigure.php";
$msg="";
if(verifyuser())
{
if(fetchrole()=='admin')
{
$un=fetchusername();
$msg="Welcome $un , <br /><a href='signout.php'>Signout</a>";
}
else
{
header("Location:loginerror.php");
}
}
else
{
header("Location:loginerror.php");
}
?>

<html >
<head>

</head>
<body>
<br/>
<br/>
<br/>
<?php
echo $msg;

Page 53
?>
<br/>
<br/>
<br/>
<br/>

<center><h2 align = center>Admin Home


Page</h2></center>

<p style = "font-size : 30pt">Services


<ul style = "color : red">
<li><a href = managecakes.php>Manage Cakes</a></li>
<li><a href = managechocolates.php>Manage Chocolates</a></li>
<li><a href = manageElectronics.php>Manage Electronics</a></li>
<li><a href = manageFlowers.php>Manage Flowers</a></li>
<li><a href = manageFashion.php>Manage Fashion</a></li>
<li><a href = manageOccassion.php>Manage Occassion</a></li>
<li><a href = manageHomeAndLiving.php>Manage Home And Living</a></li>
<li><a href = manageToysAndGifts.php>Manage Toys And Gifts</a></li>
<li><a href = manageSweets.php>Manage Sweets</a></li>
<li><a href = manageHandbags.php>Manage HandBags</a></li>
<li><a href = manage-feedback.php>Manage Feedback</a></li>
<li><a href = siteuser.php>Admin Profile</a></li>
<ul>
</p>

</body>
</html>

</div>
<?php include "bottom.php"; ?>
Page 54
</body>
</html>

MANAGE CAKES PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php"; ?>
Page 55
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href = admin_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Manage Cakes</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>
<tr>
<td>
Enter Cake ID</td><td><input type = text name = id></td>
<tr>

<td>Enter Cake Name</td> <td><input type = text name = name></td>


</tr>
<tr>

<tr>
<td>Cake Image</td><td><input type = file name = "image" id = "image"></td>
</tr>

<tr>
<td>
Page 56
Flavour</td><td><input type = text name = category></td>
<tr>
<tr>
<td>Price</td><td><input type = text name = price></td>
</tr>

<tr>
<td>Description</td><td><input type = text name = description></td>
</tr>

<tr>
<td colspan = 2>
<input type = submit name = save value = Save>
<input type = submit name = modify value = Modify>
<input type = submit name = remove value = Remove>
<input type = submit name = search value = Search>
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";
if(isset($_POST['save']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
Page 57
$price = $_POST['price'];
$description = $_POST['description'];

$query = "insert into cakes


values('','$name','$image','$category','$price','$description')";
$n = my_iud($query);
echo "$n record saved";
}

if(isset($_POST['modify']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "update cakes set


name='$name',image='$image',category='$category',price='$price',description='$descr
iption' where id='$id'";
$n = my_iud($query);
echo "$n record modified";
}

if(isset($_POST['remove']))
Page 58
{
$id = $_POST['id'];

$query = "delete from cakes where id=$id";


$n = my_iud($query);
echo "$n record removed";
}

if(isset($_POST['search']))
{

$query = "select * from cakes";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Cake ID</td>";
echo "<td>Cake Name</td>";
echo "<td>Image</td>";
echo "<td>Flavour</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";

echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
Page 59
echo "<td>$column[5]</td>";

echo "</tr>";
}
echo "</table>";
}
?>

</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

LOGIN FAILED PAGE CODING


<html>
<?php
$lmsg="";

if(file_exists('head_temp.php')) { include_once 'head_temp.php'; }


Page 60
?>
</head><body>

<?php if(file_exists('top_temp.php')) { include_once 'top_temp.php'; } ?>


<div align="center">
<h1>Login Failed </h1>
</div>
<?php if(file_exists('bottom_temp.php')) { include_once 'bottom_temp.php'; } ?>

LOGOUT CODING

<?php
@session_start();
$_SESSION['sun']="";
$_SESSION['sp']="";
@session_destroy();
setcookie('cun',"",time()-60*60*24*7);
setcookie('cp',"",time()-60*60*24*7);
header("Location:login.php");
?>

MANAGE ACCESSORIES PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

Page 61
<body>
<?php include "top.php"; ?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href = admin_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Manage Chocolate</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>
<tr>
<td>
Enter Chocolate ID</td><td><input type = text name = id></td>
<tr>

<td>Enter Chocolate Name</td> <td><input type = text name = name></td>


</tr>
<tr>

<tr>
<td>Chocolate Image</td><td><input type = file name = "image" id = "image"></td>
</tr>

Page 62
<tr>
<td>
Category</td><td><input type = text name = category></td>
<tr>
<tr>
<td>Price</td><td><input type = text name = price></td>
</tr>

<tr>
<td>Description</td><td><input type = text name = description></td>
</tr>

<tr>
<td colspan = 2>
<input type = submit name = save value = Save>
<input type = submit name = modify value = Modify>
<input type = submit name = remove value = Remove>
<input type = submit name = search value = Search>
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";
if(isset($_POST['save']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

Page 63
$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "insert into chocolate


values('','$name','$image','$category','$price','$description')";
$n = my_iud($query);
echo "$n record saved";
}

if(isset($_POST['modify']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "update chocolate set


name='$name',image='$image',category='$category',price='$price',description='$descr
iption' where id='$id'";
$n = my_iud($query);
echo "$n record modified";
}
Page 64
if(isset($_POST['remove']))
{
$id = $_POST['id'];

$query = "delete from chocolate where id=$id";


$n = my_iud($query);
echo "$n record removed";
}

if(isset($_POST['search']))
{

$query = "select * from chocolate";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Chocolate ID</td>";
echo "<td>Chocolate Name</td>";
echo "<td>Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";

echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
Page 65
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";

echo "</tr>";
}
echo "</table>";
}
?>

</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

Page 66
MANAGE BOOKING PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php" ?>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<?php
include "dbconfigure.php";
session_start();
$u = $_SESSION['sun'];
$query1 = "select * from siteuser where username='$u'";
$rs1 = my_select($query1);
$row1 = mysql_fetch_array($rs1);

$customername = $row1[0];
$email = $row1[6];
$contact = $row1[7];

$id = $_GET['id'];
Page 67
$category = $_GET['cat'];
$query = "select * from $category where id='$id'";
$rs = my_select($query);
$row = mysql_fetch_array($rs);

$id = $row[0];
$name = $row[1];
$price = $row[4];

if(isset($_POST['confirm']))
{
$username = $_POST['username'];

$giftname = $_POST['giftname'];
$quantity = $_POST['quantity'];
$address = $_POST['address'];
$contact = $_POST['contact'];
$email = $_POST['email'];
$bookingdate = $_POST['bookingdate'];

$query = "insert into booking


values('','$username','$giftname','$quantity','$address','$contact','$bookingdate')";
$n = my_iud($query);

echo "<div style = 'position : absolute ; top : 500px ; left : 400px'>$n Record Saved
<br/>Booking Successfull</div>";
}
?>
<br/>
<br/>
<br/>
<a href = customer_home.php><img src = goback.png></a>
Page 68
<div>
<br/>
<br/>
<center><h2 align = center>Fill Booking Information</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>

<tr>
<td>UserName</td> <td><input type = text name = username value = "<?php echo
$customername ?>" readonly></td>
</tr>
<tr>
<td>Gift Name</td> <td><input type = text name = giftname value = "<?php echo
$name ?>" readonly></td>
</tr>

<tr>
<td>Quantity </td><td><input type = text name = quantity></td>
</tr>

<tr>
<td>Delivery Address </td><td><input type = text name = address></td>
</tr>

<tr>
<td>Contact </td><td><input type = text name = contact></td>
</tr>

<tr>
<td>Email ID </td><td><input type = text name = email></td>
</tr>

Page 69
<tr>
<td>Booking Date </td><td><input type = text name = bookingdate value = "<?php
echo date("d-m-y"); ?>" readonly></td>
</tr>
<tr>
<td colspan = 2>
<input type = submit name = confirm value = "Confirm Order">

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

</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

<?php

if(isset($_POST['save']))
{
$username = $_POST['username'];

$giftname = $_POST['giftname'];
$quantity = $_POST['quantity'];
$address = $_POST['address'];
$contact = $_POST['contact'];
$email = $_POST['email'];
$bookingdate = $_POST['bookingdate'];
Page 70
$query = "insert into booking
values('','$username','$giftname','$quantity','$address','$contact','$bookingdate')";
$n = my_iud($query);
echo "$n record saved";
}

MANAGE USER FORM CODING

<html>
<head>
<?php
include "header.php";
?>
</head>
<body background = "mpimages/bns.jpg">
<?php include "top.php" ?>
<br/>
<br/>
<a href = admin_home.php><img src = goback.png></a>
<div>

<html >
<head>

Page 71
</head>
<body>
<br/>
<br/>

<center><h2 align = center>MANAGE


PROFILE</h2></center>

<p>

<form method="post">
<table width="360" border="0" align = center>
<tr>
<td>
Enter your Name</td>
<td><input type="text" name="username" ></td>
</tr>
<tr>
<td>
Enter your password</td>
<td>
<input type="password" name="pwd" ></td>
</tr>
<tr>
<td>Enter your Date of birthday</td>
<td>
<input type = date name =dob>
</td>
</tr>
<tr>
<td>
Enter your gender</td>
<td><input type="radio" name="gender" value='male' checked>Male
Page 72
&nbsp;&nbsp;&nbsp;
<input type="radio" name="gender" value='female'>Female
</td>
</tr>
<tr>
<td>Enter hint question</td>
<td>
<input type="text" name="hintq" ></td>
</tr>
<tr>
<td>
Enter hint answer</td>
<td><input type="text" name="hinta" ></td>
</tr>
<tr>
<td>
Enter your emailid</td>
<td><input type="text" name="emailid" ></td>
</tr>
<tr>
<td>
Enter your SMS no.</td>
<td><input type="text" name="smsno" ></td>
</tr>
<td>
Enter your Role</td>
<td>
<input type="text" name="role" >
</td></tr>
<tr>
<td>
<input type="submit" name="save" value="save"/></td>
<td>
<input type="submit" name="search" value="search"/></td>
Page 73
</tr>
<tr>
<td><input type="submit" name="modify" value="modify"/></td>
<td><input type="submit" name="remove" value="remove"/></td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";
if(isset($_POST['save']))
{
$username = $_POST['username'];
$pwd = $_POST['pwd'];
$dob = $_POST['dob'];
$gender = $_POST['gender'];
$hintq = $_POST['hintq'];
$hinta = $_POST['hinta'];
$emailid = $_POST['emailid'];
$smsno = $_POST['smsno'];
$role = $_POST['role'];

$query = "insert into siteuser


values('$username','$pwd','$dob','$gender','$hintq','$hinta','$emailid','$smsno','$role')
";
$n = my_iud($query);
echo "$n record saved";
}

if(isset($_POST['modify']))
{
$username = $_POST['username'];
$pwd = $_POST['pwd'];
$dob = $_POST['dob'];
$gender = $_POST['gender'];
Page 74
$hintq = $_POST['hintq'];
$hinta = $_POST['hinta'];
$emailid = $_POST['emailid'];
$smsno = $_POST['smsno'];
$role = $_POST['role'];

$query = "update siteuser set


pwd='$pwd',dob='$dob',gender='$gender',hintq='$hintq',hinta='$hinta',emailadd='$e
mailid',smsno='$smsno',role='$role' where username='$username' ";
$n = my_iud($query);
echo "$n record modified";
}

if(isset($_POST['remove']))
{
$username = $_POST['username'];
$pwd = $_POST['pwd'];
$dob = $_POST['dob'];
$gender = $_POST['gender'];
$hintq = $_POST['hintq'];
$hinta = $_POST['hinta'];
$emailid = $_POST['emailid'];
$smsno = $_POST['smsno'];
$role = $_POST['role'];

$query = "delete from siteuser where username='$username'";


$n = my_iud($query);
echo "$n record removed";
}

if(isset($_POST['search']))
{
$username = $_POST['username'];
$pwd = $_POST['pwd'];
Page 75
$dob = $_POST['dob'];
$gender = $_POST['gender'];
$hintq = $_POST['hintq'];
$hinta = $_POST['hinta'];
$emailid = $_POST['emailid'];
$smsno = $_POST['smsno'];
$role = $_POST['role'];

$query = "select * from siteuser";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "$n record found";
echo "<table align = center border = 1>";
echo "<tr>";
echo "<th>UserName</th>";
echo "<th>Password</th>";
echo "<th>Date of Birth</th>";
echo "<th>Gender</th>";
echo "<th>HintQ</th>";
echo "<th>HintA</th>";
echo "<th>Email ID</th>";
echo "<th>Contact No.</th>";
echo "<th>Role</th>";
echo "</tr>";
while($row = mysql_fetch_array($rs))
{
echo "<tr>";
echo "<td>$row[0]</td>" ;
echo "<td>$row[1]</td>" ;
echo "<td>$row[2]</td>" ;
echo "<td>$row[3]</td>" ;
echo "<td>$row[4]</td>" ;
echo "<td>$row[5]</td>" ;
echo "<td>$row[6]</td>" ;
Page 76
echo "<td>$row[7]</td>" ;
echo "<td>$row[8]</td>" ;
echo "</tr>";
}
echo "<table>";
}
?>

</body>
</html>

</div>
<?php include "bottom.php "?>
</body>
</html>

Page 77
MANAGE OCCASSION FORM CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php"; ?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
Page 78
<br/>
<br/>
<br/>
<br/>
<a href = admin_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Manage Occassion Items</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>
<tr>
<td>
Enter Item ID</td><td><input type = text name = id></td>
<tr>

<td>Enter Item Name</td> <td><input type = text name = name></td>


</tr>
<tr>

<tr>
<td>Item Image</td><td><input type = file name = "image" id = "image"></td>
</tr>

<tr>
<td>
Category
</td>
<td>
<select name = category>
<option value = "cakes">Cakes</option>
<option value = "chocolate">Chocolate</option>
<option value = "electronics">Electronics</option>
<option value = "fashion">Fashion</option>
Page 79
<option value = "flowers">Flowers</option>
<option value = "handbags">Hand Bags</option>
<option value = "homeandliving">Home And Living</option>
<option value = "occassion">Occassion</option>
<option value = "sweets">Sweets</option>
<option value = "toysandgifts">Toy And Gifts</option>
</select>
</td>
<tr>
<tr>
<td>Price</td><td><input type = text name = price></td>
</tr>

<tr>
<td>Description</td><td><input type = text name = description></td>
</tr>

<tr>
<td colspan = 2>
<input type = submit name = save value = Save>
<input type = submit name = modify value = Modify>
<input type = submit name = remove value = Remove>
<input type = submit name = search value = Search>
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";
if(isset($_POST['save']))
{
$id = $_POST['id'];
$name = $_POST['name'];

Page 80
move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "insert into occassion


values('','$name','$image','$category','$price','$description')";
$n = my_iud($query);
echo "$n record saved";
}

if(isset($_POST['modify']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "update occassion set


Page 81
name='$name',image='$image',category='$category',price='$price',description='$descr
iption' where id='$id'";
$n = my_iud($query);
echo "$n record modified";
}

if(isset($_POST['remove']))
{
$id = $_POST['id'];

$query = "delete from occassion where id=$id";


$n = my_iud($query);
echo "$n record removed";
}

if(isset($_POST['search']))
{

$query = "select * from occassion";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";

echo "</tr>";
while($column=mysql_fetch_array($rs))
{
Page 82
echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";

echo "</tr>";
}
echo "</table>";
}
?>

</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

Page 83
MANAGE FLOWERS PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php"; ?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href = admin_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Manage Flowers</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>
<tr>
<td>
Enter ID</td><td><input type = text name = id></td>
Page 84
<tr>

<td>Enter Flower Name</td> <td><input type = text name = name></td>


</tr>
<tr>

<tr>
<td>Flower Image</td><td><input type = file name = "image" id = "image"></td>
</tr>

<tr>
<td>
Category
</td>
<td>
<select name = category>
<option value = "cakes">Cakes</option>
<option value = "chocolate">Chocolate</option>
<option value = "electronics">Electronics</option>
<option value = "fashion">Fashion</option>
<option value = "flowers">Flowers</option>
<option value = "handbags">Hand Bags</option>
<option value = "homeandliving">Home And Living</option>
<option value = "occassion">Occassion</option>
<option value = "sweets">Sweets</option>
<option value = "toysandgifts">Toy And Gifts</option>
</select>
</td>
<tr>
<tr>
<td>Price</td><td><input type = text name = price></td>
</tr>

<tr>
Page 85
<td>Description</td><td><input type = text name = description></td>
</tr>

<tr>
<td colspan = 2>
<input type = submit name = save value = Save>
<input type = submit name = modify value = Modify>
<input type = submit name = remove value = Remove>
<input type = submit name = search value = Search>
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";
if(isset($_POST['save']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "insert into flowers


values('','$name','$image','$category','$price','$description')";
Page 86
$n = my_iud($query);
echo "$n record saved";
}

if(isset($_POST['modify']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "update flowers set


name='$name',image='$image',category='$category',price='$price',description='$descr
iption' where id='$id'";
$n = my_iud($query);
echo "$n record modified";
}

if(isset($_POST['remove']))
{
$id = $_POST['id'];

$query = "delete from flowers where id=$id";


$n = my_iud($query);
echo "$n record removed";
}
Page 87
if(isset($_POST['search']))
{

$query = "select * from flowers";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>ID</td>";
echo "<td>Flower Name</td>";
echo "<td>Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";

echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";

echo "</tr>";
}
echo "</table>";
}
?>
Page 88
</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

Page 89
MANAGE HANDBAGS PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php"; ?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href = admin_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Manage Handbags</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>
<tr>
<td>
Enter ID</td><td><input type = text name = id></td>
<tr>

Page 90
<td>Enter Name</td> <td><input type = text name = name></td>
</tr>
<tr>

<tr>
<td>Image</td><td><input type = file name = "image" id = "image"></td>
</tr>

<tr>
<td>
Category
</td>
<td>
<select name = category>
<option value = "cakes">Cakes</option>
<option value = "chocolate">Chocolate</option>
<option value = "electronics">Electronics</option>
<option value = "fashion">Fashion</option>
<option value = "flowers">Flowers</option>
<option value = "handbags">Hand Bags</option>
<option value = "homeandliving">Home And Living</option>
<option value = "occassion">Occassion</option>
<option value = "sweets">Sweets</option>
<option value = "toysandgifts">Toy And Gifts</option>
</select>
</td>
<tr>
<tr>
<td>Price</td><td><input type = text name = price></td>
</tr>

<tr>
<td>Description</td><td><input type = text name = description></td>
</tr>
Page 91
<tr>
<td colspan = 2>
<input type = submit name = save value = Save>
<input type = submit name = modify value = Modify>
<input type = submit name = remove value = Remove>
<input type = submit name = search value = Search>
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";
if(isset($_POST['save']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "insert into handbags


values('','$name','$image','$category','$price','$description')";
$n = my_iud($query);
echo "$n record saved";
Page 92
}

if(isset($_POST['modify']))
{
$id = $_POST['id'];
$name = $_POST['name'];

move_uploaded_file($_FILES['image']['tmp_name'],"upload_image/".
$_FILES['image']['name']);
$image = "upload_image/".$_FILES['image']['name'];

$category = $_POST['category'];
$price = $_POST['price'];
$description = $_POST['description'];

$query = "update handbags set


name='$name',image='$image',category='$category',price='$price',description='$descr
iption' where id='$id'";
$n = my_iud($query);
echo "$n record modified";
}

if(isset($_POST['remove']))
{
$id = $_POST['id'];

$query = "delete from handbags where id=$id";


$n = my_iud($query);
echo "$n record removed";
}

if(isset($_POST['search']))
Page 93
{

$query = "select * from handbags";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";

echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";

echo "</tr>";
}
echo "</table>";
}
?>

Page 94
</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

CUSTOMER HOME PAGE CODING


<html>
<head>
<style>
li{list-style : none}
</style>
<?php
include "header.php"; ?>
</head>
<body>
<?php include "top.php"; ?>
<div>
<?php
/*
on authentic page, only valid users of website can visit
strangers(anonymous) are not allowed
*/
@session_start();
include_once "dbconfigure.php";
$msg="";
if(verifyuser())
{
if(fetchrole()=='customer')
{
$un=fetchusername();
$msg="Welcome $un , <br /><a href='signout.php'>Signout</a>";
}
else
Page 95
{
header("Location:loginerror.php");
}
}
else
{
header("Location:loginerror.php");
}
?>

<html >
<head>

</head>
<body>
<br/>
<br/>
<br/>
<?php
echo $msg;

?>

<center><h2 align = center>Customer Home Page</h2>

<p style = "font-size : 30pt">Services


<ul style = "color : red">
<li><a href = viewMobile.php>Mobiles</a></li>
<li><a href = ViewAccessories.php>Accessories</a></li>
<li><a href = ViewThemes.php>Themes</a></li>
<li><a href = ViewRingTones.php>Ringtones</a></li>
Page 96
<li><a href = viewWallpaper.php>Wallpapers</a></li>
<li><a href = ViewMessage.php>View Message</a></li>
<li><a href = SendMessage.php>Send Message</a></li>
<li><a href = SendFeedback.php>Send Feedback</a></li>

<ul>
</p></center>

</body>
</html>

</div>
<?php include "bottom.php"; ?>
</body>
</html>

Page 97
DATA BASE CONFIGURATION CODING
<?php
$dbserver="127.0.0.1"; //localhost
$dbuser="root";
$dbpwd="";
$dbname="mobile2";

function my_iud($query)
{
global $dbserver,$dbuser,$dbpwd,$dbname;
$cid=mysql_connect($dbserver,$dbuser,$dbpwd) or die("connection failed");
mysql_select_db($dbname,$cid);
mysql_query($query,$cid);
$n=mysql_affected_rows($cid);
mysql_close($cid);
return $n;
}

function my_select($query)
{
global $dbserver,$dbuser,$dbpwd,$dbname;
$cid=mysql_connect($dbserver,$dbuser,$dbpwd) or die("connection failed");
mysql_select_db($dbname,$cid);
$rs=mysql_query($query,$cid);
mysql_close($cid);
return $rs;
}

//to be used when sql query returns a single value


function my_one($query)
{
global $dbserver,$dbuser,$dbpwd,$dbname;
Page 98
$cid=mysql_connect($dbserver,$dbuser,$dbpwd) or die("connection failed");
mysql_select_db($dbname,$cid);
$rs=mysql_query($query,$cid);
$row=mysql_fetch_array($rs);

mysql_close($cid);
return $row[0];
}

function verifyuser()
{
$u="";
$p="";
if(isset($_COOKIE['cun']) && isset($_COOKIE['cpwd']))
{
$u=$_COOKIE['cun'];
$p=$_COOKIE['cpwd'];
}
else
{
if(isset($_SESSION['sun']) && isset($_SESSION['spwd']))
{
$u=$_SESSION['sun'];
$p=$_SESSION['spwd'];
}
}
$query="select count(*) from siteuser where username='$u' and pwd='$p'";
$n=my_one($query);
if($n==1)
{
return true;
}
else
Page 99
{
return false;
}
}

function fetchusername()
{
$u="";
$p="";
if(isset($_COOKIE['cun']) && isset($_COOKIE['cpwd']))
{
$u=$_COOKIE['cun'];
$p=$_COOKIE['cpwd'];
}
else
{
if(isset($_SESSION['sun']) && isset($_SESSION['spwd']))
{
$u=$_SESSION['sun'];
$p=$_SESSION['spwd'];
}
}
$query="select count(*) from siteuser where username='$u' and pwd='$p'";
$n=my_one($query);
if($n==1)
{
return $u;
}
else
{
return false;
}
}
Page 100
function fetchrole()
{
$u="";
$p="";
if(isset($_COOKIE['cun']) && isset($_COOKIE['cpwd']))
{
$u=$_COOKIE['cun'];
$p=$_COOKIE['cpwd'];
}
else
{
if(isset($_SESSION['sun']) && isset($_SESSION['spwd']))
{
$u=$_SESSION['sun'];
$p=$_SESSION['spwd'];
}
}
$query="select count(*) from siteuser where username='$u' and pwd='$p'";
$n=my_one($query);
if($n==1)
{
$query="select role from siteuser where username='$u' and pwd='$p'";
$role=my_one($query);
return $role;
}
else
{
return false;
}
}
?>

Page 101
VIEW ELECTRONICS GIFTS PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php"; ?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href = customer_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Electronics</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>

<td>Enter Gift Name</td> <td><input type = text name = name></td>


</tr>
Page 102
<tr>

<tr>
<td>Search Via Price </td><td><input type = text name = price1> To <input type = text
name = price2></td>
</tr>

<tr>
<td colspan = 2>
<input type = submit name = search1 value = "Search ALL">
<input type = submit name = search2 value = "Search Via Name">
<input type = submit name = search3 value = "Search Via Price">
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";

if(isset($_POST['search1']))
{

$query = "select * from electronics";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Gift Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
Page 103
echo "<td>Description</td>";
echo "<th>Book Now</th>";
echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";
$category = "electronics";
echo '<td><a href="purchase_cart.php?id='.$column['id'].'&cat='.$category.'">

Order Now

</a></td>';
echo "</tr>";
}
echo "</table>";
}

if(isset($_POST['search2']))
{

$name = $_POST['name'];
$query = "select * from electronics where name='$name'";
$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
Page 104
echo "<tr>";
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Gift Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";
echo "<th>Book Now</th>";
echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";
$category = "electronics";
echo '<td><a href="purchase_cart.php?id='.$column['id'].'&cat='.$category.'">

Order Now

</a></td>';
echo "</tr>";
}
echo "</table>";
}

if(isset($_POST['search3']))
Page 105
{

$price1 = $_POST['price1'];
$price2 = $_POST['price2'];
$query = "select * from electronics where price>='$price1' and price<='$price2'";
$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Gift Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";
echo "<th>Book Now</th>";
echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";
$category = "electronics";
echo '<td><a href="purchase_cart.php?id='.$column['id'].'&cat='.$category.'">

Order Now

</a></td>';
echo "</tr>";
Page 106
}
echo "</table>";
}
?>

</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

Page 107
VIEW FASHION GIFTS PAGE CODING

<html>
<head>
<?php include "header.php" ?>
</head>

<body>
<?php include "top.php"; ?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<a href = customer_home.php><img src = goback.png></a>
<div>
<br/>
<br/>
<center><h2 align = center>Fashion</h2></center>
<form method = post enctype='multipart/form-data'>
<table align = center>

<td>Enter Gift Name</td> <td><input type = text name = name></td>


</tr>
<tr>
Page 108
<tr>
<td>Search Via Price </td><td><input type = text name = price1> To <input type = text
name = price2></td>
</tr>

<tr>
<td colspan = 2>
<input type = submit name = search1 value = "Search ALL">
<input type = submit name = search2 value = "Search Via Name">
<input type = submit name = search3 value = "Search Via Price">
</td>
</tr>
</table>
</form>
<?php
include "dbconfigure.php";

if(isset($_POST['search1']))
{

$query = "select * from fashion";


$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Gift Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";
Page 109
echo "<th>Book Now</th>";
echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";
$category = "flowers";
echo '<td><a href="purchase_cart.php?id='.$column['id'].'&cat='.$category.'">

Order Now

</a></td>';
echo "</tr>";
}
echo "</table>";
}

if(isset($_POST['search2']))
{

$name = $_POST['name'];
$query = "select * from fashion where name='$name'";
$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
Page 110
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Gift Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";
echo "<th>Book Now</th>";
echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";
$category = "fashion";
echo '<td><a href="purchase_cart.php?id='.$column['id'].'&cat='.$category.'">

Order Now

</a></td>';
echo "</tr>";
}
echo "</table>";
}

if(isset($_POST['search3']))
{
Page 111
$price1 = $_POST['price1'];
$price2 = $_POST['price2'];
$query = "select * from fashion where price>='$price1' and price<='$price2'";
$rs = my_select($query);
$n = mysql_num_rows($rs);
echo "<table align = center border = 1 width=100%>";
echo "<tr>";
echo "<td>Gift ID</td>";
echo "<td>Gift Name</td>";
echo "<td>Gift Image</td>";
echo "<td>Category</td>";
echo "<td>Price</td>";
echo "<td>Description</td>";
echo "<th>Book Now</th>";
echo "</tr>";
while($column=mysql_fetch_array($rs))
{

echo "<tr>";
echo "<td>$column[0]</td>";
echo "<td>$column[1]</td>";
echo '<td><img src="'.$column['image'].'" width="100"></td>';
echo "<td>$column[3]</td>";
echo "<td>$column[4]</td>";
echo "<td>$column[5]</td>";
$category = "fashion";
echo '<td><a href="purchase_cart.php?id='.$column['id'].'&cat='.$category.'">

Order Now

</a></td>';
echo "</tr>";
}
Page 112
echo "</table>";
}
?>

</div>
<!-- Bottom section -->
<?php include "bottom.php" ?>
</body>
</html>

Page 113
CHAPTER # 8
Advantages & Limitations

Advantages of “Online Gift Shop System”:

“Online Gift ShopSystem” provides various features, which


complement the information system and increase the productivity of the
system. These features make the system easily usable and convenient. Some of
the important features included are listed as follows:

 Intelligent User Forms Design


 Data access and manipulation through same forms
 Access to most required information
 Data Security
 Restrictive data access, as per login assigned only.
 Organized and structured storage of facts.
.
 Strategic Planning made easy.
 No decay of old Records.
 Exact financial position of the Business.

Limitations of “Online Gift Shop System”:


Besides the above achievements and the successful completion of the project, we still

Page 114
feel the project has some limitations, listed as below:

1. It is not a large scale system.


2. Only limited information provided by this system.
3. Since it is an online project, customers need internet connection to buy
products.
4. People who are not familiar with computers can’t use this software.

CHAPTER # 8
Page 115
Future Scope

FUTURE SCOPE

This web application involves almost all the features of the online shopping. The future
implementation will be online help for the customers and chatting with website administrator.

CONCLUSION
The project entitled “Online Gift Shopping” is developed using PHP as front end and
MYSQL database in back end to computerize the process of online buying and selling of gift
in a showroom. This project covers only the basic features required.

Page 116
Bibliography

BIBLIOGRAPHY

 FOR PHP INSTALLATION

 http://www.php.net/

 FOR DEPLOYMENT AND PACKING ON SERVER

www.developer.com
www.15seconds.com

 FOR MY SQL

 http://www.mysql.com/

 FOR CSS

 http://cssed.sourceforge.net/

 FOR APACHE

 http://www.apache.org/

Page 117
 FOR OTHER USEFUL REFERENCES

 http://www.eclipse.org/pdt/
 http://www.w3schools.com/default.asp
 http://en.wikipedia.org/

 REFERENCE BOOKS

Lee Babin, “Beginning Ajax with PHP”.


Leon Atkinson,“ Core PHP Programming” .
Luke Welling & Laura Thompson, “Beginning Ajax with PHP”.
Roger S.Pressman, “Software Engineering”.

Page 118

Das könnte Ihnen auch gefallen