You are on page 1of 57

UNIVERSITY INSTITUTE OF COMPUTING

Minor project final report


of
Restaurant management system

UNDER-TAKEN BY: GIUDED BY:


Amandeep kaur
17BCA1503
17BCA1507
17BCA1511
FOOD ORDERING
MANAGEMENT
SYSTEM
Advantages:

1. Makes the ordering process easier


2. Efficient customer and order management
3. Monitor your expenses incurred in real time
4. Free and cheap marketing
5. Better customers data
6. The convenience of mobile ordering
7. Stay ahead of the competition
8. Greater reach

User Module:
The customer table consists of below details

1. fname : represents first name of the customer.


2. lname : represents last name of the customer
3. location : represents location of the customer
4. mob : used for saving mobile number of the customer
5. addr is used for saving address of customer
6. email used for saving the email of the customer
7. pw : will save password of the customer
8. cpw : can help customer to change password

This table is used to get the details of customers

Employee Module:
Employee table is used to save user login information.

1. id {primary key} : user to save id of every user.


2. Email : saves the email info of the user.
3. Password : will save password of user.
Orders Module:
Order table used to save

1. Email : save email of the customer.


2. Qty1 : saves quantity of Gulab Jamun.
3. Qty2 : saves quantity of Bolani
4. Qty3 : saves quantity of Plain Naan
5. Qty4 : saves quantity of Pulav
6. Qty5 : saves quantity of ghen
7. Qty6 : saves quantity Paneer Bhurji
8. Qty7 : saves quantity of Dosa
9. Qty8 : saves quantity of Mutton Leg
10. Qty8 : saves quantity of Thali

FUTURE SCOPES

 The more the population is increasing with their increased purchasing


power the more are the situations of food ordering occurred. Home
deliveries are a matter of daily system nowadays for every restaurant big
And small in the towns.
 With the online phone payment system feature ordering food using
restaurant based apps has become easier nowadays. There occurs no
requirement to make use of cash. One can order food online using online
payment modes right from the restaurant app.
 The ease and important of online food ordering using restaurant mobile
apps make sure that Tele calling is no longer used for ordering. The more
restaurants are adapting to this new technique of food ordering the more
the orders coming from phone calls are declining. There is no barrier of
language even with the online ordering system.
 More and more restaurants are using mobile platforms for food ordering.
This means competitiveness is high in the market. As a result, the price
of food gets lowered and it is a blessing for the customers.
SYSTEM ANALYSIS & FEASIBILITY STUDY
System analysis

System analysis is a necessary activity that takes place when we are building a new
informations system or changing existing ones. Analysis is used to understand the
existing system and what is required of it. At the end of analysis, there is system
description and a set of requirements for a new system. If there is no existing system,
the analysis define only the requirements.

Needs
1. High Employee Productivity. Think about all the time your employees spend
taking order from the user over the phone and making sure that the order is correct.
When taking orders over the phone, there is a higher likelihood of miscommunication,
in turn, compelling employees to stay on the phone longer to ensure that they have
gotten the correct order before hanging up. By implementing an online ordering
service, employees will spend less time taking phone orders and can spend more time
actually preparing those orders for pick-up or delivery to the customer. Another great
benefit of online ordering is the ability for the customer to pre-place large orders and
set a specific pick-up or delivery time. This allows the restaurant employees time to
properly prep large orders in advance.

2. Order Accuracies. Orders are needed to be accurate going back to the


miscommunication that often occurs when taking orders over the phone, online
ordering systems allow the customer to select and modify their food order exactly the
way they like it. This order will then be sent directly to a restaurant printer with no
misunderstanding or miscommunication. Being able to take an order straight from the
printer to prep will cut back on order inaccuracy and will save the restaurant from
wasting money and bad reviews.

3. Grow your Business. Sometimes people don’t want to be bothered with calling and
placing their take-out or delivery order over the phone, and opt for a restaurant that
provides an online ordering service or application instead. Convenience is key when it
comes to customer service. Providing a seamless and easy-to-use online ordering
system will create a better experience for customers, resulting in an increase in sales.

4. Ability to Build a Database. When your customers order through an online


ordering service, this creates an opportunity for you to capture information, such as an
email address, and use this information to create a database. This database can then be
used to communicate with your customers and encourage them to come back through
loyalty programs, email marketing, mailing coupons, and more. When taking orders
over the phone, you often times only receive their phone number and delivery address,
which usually does not allow you to reengage with the customer after the transaction is
complete.

5. Powerful Analytics. Once you’ve built your database of customers, you can then
use analytics offered with online ordering services to track the ordering patterns of
your customers. This will allow you to offer tailored promotions to customers based on
what they frequently order or how frequently they order. You can also use this
information to adjust, add, or remove menu items based on what your customers are
ordering.

Implementing an online ordering system can bring endless benefits to your restaurant
business. You may consider using your own, or partnering with an existing online
ordering app. Whichever you choose, Star Micronics is there to help you seamlessly
integrate online ordering into your restaurant by providing cloud-based point of sale
technology to help that order go straight from the cloud, to your restaurant, and then
out the door.

Feasibility study

All projects are feasible if unlimited resources and infinite time is given!
Unfortunately, the development of computer-based system or product is more likely
plagued by a shortage of resources and difficult delivery dates. It is both necessary and
judicious to evaluate the feasibility of a project at the earliest possible time. Generally,
the feasibility study is used for determining the cost of required resources, benefits and
whether the proposed system is feasible with respect to the organization. There are
three types of feasibility which are equally important. They are: -

1. Economic feasibility
2. Technical feasibility
3. Operational feasibility

1. Economical feasibility

Economic feasibility is concerned with cost savings, increased profits & reductions in
efforts. It shows how much beneficial is the new developed
system than the existing system.
System startup cost: -

1. PC with good Processor


2. Software

System operating costs: -

1. Additional equipment (CDs, power supply) maintenances


2. Program maintenance

As this project is related to security service which aims at providing better services to
users and viewers and does not yield any income. Providing better services is the basic
requirement of any organization either services sector or financial sector. So, the
proposed system is economically feasible as it also reduces manpower utilization.

2. Technical feasibility: -

Technical feasibility deals with the existing technology, software and hardware
requirement of the proposed system. The proposed system
“Online Food Ordering System” needs the following: -

1. Software required for development


2. Hardware requirement for development

In order to implement the proposed system necessary technology will be acquired.


Hence the proposed system is technically feasible.

3.Operational feasibility: -

Operational feasibility is the willingness & ability of the management, employees, users
and others to use & support a proposed system. There is no difficulty in handling the
system. There is full support from management.

This system can give good support and makes the services easy.
System Requirements

Software Requirements :

 XAMPP Server : XAMPP is a free and open-source cross-platform web


server solution stack package developed by Apache Friends,[2] consisting
mainly of the Apache HTTP Server, MariaDB database,
and interpreters for scripts written in the PHP and Perl programming
languages. Since most actual web server deployments use the same
components as XAMPP, it makes transitioning from a local test server to
a live server possible.

 Text Editor : A text editor is a type of computer program that edits plain
text. Such programs are sometimes known as "notepad" software,
following the naming of Microsoft Notepad. Text editors are provided
with operating systems and software development packages, and can be
used to change files such as configuration files, documentation files
and programming language source code.

 Browser : A web browser or Internet browser, a browser is


a software program to present and explore content on the World Wide
Web. These pieces of content, including pictures, videos, and web pages,
are connected using hyperlinks and classified with URIs (Uniform
Resource Identifiers). Here browser is usedto run the php code.

