Automobile Management System: Bachelor of Computer Science Tom Kentenich Siby (DEPT NO: 16-CS-024)
Automobile Management System: Bachelor of Computer Science Tom Kentenich Siby (DEPT NO: 16-CS-024)
Automobile Management System: Bachelor of Computer Science Tom Kentenich Siby (DEPT NO: 16-CS-024)
CHENNAI – 600034
BONAFIDE CERTIFICATE
The main aim of this project is to create a website that is helpful to buy
Automobile
In the Proposed System, application can maintain vehicle details like manufacturer, year
of manufacturing, price and model etc. We can also view all the vehicle details which
are kept for sale effectively. With this Customer can get the information quickly like
vehicle details which have been entered clearly.
FRONT END:
PHP,html
BACK END:
MYSQL
ACKNOWLEDGEMENT
First, I would like to thank the Almighty without whom this task would have not been
achieved. I express my sincere and profound gratitude to our college principal
Rev.Dr.M.AROCKIASAMY XAVIER, S.J. and Deputy Principal Dr.FATIMA
VASANTH for their encouragement and support to do my project in our computer Lab.
I would also like to thank our Head of the Department Dr C. Muthu, M.Sc.,
M.Tech., Ph.D. and our Co-ordinator Prof. M. Regina M.Sc.,M.C.A.,M.Phil. for
their support to finish this project.
My special thanks to Prof. Prof. Maria Vinitha MCA,M.Phil.,who gave me the needed
information and encouragement for the successful completion of this project.
I take this opportunity to thank all the staff members and the Lab Administrators of the
Computer Science Department who rendered their help directly to finish my project in
time.
Last but not the least, I would like to express my hearty thanks to my parents, without
whom I would not have come to this level in my life. My hearty thanks to my friends
and well-wishers who supported and encouraged me to complete this project
successfully.
As of now, the automobile websites are more complicated to use and the services
they provided are very less. While in this project the users can view the automobiles
with less complexity and this project will satisfy the users with more services. This will
help the users more than the existing system.
• Platform: Windows 7
• Front-end: PHP
• Back-end: MYSQL
System design is the process of designing the elements of a system such as the architecture,
modules and components, the different interfaces of those components and the data that goes
through that system. System design is the phase that bridges the gap between problem domain and
the existing system in a manageable way.
Software architecture refers to the high level structures of a software system and the
discipline of creating such structures and systems. Each structure comprises software elements,
relations among them, and properties of both elements and relations. The architecture of a software
system is a metaphor, analogous to the architecture of a building. It functions as a blueprint for the
system and the developing project, laying out the tasks necessary to be executed by the design
teams
LEVEL 0:
LEVEL 1:
LEVEL 2:
Table design:
Login table
Registration table
Registration table
Test_drive table
Feedback table
PROJECT DESCRIPTION
The modules proposed here will help the users and admin to interact
1. ADMIN
2. USERS
Admin:
Manage user:
▪ To manage the users
Manage Feedback:
▪ To maintain and manage the customer feedbacks
Manage car detail:
▪ To maintain and manage the car details
Manage bike detail:
▪ To maintain and manage the bike details
Manage service details:
▪ To maintain and manage the services details
Manage test_drive details:
▪ To maintain and manage the test drive details
Users:
Registration:
New Users can register in our web site.
Login:
Already registered Users can login in our web site.
View product:
Customer can view the product.
Feedback:
Users can give the feedback to admin.
service details:
▪ user can book Services to there owned cars.
test_drive details:
▪ user can book test drives directly.
CHAPTER 5
SYSTEM DEVELOPMENT
5.1 LANGUAGE/TOOLS
PHP is a server-side scripting language designed for web development but also used as
a general-purpose programming language. PHP code may be embedded into HTML code, or it
can be used in combination with various web template systems, web content management
systems, and web frameworks. PHP code is usually processed by a PHP interpreter
implemented as a module in the web server or as a Gateway Interface (CGI) executable. The
web server combines the results of the interpreted and executed PHP code, which may be any
type of data, including images, with the generated web page. PHP code may also be executed
with a command-line interface (CLI) and can be used to implement standalone graphical
applications.
The standard PHP interpreter, powered by the Zend Engine, is free software released
under the PHP License. PHP has been widely ported and can be deployed on most web servers
on almost every operating system and platform, free of charge.
It is used to manage dynamic content, databases, session tracking, even build entire
ecommerce sites. It is integrated with a number of popular databases, including MySQL,
PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server. PHP is pleasingly zippy in
its execution, especially when compiled as an Apache module on the UNIX side. The MySQL
server, once started, executes even very complex queries with huge result sets in record-setting
time. PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4
added support for Java and distributed object architectures (COM and CORBA), making n-tier
development a possibility for the first time. PHP is forgiving: PHP language tries to be as
forgiving as possible. PHP Syntax is C-Like.
FEATURES
Simple: It is very simple and easy to use, compare to other scripting language it is very
simple and easy, this is widely used all over the world.
Open Source:
Open source means you no need to pay for use PHP, you can free download and use.
Platform Independent:
PHP code will be run on every platform, Linux, UNIX, Mac OS X and Windows.
Case Sensitive:
PHP is case sensitive scripting language at time of variable declaration. In PHP, all
keywords (e.g. if, else, while, echo, etc.), classes, functions, and user-defined functions are
NOT case-sensitive.
MySQL
MySQL is a database system used on the web.
DEPLOYMENT
MySQL can be built and installed manually from source code, but it is more commonly
installed from a binary package unless special customizations are required. On most Linux
distributions, the package management system can download and install MySQL with minimal
effort, though further configuration is often required to adjust security and optimization
settings.
BACKUP SOFTWARE
mysqldump is a logical backup tool included with both community and enterprise
editions of MySQL. It supports backing up from all storage engines. MySQL Enterprise
Backup is a hot backup utility included as part of the MySQL Enterprise subscription from
Oracle, offering native InnoDB hot backup, as well as backup for other storage engines.
5.2 PSEUDO CODE
The rules of pseudo code are reasonably straight forward. All statement showing
“dependency” is to be indented. These include while, do, for and if switch. Example
below will illustrate this notation.
IF email is blank
IF email AND password AND password confirmation all contain valid values
Enable Signup Submit
Login (user):
Software testing is an investigation conducted to provide stakeholders with information about the
quality of the software product or service under test. Software testing can also provide an objective,
independent view of the software to allow the business to appreciate and understand the risks of
software implementation. Test techniques include the process of executing a program or application
with the intent of finding software bugs (errors or other defects), and verifying that the software
product is fit for use.
As the number of possible tests for even simple software components is practically infinite, all
software testing uses some strategy to select tests that are feasible for the available time and
resources. As a result, software testing typically (but not exclusively) attempts to execute a program
or application with the intent of finding software bugs (errors or other defects). The job of testing is
an iterative process as when one bug is fixed, it can illuminate other, deeper bugs, or can even create
new ones.
Software testing can be conducted as soon as executable software (even if partially complete) exists.
The overall approach to software development often determines when and how testing is conducted.
For example, in a phased process, most testing occurs after system requirements have been defined
and then implemented in testable programs. In contrast, under an agile approach, requirements,
programming, and testing are often done concurrently.
UNIT TESTING
Unit testing refers to tests that verify the functionality of a specific section of code, usually at
the function level. In an object-oriented environment, this is usually at the class level, and the
minimal unit tests include the constructors and destructors.
These types of tests are usually written by developers as they work on code (white-box style),
to ensure that the specific function is working as expected. One function might have multiple
tests, to catch corner cases or other branches in the code. Unit testing alone cannot verify the
functionality of a piece of software, but rather is used to ensure that the building blocks of the
software work independently from each other.
Unit testing is a software development process that involves a synchronized application of a
broad spectrum of defect prevention and detection strategies in order to reduce software
development risks, time, and costs. It is performed by the software developer or engineer
during the construction phase of the software development life cycle. Unit testing aims to
eliminate construction errors before code is promoted to additional testing; this strategy is
intended to increase the quality of the resulting software as well as the efficiency of the
overall development process.
Depending on the organization's expectations for software development, unit testing might
include static code analysis, data-flow analysis, metrics analysis, peer code reviews, code
coverage analysis and other software testing practices.
INTERGATION TESTING
Integration testing is any type of software testing that seeks to verify the interfaces between
components against a software design. Software components may be integrated in an iterative
way or all together Normally the former is considered a better practice since it allows
interface issues to be located more quickly and fixed.
Integration testing works to expose defects in the interfaces and interaction between
integrated components (modules). Progressively larger groups of tested software components
corresponding to elements of the architectural design are integrated and tested until the
software works as a system.
TESTING TEST CASES
1. Go to site
login
2
2. Enter
Check Email id
Login
login with
3. Enter Unsuccessful
Invalid
Password
data
4. Submit
Acceptance testing
Formal testing with respect to user needs, requirements, and business processes
conducted to determine whether or not a system satisfies the acceptance criteria and to enable
the user, customers or other authorized entity to determine whether or not to accept the system.
The purpose of this test is to evaluate the system’s compliance with the business requirements
and assess whether it is acceptable for delivery.
VALIDATION:
The process of evaluating software during the development process or at the end of the
development process to determine whether it satisfies specified business requirements.
Validation Testing ensures that the product actually meets the client's needs. It can also be
defined as to demonstrate that the product fulfils its intended use when deployed on
appropriate environment.
VALIDATION:
Login page
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="header">
<h2>Login</h2>
</div>
<div class="input-group">
<label>Username</label>
</div>
<div class="input-group">
<label>Password</label>
</div>
<div class="input-group">
<button type="submit" class="btn" name="login_user">Login</button>
</div>
<p>
</p>
</form>
</body>
</html>
Register
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="header">
<h2>Register</h2>
</div>
<label>Username</label>
</div>
<div class="input-group">
<label>Email</label>
</div>
<div class="input-group">
<label>Password</label>
</div>
<div class="input-group">
<label>Confirm password</label>
</div>
<div class="input-group">
</div>
<p>
</p>
</form>
</body>
</html>
SERVER.PHP
<?php
session_start();
$username = "";
$email = "";
$errors = array();
if (isset($_POST['reg_user']))
if ($password_1 != $password_2)
}
$user_check_query = "SELECT * FROM users WHERE username='$username' OR
email='$email' LIMIT 1";
$user = mysqli_fetch_assoc($result);
if ($user) {
if (count($errors) == 0) {
$password = md5($password_1);
mysqli_query($db, $query);
$_SESSION['username'] = $username;
header('location: index.php');
}
}
if (isset($_POST['login_user'])) {
if (empty($username)) {
if (empty($password)) {
if (count($errors) == 0) {
$password = md5($password);
if (mysqli_num_rows($results) == 1) {
$_SESSION['username'] = $username;
header('location: index.php');
}else {
}
}
?>
LOGIN PAGE
The user can get into the home page through the login page. the users who register and login
can only access the home page.
REGISTRATION PAGE:
The new users can register throw this page
HOME PAGE:
the home page contains different types of cars the user can choice from it and the user can
click it to get the detailed information about the car
BIKE PAGE
the bike page contains different types of bikes the user can choice from it and the user can
click it to get the detailed information about the car
PRODUCT PAGE:
Product page will have the detailed information about the cars and bikes
FEEDBACKS
The service page will help the users to book services to their owned car.
TEST DRIVE
Thus the approach of developing this system “AUTO MOBILE MANAGEMENT” has been
completed successfully and it is found to be satisfactory. The Internet has become a major
resource in modern business, thus electronic shopping has gained significance not only from
the entrepreneur’s but also from the customer’s point of view. For the entrepreneur, electronic
shopping generates new business opportunities. As per a survey, most consumers of online
stores are impulsive and usually make a decision to stay on a site within the first few seconds.
We have designed the project to provide the user with easy navigation, retrieval of data and
necessary feedback as much as possible. In this project, the user is provided with an automobile
web site that can be used to book, service and view varieties of cars. To implement this as a
web application we used PHP as the Technology. PHP (XAMPP) has several advantages such
as enhanced performance, scalability, built- in security and simplicity. To build any web
application using PHP we need a programming language such as JAVA SCRIPT, HTML and
so on. PHP uses MySQL server to interact with the database as it provides in-memory caching
that eliminates the need to contact the database server frequently and it can easily deploy and
maintain PHP application. MySQL was used as back-end database since it is one of the most
popular open source databases, and it provides fast data access, easy installation and simplicity.
FUTURE ENHANCEMENT
The automobile website will be even friendlier and makes the work easier.
1. The more services can be provided by the website by buying and selling the old cars
and bikes.
2. They also sell the rare parts that are no available in stores.
3. User interface can be improved.
APPENDIX A – DATA DICTIONARY
APPENDIX B – SAMPLE CODING
Login:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Login</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<?php
require('db.php');
session_start();
if (isset($_POST['username'])){
$username = stripslashes($_REQUEST['username']);
$username = mysqli_real_escape_string($con,$username);
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con,$password);
$query = "SELECT * FROM `users` WHERE username='$username'
and password='".md5($password)."'";
$result = mysqli_query($con,$query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if($rows==1){
$_SESSION['username'] = $username;
header("Location: index.html");
}else{
echo "<div class='form'>
<h3>Username/password is incorrect.</h3>
<br/>Click here to <a href='login.php'>Login</a></div>";
}
}else{
?>
<div class="form">
<h1>Log In</h1>
<form action="" method="post" name="login">
<input type="text" name="username" placeholder="Username" required />
<input type="password" name="password" placeholder="Password" required />
<input name="submit" type="submit" value="Login" />
</form>
<p>Not registered yet? <a href='register.php'>Register Here</a></p>
</div>
<?php } ?>
</body>
</html>
REGISTRATION:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Registration</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<?php
require('db.php');
if (isset($_REQUEST['username']))
$username = stripslashes($_REQUEST['username']);
$username = mysqli_real_escape_string($con,$username);
$email = stripslashes($_REQUEST['email']);
$email = mysqli_real_escape_string($con,$email);
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con,$password);
$trn_date = date("Y-m-d H:i:s");
$query = "INSERT into `users` (username, password, email, trn_date)
VALUES ('$username', '".md5($password)."', '$email', '$trn_date')";
$result = mysqli_query($con,$query);
if($result){
echo "<div class='form'>
<h3>You are registered successfully.</h3>
<br/>Click here to <a href='login.php'>Login</a></div>";
}
}else{
?>
<div class="form">
<h1>Registration</h1>
<form name="registration" action="" method="post">
<input type="text" name="username" placeholder="Username" required />
<input type="email" name="email" placeholder="Email" required />
<input type="password" name="password" placeholder="Password" required />
<input type="submit" name="submit" value="Register" />
</form>
</div>
<?php } ?>
</body>
</html>
HOME PAGE:
<html>
<head>
<title>AUTOMOBILE WEBSITE</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/Simple-Slider">
<link rel="stylesheet" href="css/font-awesome.min.css">
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="top-nav-bar">
<div class="search-box">
<i class="fa fa-bars" id="menu-btn" onclick="openmenu()"></i>
<i class="fa fa-times" id="close-btn" onclick="closemenu()"></i>
<section class="header">
<div class="side-menu" id="side-menu">
<ul>
<li>PRODUCTS <i class="fa fa-angle-right"></i>
<ul>
<li><a href="index.php">cars</li>
<li><a href="bikes.php">bikes</li>
<li><a href="carspa.php">car parts</li>
<li><a href="bikepa.php">bike parts</li>
</ul>
</li>
</li>
</ul>
</div>
<div class="slider">
<div id="slider" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/Swift-web-banner.jpg" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="images/img-2.jpeg" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="images/img-3.jpeg" class="d-block w-100">
</div>
</div>
<ol class="carousel-indicators">
<li data-target="#slider" data-slide-to="0" class="active"></li>
<li data-target="#slider" data-slide-to="1"></li>
<li data-target="#slider" data-slide-to="2"></li>
</ol>
</div>
</div>
</section>
<!-----------------PREMIUM------------------>
<section class="on-sale">
<div class="container">
<div class="title-box">
<h2>PREMIUM</h2>
</div>
<div class="row">
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/Mercedes-Benz-AMG.jpg"></a>
</button>
</div>
</div>
<div class="product-bottom text-center"></i>
<h3>Mercedes Benz amg</h3>
<h5>3 crores</h5>
</div>
</div>
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/MercedesBenz.jpg"></a>
</div>
<div class="product-bottom text-center">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<h3>MercedesBenz </h3>
<h5>70-80 lakhs</h5>
</div>
</div>
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/Ferrari.jpg"></a>
</div>
</div>
<div class="product-bottom text-center">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<h3>Ferrari</h3>
<h5>3-4 crores</h5>
</div>
</div>
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/Audi-R8.jpg"></a>
</div>
<div class="product-bottom text-center">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
<i class="fa fa-star-o"></i>
<h3>Audi-R8</h3>
<h5>1-2 crores</h5>
</div>
</div>
</div>
</div>
</section>
Bike page:
<html>
<head>
<title>AUTOMOBILE WEBSITE</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/Simple-Slider">
<link rel="stylesheet" href="css/font-awesome.min.css">
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="top-nav-bar">
<div class="search-box">
<i class="fa fa-bars" id="menu-btn" onclick="openmenu()"></i>
<i class="fa fa-times" id="close-btn" onclick="closemenu()"></i>
<section class="header">
<div class="side-menu" id="side-menu">
<ul>
<li>PRODUCTS <i class="fa fa-angle-right"></i>
<ul>
<li><a href="index.php">cars</li>
<li><a href="bikes.php">bikes</li>
<li><a href="carspa.php">car parts</li>
<li><a href="bikepa.php">bike parts</li>
</ul>
</li>
</li>
</li>
</ul>
</div>
<div class="slider">
<div id="slider" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/Swift-web-banner.jpg" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="images/img-2.jpeg" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="images/img-3.jpeg" class="d-block w-100">
</div>
</div>
<ol class="carousel-indicators">
<li data-target="#slider" data-slide-to="0" class="active"></li>
<li data-target="#slider" data-slide-to="1"></li>
<li data-target="#slider" data-slide-to="2"></li>
</ol>
</div>
</div>
</section>
<!-----------------new arivals------------------>
<section class="on-sale">
<div class="container">
<div class="title-box">
<h2>new arrivals</h2>
</div>
<div class="row">
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/pulsar.jpg"></a>
</button>
</div>
</div>
<div class="product-bottom text-center"></i>
<h3>pulsar</h3>
<h5>70,000</h5>
</div>
</div>
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/r15.jpg"></a>
</div>
<div class="product-bottom text-center">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<h3>Yamaha r15 </h3>
<h5>1,50,000</h5>
</div>
</div>
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/honda.jpg"></a>
</div>
</div>
<div class="product-bottom text-center">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<h3>honda</h3>
<h5>40,000</h5>
</div>
</div>
<div class="col-md-3">
<div class="product-top">
<a href="product.html"><img src="images/dominor.jpg"></a>
</div>
<div class="product-bottom text-center">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
<i class="fa fa-star-o"></i>
<h3>dominor</h3>
<h5>1,28,000</h5>
</div>
</div>
</div>
</div>
</section>
PRODUCT PAGE
<html>
<head>
<title>AUTOMOBILE MANAGEMENT</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css">
<script src=" /jquery-3.3.1.slim.min.js"></script>
<script src=" bootstrap/4.2.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="top-nav-bar">
<div class="search-box">
<a href="index.html"><img src="images/orange-logo.png" class="logo"></a>
<input type="text" class="form-control">
<span class="input-group-text"><i class="fa fa-search"></i></span>
</div>
<div class="menu-bar">
<ul>
<li><a href="registration.php">Sign Up</a></li>
<li><a href="login.php">Log In</a></li>
</ul>
</div>
</div>
<!-------------Single Product------------->
<section class="single-product">
<div class="container">
<div class="row">
<div class="col-md-5">
<div id="product-slider" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/Ferrari.jpg" class="d-block">
</div>
<a class="carousel-control-prev" href="#product-slider" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#product-slider" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
<div class="col-md-7">
<p class="new-arrival text-center">NEW</p>
<h2>Ferrari</h2>
<p>Product Code: IRSC2019</p>
<html>
<head>
<title>AUTOMOBILE MANAGEMENT</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/Simple-Slider">
<link rel="stylesheet" href="css/font-awesome.min.css">
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="js/bootstrap.min.js"></script></head>
<body>
<div class="top-nav-bar">
<!-------------Single Product------------->
<section class="single-product">
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="product-top">
<img src="images/Ferrari.jpg" class="d-block">
</div>
</div>
</div>
<div class="col-md-7">
<p class="new-arrival text-center">NEW</p>
<p class="price">3-4 crores</p>
<p><b>Brand:</b>FERRARI</p>
<button type="button" class="btn btn-primary">book</button>
<button type="button" class="btn btn-primary">service</button>
</div>
</div>
</div>
</section>
<!------------product-description-------------->
<section class="product-description">
<div class="container">
<h6>Product Description</h6>
<p>What would be better than a Ferrari with a V12 engine, mad power that can seat two? The answer
is the same Ferrari that can seat four. Known for its two seater rockets, Ferrari built the FF in 2011 –
the fastest four-seater car that time. Five years later, we have the GTC4 Lusso, the next generation
FFWhat would be better than a Ferrari with a V12 engine, mad power that can seat two? The answer
is the same Ferrari that can seat four. Known for its two seater rockets, Ferrari built the FF in 2011 –
the fastest four-seater car that time. Five years later, we have the GTC4 Lusso, the next generation
FF</p>
<hr>
</div>
<div class="title-box">
<h2>GALLERY</h2>
</div>
<table align="center">
<div class="table">
<tr>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
</tr>
<tr>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
</tr>
</table>
</div>
<div class="title-box">
<h2>description</h2>
</div>
<table align="center" border="5" cellspacing="10">
<tr>
<td>RAI Mileage <td>
<td>28.4 kmpl<td>
</tr>
<tr>
<td>City Mileage<td>
<td>19.74 kmpl<td>
</tr>
<tr>
<td>Fuel Type<td>
<td>Diesel/petrol<td>
</tr>
<tr>
<td>Engine(cc)<td>
<td>1248<td>
</tr>
<tr>
<td>Max Power<td>
<td>74bhp@4000rpm<td>
</tr>
<tr>
<td>Max Torque<td>
<td>190Nm@2000rpm<td>
</tr>
<tr>
<td>Seating<td>
<td>5<td>
</tr>
<tr>
<td>Engine Description<td>
<td>1.3 litre 16V 74bhp Diesel Engine<td>
</tr>
<tr>
<td>1.3 litre 16V 74bhp Diesel Engine<td>
<td>auto/manual<td>
</tr>
<tr>
<td>Cargo Volume<td>
<td>268 Liters<td>
</tr>
</table>
<div class="title-box">
<h2>MODELS</h2>
</div>
<table align="center" border="5" cellspacing="10">
<tr>
<td>200 CDI Style <td>
<td>2143 cc, Diesel, Automatic, 17.9 kmpl 31.72 Lakhs<td>
</tr>
<tr>
<td>200 Petrol Sport <td>
<td>1991 cc, Petrol, Automatic, 15.04 kmpl 77.69 Lakhs a <td>
</tr>
<tr>
<td>200 CDI Sport
<td>
<td>2143 cc, Diesel, Automatic, 17.9 kmpl 35.1 Lakhs<td>
</tr>
<tr>
<td>200 Urban Sport<td>
<td>1991 cc, Petrol, Automatic, 15.04 kmpl 35.99 Lakhs<td>
</tr>
<tr>
<td>200 D Urban Sport<td>
<td>
2143 cc, Diesel, Automatic, 17.9 kmpl 36.97 Lakhs<td>
</tr>
<tr>
<td>45 AMG 4MATIC<td>
<td>1991 cc, Petrol, Automatic, 15.04 kmpl 75.2 Lakhs<td>
</tr>
<tr>
<td>45 Aero Edition <td>
<td>1991 cc, Petrol, Automatic, 15.04 kmpl 77.69 Lakhs <td>
</tr>
</table>
<div class="title-box">
<h2>Feedback</h2>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6 text-center">
<form class="form-horizontal">
<fieldset>
<p class="lead">I’d love to hear from you! Complete the form to send me an email.</p>
<div class="form-group">
<label for="inputName" class="col-lg-2 control-label"></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputName" placeholder="Name">
</div>
</div>
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label"></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="textArea" class="col-lg-2 control-label">Textarea</label>
<div class="col-lg-10">
<textarea class="form-control" rows="3" id="textArea"></textarea>
<span class="help-block">A longer block of help text that breaks onto a new line and may extend
beyond one line.</span>
</div>
</div>
BOOKING.PHP
<?php
if(!empty($_POST["register-user"])) {
/* Form Required Field Validation */
foreach($_POST as $key=>$value) {
if(empty($_POST[$key])) {
$error_message = "All Fields are required";
break;
}
}
if(!isset($error_message)) {
if (!filter_var($_POST["userEmail"], FILTER_VALIDATE_EMAIL)) {
$error_message = "Invalid Email Address";
}
}
if(!isset($error_message)) {
if(!isset($_POST["gender"])) {
$error_message = " All Fields are required";
}
}
if(!isset($error_message)) {
if(!isset($_POST["terms"])) {
$error_message = "Accept Terms and Conditions to Register";
}
}
if(!isset($error_message)) {
require_once("dbcontroller.php");
$db_handle = new DBController();
$query = "INSERT INTO registered_users (user_name, first_name, last_name, password, email,
gender) VALUES
('" . $_POST["userName"] . "', '" . $_POST["firstName"] . "', '" . $_POST["lastName"] . "', '" .
$_POST["mobile"] . "','" . $_POST["date"] . "', '" . $_POST["userEmail"] . "', '" . $_POST["gender"] . "')";
$result = $db_handle->insertQuery($query);
if(!empty($result)) {
$error_message = "";
$success_message = "You have registered successfully!";
unset($_POST);
} else {
$error_message = "Problem in registration. Try Again!";
}
}
}
?>
<html>
<head>
<title>PHP User Registration Form</title>
<style>
body{
width:610px;
font-family:calibri;
}
.error-message {
padding: 7px 10px;
background: #fff1f2;
border: #ffd5da 1px solid;
color: #d6001c;
border-radius: 4px;
}
.success-message {
padding: 7px 10px;
background: #cae0c4;
border: #c3d0b5 1px solid;
color: #027506;
border-radius: 4px;
}
.demo-table {
background: #d9eeff;
width: 100%;
border-spacing: initial;
margin: 2px 0px;
word-break: break-word;
table-layout: auto;
line-height: 1.8em;
color: #333;
border-radius: 4px;
padding: 20px 40px;
}
.demo-table td {
padding: 15px 0px;
}
.demoInputBox {
padding: 10px 30px;
border: #a9a9a9 1px solid;
border-radius: 4px;
}
.btnRegister {
padding: 10px 30px;
background-color: #3367b2;
border: 0;
color: #FFF;
cursor: pointer;
border-radius: 4px;
margin-left: 10px;
}
</style>
</head>
<body>
<form name="frmRegistration" method="post" action="">
<table border="0" width="500" align="center" class="demo-table">
<?php if(!empty($success_message)) { ?>
<div class="success-message"><?php if(isset($success_message)) echo $success_message; ?></div>
<?php } ?>
<?php if(!empty($error_message)) { ?>
<div class="error-message"><?php if(isset($error_message)) echo $error_message; ?></div>
<?php } ?>
<tr>
<td>Name</td>
<td><input type="text" class="demoInputBox" name="userName" value="<?php
if(isset($_POST['userName'])) echo $_POST['userName']; ?>"></td>
</tr>
<tr>
<td>car Name</td>
<td><input type="text" class="demoInputBox" name="firstName" value="<?php
if(isset($_POST['firstName'])) echo $_POST['firstName']; ?>"></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" class="demoInputBox" name="lastName" value="<?php
if(isset($_POST['lastName'])) echo $_POST['lastName']; ?>"></td>
</tr>
<tr>
<td>mobile no</td>
<td><input type="text" class="demoInputBox" name="mobile" value="<?php
if(isset($_POST['mobile'])) echo $_POST['mobile']; ?>"></td>
</tr>
<tr>
<td>date</td>
<td><input type="date" class="demoInputBox" name="lastName" value="<?php
if(isset($_POST['date'])) echo $_POST['date']; ?>"></td>
</tr>
<tr></tr>
<tr>
<td>Email</td>
<td><input type="text" class="demoInputBox" name="userEmail" value="<?php
if(isset($_POST['userEmail'])) echo $_POST['userEmail']; ?>"></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="gender" value="Male" <?php if(isset($_POST['gender']) &&
$_POST['gender']=="Male") { ?>checked<?php } ?>> Male
<input type="radio" name="gender" value="Female" <?php if(isset($_POST['gender']) &&
$_POST['gender']=="Female") { ?>checked<?php } ?>> Female
</td>
</tr>
<tr>
<td colspan=2>
<input type="checkbox" name="terms"> I accept Terms and Conditions <input type="submit"
name="register-user" value="Register" class="btnRegister"></td>
</tr>
</table>
</form>
</body></html>
Dbconnection.php
<?php
class DBController {
private $host = "localhost";
private $user = "root";
private $password = "";
private $database = "phppot_examples";
private $conn;
function __construct() {
$this->conn = $this->connectDB();
}
function connectDB() {
$conn = mysqli_connect($this->host,$this->user,$this->password,$this->database);
return $conn;
}
function runQuery($query) {
$result = mysqli_query($this->conn,$query);
while($row=mysqli_fetch_assoc($result)) {
$resultset[] = $row;
}
if(!empty($resultset))
return $resultset;
}
function numRows($query) {
$result = mysqli_query($this->conn,$query);
$rowcount = mysqli_num_rows($result);
return $rowcount;
}
function updateQuery($query) {
$result = mysqli_query($this->conn,$query);
if (!$result) {
die('Invalid query: ' . mysqli_error($this->conn));
} else {
return $result;
}
}
function insertQuery($query) {
$result = mysqli_query($this->conn,$query);
if (!$result) {
die('Invalid query: ' . mysqli_error($this->conn));
} else {
return $result;
}
}
function deleteQuery($query) {
$result = mysqli_query($this->conn,$query);
if (!$result) {
die('Invalid query: ' . mysqli_error($this->conn));
} else {
return $result;
}
}
}
?>
PRODUCT.PHP
<html>
<head>
<title>AUTOMOBILE MANAGEMENT</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/Simple-Slider">
<link rel="stylesheet" href="css/font-awesome.min.css">
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="js/bootstrap.min.js"></script></head>
<body>
<div class="top-nav-bar">
<!-------------Single Product------------->
<section class="single-product">
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="product-top">
<img src="images/Ferrari.jpg" class="d-block">
</div>
</div>
</div>
<div class="col-md-7">
<p class="new-arrival text-center">NEW</p>
<p class="price">3-4 crores</p>
<p><b>Brand:</b>FERRARI</p>
<button type="button" class="btn btn-primary">book</button>
<button type="button" class="btn btn-primary">service</button>
</div>
</div>
</div>
</section>
<!------------product-description-------------->
<section class="product-description">
<div class="container">
<h6>Product Description</h6>
<p>What would be better than a Ferrari with a V12 engine, mad power that can seat two? The answer
is the same Ferrari that can seat four. Known for its two seater rockets, Ferrari built the FF in 2011 –
the fastest four-seater car that time. Five years later, we have the GTC4 Lusso, the next generation
FFWhat would be better than a Ferrari with a V12 engine, mad power that can seat two? The answer
is the same Ferrari that can seat four. Known for its two seater rockets, Ferrari built the FF in 2011 –
the fastest four-seater car that time. Five years later, we have the GTC4 Lusso, the next generation
FF</p>
<hr>
</div>
<div class="title-box">
<h2>GALLERY</h2>
</div>
<table align="center">
<div class="table">
<tr>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
</tr>
<tr>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
<td><a href="images/Ferrari.jpg"><img src="images/Ferrari/Ferrari.jpg"></a></td>
</tr>
</table>
</div>
<div class="title-box">
<h2>description</h2>
</div>
<table align="center" border="5" cellspacing="10">
<tr>
<td>RAI Mileage <td>
<td>28.4 kmpl<td>
</tr>
<tr>
<td>City Mileage<td>
<td>19.74 kmpl<td>
</tr>
<tr>
<td>Fuel Type<td>
<td>Diesel/petrol<td>
</tr>
<tr>
<td>Engine(cc)<td>
<td>1248<td>
</tr>
<tr>
<td>Max Power<td>
<td>74bhp@4000rpm<td>
</tr>
<tr>
<td>Max Torque<td>
<td>190Nm@2000rpm<td>
</tr>
<tr>
<td>Seating<td>
<td>5<td>
</tr>
<tr>
<td>Engine Description<td>
<td>1.3 litre 16V 74bhp Diesel Engine<td>
</tr>
<tr>
<td>1.3 litre 16V 74bhp Diesel Engine<td>
<td>auto/manual<td>
</tr>
<tr>
<td>Cargo Volume<td>
<td>268 Liters<td>
</tr>
</table>
<div class="title-box">
<h2>MODELS</h2>
</div>
<div class="title-box">
<h2>Feedback</h2>
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6 text-center">
<form class="form-horizontal">
<fieldset>
<p class="lead">I’d love to hear from you! Complete the form to send me an email.</p>
<div class="form-group">
<label for="inputName" class="col-lg-2 control-label"></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputName" placeholder="Name">
</div>
</div>
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label"></label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="textArea" class="col-lg-2 control-label">Textarea</label>
<div class="col-lg-10">
<textarea class="form-control" rows="3" id="textArea"></textarea>
<span class="help-block">A longer block of help text that breaks onto a new line and may extend
beyond one line.</span>
</div>
</div>
APPENDIX C – SAMPLE OUTPUT: