Professional Documents
Culture Documents
Full Document-Smart Parking
Full Document-Smart Parking
PROJECT TITLE
By
NAME
Register No: 15601344
Submitted to the
ANNA UNIVERSITY
CHENNAI 600 025
Jan, 2022
2
BONAFIDE CERTIFICATE
Certified that this mini project report titled PRJECT TITLE is the bonafide work
of NAME (Reg. No. 15601344) who carried out the project work under my supervision.
Certified further, that to the best of my knowledge the work reported herein does not form
part of any other project report or dissertation on the basis of which a degree or award was
_______________________________ __________________________________
____________________ _____________________
DECLARATION
I affirm that the project work titled PROJECT TITLE being submitted in partial
fulfillment for the award of Master of Computer Application is the original work carried
out by me. It has not formed the part of any other project work submitted for award of any
degree or diploma, either in this or any other University.
ABSTRACT
ACKNOWLEDGEMENT
First, I would like to thank God almighty for all the blessing he has endowed
upon me and molded me what I am now. I thank my parents Mr.Father Name and
Mrs.Mother Name for their immense love and support.
I extend my thanks to all my friends for their timely help rendered throughout
the project.
6
TABLE OF CONTENTS
ABSTRACT iv
LIST OF TABLES viii
LIST OF FIGURES ix
LIST OF ABBREVIATIONS x
1 INTRODUCTION 01
1.1 OBJECTIVE 01
2 SYSTEM ANALYSIS 03
2.1 EXISTING SYSTEM 03
2.1.1 Disadvantage 03
2.2 PROPOSED SYSTEM 03
2.2.1 Advantages 03
2.3 FEASIBILITY STUDY 04
2.3.1 Economical Feasibility 04
2.3.2 Technical Feasibility 04
2.3.3 Social Feasibility 04
3 SYSTEM SPECIFICATION 05
3.1 HARDWARE REQUIREMENTS 05
3.2 SOFTWARE REQUIREMENTS 05
4 SOFTWARE DESCRIPTION 06
4.1 FRONT END 06
4.1.1 Feature of PHP 06
4.1.2. Accessing an HTML page 07
4.1.3 Accessing a PHP page 07
4.1.4 Security 09
4.1.5 Benefit of PHP 10
4.2 BACK END 12
4.2.1 What is Data Base? 12
4.2.2 Features of MYSQL 12
7
5 PROJECT DESCRIPTION 14
5.1 PROBLEM DEFINITION 14
5.2 OVERVIEW OF THE PROJECT 14
5.3 MODULE DESCRIPTION 15
5.3.1 Admin Module 15
5.3.2 Staff Module 16
5.3.3 Student Module 16
5.4 USE CASE DIAGRAM 17
5.5 CLASS DIAGRAM 17
5.6 STATE DIAGRAM 18
5.7 DATABASE DESIGN 20
5.8 INPUT DESIGN 24
5.9 OUTPUT DESIGN 24
6 SYSTEM TESTING 25
6.1 WHITE BOX TESTING 25
6.2 BLACK BOX TESTING 26
6.3 UNIT TESTING 26
6.4 ACCEPTANCE TESTING 27
6.5 TEST CASE REPORT 27
7 SYSTEM IMPLEMENTATION 28
8 CONCLUSION AND FUTURE ENHANCEMENT 29
8.1 CONCLUSION 29
8.2 FUTURE ENHANCEMENT 29
APPENDICES 30
APPENDIX I SAMPLE SOURCE CODE 30
APPENDIX II SAMPLE SCREEN SHOTS 36
REFERENCES 50
8
LIST OF TABLE
LIST OF FIGURES
LIST OF ABBREVIATION
CHAPTER 1
INTRODUCTION
1.1 OBJECTIVE
We developed this project to book a car on parking at the fare charges. In present
system all booking work done manually and it takes very hard work to maintain the
information of booking and cars. If you want to find which vehicle is available for booking
then it takes a lot of time. It only makes the process more difficult and hard. This aim of
the project is to automate the work performed in the car parking management system like
generating daily bookings, records of car or cab available for booking, record of routes
available, parking slot for cars for every rout, store record of the customer. Car parking
management system is a car booking software that provides a complete solution to all your
day-to-day car booking office running needs. This system helps you to keep the
information of Customer online. You can check your customer information any time by
using this system. Cab rental management system is a unique and innovative product.
Using this this you can also keep the information of number of bookings in current month
or in last 6 month or in last year. This helps you to track your business and you earning in
particular month or in any year. Based on this information you can take decision regarding
your business development.
12
CHAPTER 2
SYSTEM ANALYSIS
Car parking System will help users to book a car slot for some fee specified. Till
now there was no clear web based UI to help the users to parking the vehicle. They had to
manually rent the vehicle through their offices. It was a difficult task to manage parking
vehicles. Keeping track of all the parking cars was a problem.
2.1.1 Disadvantages
2.2.1 Advantages
Avoided Carbon Emissions
Improved Public Health
Complete electrification of public transport system
Displacing petroleum
Dynamic pricing
Better and more efficient Parking
The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out.
This study is carried out to check the economic impact that the system will have on
the organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available.
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed system
14
must have a modest requirement, as only minimal or null changes are required for
implementing this system.
The aspect of study is to check the level of acceptance of the system by the
user. This includes the process of training the user to use the system efficiently. The user
must not feel threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are station to educate the user
about the system and to make him familiar with it.
\
15
CHAPTER 3
SYSTEM SPECIFICATION
CHAPTER 4
SOFTWARE DESCRIPTION
PHP was originally created by Rasmus Lerdorf in 1995[1] and has been in
continuous development ever since. The main implementation of PHP is now produced by
The PHP Group and serves as the de facto standard for PHP as there is no formal
specification.
PHP is free software released under the PHP License, which is incompatible with
the GNU General Public License (GPL) because restrictions exist regarding the use of the
term PHP.
1. Your browser sends a request to that web page's server (computer) for the file
(HTML or image) you wish to view.
2. The web server (computer) sends the file requested back to your computer.
3. Your browser displays the file appropriately.
4. If you request a PHP file (ends with ".php"), the server handles it differently.
Your browser sends a request to that web page's server for the PHP file you wish to
view.
The web server calls PHP to interpret and perform the operations called for in the
PHP script.
The web server sends the output of the PHP program back to your computer.
18
PHP originally stood for personal home page. Its development began in 1994 when
the Danish/Greenlandic programmer Rasmus Lerdorf initially created a set of Perl scripts
he called 'Personal Home Page Tools' to maintain his personal homepage, including tasks
such as displaying his résumé and recording how much traffic his page was receiving. He
rewrote these scripts as C programming language Common Gateway Interface (CGI)
binaries, extending them to add the ability to work with web forms and to communicate
with databases and called this implementation 'Personal Home Page/Forms Interpreter' or
PHP/FI. PHP/FI could be used to build simple, dynamic web applications. Lerdorf released
PHP/FI as 'Personal Home Page Tools (PHP Tools) version 1.0' publicly on June 8, 1995,
to accelerate bug location and improve the code. This release already had the basic
functionality that PHP has today. This included Perl-like variables, form handling, and the
ability to embed HTML. The syntax was similar to Perl but was more limited and simpler,
although less consistent. A development team began to form and, after months of work and
beta testing, officially released PHP/FI 2 in November 1997.
A new major version has been under development alongside PHP 5 for several
years. This version was originally planned to be released as PHP 6 as a result of its
significant changes, which included plans for full Unicode support. However, Unicode
support took developers much longer to implement than originally thought, and the
decision was made in March 2010[13] to move the project to a branch, with features still
under development moved to trunk.
Changes in the new code include the removal of register_globals, magic quotes,
and safe mode. The reason for the removals was that register_globals had given way to
security holes, and the use of magic quotes had an unpredictable nature, and was best
avoided. Instead, to escape characters, magic quotes may be replaced with the addslashes()
function, or more appropriately an escape mechanism specific to the database vendor itself
like MySQL_real_escape_string() for MySQL. Functions that will be removed in future
versions and have been deprecated in PHP 5.3 will produce a warning if used.
19
PHP currently does not have native support for Unicode or multibyte strings;
Unicode support is under development for a future version of PHP and will allow strings as
well as class, method, and function names to contain non-ASCII characters.
PHP interpreters are available on both 32-bit and 64-bit operating systems, but on
Microsoft Windows the only official distribution is a 32-bit implementation, requiring
Windows 32-bit compatibility mode while using Internet Information Services (IIS) on a
64-bit Windows platform. As of PHP 5.3.0, experimental 64-bit versions are available for
MS Windows.
4.1.4 Security
The PHP interpreter only executes PHP code within its delimiters. Anything
outside its delimiters is not processed by PHP (although non-PHP text is still subject to
control structures described within PHP code). The most common delimiters are <?php to
open and ?> to close PHP sections. <script language="php"> and </script> delimiters are
also available, as are the shortened forms <? or <?= (which is used to echo back a string or
variable) and ?> as well as ASP-style short forms <% or <%= and %>. While short
delimiters are used, they make script files less portable as support for them can be disabled
in the PHP configuration, and so they are discouraged. The purpose of all these delimiters
is to separate PHP code from non-PHP code, including HTML.
The first form of delimiters, <?php and ?>, in XHTML and other XML documents,
creates correctly formed XML 'processing instructions'. This means that the resulting
mixture of PHP code and other markup in the server-side file is itself well-formed XML.
Variables are prefixed with a dollar symbol and a type does not need to be specified
in advance. Unlike function and class names, variable names are case sensitive. Both
double-quoted ("") and heredoc strings allow the ability to embed a variable's value into
the string. PHP treats newlines as whitespace in the manner of a free-form language
(except when inside string quotes), and statements are terminated by a semicolon.
20
In terms of keywords and language syntax, PHP is similar to most high level
languages that follow the C style syntax. if conditions, for and while loops, and function
returns are similar in syntax to languages such as C, C++, Java and Perl.
Because the server does processing, the output of PHP files changes when its input
changes. For example, most of the pages on the Horticulture site have only two (2) PHP
commands:
Include the header file that defines the links on the left, the banner, and the quick
links at the top.
Include the footer file that displays the mission statement and Horticulture contact
information.
Because including the files is performed every time the PHP file is accessed, when
the header/footer files change, the new content will be immediately updated.
PHP has become the most popular Web programming language not only because it
is free. PHP is a full-fledged programming language (unlike HTML for example, which is
more of a presentation means) and many complex applications can be written it it. Another
benefit of applications written in PHP is that they are fast and if written properly, they
could be pretty secure. There are also tons of ready PHP scripts and functions, which you
can customize to your liking and use in your PHP applications.
Web development is becoming a more prosperous industry lately. Since the Internet
and the computer wave in general are becoming quite lucrative, web development is
becoming a booming industry in which everyone wants to be a part. However, it is also a
very competitive industry since there are many professionals that are quite adept at
programming. Therefore, learning proper PHP development strategies is beneficial. If you
already have prior knowledge of computer language and coding, PHP should come as a
second nature to you.
21
Before building website you need to know which language you are going to use in
a professional looking website. PHP is one of the best and easy to use programming
language as it can be run to any operating system. PHP is free language so that is the huge
advantage of this language. For handling database connections, formatting date, editing
strings, handling emails and all PHP can be very useful. It can be easily extend for some
specific functions that you would like to add in your website. Reliability of this language is
extra ordinary as PHP already runs on millions of servers around the world, which means
that it's powerful enough for even the most demanding situations. It provides web
developers much more liberation in creating website with some of the outstanding features
and they can use regular elements frequently.
PHP can be very much successful for creating Dynamic Websites. PHP
programmers with the use of open source codes benefit from the flexibility of editing,
modifying and updating the source code when there is mandatory.
PHP is based on C++ programming language and the syntax used in PHP is fairly
similar to C, C++. There is huge community of developers who still believes that C/C++ is
still the best programming language. For every website to get reasonable progress it can be
use Content Management System such as Joomla, Word Press etc. here PHP and MySQL
are very helpful in successful CMS running. There are so many IT companies which
provide best quality PHP web development work from India. The reason for Outsourcing
PHP development to India is that it is very cost effective with better quality. In the
professional field of Web and software development services we have achieved great
amount of victory with skilled and experienced PHP programmers.
PHP has been supported by almost every hosting company. PHP can be the best
choice to run an application on Linux based hosting platforms. PHP is a server side
scripting language originally designed to build dynamic websites. Modern web 2.0
applications are largely characterized by mashups and desktop style user interfaces. php is
an excellent choice for interacting with other websites and providing rich user experience.
Simple php commands like curl or fopen allow you to grab data from other websites with
relative ease.
22
A database is not generally portable across different DBMSs, but different DBMSs
can interoperate by using standards such as SQL and ODBC or JDBC to allow a single
application to work with more than one DBMS. Computer scientists may classify database-
management systems according to the database models that they support; the most popular
database systems since the 1980s have all supported the relational model - generally
associated with the SQL language.
MySQL Introduction
The MySQL database has become the world's most popular open source database
because of its consistent fast performance, high reliability and ease of use. It's used on
every continent -- Yes, even Antarctica! -- by individual Web developers as well as many
of the world's largest and fastest-growing organizations to save time and money powering
their high-volume Web sites, business-critical systems and packaged software.
23
Not only is MySQL the world's most popular open source database, it's also
become the database of choice for a new generation of applications built on the LAMP
stack (Linux, Apache, MySQL, PHP / Perl / Python.) MySQL runs on more than 20
platforms including Linux, Windows, Mac OS, Solaris, HP-UX, IBM AIX, giving you the
kind of flexibility that puts you in control.
MySQL can be built and installed manually from source code, but this can be
tedious so 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.
Much of MySQL's appeal originates in its relative simplicity and ease of use, which
is enabled by an ecosystem of open source tools such as phpMyAdmin
There are however limits to how far performance can scale on a single server, so on
larger scales, multi-server MySQL deployments are required to provide improved
performance and reliability. A typical high-end configuration can include a powerful
master database which handles data write operations and is replicated to multiple slaves
that handle all read operations.
24
CHAPTER 5
PROJECT DESCRIPTION
Car parking System will help users to book a car slot for some fee specified. Till
now there was no clear web based UI to help the users to parking the vehicle. They had to
manually rent the vehicle through their offices. It was a difficult task to manage parking
vehicles. Keeping track of all the parking cars was a problem.
In present system all booking work done manually and it takes very hard work to
maintain the information of booking and cars. If you want to find which vehicle is
available for booking then it takes a lot of time. It only makes the process more difficult
and hard. This aim of the project is to automate the work performed in the car parking
management system like generating daily bookings, records of car or cab available for
booking, record of routes available, parking slot for cars for every rout, store record of the
customer. Car parking management system is a car booking software that provides a
complete solution to all your day-to-day car booking office running needs. This system
helps you to keep the information of Customer online. You can check your customer
information any time by using this system.
25
5.3.1 Admin
Login
Add Slot Details
Add User Details
View Booking Details
View Payment Details
Report
5.3.2 User
User Register
User Login
View Slot Details
Booking
Cancel
Payment
Feedback
Login
The admin can only login in this page. It checks whether the username and
password are correct, if correct allows the administrator to update or view the details else
displays the error message.
Add slot
Add and manage parking slot and locations. Set access rules and visibility
(private/public), monitor usage and consumption.
Add User Details
In this module, admin add the user details like username, mobile number,
password, Location and city.
View payment
Accept payments from customers, generate receipts and reports. PayPal, credit &
debit card and voucher payments are supported out-of-the-box with further payment
options to be added upon request.
26
View Feedback
The admin view can their feedback about the entire process whether it may be
positive or negative and the feedback.
Reports
Administrator is responsible for providing the all reports. The bills provided by
administrator are checked by secretary
Registration
In this module describe the user registration process. User register the information
like a user name, mobile number, mail id, etc.
\
Login
User was registered into this website after that they are receive the notification via
SMS/email id.
Booking
Easy booking via web or mobile application, Authentication with a telephone call
or mobile application allows the ad hoc use of unregistered users (no need to build roaming
systems for users). EV drivers will be able to locate EV charging stations, get step by-step
directions, determine the charger type (Single or DualLevel Port), and view real-time
station status (available, in use, etc.) in our new Advanced dashboards.
Parking locations
This module creates and configures parking lots, sometimes referred to as parking
orbits, Real-time monitoring of parking space availability by facility, level, and single
space. Monitors the occupancy of parking lots and parking garages.
Payment
Accept payments from customers, generate receipts and reports. PayPal, credit &
debit card and voucher payments are supported out-of-the-box with further payment
options to be added upon request.
Feedback
The customer can provide their feedback about the entire process whether it may be
positive or negative and the feedback.
27
Vehicle Registration
Vehicle Information
Booking
Vehicle User Parking Controller
Fast-Tag Integration
Notification
Cloud Server
Access
Storage
Vehicle Vehicle
Registration Informations
Notification Notifications
Parking Space
Simulation
30
These data are stored in the rows and columns form called table. Thus, a collection
of all tables with their inter relationship could be termed a database.
Types of database
Various data modules are used to represent the data and each one is treated in
different manners to stored and retrieve data. The various types of data modules are
Hierarchical model, Network model, Relationship model
Hierarchical model
In a hierarchical data model the records have a parent child relationship. It is stored
together as a logical unit to create a relationship between these two units one unit must be
considered as parent has many children but child has only one parent. This type of model is
called as hierarchical model.
Network model
The network model allows any unit can be related to other multiple units through
fixed relationship. Age of this network model is that the database does not have fixed
structure. This type of model is called network model is network model.
Relationship model
A relational model stores closely related data in logical unit called tables. It is
represented the in forma of o9f rows and columns. There is no fixed relationship among
31
the tables and no parent child relationship. This type of model is more advantage to get
information from the tables.
In the project, the input design is made in various web forms with various methods.
For example, in the Admin form, the empty username and password is not allowed. The
username if exists in the database, the input is considered to be invalid and is not accepted.
The design of output is the most important task of any system. During output
design, developers identify the type of outputs needed, and consider the necessary output
controls and prototype report layouts.
Output design generally refers to the results and information that are generated by
the system for many end-users; output is the main reason for developing the system and the
basis on which they evaluate the usefulness of the application. In the project, if the
employee has to communicate with other employees they can communicate through send
and receive message.
32
CHAPTER 6
SYSTEM TESTING
System Testing
Testing is the stage of implementation of which aimed at ensuring that the system
works accurately and efficiently before live operation commences. Testing is vital to the
success of the system. System testing makes a logical assum
White box testing assumes that the specific logic is important and must be tested to
guarantee the system proper functioning. The main use of t6he white box id the error based
33
testing. In a white box testing, the bugs are looked for that has a low probability of
execution that have been overlooked previously. It is also known as path testing.
API testing – testing of the application using public and private APIs.
Code coverage – creating tests to satisfy some criteria of code coverage
Fault injection methods – introducing faults to gauge the efficacy of testing
strategies
Mutation testing methods
Static testing methods
White box testing assumes that the specific logic is important and must be tested to
guarantee the systems proper functioning. The main use of the white box id the error based
testing.
Black box testing also called behavioral testing, focuses on the functional
requirements of software. This testing approach enables the software engineer to drive the
input conditions that will fully exercise all requirements for a program.
The procedure level testing is made first. By giving improper inputs, the errors
occurred are noted and eliminated .Then the web form level is made.
34
The first level of test is unit testing. The purpose of unit testing is to ensure that
each program is fully tested. The second step is integration testing. In this individual
program units or program are integrated and tested as a complete system to ensure that the
software requirements are met.
CHAPTER 7
SYSTEM IMPLEMENTATION
After the system has been tested, the implementation type or the change over
technique from the existing system to the new system is a step-by-step process. In the
system at first only a module of the system is implemented and checked for suitability and
efficiency. When the end user related to the particular module is satisfied with the
performance, the next step of implementation is preceded.
CHAPTER 8
8.1 CONCLUSION
Site Design for parking offers context for how to design parking stations in a
variety of parking facility types. It provides background on the underlying parking facility
design and function. Additionally, it demonstrates how to create convenient and safe
Parking stations. Every parking design will offer a different set of issues. The design
templates shown in Section 5 provide examples that can be adapted to address a range of
physical conditions.
In future work, we will detail and develop this new adaptable self-organization
protocol for wireless sensor networks by performing simulations in order to demonstrate its
strength by comparing it with other existing self-organization protocols.
The future aspects of IoV is bright with the assumption that the aforementioned
challenges and issues would be resolved. A summarized view of the evolution of vehicular
communication is depicted in for making a clear picture of IoV ahead. IoV would bring
novel features in every field of automobile right from the manufacturing up to the customer
experience. Some of these features of future vehicular communications are introduced
below
Online Vehicle
Each vehicle would be online right from the completion of manufacturing up
to the usage by customers. Most of the services related to vehicle would be available
online. The services include status of vehicles, annual inspection report by authority, road
tax payment status, repair or service history, etc. The management cost of vehicle would be
drastically reduced. This is due to the online availability and timely intimation of service
related information.
38
Global Internet ID
APPENDICES
APPENDIX I
SAMPLE SOURCE CODE
Index
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$uname=$_SESSION['uname'];
$q1=mysql_query("select * from ev_station where id=$id");
$r1=mysql_fetch_array($q1);
$num=$r1['num_charger'];
$station=$r1['uname'];
$stname=$r1['name'];
echo 'here';
}
else
{
echo "av";
}*/
if(isset($btn))
{
$q3=mysql_query("select * from ev_booking where carno='$carno'");
$n3=mysql_num_rows($q3);
if($n3>0)
{
$r3=mysql_fetch_array($q3);
$cimage=$r3['cimage'];
}
else
{
$rn=rand(1,10);
$cimage="c".$rn.".jpg";
}
$rdate=date("d-m-Y");
$ch1=mktime(date('h')+4,date('i')+30,date('s'));
$rtime=date('H:i:s',$ch1);
}
} */
if($n2==0)
{
$mq=mysql_query("select max(id) from ev_booking");
$mr=mysql_fetch_array($mq);
$bid=$mr['max(id)']+1;
$exe=mysql_query("insert into
ev_booking(id,uname,station,carno,reserve,slot,cimage,mins,plan,amount,rtime,etime,rdate
42
,otp,pay_st,status)
values($bid,'$uname','$id','$carno','1','$slot','$cimage','0','','','$rtime','','$rdate','','0','1')");
?>
<script language="javascript">
alert("Booked Successfully");
window.location.href="slot.php?id=<?php echo $id; ?>";
</script>
<?php
}
else
{
?>
<script language="javascript">
alert("Already Booked in this Slot!");
</script>
<?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
43
<body>
<?php include("include/link_user.php"); ?>
<div style="padding-left:20px">
<br>
<h3>User: <?php echo $uname; ?></h3>
</div>
<div class="card-body">
<form method="POST">
<div class="form-row">
<div class="name">Car No.</div>
<div class="value">
<div class="input-group">
<input class="input--style-5" type="text" name="carno">
</div>
</div>
</div>
<div>
<input type="submit" name="btn" class="btn btn--radius-2 btn--red" value="Booking" />
</div>
</form>
</div>
</div>
</div>
</div>
</html>
<!-- end document-->
History
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$uname=$_SESSION['uname'];
$qry=mysql_query("select * from ev_booking where uname='$uname' order by id desc");
if(isset($_REQUEST['act'])=="cancel")
{
$bid=$_REQUEST['bid'];
mysql_query("update ev_booking set charge_st=0 where id=$bid");
?>
<script language="javascript">
window.location.href="history.php";
</script>
<?php
}
46
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
<body>
<?php include("include/link_user.php"); ?>
<div class="page-wrapper bg-gra-03 p-t-45 p-b-50">
<div class="wrapper wrapper--w790">
<div class="card card-5">
<div style="padding-left:100px">
<br><h3>User: <?php echo $uname; ?></h3>
<table width="80%" border="1" align="center" cellpadding="5" cellspacing="0">
<tr>
<th width="5%" align="left">Sno</th>
<th width="34%" align="left">Station</th>
<th width="20%" align="left">Slot No. </th>
<th width="21%" align="left">IN Time </th>
<th width="20%" align="left">OUT Time </th>
<th width="20%" align="left">Details</th>
</tr>
<?php
$i=0;
while($row=mysql_fetch_array($qry))
{
$i++;
$q1=mysql_query("select * from ev_station where id='".$row['station']."'");
$r1=mysql_fetch_array($q1);
?>
<tr>
<td align="left"><?php echo $i; ?></td>
<td align="left"><?php echo '<a href="map.php?lat='.$r1['lat'].'&lon='.$r1['lon'].'"
target="_blank">'.$r1['name'].", ".$r1['area'].", ".$r1['city'].'</a>'; ?></td>
<td align="left"><?php echo $row['slot']; ?></td>
<td align="left"><?php
echo $row['rdate']." ".$row['rtime'];
?></td>
<td align="left"><?php echo $row['edate']." ".$row['etime']; ?></td>
48
<td align="left"><?php
if($row['pay_st']=="2")
{
echo "<br>Amount: Rs. ".$row['amount']."(Paid)";
}
else
{
echo "Parking";
}
?></td>
</tr>
<?php
}
?>
</table>
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
<script src="js/global.js"></script>
</html>
<!-- end document-->
Home
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$uname=$_SESSION['uname'];
$qry=mysql_query("select * from ev_station where uname='$uname'");
$row=mysql_fetch_array($qry);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
<body>
<?php include("include/link_station.php"); ?>
<div class="page-wrapper bg-gra-03 p-t-45 p-b-50">
<div class="wrapper wrapper--w790">
<div class="card card-5">
<div style="padding-left:100px">
<br>
<h3>Parking Station: <?php echo $uname; ?></h3>
<table width="80%" border="1" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="50%" align="left">Energy Station </td>
<td width="50%" align="left"><?php echo $row['name']; ?></td>
</tr>
<tr>
<td align="left">Area</td>
<td align="left"><?php echo $row['area']; ?></td>
</tr>
<tr>
51
<td align="left">City</td>
<td align="left"><?php echo $row['city']; ?></td>
</tr>
<tr>
<td align="left">Number of Vehicle Charger </td>
<td align="left"><?php echo $row['num_charger']; ?></td>
</tr>
<tr>
<td align="left">Location</td>
<td align="left"><a href="#">View Map </a></td>
</tr>
<tr>
<td height="22" colspan="2" align="center"><a href="#">Edit</a></td>
</tr>
</table>
</div>
<div class="card-body">
</div>
</div>
</div>
</div>
</html>
<!-- end document-->
Login
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
if(isset($btn))
{
$qry="select * from ev_station where uname='$uname' && pass='$pass'";
$result=mysql_query($qry);
if(mysql_num_rows($result)>0)
{
$_SESSION['uname']=$uname;
header("location:home.php");
}
else
{
$msg="Invalid Username or Password!";
}
}
?>
Login2
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
53
$msg="";
if(isset($btn))
{
$qry="select * from ev_admin where username='$uname' && password='$pass'";
$result=mysql_query($qry);
if(mysql_num_rows($result)>0)
{
$_SESSION['uname']=$uname;
header("location:admin.php");
}
else
{
$msg="Invalid Username or Password!";
}
}
?>
Payment
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$uname=$_SESSION['uname'];
$q1=mysql_query("select * from ev_register where uname='$uname'");
$r1=mysql_fetch_array($q1);
$edate=date("d-m-Y");
$ch1=mktime(date('h')+4,date('i')+30,date('s'));
$etime=date('H:i:s',$ch1);
$thour=(strtotime($edt)-strtotime($rdt))/(60*60*24);
$perday=$thour+1;
$park_cost=$perday*20;
if($r2['charge']>0)
{
$amount=$r2['charge'];
}
else
{
$amount=$park_cost;
}
55
if(isset($btn))
{
$otp=rand(1000,9999);
if($pay_mode=="Bank")
{
?>
<script language="javascript">
window.location.href="verify_otp.php?bid=<?php echo $bid; ?>";
</script>
<?php
}
else
{
mysql_query("update ev_booking set pay_mode='$pay_mode',pay_st=1 where id=$bid");
?>
<script language="javascript">
alert("Wait for Payment Process");
window.location.href="slot.php?id=<?php echo $station; ?>";
</script>
<?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
56
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
function checkMode()
{
if(document.form1.pay_mode.value=="Bank")
{
document.getElementById("x1").style.display="block";
}
else
{
document.getElementById("x1").style.display="none";
}
}
</script>
</head>
<body>
<?php include("include/link_user.php"); ?>
<div class="input-group">
<select name="pay_mode" onChange="checkMode()">
<option value="">-Pay Mode-</option>
<option value="Bank">Bank</option>
<option value="Cash">Cash</option>
</select>
</div>
</div>
</div>
<div class="form-row">
<div class="name">Amount</div>
<div class="value">
<div class="input-group">
Rs. <?php echo $amount; ?>
</div>
</div>
</div>
<div>
<input type="submit" name="btn" class="btn btn--radius-2 btn--red" value="Payment" />
59
</div>
</form>
</div>
</div>
</div>
</div>
</html>
<!-- end document-->
Reg_station
<?php
include("include/dbconnect.php");
extract($_REQUEST);
if(isset($btn))
{
$mq=mysql_query("select max(id) from ev_station");
$mr=mysql_fetch_array($mq);
$id=$mr['max(id)']+1;
60
$exe=mysql_query("insert into
ev_station(id,name,stype,num_charger,area,city,lat,lon,uname,pass)
values($id,'$name','$stype','$num_charger','$area','$city','$lat','$lon','$uname','$pass')");
if($exe)
{
?>
<script language="javascript">
alert("Registered Successfully");
window.location.href="login2.php";
</script>
<?php
}
else
{
?>
<script language="javascript">
alert("Could not Registered!");
</script>
<?php
}
}
?>
register
?php
include("include/dbconnect.php");
extract($_REQUEST);
if(isset($btn))
{
$mq=mysql_query("select max(id) from ev_register");
$mr=mysql_fetch_array($mq);
$id=$mr['max(id)']+1;
$exe=mysql_query("insert into
ev_register(id,name,address,mobile,email,account,card,bank,amount,uname,pass)
61
values($id,'$name','$address','$mobile','$email','$account','$card','$bank','10000','$uname','
$pass')");
if($exe)
{
?>
<script language="javascript">
alert("Registered Successfully");
window.location.href="login.php";
</script>
<?php
}
else
{
?>
<script language="javascript">
alert("Could not Registered!");
</script>
<?php
}
}
?>
Slot
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$uname=$_SESSION['uname'];
$rdate=date("d-m-Y");
$r1=mysql_fetch_array($q1);
$num=$r1['num_charger'];
$station=$r1['uname'];
$stname=$r1['name'];
if(isset($_REQUEST['act']))
{
$act=$_REQUEST['act'];
}
else
{
$act="";
}
/*if($act=="req")
{
$rid=$_REQUEST['rid'];
mysqli_query($conn,"update ev_booking set charge_st=1 where id=$rid");
?>
<script language="javascript">
window.location.href="slot.php?id=<?php echo $id; ?>";
</script>
<?php
}
else*/
if($act=="cancel")
{
$rid=$_REQUEST['rid'];
mysql_query("update ev_booking set charge_st=0 where id=$rid");
?>
<script language="javascript">
window.location.href="slot.php?id=<?php echo $id; ?>";
63
</script>
<?php
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
<body>
<?php include("include/link_user.php"); ?>
<div align="center">
<br><h3>User: <?php echo $uname; ?>, Station:<?php echo $stname; ?> (<?php echo
$station; ?>)</h3>
<?php
$k=1;
$r=ceil($num/5);
$rem=$num%5;
if($rem>0)
{
$cc=$rem;
}
else
{
$cc=5;
65
}
?>
<table border="1" align="center">
<?php
for($i=1;$i<=$r;$i++)
{
?><tr><?php
if($i<$r)
{
$c=5;
}
else
{
$c=$cc;
}
for($j=1;$j<=$c;$j++)
{
?>
<iframe src="charge2.php?rid=<?php echo $sr['id']; ?>" frameborder="0" width="100%"
height="40"></iframe>
<?php
}
else if($sr['charge_st']>=3)
{
?>
<span class="style2">Charge Completed</span><br />
<a href="select.php?id=<?php echo $id; ?>&slot=<?php echo $k; ?>&rid=<?php echo
$sr['id']; ?>">Need Charge</a>
<?php
}
else
{
?>
<a href="select.php?id=<?php echo $id; ?>&slot=<?php echo $k; ?>&rid=<?php echo
$sr['id']; ?>">Need Charge</a>
<?php
}*/
?>
<br />
Book Time: <?php echo $sr['rdate'].",".$sr['rtime']; ?> <br />
(Reserved for <?php
if($sr['reserve']=="1")
{
echo "Parking";
}
?>)
<?php
}
68
else
{
?>
<img src="images/slot.jpg" width="186" height="234"><br>
<!--<select name="btim">
<option value="">-Booked Time-</option>
<option>10:40 AM-11:10 AM</option>
</select>-->
</div>
<div class="card-body">
</div>
<!--</div>
</div>
</div>-->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Vendor JS-->
<script src="vendor/select2/select2.min.js"></script>
<script src="vendor/datepicker/moment.min.js"></script>
<script src="vendor/datepicker/daterangepicker.js"></script>
</html>
<!-- end document-->
View
<?php
session_start();
include("include/dbconnect.php");
extract($_REQUEST);
$msg="";
$uname=$_SESSION['uname'];
$rdate=date("d-m-Y");
if(isset($_REQUEST['act']))
{
70
$act=$_REQUEST['act'];
}
else
{
$act="";
}
if($act=="start")
{
$rid=$_REQUEST['rid'];
mysql_query("update ev_booking set charge_st=2 where id=$rid");
?>
<script language="javascript">
window.location.href="view.php";
</script>
<?php
}
if($act=="pay")
{
mysql_query("update ev_booking set pay_st=2,status=0,sms_st=1 where id=$bid");
?>
<script language="javascript">
window.location.href="paid.php?bid=<?php echo $bid; ?>";
</script>
<?php
}
?>
<!DOCTYPE html>
<html lang="en">
71
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Colorlib Templates">
<meta name="author" content="Colorlib">
<meta name="keywords" content="Colorlib Templates">
<body>
<?php include("include/link_station.php"); ?>
<div align="center">
<br><h3>Parking Station:<?php echo $stname; ?></h3>
<?php
$k=1;
$r=ceil($num/5);
$rem=$num%5;
if($rem>0)
{
$cc=$rem;
}
else
{
$cc=5;
}
?>
<table border="1" align="center">
<?php
for($i=1;$i<=$r;$i++)
{
?><tr><?php
if($i<$r)
{
73
$c=5;
}
else
{
$c=$cc;
}
for($j=1;$j<=$c;$j++)
{
?>
<br />
<?php
if($sr['pay_st']=="1" && $sr['pay_mode']=="Cash")
{
?><h3 style="color:#FF0000">Payment Verification</h3><?php
echo ' <a href="view.php?act=pay&bid='.$sr['id'].'">Amount Received</a>';
}
else
{
?>
Book Time: <?php echo $sr['rdate'].",".$sr['rtime']; ?> <br />
(Reserved for <?php
if($sr['reserve']=="1")
{
echo "Parking";
}
echo ")";
}
?>
<?php
}
else
{
?>
<img src="images/slot.jpg" width="186" height="234"><br>
<!--<select name="btim">
<option value="">-Booked Time-</option>
<option>10:40 AM-11:10 AM</option>
</select>-->
75
</div>
<div class="card-body">
</div>
<!--</div>
</div>
</div>-->
<script src="js/global.js"></script>
</html>
<!-- end document-->
APPENDIX II
SAMPLE SCREEN SHOTS
Home.php
77
User login.php
Register.php
78
User.php
Parking.php
79
Parking cost.php
Booking.php
80
81
Station.php
82
Parking Station.php
83
84
85
86
REFERENCES
Book Reference
Website Reference
https://www.w3schools.com/php/php_intro.asp
https://www.tutorialspoint.com/php/index.html
https://www.tutorialspoint.com/php/php_syntax_overview.htm