Hardware Requirements :

 RAM: 2GB or More


 Processor: 500 MHz or Faster

Front-End :

 PHP : The PHP Hypertext Preprocessor (PHP) is a programming


language that allows web developers to create dynamic content that
interacts with databases. PHP is basically used for developing web based
software applications. This tutorial helps you to build your base with PHP.
PHP started out as a small open source project that evolved as more and more people
found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way
back in 1994.
PHP is a MUST for students and working professionals to become a great Software
Engineer specially when they are working in Web Development Domain. I will list
down some of the key advantages of learning PHP:
 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
 PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-
commerce sites.
 It is integrated with a number of popular databases, including MySQL,
PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server

 HTML : HTML stands for Hyper Text Markup Language, which is the most
widely used language on Web to develop web pages. HTML was created by
Berners-Lee in late 1991 but "HTML 2.0" was the first standard HTML
specification which was published in 1995. HTML 4.01 was a major version of
HTML and it was published in late 1999. Though HTML 4.01 version is widely
used but currently we are having HTML-5 version which is an extension to
HTML 4.01, and this version was published in 2012.
Originally, HTML was developed with the intent of defining the structure of
documents like headings, paragraphs, lists, and so forth to facilitate the sharing
of scientific information between researchers. Now, HTML is being widely used
to format web pages with the help of different tags available in HTML language.
HTML is a MUST for students and working professionals to become a great
Software Engineer specially when they are working in Web Development
Domain. I will list down some of the key advantages of learning HTML:
Create Web site - You can create a website or customize an existing web
template if you know HTML well.

 CSS : Cascading Style Sheets, fondly referred to as CSS, is a simply


designed language intended to simplify the process of making web pages
presentable. CSS allows you to apply styles to web pages. More
importantly, CSS enables you to do this independent of the HTML that
makes up each web page.
CSS is easy to learn and understood but it provides powerful control over
the presentation of an HTML document.
CSS saves time : You can write CSS once and reuse same sheet in multiple
HTML pages.

Easy Maintainence : To make a global change simply change the style, and all

 Javascript : JavaScript is a very powerful client-side scripting language.


JavaScript is used mainly for enhancing the interaction of a user with the
webpage. In other words, you can make your webpage more lively and
interactive, with the help of JavaScript. JavaScript is also being used widely
in game development and Mobile application development.
Being a scripting language, JavaScript cannot run on its own. In fact, the
browser is responsible for running JavaScript code. When a user
requests an HTML page with JavaScript in it, the script is sent to the
browser and it is up to the browser to execute it. The main advantage of
JavaScript is that all modern web browsers support JavaScript. So, you
do not have to worry about whether your site visitor uses Internet Explorer,
Google Chrome, Firefox or any other browser. JavaScript will be
supported. Also, JavaScript runs on any operating system including
Windows, Linux or Mac. Thus, JavaScript overcomes the main
disadvantages of VBScript (Now deprecated) which is limited to just IE and
Windows.

 Bootstrap : Bootstrap is a free and open-source CSS framework directed at


responsive, mobile-first front-end web development. It contains CSS- and
JavaScript-based design templates
for typography, forms, buttons, navigation and other interface components.
Bootstrap is the third-most-starred project on GitHub, with more than 135,000
stars, behind only freeCodeCamp (almost 305,000 stars) and marginally
behind Vue.js framework. According to Alexa Rank, Bootstrap
getbootstrap.com is in the top-2000 in US while vuejs.org is in top-7000 in US.

Back-End :

 MySQL 5.5.32 (using phpmyadmin 4.0.6) : MySQL is the most


popular Open Source Relational SQL Database Management System. MySQL is one of
the best RDBMS being used for developing various web-based software applications.
MySQL is developed, marketed and supported by MySQL AB, which is a Swedish
company. This tutorial will give you a quick start to

MySQL and make you comfortable with MySQL programming.


Data Flow Diagram (DFD):-

Data flows are data structures in motion, while data stores are structure of data. Data
flows are paths or ‘pipe lines’, along which data structures travel, where as the data
stores are place where data structures are kept until needed.
Data flows are structure of data in motion, while data stores are data structures at rest.
Hence it is possible that the data flow and the data store would be made up of the same
data structure.
Data flow diagrams is a very easy tool for the system analyst because it gives the analyst
the overall picture of the system, it is a diagrammatic approach.

1) Level-0 DFD : Shows outline of System Models

Food Order
Management Management

Online
Food
Ordering
System

Admin
Management
2) Level-1 DFD: This shows the separation of all external, relationship between those
modules and the application.

Check User Login Order


Details Management

Customer
Management Login
Management

Online
Order management
Food
Generate Order
Ordering Report
Delivery Address System
management

Generate System
Food Management User Report
3) Level – 2 DFD : This differentiates the modules frontend and backend.

Check Manage Order Details


Login Login To role of
System Access

Manage Coupon
Details

Forgot
password Check
Credential Manage
s Modules Manage Customer
Details

Send
Email to Manage Cash Details
User

Manage Roles of Manage User


User Manage System Admins Manage Report
Permission
SYSTEM DESIGN

Every restaurateur, owner and manager knows they need an effective and efficient
online ordering system in order to ensure their long-term success as a business. What
most of them don’t know, however, is how or where to get started. It can seem like
there are a million possibilities, and every single one of them can seem like a stroke of
genius.
The problem is that most people who are unfamiliar with web design, online
purchasing systems and point of sale integration don’t always understand how much an
online food ordering system design impacts its overall functionality. What looks
amazing on a website may be a complete pain in the posterior for your customers to
use or your house manager to administrate without four calls a day to technical support
or numerous hours of training.
So, just how do you design a proper online food ordering system, anyway? Here are
some tips to get you started on your system design journey. Even if you decide to bring
in outside help, you will at least be familiar with what is out there and how it could
potentially affect your customers and staff.

Over the last century, people’s eating habits have changed a lot. Technology has also
contributed to the changes in consumer preference as their dependence on technology
has moved them to do everything online including getting cooked meals delivered to
their doorstep.

Probably, this is the one of the reason why the mobile applications for ordering food
online are so popular nowadays and became great source of ideas for UI/UX designers.

Challenge
I found that factors contributing to the popularity of online food ordering were: lack of
time to prepare food, availability of variety, rewards and cash-backs. It led me to think
of convenient and more attractive app for users in order to meet their expectations more
precisely while ordering food online.

Task
Create UI/UX design of website for ordering food online.
Problem Definition
The mobile aggregator is an application that combines various thematic platforms in
order to increase their level of sales and ensure the convenience of the choice of dishes
and drinks by users. A distinctive feature of the website is a single design, user-friendly
interface.

I decided to create competing a website where to make an order should be as simple as


few clicks on mobile device. And it should be easy to understand and informative about
the options and choices the users have.

Process
I’ve started the process with competitive research and I identified top three competitors.
Analyzing and comparing the content of their websites helped me to determine the
direction of development for my website.
CODE

INDEX.PHP

<HTML>
<HEAD>
<TITLE>Welcome to 24X7 Foodies.com!</TITLE>
<style type="text/css">
@import url(style.css);
a:link {color: #ffffff} // color of links set to white
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
</style>
</HEAD>
<BODY background="background.jpg">
<?php include("header.php"); ?>
<FONT size="5" color="white">
<SECTION align="center"><A HREF="index.php"><IMG SRC="logo.png"
alt="Home" id="logo" width="40" height="35"
align="rights"></IMG></A></SECTION>
<SECTION><MAIN>
<B><P>We are available only at the following regions.<BR> Please select any
one:</P></B></FONT>
<SECTION align="center"><IMG src="burger.jpg" width="250" height="200"
align="rights"></IMG></SECTION>
<TABLE >
<TR><TD><FONT size="6" color="black">
<A HREF="order.php" style="text-decoration: none">1)Kandivali
West</A></FONT></TD></TR>
<TR><TD><FONT size="6" color="ffb6c1">
<A HREF="order.php" style="text-decoration: none">2)Kandivali
East</A></FONT></TD></TR>
<TR><TD><FONT size="6" color="ffb6c1">
<A HREF="order.php" style="text-decoration: none">3)Borivali

West</A></FONT></TD></TR>
<TR><TD><FONT size="6" color="ffb6c1">
<A HREF="order.php" style="text-decoration: none">4)Borivali
East</A></FONT></TD></TR>
</TABLE></SECTION></MAIN><BR><HR width="1000">
<FOOTER>
<FONT size="2" color="white">
By continuing past this page, you agree to our Terms of Service, Cookie Policy,
Privacy Policy and Content Policies. &copy 2015-2016 - 24x7 Foodies Media Pvt Ltd.
All rights reserved.</FONT>
</FOOTER>
</BODY>
</HTML>

HELP.PHP

<HTML>
<HEAD>
<TITLE>Help & FAQ</TITLE>
<style type="text/css">
*{font-family: 'Roboto', sans-serif;}
a:link {color: #ffffff}
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
#grad {background: linear-gradient(to right, aqua , white);}
#panel, #flip { padding: 2px; text-align: left}
#panel1,#panel2,#panel3,#panel4,#panel5,#panel6,#voucher{ display:none; } //hide
this content
.ptr { text-decoration: none; cursor: pointer;}
</style>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){ $("#flip1").click(function(){
$("#panel1").slideToggle("slow"); });});
</script>
<script>
$(document).ready(function(){ $("#flip2").click(function(){
$("#panel2").slideToggle("slow"); });});
</script>
<script>
$(document).ready(function(){ $("#flip3").click(function(){
$("#panel3").slideToggle("slow"); });});
</script>
<script>
$(document).ready(function(){ $("#flip4").click(function(){
$("#panel4").slideToggle("slow"); });});
</script>
<script>
$(document).ready(function(){ $("#flip5").click(function(){
$("#panel5").slideToggle("slow"); });});
</script>
<script>
$(document).ready(function(){ $("#flip6").click(function(){
$("#panel6").slideToggle("slow"); });});
$(document).mouseup(function (e)
{ var container = $(".panel");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0)
{ container.hide("slow"); }});
$(document).ready(function(){
$("#banner").mouseenter(function()
{
$("#voucher").show();
$("#voucher").animate({left: '500px'});
});
});
</script>
<script>
$(document).ready(function(){ $("#banner").dblclick(function(){
alert("Error!!! You have double clicked. Please retry.");
});
});
$(document).ready(function(){
$("#voucher").mousedown(function(){
var $temp = $("<input>");
$("body").append($temp);
$temp.val($("#voucher").text()).select();
document.execCommand("copy");
$temp.remove();
});
});
</script>
</HEAD>
<BODY background="dark.jpg">
<?php include("header.php"); ?>
<TABLE width="1200" height="440" style="border-width:4px; border-
style:dashed;border-color:#0000CC;border-radius: 25px;" align="center" id="grad">
<CAPTION><FONT color="white" size="5">Help & FAQ</FONT></CAPTION>
<TR><TD><FONT size="4" face="Tahoma"><UL>
<LI><SECTION id="flip1" class="ptr">Where do you deliver?</SECTION>
<div id="panel1" class="panel">
We deliver across the following regions:<BR>
1)Kandivali West<BR>
2)Kandivali East<BR>
3)Borivali West<BR>
4)Borivali East<BR></div></LI><HR>
<LI><SECTION id="flip2" class="ptr">When do you deliver?</SECTION>
<div id="panel2" class="panel">
We deliver Wednesday, Thursday and Friday for all customers, as well as Saturdays,
Mondays, Tuesdays and Sundays in specific areas.<BR>
You can order during any time of the day. The delivery will be done between 30-60
mins after placement of order.</div></LI><HR>
<LI><SECTION id="flip3" class="ptr">What if I am not at home to accept the
delivery?</SECTION>
<div id="panel3" class="panel">Not to worry! If you are not home during delivery,
our courier will drop the box off at your front door (or wherever you specify in your
Delivery Instructions).
If you live in an area where a box could not easily be left, we suggest one of the
following solutions:<BR>
✔Provide the address of a helpful neighbor that will be home during the delivery
window and can accept your package for you.<BR>
✔Have the box delivered to your work place.</div></LI><HR>
<LI><SECTION id="flip4" class="ptr">How does the food stay fresh in
transit?</SECTION>
<div id="panel4" class="panel">We have specially designed boxes that we pack with a
nice, thick liner and ice packs to ensure that everything arrives to you perfectly
cold!</DIV></LI><HR>
<LI><SECTION id="flip5" class="ptr">How much does delivery cost?</SECTION>
<div id="panel5" class="panel">It’s free, silly! You subscribe and delivery is on
us!</DIV></LI><HR>
<LI><SECTION id="flip6" class="ptr">How many calories do your meals
have?</SECTION>
<div id="panel6" class="panel">Roughly speaking our meals contain anywhere from
500-800 calories each.</DIV></LI></UL></FONT></TR></TD></TABLE>
<DIV id="voucher" style="color:white;position:absolute;font-size: 25">Your Voucher
ID is :6457HT5467 (Click to copy)</DIV><BR>
<IMG SRC="voucher.jpg" width="300" height="150" border="2" id="banner"
align="right"></IMG>
</BODY>
</HTML>

HEADER.PHP

<!DOCTYPE html>
<html>
<head>
<title><?php echo "$title" ?></title>
<style type="text/css">
@import url(style.css);
a:link {color: #ffffff} // color of links set to white
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
</style>
</head>
<body>
<FONT size="4" color="white">
<NAV align="right" color="white">
<A HREF="index.php">Home</A>&nbsp&nbsp&nbsp
<A HREF="help.php">Help</A>&nbsp&nbsp&nbsp
<?php
session_start();
if(isset($_SESSION['user_info']))
echo 'Welcome <A HREF="login.php"> '.$_SESSION['user_info'].'</a>';
else
echo '<A HREF="register.php">Login/Register</A>';
?>
</FONT></NAV>
</body>
</html>
REGISTER.PHP

<?php
$conn = mysqli_connect("localhost","root","","foodies");
if(!$conn){
die('Could not connect: '.mysqli_connect_error());
}
if (isset($_POST['submit']))
{
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$location=$_POST['location'];
$mob=$_POST['mob'];
$addr=$_POST['addr'];
$email=$_POST['email'];
$pw=$_POST['pw'];
$cpw=$_POST['cpw'];
$sql = "INSERT INTO user VALUES ('$fname', '$lname', '$location', '$mob', '$addr',
'$email', '$pw', '$cpw');";
if(mysqli_query($conn, $sql))
{
$message = "You have been successfully registered";
}
else
{
$message = "Could not insert record";
}
echo "<script type='text/javascript'>alert('$message');</script>";
$sql1 = "INSERT INTO php_users_login(`email`, `password`) VALUES ('$email',
'$pw');";
if(mysqli_query($conn, $sql1))
{
}
else
{
echo "<script type='text/javascript'>alert('Could not insert record');</script>";
}
}
?>
<HTML>
<HEAD>
<TITLE>Register-24X7 Foodies.com</TITLE>
<LINK REL="STYLESHEET" HREF="STYLE.CSS">
<SCRIPT type="text/javascript">
function validate()
{
var fname=document.getElementById("fname");
var lname=document.getElementById("lname");
var mob=document.getElementById("mob");
var location=document.getElementById("location");
var EmailId=document.getElementById("email");
var addr=document.getElementById("addr");
var pw=document.getElementById("pw");
var cpw=document.getElementById("cpw");
var alphaExp = /^[a-zA-Z]+$/;
var atpos = EmailId.value.indexOf("@");
var dotpos = EmailId.value.lastIndexOf(".");
if(fname.value==null || fname.value=="")
{
fname.focus();
alert("Enter valid first name");
return false;
}
if(fname.value.match(alphaExp)){}
else{
alert("First name can have only letters");
fname.focus();
return false;
}
if(lname.value==null || lname.value=="")
{
lname.focus();
alert("Enter valid last name");
return false;
}
if(lname.value.match(alphaExp)){}
else{
alert("Last name can have only letters");
lname.focus();
return false;
}
if(location.selectedIndex==0)
{
alert("Please select location");
location.focus();
return false;
}
if(mob.value==null || mob.value==" ")
{
alert("Please Enter Mobile Number");
mob.focus();
return false;
}
if (isNaN(mob.value))
{
alert(" Your Mobile Number must be Integers");
mob.focus();
return false;
}
if((mob.value.length!= 10))
{
alert("Enter the valid Mobile Number(Like : 9669666999)");
mob.focus();
return false;
}
if(addr.value==" " || addr.value=="")
{
alert("Please Enter Your Address");
addr.focus();
return false;
}
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=EmailId.value.length)
{
alert("Enter valid email-ID");
EmailId.focus();
return false;
}
if(pw.value.length< 8 || cpw.value.length< 8)
{
alert("Please enter a password of atleast 8 characters");
pw.focus();
return false;
}
else if (pw.value.length != cpw.value.length)
{
alert("Passwords do not match.");
pw.focus();
return false;
}
else if (pw.value != cpw.value)
{
alert("Passwords do not match.");
pw.focus();
return false;
}
if (confirm("Do you want to submit your details?") == true) {}
else
{
return false;
}
var survey=prompt("How did you hear about us? (Used only for survey)");
return true;
}
</SCRIPT>
</HEAD>
<BODY background="background.jpg" style="background-position: center;
background-repeat: no-repeat;
background-size: cover"link="white" alink="white" vlink="white">
<?php include("header.php"); ?>
<FORM name="register" method="post" action="register.php" onsubmit="return
validate()">
<TABLE border="1" bordercolor="white">
<CAPTION><FONT size="6" color="WHITE">Enter your
details:</FONT></CAPTION>
<TR class="left"><TD><FONT size="5" color="WHITE">First
name:</FONT></TD>
<TD><INPUT name="fname" type="TEXT" placeholder="Enter your first name"
size="30" maxlength="30" align="center" id="fname"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Last
name:</FONT></TD>
<TD><INPUT type="TEXT" name="lname" align="center" size="30"
maxlength="30" placeholder="Enter your last name" id="lname"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Location:</FONT></TD>
<TD><SELECT name="location" id="location" style="color:#d3d3d3;"
onchange="document.postElementById('location').style.color='black';">
<OPTION VALUE="none" disabled selected>-------SELECT YOUR LOCATION-----
--</OPTION>
<OPTION VALUE="Kandivali West" style="color:black;">Kandivali
West</OPTION>
<OPTION VALUE="Kandivali East" style="color:black;">Kandivali
East</OPTION>
<OPTION VALUE="Borivali East" style="color:black;">Borivali East</OPTION>
<OPTION VALUE="Borivali West" style="color:black;">Borivali West</OPTION>
</SELECT></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Mobile
Number:</FONT></TD>
<TD><INPUT type="TEXT" name="mob" size="30" maxlength="10"
placeholder="Enter your mobile number" id="mob"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Address:</FONT></TD>
<TD class="left"><TEXTAREA rows="7" cols="33" wrap="physical"
placeholder="Enter your address" id="addr"
name="addr"></TEXTAREA></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">E-Mail
ID:</FONT></TD>
<TD><INPUT name="email" type="TEXT" id="email" placeholder="Enter your E-
Mail ID" size="30" maxlength="30"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Password:</FONT></TD>
<TD><INPUT type="PASSWORD" name="pw" size="30" id="pw"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Confirm
Password:</FONT></TD>
<TD><INPUT type="PASSWORD" name="cpw" size="30" id="cpw"></TD></TR>
<TR class="left"><TD colspan="2"><FONT size="4" color="WHITE">
<INPUT type="checkbox" name="tc" value="tc">
I have read and accepted the Terms and Conditions and
<BR>&nbsp&nbsp&nbsp&nbsp&nbspPrivacy Policy</FONT></TD></TR>
</TABLE>
<P><INPUT TYPE="Submit" value="Submit" name="submit" id="submit"
class="button" onclick="if(!this.form.tc.checked){alert('You must agree to the terms
first.');return false}">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<INPUT TYPE="Reset" value="Reset" id="reset" class="button"></P></FORM>
<HR width="1000">
<FORM action="login.php">
<P align="CENTER"><FONT size="6" color="white" face="Arial">
Already have an account with us?<BR></FONT>
<INPUT TYPE="submit" value="Login" id="login" class="button"></P>
</FORM>
</BODY>
</HTML>
LOGIN.PHP
<?php
$conn = mysqli_connect("localhost","root","","foodies");
if(!$conn){
die('Could not connect: '.mysqli_connect_error());
}
if (isset($_POST['submit']))
{
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$location=$_POST['location'];
$mob=$_POST['mob'];
$addr=$_POST['addr'];
$email=$_POST['email'];
$pw=$_POST['pw'];
$cpw=$_POST['cpw'];
$sql = "INSERT INTO user VALUES ('$fname', '$lname', '$location', '$mob', '$addr',
'$email', '$pw', '$cpw');";
if(mysqli_query($conn, $sql))
{
$message = "You have been successfully registered";
}
else
{
$message = "Could not insert record";
}
echo "<script type='text/javascript'>alert('$message');</script>";
$sql1 = "INSERT INTO php_users_login(`email`, `password`) VALUES ('$email',
'$pw');";
if(mysqli_query($conn, $sql1))
{
}
else
{
echo "<script type='text/javascript'>alert('Could not insert record');</script>";
}
}
?>
<HTML>
<HEAD>
<TITLE>Register-24X7 Foodies.com</TITLE>
<LINK REL="STYLESHEET" HREF="STYLE.CSS">
<SCRIPT type="text/javascript">
function validate()
{
var fname=document.getElementById("fname");
var lname=document.getElementById("lname");
var mob=document.getElementById("mob");
var location=document.getElementById("location");
var EmailId=document.getElementById("email");
var addr=document.getElementById("addr");
var pw=document.getElementById("pw");
var cpw=document.getElementById("cpw");
var alphaExp = /^[a-zA-Z]+$/;
var atpos = EmailId.value.indexOf("@");
var dotpos = EmailId.value.lastIndexOf(".");
if(fname.value==null || fname.value=="")
{
fname.focus();
alert("Enter valid first name");
return false;
}
if(fname.value.match(alphaExp)){}
else{
alert("First name can have only letters");
fname.focus();
return false;
}
if(lname.value==null || lname.value=="")
{
lname.focus();
alert("Enter valid last name");
return false;
}
if(lname.value.match(alphaExp)){}
else{
alert("Last name can have only letters");
lname.focus();
return false;
}
if(location.selectedIndex==0)
{
alert("Please select location");
location.focus();
return false;
}
if(mob.value==null || mob.value==" ")
{
alert("Please Enter Mobile Number");
mob.focus();
return false;
}
if (isNaN(mob.value))
{
alert(" Your Mobile Number must be Integers");
mob.focus();
return false;
}
if((mob.value.length!= 10))
{
alert("Enter the valid Mobile Number(Like : 9669666999)");
mob.focus();
return false;
}
if(addr.value==" " || addr.value=="")
{
alert("Please Enter Your Address");
addr.focus();
return false;
}
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=EmailId.value.length)
{
alert("Enter valid email-ID");
EmailId.focus();
return false;
}
if(pw.value.length< 8 || cpw.value.length< 8)
{
alert("Please enter a password of atleast 8 characters");
pw.focus();
return false;
}
else if (pw.value.length != cpw.value.length)
{
alert("Passwords do not match.");
pw.focus();
return false;
}
else if (pw.value != cpw.value)
{
alert("Passwords do not match.");
pw.focus();
return false;
}
if (confirm("Do you want to submit your details?") == true) {}
else
{
return false;
}
var survey=prompt("How did you hear about us? (Used only for survey)");
return true;
}
</SCRIPT>
</HEAD>
<BODY background="background.jpg" style="background-position: center;
background-repeat: no-repeat;
background-size: cover"link="white" alink="white" vlink="white">
<?php include("header.php"); ?>
<FORM name="register" method="post" action="register.php" onsubmit="return
validate()">
<TABLE border="1" bordercolor="white">
<CAPTION><FONT size="6" color="WHITE">Enter your
details:</FONT></CAPTION>
<TR class="left"><TD><FONT size="5" color="WHITE">First
name:</FONT></TD>
<TD><INPUT name="fname" type="TEXT" placeholder="Enter your first name"
size="30" maxlength="30" align="center" id="fname"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Last
name:</FONT></TD>
<TD><INPUT type="TEXT" name="lname" align="center" size="30"
maxlength="30" placeholder="Enter your last name" id="lname"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Location:</FONT></TD>
<TD><SELECT name="location" id="location" style="color:#d3d3d3;"
onchange="document.postElementById('location').style.color='black';">
<OPTION VALUE="none" disabled selected>-------SELECT YOUR LOCATION-----
--</OPTION>
<OPTION VALUE="Kandivali West" style="color:black;">Kandivali
West</OPTION>
<OPTION VALUE="Kandivali East" style="color:black;">Kandivali
East</OPTION>
<OPTION VALUE="Borivali East" style="color:black;">Borivali East</OPTION>
<OPTION VALUE="Borivali West" style="color:black;">Borivali West</OPTION>
</SELECT></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Mobile
Number:</FONT></TD>
<TD><INPUT type="TEXT" name="mob" size="30" maxlength="10"
placeholder="Enter your mobile number" id="mob"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Address:</FONT></TD>
<TD class="left"><TEXTAREA rows="7" cols="33" wrap="physical"
placeholder="Enter your address" id="addr"
name="addr"></TEXTAREA></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">E-Mail
ID:</FONT></TD>
<TD><INPUT name="email" type="TEXT" id="email" placeholder="Enter your E-
Mail ID" size="30" maxlength="30"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Password:</FONT></TD>
<TD><INPUT type="PASSWORD" name="pw" size="30" id="pw"></TD></TR>
<TR class="left"><TD><FONT size="5" color="WHITE">Confirm
Password:</FONT></TD>
<TD><INPUT type="PASSWORD" name="cpw" size="30" id="cpw"></TD></TR>
<TR class="left"><TD colspan="2"><FONT size="4" color="WHITE">
<INPUT type="checkbox" name="tc" value="tc">
I have read and accepted the Terms and Conditions and
<BR>&nbsp&nbsp&nbsp&nbsp&nbspPrivacy Policy</FONT></TD></TR>
</TABLE>
<P><INPUT TYPE="Submit" value="Submit" name="submit" id="submit"
class="button" onclick="if(!this.form.tc.checked){alert('You must agree to the terms
first.');return false}">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<INPUT TYPE="Reset" value="Reset" id="reset" class="button"></P></FORM>
<HR width="1000">
<FORM action="login.php">
<P align="CENTER"><FONT size="6" color="white" face="Arial">
Already have an account with us?<BR></FONT>
<INPUT TYPE="submit" value="Login" id="login" class="button"></P>
</FORM>
</BODY>
</HTML>
STYLE.CSS

P,FOOTER,tr {text-align: center;}


table { margin: auto; }
tr.left{text-align:left}
.button {display: inline-block; border-radius: 10px; background-color:aqua; border:
none; color: #000080;
text-align: center; font-size: 20px; padding: 5px; width: 200px; transition: all 0.5s;
cursor: pointer; margin:
5px;}
#button span { cursor: pointer; display: inline-block; position: relative; transition:
0.5s;}
#button span:after { content: '»'; position: absolute; opacity: 0; top: 0; right: -20px;
transition: 0.5s;}
#button:hover span { padding-right: 25px;}
#button:hover span:after { opacity: 1; right: 0;}
img#logo{-webkit-filter: drop-shadow(10px 10px 10px red); filter: drop-shadow(8px
8px 10px red);}
* { max-width: 100%; height: auto; font-family: 'Roboto', sans-serif;}
MAIN.CSS

*{ font-family: 'Roboto', sans-serif; }


html,button,input,select,textarea { color: #222;}
html { font-size: 1em; line-height: 1.4;}
::-moz-selection { background: #b3d4fc; text-shadow: none;}
::selection { background: #b3d4fc; text-shadow: none;}
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0;
padding: 0;}
audio,canvas,img,video { vertical-align: middle;}
fieldset { border: 0; margin: 0; padding: 0;}
textarea { resize: vertical;}
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-
box;}
*:before,*:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-
sizing: border-box;}
body { background: #333333 url(../img/3.jpg) no-repeat center bottom fixed;
-webkit-background-size: cover; -moz-background-size: cover; -o-background-size:
cover; background-size: cover; font-weight: 300;}
.login-form { margin: 50px auto; background: white; padding: 30px 0; position:
relative; -webkit-box-shadow: 0 0 5px 3px rgba(0, 0, 0, 0.125); box-shadow: 0 0 5px
3px rgba(0, 0, 0, 0.125); height: 400px; }
.login-form #form-loading { text-align: center; position: absolute; top: 0; bottom: 0;
width: 100%;
opacity: 0.5; filter: alpha(opacity=50); z-index: 1000; background: #555555;}
.login-form #form-loading i { font-size: 100px;}
.login-form #form-message { text-align: center; color: #555555;}
.login-form .h1 { font-size: 30px; color: #3EC038; padding: 15px 15px 35px 15px;
text-transform: uppercase;
text-align: center;}
.login-form .logo { height: auto; max-width: 100%;}
.login-form .group { *zoom: 1; -webkit-transition: all ease .2s; transition: all ease .2s;
border-left: 4px solid #fff; padding: 10px 0;}
.login-form .group:before,.login-form .group:after { content: " "; display: table;}
.login-form .group:after { clear: both;}
.login-form.group>label {padding-left: 15px; padding-top: 5px;color: #555555; font-
size: 16px;display: block;}
.login-form .group > label.empty { display: block; height: 1px; padding: 0; margin: 0;}
.login-form .group > div { padding: 0 15px;}
.login-form .group > div.addon-right { position: relative; padding-right: 50px;}
.login-form .group > div.addon-right > i { position: absolute; right: 25px; top: 9px; z-
index: 999; color: #555555;}
.login-form .group > div .error-message { font-size: 12px; color: red; margin-top:
5px;}
.login-form .group.active { background: #F6F6F6; border-left-color: #40C2FF; -
webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.03); box-shadow: inset 0px 0px
3px rgba(0, 0, 0, 0.03);}
.login-form input[type=submit] { border: none; background: #65CA60; color: white;
padding: 5px 20px;
text-transform: uppercase; font-weight: 500; border-radius: 1px; -webkit-box-shadow:
inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -
webkit-transition: background ease-in-out .15s; transition: background ease-in-out
.15s; cursor:pointer;}
.login-form input[type=button] { border: none; background: #65CA60; color: white;
padding: 5px 20px;
text-transform: uppercase; font-weight: 500; border-radius: 1px; -webkit-box-shadow:
inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -
webkit-transition: background ease-in-out .15s; transition: background ease-in-out
.15s; cursor:pointer;}
.login-form input[type=submit]:hover { background: #5AC253;}
.login-form { width: 320px;}
@media (min-width: 550px) {
.login-form { width: 520px; }
.login-form .group > label { float: left; width: 180px; }
.login-form .group > div { margin-left: 180px; padding-left: 0; }
}
.form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-
size: 14px;
line-height: 1.428571429; color: #555555; background-color: #ffffff; background-
image: none;
border: 1px solid #cccccc; border-radius: 1px; -webkit-box-shadow: inset 0 1px 1px
rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color
ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s,
box-shadow ease-in-out .15s;}
.form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0
1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px
1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);}
.form-control::-moz-placeholder { color: #999999; opacity: 1;}
.form-control:-ms-input-placeholder { color: #999999;}
.form-control::-webkit-input-placeholder { color: #999999;}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control { cursor: not-allowed; background-color: #eeeeee;
opacity: 1;}
textarea.form-control { height: auto;}
.hide { display: none !important;}
.show { display: block !important;}
.one-line { text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
.arrow-up { border-left-color: transparent; border-right-color: transparent; border-top-
style: none;}
.arrow-down { border-left-color: transparent; border-right-color: transparent; border-
bottom-style: none;}
.arrow-right { border-top-color: transparent; border-bottom-color: transparent; border-
right-style: none;}
.arrow-left { border-top-color: transparent; border-bottom-color: transparent; border-
left-style: none;}
.arrow { width: 0; height: 0; display: inline-block; vertical-align: middle; border-color:
white; border-width: 5px; border-style: solid;}
.arrow.up { border-left-color: transparent; border-right-color: transparent; border-top-
style: none;}
.arrow.down { border-left-color: transparent; border-right-color: transparent; border-
bottom-style: none;}
.arrow.right { border-top-color: transparent; border-bottom-color: transparent; border-
right-style: none;}
.arrow.left { border-top-color: transparent; border-bottom-color: transparent; border-
left-style: none;}
label.err { color: red; display: block; margin: 0; width: auto;}
em { display: block; margin: 5px 0 0px 180px; font-style: inherit;}
.welcome{ line-height: 50px; padding-left:30px; color: #555555;
CONFIG.PHP
<?php
/* Define MySQL connection details and database table name */
//$SETTINGS["mysql_database"] = 'foodies';
//$SETTINGS["USERS"] = 'php_users_login'; // this is the default table name that we
used
/* Connect to MySQL */
$connection = mysqli_connect("localhost","root","","foodies"); //or die ('Unable to
connect to MySQL server.<br ><br >Please make sure your MySQL login details are
correct.');
//$db = mysqli_select_db($SETTINGS["mysql_database"], $connection) or die
('request "Unable to select database."');
?>
CHANGEPW.PHP
<html>
<head>
<title>Change password</title>
<link rel="stylesheet" href="css/main.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,500'
rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"
rel="stylesheet">
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/main.js"></script>
<style type="text/css">
a:link {color: #ffffff}
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
</style>
</head>
<body>
<?php include("header.php"); ?>
<form id="login-form" class="login-form" name="form1" method="post"
action="changepw.php">
<div id="form-content"> <div class="welcome">
Do you want to change your password?<br />
Email ID: <input type="text" name="email"><br/>
Current password: <input type="password" name="opw"><br/>
New password: <input type="password" name="npw"><br/><br/>
<center><input type="submit" name="changepw" value="Change
password"></center> </div> </div> </form>
</body>
</html>
<?php
$connect = mysqli_connect("localhost","root","");
mysqli_select_db("foodies") or die("couldn't find database");
if (isset($_POST['changepw'])){
$email=$_POST['email'];
$opw=$_POST['opw'];
$npw=$_POST['npw'];
$query = mysqli_query("select * from php_users_login where email='$email'");
$numrows = mysqli_num_rows($query);
if($numrows!=0)
{
while($row = mysqli_fetch_assoc($query))
{
$dbemail = $row['email'];
$dbpassword = $row['password'];
}
if($dbemail==$email&&$opw==$dbpassword)
{
$sql2 ="UPDATE php_users_login SET password= '$npw' WHERE email=
'$dbemail';";
if(mysqli_query($sql2))
{
echo "<script type='text/javascript'>alert('Password changed successfully');</script>";
}
else
{
echo "<script type='text/javascript'>alert('Error');</script>";
}
}
else
echo "<script type='text/javascript'>alert('Incorrect password');</script>";
}
else
echo "<script type='text/javascript'>alert('User does not exist');</script>";
}
?>

DEACT.PHP
<html>
<head>
<title>Deactivate account</title>
<link rel="stylesheet" href="css/main.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,500'
rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"
rel="stylesheet">
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/main.js"></script>
<style type="text/css">
a:link {color: #ffffff}
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
</style>
</head>
<body>
<?php include("header.php"); ?>
<form id="login-form" class="login-form" name="form1" method="post"
action="deact.php">
<div id="form-content"> <div class="welcome">Do you sure you wish to deactivate
your account?<br />
Email ID: <input type="text" name="email"><br/>
Password: <input type="password" name="password"><br/><br/><br/>
<center><input type="submit" name="submit" value="Deactivate
account"></center></div> </div>
</form>
</body>
</html>
<?php
if (isset($_POST['submit']))
{
$email=$_POST['email'];
$password=$_POST['password'];
$connect = mysql_connect("localhost","root","");
mysql_select_db("foodies") or die("couldn't find database");
$query = mysql_query("select * from php_users_login where email='$email'");
$numrows = mysql_num_rows($query);
if($numrows!=0)
{
while($row = mysql_fetch_assoc($query))
{
$dbemail = $row['email'];
$dbpassword = $row['password'];
}
if($email==$dbemail&&$password==$dbpassword)
{
$sql1 ="DELETE FROM `php_users_login` WHERE email='$dbemail';";
if(mysql_query($sql1))
{
echo "<script type='text/javascript'>alert('User deleted successfully');</script>";
}
else
{
echo "<script type='text/javascript'>alert('Could not delete user');</script>";
}
}
else
echo "<script type='text/javascript'>alert('Incorrect password');</script>";
}
else
echo "<script type='text/javascript'>alert('User does not exist');</script>";
}
?>
ORDER.PHP
<?php
session_start();
include('config.php');
if (isset($_POST['submit'])){
if(!empty($_SESSION['user_info'])) {
$qty1=$_POST['qty1'];
$qty2=$_POST['qty2'];
$qty3=$_POST['qty3'];
$qty4=$_POST['qty4'];
$qty5=$_POST['qty5'];
$qty6=$_POST['qty6'];
$qty7=$_POST['qty7'];
$qty8=$_POST['qty8'];
$qty9=$_POST['qty9'];
$user_info=$_SESSION['user_info'];
$sum=30* (int)$qty1+60* (int)$qty2+30* (int)$qty3+180* (int)$qty4+350*
(int)$qty5+200* (int)$qty6+300* (int)$qty7+250* (int)$qty8+270* (int)$qty9;

$msg="Order placed successfully. Please make a payment of Rs ".$sum." by


cash on successful delivery";
$connect = mysqli_connect("localhost","root","");
mysqli_select_db($connection,"foodies") or die("couldn't find database");
$sql="INSERT INTO
orders(email,qty1,qty2,qty3,qty4,qty5,qty6,qty7,qty8,qty9)VALUES('$user_in
fo','$qty1','$qty2','$qty3','$qty4','$qty5','$qty6','$qty7','$qty8','$qty9');";
if(mysqli_query($connection,$sql))
{
echo '<script type="text/javascript"> alert("'.$msg.'")</script>';
}
else
{
echo "<script type='text/javascript'>alert('Could not place order');</script>";
}
}
else
echo "<script type='text/javascript'>alert('Please login');</script>";
}
?>
<html>
<head>
<title>Order</title>
<style type="text/css">
@import url(style.css);
a:link {color: #ffffff}
a:visited {color: #ffffff}
a:hover {color: #ffffff}
a:active {color: #ffffff}
font{color:white}
img{width:300; height:200;}
table{border-color:white;height:90%;}
img{border-color:white}

body{no-repeat center center fixed;


-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;}
</style>
<script type="text/javascript">
function subtractQty(qty){
if(qty.value - 1 < 0)
return;
else
qty.value--;
}
function chk()
{
var qty1=document.getElementById("qty1");
var qty2=document.getElementById("qty2");
var qty3=document.getElementById("qty3");
var qty4=document.getElementById("qty4");
var qty5=document.getElementById("qty5");
var qty6=document.getElementById("qty6");
var qty7=document.getElementById("qty7");
var qty8=document.getElementById("qty8");
var qty9=document.getElementById("qty9");
if((qty1.value=='' && qty2.value=='' && qty3.value=='' && qty4.value==''

&&qty5.value=='' && qty6.value=='' && qty7.value=='' && qty8.value==''


&&qty9.value=='')||(qty1.value=='0' && qty2.value=='0' && qty3.value=='0'
&& qty4.value=='0' && qty5.value=='0' && qty6.value=='0' &&
qty7.value=='0' && qty8.value=='0' && qty9.value=='0' ))
{
alert("Please select atleast 1 item");
return false;
}
return true;
}
</script>
</head>
<body background="a.jpg">
<FONT size="4" color="white">
<NAV align="right">
<A HREF="index.php">Home</A>&nbsp&nbsp&nbsp
<A HREF="help.php">Help</A>&nbsp&nbsp&nbsp
<?php
if(isset($_SESSION['user_info']))
echo 'Welcome <A HREF="login.php"> '.$_SESSION['user_info'].'</a>';
else
echo '<A HREF="register.php">Login/Register</A>';
?>
</FONT></NAV>
<form action="order.php" name="orderform" method="post">
<table cellspacing="5" cellpadding="2" align="center">
<caption><font size="5"><U>ORDER HERE</U></font></caption>
<tr><td>
<img src="gulabjamun.jpg" width="300" height="200" border="5"><br/>
<font size="4">Gulab Jamun</font>
&nbsp;&nbsp;<input type='text' name='qty1' id='qty1' size="1"
maxlength="2" class="qty" style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty1").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty1);'
value='-'/>
<font size="4">Rs. 30</font></td>
<td><img src="samosa.jpg" width="300" height="200" border="2"><br/>
<font size="4">Samosa</font>&nbsp;&nbsp;
<input type='text' name='qty2' id='qty2' size="1" maxlength="2" class="qty"
style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty2").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty2);'
value='-'/>
<font size="4">Rs. 60</font></td>
<td><img src="naan.jpg" width="300" height="200" border="2"><br/>
<font size="4">Plain Naan</font>&nbsp;&nbsp;
<input type='text' name='qty3' id='qty3' size="1" maxlength="2" class="qty"
style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty3").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty3);'
value='-'/>
<font size="4">Rs. 30</font></td></tr>
<tr><td><img src="pulav.jpg" width="300" height="200" border="2" ><br/>
<font size="4">Pulav</font>&nbsp;&nbsp;
<input type='text' name='qty4' id='qty4' size="1" maxlength="2" class="qty"
style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty4").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty4);'
value='-'/>
<font size="4">Rs. 180</font></td><td><img src="pizza.jpg" width="300"
height="200" border="2"><br/>
<font size="4">Pizza</font>&nbsp;&nbsp;
<input type='text' name='qty5' id='qty5' size="1" maxlength="2" class="qty"
style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty5").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty5);'

value='-'/>
<font size="4">Rs. 350</font></td>
<td><img src="bhurji.jpg" width="300" height="200" border="2"><br/>
<font size="4">Paneer Bhurji</font>&nbsp;&nbsp;<input type='text'
name='qty6' id='qty6' size="1" maxlength="2" class="qty" style="width:
25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty6").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty6);'
value='-'/>

<font size="4">Rs. 200</font></td></tr>


<tr><td>
<img src="dosa.jpg" width="300" height="200" border="2"><br/>
<font size="4">Dosa</font>
&nbsp;&nbsp;<input type='text' name='qty7' id='qty7' size="1"
maxlength="2" class="qty" style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty7").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty7);'
value='-'/>
<font size="4">Rs. 300</font>
</td><td>
<img src="nonveg.jpg" width="300" height="200" border="2"><br/>
<font size="4">Mutton Leg</font>
&nbsp;&nbsp;<input type='text' name='qty8' id='qty8' size="1"
maxlength="2" class="qty" style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty8").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty8);'
value='-'/>
<font size="4">Rs. 250</font></td>
<td>
<img src="thali.jpg" width="300" height="200" border="2"><br/>
<font size="4">Thali</font>
&nbsp;&nbsp;<input type='text' name='qty9' id='qty9' size="1"
maxlength="2" class="qty" style="width: 25px;"/>
<input type='button' name='add' onclick='javascript:
document.getElementById("qty9").value++;' value='+'/>
<input type='button' name='subtract' onclick='javascript: subtractQty(qty9);'
value='-'/>
<font size="4">Rs. 270</font></td></tr>
<tr></tr><tr></tr><tr></tr><tr></tr><tr><td colspan="3"><input

type="submit" name="submit" value="Order now!!!" class="button"


onclick="return chk()"></input></td></tr>

</table></form>
</body>
</html>
DATABASE
TESTING

SOFTWARE TESTING

Testing is vital to the success of the software. Testing of the s/w leads to uncovering of
errors in the s/w functional and requirements are met. Testing also provide a good
indication of s/w reliability as software quality as a whole. The result of the different
phases of testing are evaluated and then compared with the expected results. If the errors
are uncovered they are debugged and corrected.

Software Testing Techniques:

A strategy for the software testing may also be viewed in the context of the spiral.

(1).Unit Testing:
Unit test begins at the vortex of the spiral and concentrates on each unit of the software
as implemented in source code. Unit testing focuses verification effort on the smallest
unit of software design- the software component or module using the component level
design description as a guide, important control paths are tested to uncover errors within
the boundary of the module. The unit testing is white-box oriented, and the steps can be
conducted in parallel for multiple components.
The modules in the project allocated to each of the individuals were tested individually
for errors and a list of all the errors were compiled and the code was reworked to remove
the errors encountered. Thus as a first step, the modules was first individually made error
free.

(2).Integration Testing:
Integration Testing is a systematic technique for constructing the program structures
while at the same time conducting tests to uncover errors associated with interfacing.
The objective is to take unique tested components and build a program structure that has
been dictated by design.
A number of different incremental integration strategies are discussed below:

(a).Top-Down Integration: Top down integration testing is an incremental approach to


construction of a program structure. Modules are integrated by downward through the
control hierarchy, beginning with the main control module. Modules subordinate (and
ultimately subordinate) to the main control module and incorporated into the structure
in either a depth-first or breadth-first manner.

(b).Bottom-up integration : Bottom-up integration testing as its name implied, begins


construction and testing with atomic modules (i.e. components at the lowest level in the
program structure) because components are integrated from the bottom up, processing
required for components subordinate to a given level is always available need for struts
is eliminated.

(3).Regression Testing:
Each time a new module is added as a part of integration testing, the software changes,
new data flow part are established, new i/o may occur and new control logic is invoked.
Regression is the re execution of some subsets of tests that have already been conducted
to ensure that changes have not propagate unintended side effects.

(4).Validation Testing:
At the culmination of integration testing, software is completely assembled as a
package, interfacing errors have been uncovered and corrected, and a final series of
software tests-validation testing- may begin. Validation succeeds when software
functions in a manner that can be reasonably expected by the customer.

Validation Test Criteria: Software validation is achieved through a series of black box
tests that demonstrate conformity with requirements.
After each validation test case has been conducted, one of two possible conditions exists:

• The function or performance characteristics conform to specification and are


accepted or
• A deviation from specification is uncovered and a deficiency list is created.

Configuration Review
The intent of the review is to ensure that all elements of the software configuration have
been properly developed, are cataloged and have the necessary detail to bolster the
support phase of the software life cycle.

(5).Alpha and Beta Testing:

Alpha Testing: The customer conducts the alpha test at the developer site. The software
is used in a nature setting with the developer “looking over the shoulder” of the user and
recording errors and usage problem. Alpha test is conducted in a controlled environment.
The developer of the software creates this environment. The most important advantage
of this type of test is that during this test the user can work on the software in a guidance
of the developer of the software. This can be a medium so that the user can get the better
training for the use of the software and developer can get the real reason of the generation
of error or defect.

(b).Beta Testing: The Beta test is conducted at one or more customer site by the end
users of the software. Beta test is a live application of the software in an environment
that cannot be controlled by the developer. The customer records all problems that are
encountered during beta testing and reports these to the developer at regular intervals.
At a result of problems during beta test, the software developer makes modification and
then prepares for releases of the software product to the entire customer based.

(6).System Testing:
System testing is actually a series of different tests whose primary purpose is to fully
exercise the computer based system. Although each test has a different purpose, all work
to verify that system elements have been properly integrated and perform allocated
functions.

(7).Recovery Testing:
Recovery testing is a system test that forces the software to fail in a variety of ways and
verifies that recovery is properly performed. If recovery is
automatic data recovery and restart and are evaluated for correctness. If recovery
requires human intervention, the mean-time–to –repair (MTTR) is evaluated to
determine whether it is with in acceptable limits.

(8).Security Testing :
Security testing attempts to verify that protection mechanism built into a system will, in
fact, protect it from improper penetration.

(9).Stress Testing:
Stress testing executes a system in a manner that demands resources in an abnormal
quantity, frequency or volume. For example

•Special test may be designed that generate 10 interrupts per second when one or two is
the average rate.
•Test cases that may excessive hunting for disk-resident data are created.

(10)Performance testing:
Performance testing is designed to test the run time performance of software within the
context of the integrated system. Performance testing occurs throughout all steps in the
testing process.
SCOPE OF TESTING

White Box Testing:


The purpose of any security testing method is to ensure the robustness of a system in
the face of malicious attacks or regular software failures. White box testing is performed
based on the knowledge of how the system is implemented. White box testing includes
analyzing data flow, control flow, information flow, coding practices, and exception and
error handling within the system, to test the intended and unintended software behavior.
White box testing can be performed to validate whether code implementation follows
intended design, to validate implemented security functionality, and to uncover
exploitable vulnerabilities.
White box testing requires access to the source code. Though white box testing can be
performed any time in the life cycle after the code is developed, it is a good practice to
perform white box testing during the unit testing phase.
White box testing requires knowing what makes software secure or insecure, how to
think like an attacker, and how to use different testing tools and techniques. The first
step in white box testing is to comprehend and analyze source code, so knowing what
makes software secure is a fundamental requirement. Second, to create tests that exploit

software, a tester must think like an attacker. Third, to perform testing effectively, testers
need to know the different tools and techniques available for white box testing. The three
requirements do not work in isolation, but together.

Black Box Testing:


Black box testing takes an external perspective of the test object to derive test cases.
These tests can be functional or non-functional, though usually functional. The test
designer selects valid and invalid input and determines the correct output. There is no
knowledge of the test object's internal structure.
This method of test design is applicable to all levels of software testing: unit, integration,
functional testing, system and acceptance. The higher the level, and hence the bigger
and more complex the box, the more one is forced to use black box testing to simplify.
While this method can uncover unimplemented parts of the specification, one cannot be
sure that all existent paths are tested.

Test Strategy

How we plan to cover the product so as to develop an adequate assessment of quality.


A good test strategy is:
• Specific
• Practical
• Justified
The purpose of a test strategy is to clarify the major tasks and challenges of the test
project.
Test Approach and Test Architecture are other terms commonly used to describe what
I’m calling test strategy.

testing, cause-effect graphing, boundary testing, and white box testing to test this product
against its specification."
The test strategy is a formal description of how a software product will be tested. A test
strategy is developed for all levels of testing, as required. The test team analyzes the
requirements, writes the test strategy and reviews the plan with the project team. The
test plan may include test cases, conditions, the test environment, a list of related tasks,
pass/fail criteria and risk assessment.
Inputs for this process:
• A description of the required hardware and software components, including test
tools. This information comes from the test environment, including test tool data.
• A description of roles and responsibilities of the resources required for the test
and schedule constraints. This information comes from man-hours and schedules.
• Testing methodology. This is based on known standards.
• Functional and technical requirements of the application. This information comes
from requirements, change request, technical and functional design documents.
• Requirements that the system can not provide, e.g. system
limitations.

Outputs for this process:


• An approved and signed off test strategy document, test plan, including test cases.
• Testing issues requiring resolution. Usually this requires additional negotiation at
the project management level.

Test Planning

Testing is sometimes incorrectly thought as an after-the-fact activity; performed after


programming is done for a product. Instead, testing should be performed at every
development stage of the product. Test data sets must be derived and their correctness
and consistency should be monitored throughout the development process.
If we divide the lifecycle of software development into “Requirements Analysis”,
“Design”, “Programming/Construction” and “Operation and Maintenance”, then testing
should accompany each of the above phases. If testing is isolated as a single phase late
in the cycle, errors in the problem statement or design may incur exorbitant costs. Not
only must the original error be corrected, but the entire structure built upon it must also
be changed. Therefore, testing should not be isolated as an inspection activity. Rather
testing should be involved throughout the SDLC in order to bring out a quality product.
BIBLIOGRAPHY

http://www.google.com
http://www.w3schools.com
http://www.tutorial.com
https://www.dofactory.com
https://www.csstutorial.net
http://www.afg.com

You might also like