Petrol Pump Management System Project Report
Petrol Pump Management System Project Report
Shashi Singh,
………………………. ……………………..
Signature of the Students Signature of the Counsellor
Date:- Date:-
2
3
4
ACKNOWLEDGEMENT
The merits of our project depends only on the wide panorama of the people who
have devoted their precious time , and provided valuable suggestion as well as
guidance to our project.
We are highly obliged to our Prof. Y. N. Singh and our Prof. Girish Chandra
who passed our project at its very initial stage of planning. Also he told us to work
on our project at the starting of the year. Also he told us to take the help of him if we
want in our project.
We also express our gratitude towards our project guide Girish Chandra SIR who
has guided as well as helped from the apex of our project.
We would also like to thanks our lab assistant who allowed working on pc of their
lab and also helped in our project for taking some printout. Also we thanks to their
keen interest in our project and their intellectual assistance throughout their
completion of their project.
The collection of the various ideas, and the progress of our project depends upon
the intellectual of all the staff members of Institute of Engineering & Technology
Lucknow.
Finally we would like to express our group members who have duly worked on the
project and made it successful by the time of submission.
5
Affiliated to Indira Gandhi National Open University
(IGNOU)
CERTICATE
This is to certify that
Shashi Singh.
Pragya Rai.
Sagufta Beg.
Nayanshi Srivastava.
Have submitted this project work entitled “Petrol Pump Management System” is a
bonafied record of project work carried out in partial fulfillment for the award of the
Master’s
OF
Computer Applications
This is a record of their own work carried out by them under our supervision and
Guidance
---------------------- ----------------------------
Project Guide Project Guide
(Prof. Y. N. Singh) (Prof. Girish Chandra)
2019-2020
6
PREFACE
Computerisation is worldwide and requires only software to run huge industries and
institution. TODAY THE INDUSTRIAL WORLD IS LARGELY HIT BY AUTOMATION.
Here we present our project of PETROL MANAGEMENT . The aim of our project is to
acquaint our user with various detail of our system. Thus this report give you the brief
overview of our project.
Our project report is divided into various chapter. In which the first chapter is
introduction which gives the introduction about the whole project what the project is what is
the main content of our project. The second chapter is about the system development life
cycle means it gives us the information about how we had designed our project
.
The third chapter is about the language which we used in our project. And also the front-
end language which we used in our project. The fourth chapter is about the DFD OF OUR
PROJECT.
THE fifth chapter deals with the detail explanation of our project. It describes the various
forms which we used in our project and what that forms means. The sixth and seventh
chapter deals with the advantage and the application of our project.
7
CONTENTS
2 PROJECT PLAN 9
8
3 WHY VB 6.0 19
3.1 Overview of a visual basic language.
3.2 The several features of VB.
3.3 Connecting VB with backend MS-ACCESS.
4 COMPLETE EXPLANATION 22
5 ADVANTAGES 55
6 FUTURE EXPANSION 56
7 LIST OF FIGURES
8 BIBLIOGRAPHY 57
9
1 INTRODUCTION
These project means that what the various activities are been carried out at the
petrol system. In these project we will be including about how we can find out the
information about the various petrol pump. Also in our project we will be including
how we can find that which person has came when and when he will be going
out. Also we will including that which person has sold how many litres of petrol,
diesel, oil.
Also we can find that what is the amount he has received on a particular day.
Also in our project we will be including the sales module in which a person can
find what is the work done by a particular person on that day. Also a person can
find out whether a person is present on that day or not.
Also a person can find thru net what is the cost of the particular petrol, diesel,
oil per liter. Also we will be including how we can find that what is the bonus a
particular employee is getting. Also we will be including how we can find full
details of all employee like his address, phone number etc. Also if we want to get a
information of a particular employee we can get thru database.
Also we can find about what salary a employee is getting in our project. Also
we will be including how we can find what is the amount of petrol, diesel, oil a
employee has sold. Also we will be including how we can find which employee is
working in which shift and also his daily reports. Also we will be including how
we can find which is the senior staff in petrolpump.
Also we will be including some of the database reports of how we can update
the particular information about a employee. Also we will be including how a
person can get the information about which employee is the most experiences and
which is the newly joint. Also we will be including how we can get the information
of which employee has joint at which time and at which date.
10
1.1 INDUSTRIES AS THE BACKBONE OF THE COUNTRY:-
Now a days all the companies are being developing with the help of software. First
there were no many software company in the country but as the world is progressing many
software engineers are also being developed.Due to this software industries all work is
done easily by the help of computers. There is no need to maintain a file record all the
record can be saved in the computer.
Before the computer were developed all work was done manually. So in order to
overcome this computer was developed. Now the whole world has developed due to
autoamation. Means with the help of computer all work is done automatically. In industries
also the work is done thru the help of computer only so there is no need of keeping more
workers in industries. Because as the work is done automatically the world is progressing
due to this. In pune,hydrebad&banglore the software industries are developing in more
percentage so there also the work is done automatically in industries.
As the work at petrol pump is done manually so it becomes hard for the supervisor
to maintain a daily record. So for that we decide to make this project in which all the work
is done with the help of one computer. Our project gives the supervisor to maintain a daily
record in an easiest way. In our project there are several forms we had included. Our
project is totally based on VB LANGUAGE. In our project we had included a form named
OPERATION in which the supervisor can find the detail information of the employee.
Also with this he can delete the employee record if he wants. In our project we have a
module named product cost in which we can get the cost of each product. Also we have a
module named staff management in which we can get the information about each staff like
11
about his address , phone number , joining date , native address. Also in our project we
have a report which has an ado connectivity which is useful for entering the data to the
database table. Also we have a report form in which there are several reports like pumps
daily report , shift delivery report , pumps report , cumulative daily report , salary report.
This all has an database querry which is useful for entering the data of the database. Also
this petrol pump management system will be useful for many pumps. Also we have
provided the password facility for each module in our project for its safety purpose so if
there are any confidential matter then it can be preserved by giving the password to that
module so only the supervisor can open it no any other employee can open it.
In all petrol pumps if supervisor want to maintain the record of the pumps then he
has to go to each pumps for calculating the readings of each pumps. But in our project we
have provided facility to the supervisor in such that he can keep records of each pump just
by sitting on one computer. If the supervisor wants to calculate to litres sold by an
employee then he can view that just by clicking on module named litres sold this will
display him the detail information of that employee how much he was given the petrol at
the starting of the day and how much he has sold in whole day and the amount he has
calculated. Also the supervisor can see whether the target given to him was completed or
not.
Also he can keep the record of the employee which are deleted and also can view whether
the employee is paid the bonus or not. This will provide the supervisor to do his job easily
any time he wants to access the data from the report of the any employee. Also if the
supervisor wants the record of the pump then he can view that easily without having any
effort of going to their and calculating the reading individually of the pump. This will be
useful for viewing the information of all the pump available in the petrol pump.
12
2 PROJECT PLAN
It deals with handling system problem. The feasibility study proposes one or more
conceptual solutions to the problem set for the project. The conceptual solutions give an idea
of what the system will look like. They define what will be done on the computer and what
will remain manual. They also indicate what input will be needed by the system and what
output will be produced by the system. Also it tells that whether the plan of the project is
been made by the people. Here also it tells the timing of the project that whether it is
completed in time or not. They also indicate whether the input will be needed by the system
and what manual the output produced i.e in feasibility study the analyst has to do evaluation
of existing systems and procedures. He has to present a number of alternative solutions to the
user requirements.
2.1.1 OPERATIONAL:-
This feasibility study deals with the operation of the project. Here we are going to
explain the whole operation of the project .In this project we have provide the ado
connection which is useful for the connectivity of the database. This will provide the
connection so that with which we can open more then one form due to this ado connection.
This project is totally based on the visual basic language and in this visual basic we have
provided the connection and also we have used ms-access so that we can create an database
table. Here we have provided the user name and password facility so that there are some
form which should provide security purpose. A system development project are likely to be
feasible if it meets user requirements , needs , and expectation. User acceptance is an
important determinant of operational feasibility. It requires careful consideration. Here also
there are several reports generated by the database access so that which will be useful for
entering the record of the employee .
13
2.1.2 TECHNICAL:-
The cost of the project is less as compared to the other project. Also it is cheaper as
compared to other project. Here only software is used so there is no need of extra cost that
the project might be damaged. It is user friendly and can be interacted with other person.
Also it can be used by any person if that person knows VB language then can be easily
handled. Also there is no need of having any high range pc it can work with normal
configuration pc.
In this life cycle phase there are several steps which are to be followed they are:-
1) System Engineering:-
This phase deals with the engineering part of the project. In system engineering
work cannot be established before the system requirements for allocating the needs and
subset of the requirements. In this we will be specifying the that whether it will be easy to
14
work with this project or not. Also we have here provided the requirements like vb and ms-
access.
2) System Analysis:-
Analysis is a detailed of the various operation performed by the system and the
relationship exist between the system. In our project we analysed the relationship that we
will be using in our project. In analysment we also decided how many module we will be
including in our project. Also the brief overview of how our project will look like was done
in the analysment. We also decided what type of connectivity we will be providing in our
project was done. Also we referred some of the books of vb so that which will be useful for
writing the code of the project. In analysement also we analyse that in how many days we
will be completing our project so that it will be submitted in correct time as per the given
schedule.
3) SYSTEM DESIGN:-
This is the most challenging phase of the System Development Life Cycle. In this
phase we decided how our project design will look like. We designed several forms in VB
which were to be include in our poject. There were around 29forms which were designed by
us in which all the concepts was included. This designing of forms was helped by our project
guide. It also focused on four steps:-
1)DATA STRUCTURE
2)SOFTWARE ARCHITECTURAL
3)PROCEDURAL DESIGN
4)CHARACTERISTICS
Also these designing was done only in vb in which we designed all the form and there are
also some form which will be useful or entering the data so we designed that form in
database and also there are two module. This deigning finally was completed by us at the
mid of the year.
4) CODE:-
15
This coding is done by us by referring the books in vb and some information in
internet.
2.4 SYSTEM REQUIREMENTS:-
b. ) SOFTWARE REQUIREMENTS:-
FRONT END:- For this we have used VISUAL BASIC 6.0. It requires a winxp.
BACKEND:- For this we have used MS-ACCESS.
16
2.5 DATA FLOW DIAGRAM:-
This are the various symbol used in data flow diagram. And we also had used this diagram to
draw the data flow diagram.
17
2.5.1CONTEXT LEVEL DFD
Interface
Generate Code for
Vb
programmer Visual
with Basic
Editor
Application
Program
Of VB
Access
database
file
Code Information.dbf
2.5.2 DFD-LEVEL-1
18
Enter Access the product user
Product has selected and then
User Cost 2.0
value
Display cost of
product
Display employee
record detail of
Does the employee
work
Bonus level
2.0 Supervisor checks the
work and then
19
In this we have explained what is the way that we have provided for writng the code. In
this we have done coding fully on visual basic language. We have used an ado connection for
writing the code of the project. This ado is an active directx object it is basically used for making a
connection with the database table and the vb language. This is very much useful also for the data
access purpose. Also we have used an ms-access so with that it is easy to use the connection for
the ado. Also in our project we have used the table called RS which is used for entering the value
and also for the connectivity that is for storing the result of the two table. Also in our project there
are various reserve keyword used for some database access purpose. Also we have used various
comments in our project which will be useful for disabling some of the statements which might
not be useful in our project. Hence there are various coding explanation which we have explained
later in the complete explanation form. This is all about the coding part of the project.
In this phase we have tested the project that we created. It basically sees the logical
internals of the software and the logical externals of the software. It took around a week to
complete this testing because after making the project we should to our guide who told to make
several changes in the project. And also suggested to do the coding part properly. So after
making all this we gave our guide to test the project.
2.8 MAINTENANCE:-
Software maintenance replies each of the preceding life cycle steps to an existing program.
In maintenance part there are also we have done the various steps for maintaining it properly so
that it does not require any extra maintaining part.
Visual basic is a structured programming language and a complete application development tool
for the MS WindowsXP operating system. It is an efficient interactive environment for designing
forms. Due to its an integrated development environment(IDE), you can develop, run test & debug
your application easily.
20
The imported feature that VB provides that it is Graphical User Interface Language. It relies on
windows, iconic representation of entities, put down menus or pop-up-menus & pointing devices
are now common place on personal computers & workstations. This type of interface demonstrates
that the proverb “A picture is worth a thousand word” has not lost its truth. Now-a-day, users
presented with a desktop filled with icons & programs which are helpful to user. Graphical User
Interfaceare extremely helpful for the beginners. Therefore we decided to use Visual Basic with
which we can develop Graphical User Interface based application for our project. Also the main
motive behind using this language is that it is very user friendly and the student can easily interact
with this system.
Also this language was taught to us in second year so we were having good hand in this
language and so we decide to take visual basic as a forntend language. Also for studying this
language we also reffered some of the books of it. The visual basic language can be easily written
and there is no difficult to understand the code syntax because if one knows c and c++ then it will
be very easy for him to study visual basic
3) A pointing device such as a mouse for selecting choices from menu of indicating items of
interest in a window.
4) This type of language in which during design time , you are able to see how your program will
look during runtime.
5) This is the great advantage over other programming language , because you are able to change
and experiment with your design until you are satisfied with colors , sizes , images etc. which are
included in your program.
6) Visual Basic provides many readymade function & tool. This help us to get the output in
graphical form.
21
7) It provides the component MICROSOFT DATA REPORT DESIGNER VB 6.0 that is useful in
creating the monthly report about the detail of any organization which we have used in our project to
make the reports of the book.
8) The code of the visual basic can easily written. And the code syntax is same as that of the any
other software language. And this language code can be easily written by just seeing the books of
the some visual basic.
9) Also there is a facility of providing the ado connection facility with the help of the visual basic
code. For this we have to enter the database value and the data table.
10) In visual basic it is also very useful to create an MDI form. Also there are very easy ways to
create an mdi form so then we will be very ways to design this form.
We have used MICROSOFT VISUAL BASIC 6.0 as front end and MICROSOFT ACCESS as
backend. For connecting VB with MS-ACCESS we have used the component ADO by selecting the
MICROSOFT ADO DATA CONTROL 6.0(OLEDB) property. Then we have created the database
table in MS-ACCESS.
And then by using the ADODB properties and selecting MICROSOFT JET 4.0 OLEDB
provider we have connected the created database to the VB. Also ms-access will be useful for
entering the data in the database. This ms-access can also be useful for providing the ado
connectivity with which we can add the value of the two table. This ms-access also create the third
table automatically which will be useful for entering the table.
22
4) COMPLETE EXPALNATION
BONUS – MALE
Bonus is the main motive of every person earning in the world. This is an extra salary
paid to the employee working in the world. This same procedure is repeated for our project
. means here the employee will be given the bonus if he completes the work assigned to
him was completed by him at the end of the week. There are several works to be done
before getting the bonus. Also the bonus will be reducted 50rs if the employee was absent
at that day.
This is the module of our project . it is used to calculate the bonus of the employee. Here also
we can find that whether the employee is paid the bonus or not. But before giving the bonus we
23
have to find that whether the target given to the employee was completed by him or not. If the
target given to that employee was completed by him at the end of the week then he will be paid
the bonus 100rs.but if he fails to achieve the target then the bonus given to him will not be
given. Also at this time the supervisor can check whether the employee was present on that day.
If he is present then he will be paid full 100rs bonus otherwise if he is absent then 50rs will be
cutted from the employee bonus even though he achieve the target given to him.
This bonus will be given at the end of the month with his salary only. Also while calculating
the bonus it is checked that in which shifts the employee was working. If he is working in night
shift he will be given the bonus according to his work done that is achieving the target. And if he
is working in morning shifts then he will be paid the bonus according to his morning target .
This bonus is for also the female staff. For female staff the same procedure is repeated as the
procedure given for the male staff.
24
PRODUCT MANAGEMENT
This is the module which we added in our project which will be useful for the buyer to
easily know what is the cost of each product and the cost of that product per liters. For this
we have provided the password security so that the outsiders cannot change the cost of this
product.
Here before opening it it will ask you for the password to enter. As soon as you enter the
password it display the PRODUCT MANAGEMENT SCREEN. It will display you the cost of
each product. Here the cost will be changed as the cost for that product changes. Means the cost
of petrol , oil , diesel changes in months or two months so this changes can be changed by us by
login in to the product management form. This is the form which contain the main idea of the
project. Means each one who comes to buy the product first sees the cost of that product and
then he decide which one he should used. So it is the main form in our project.
This is the form which will be only viewed by the supervisor for making the changes in the
form of it.
25
PUMPS MANAGEMENT
This is the pumps management form which will display the information about the pumps
record. For this we have provided the password facility that means whenever you login you
have to enter the user name and the password. This is done for the security purpose of the
petrol pump.
Whenever you open this form it will display the password field in which you have to display
the password and as you enter the correct password it will display you the PUMPS
MANAGEMENT form. This form contain the product name , pump list , highest value , new
pump , edit pump , remove pump.
If the supervisor wants to know the final reading calculated by the employee then he can
view that information just by selecting the pump-list button. As soon as you select this button it
will display you the product name and the highest value calculated by that employee working on
that form. This will display the different readings for different product and the employee might
26
be the same because he might work for one pump on one day and on another day he will work
for the another pump. So this will be automatically generated inside only.
Here we can also add the new pump name if some arises. Means if there is a new employee
then the record for that employee can be created. We also have provide the edit option with
which we can edit the information if the supervisor has entered some wrong information then he
can edit it by clicking just edit button and he can change the information. Also there is a facility
to delete the pump record from the pump list .suppose if some employee was working on pump1
and then he suddenly lives the job and some other employee comes on his place then he can
remove the information of that employee who has left by deleting the record for that employee.
And also he can add the record of that new employee by selecting the new pump option. Also the
employee highest value will be calculated of that employee.
27
STAFF MANAGEMENT
This form will give us the information about staff. Here also we have provided the password
facility so that any other employee cannot see the staff record of some other record. There are
several options like staff id number , personal details , permanent address , staff guarantor ,
retrenched staff , suspend staff , edit staff information , employee staff. This are the various
forms of our project.
First when you open this module it will ask you for the password field. Once you enter the
password then it will display you the STAFF MANAGEMENT form in which all the details
about that staff is associated. If you want the information of some employee then you have to
select the staff id number options which will display the id of the employee. You just select the
id of that employee which you want and then it will display the information of that employee. It
will display the first name , last name , surname. Also it will display the information like his
age , sex , address , permanent address , staff guarantor. In permanent address it will display the
native address of that employee. Also if you want to add some new employee then it can be done
by selecting employee staff option. Then you fill all the information of that employee and click
on save it will ask you for the employee id number and as soon as you enter the id number the
record for that employee will be saved.
28
Also there is the facility to retrenched the staff record. If some employee has been removed
from the pump hen his record will be deleted by selecting the retrenched staff record options.
This will remove the record of that employee from the staff management record. Also if some
employee has been suspended for some days then the information can be removed for some days
and then it can be saved in this record called suspended information.
Also in our project we have included the facility of recalling the information of the employee
which were retrenched and suspended. For doing this you have to select the retrenched button
from recall staff information module. It will ask you for the id number for which staff you want
to view the information just select his id number and then the information for that employee will
be recalled. Also the same procedure is repeated for viewing the information about the employee
which are suspended. You can also recall the instruction of that employee by selecting an option
suspended staff. This will recall the information of the employee which are suspended. Also
there is a facility of including the image of that employee if the supervisor wants to add .This is
all about the staff management module. This is used for calculating the all records.
29
SHIFT DELEVERY REPORT
This is the module called the SHIFT DELEVERY REPORT which is used for calculating
the report of the employee according to their shift. Here we have provided the password facility
so that so that n any other cannot view the information about this except the supervisor of that
pump. It has option like shifts and the date.
As soon you open this form it will ask you for the password and as you entered the correct
password it will open you the form. First for viewing the information about it you select the shift
of that employee and then select the date of that employee that is from where to where the date
you want. And after selecting it click on view report it will display you the report of that
employee. As soon you hit enter if there is a record found it will display a message that one
record found in database and there if you click ok it will display the whole record of that
employee like staff id , staff name , pump , initial reading , final reading , returned to tank ,
actual litres sold , amount , unit cost and reason for returning to the tank.
This all information like amount will display the amount colleted by that employee at the
end of the day also we can find that in which shifts he was working. There also a form called
initial reading and final reading which will display you the initial reading of that employee and
also display the final reading collected by him at the end of the day. You can also view
information like litres being sold by that employee at the end of the day. And what was the
amount of petrol he was given at the beginning of the day. Also it displays the unit cost means
the cost of the product sold per unit of litres. It will also display the employee id of that
employee. Also we have provided the facility of finding a report of an employee that is an
individual report an employee. In this you just have to enter the shifts and just select the date
and then click on view report it will display the report of the individual employee in this you can
view the report of the single employee only here there is no facility of including report of more
than one employee.
This is all about this forms which we have included in our project. This calculation is done
automatically from the database table which views the information of the employee. This is the
table for viewing the report of the single employee as well as more than one employee.
30
31
LITRES SOLD
This form name is LITRES SOLD. As by the name only you can conclude that what it will
display. This is the form which displays information about the litres sold by an employee. Here
we have provided the password facility so that none of the employee can see the information and
also they cannot change the information if they want. This is only being viewed by the
supervisor and the manager of the pump to view the information of the employee to find that
what is the amount of petrol , oil , diesel is sold by an employee.
First when you enter the field it will ask you for the password and when you enter the
password it will open the form litres sold. In this form it contain various option like select
pump , pump detail , present reading , quantity returned , reason for returning the product. Here
you have to select all the information if you want to view the information.
Here we have created a link between all the product if you enter the one value it will ask
you to enter the second value. First when you select the pump it will display you the it will
automatically display you the product type , last reading and the cost of that product. Then it
will ask you to write the present reading and when you write the present reading it will ask you
to write that whether you have returned any product or not if you have returned then just write
the amount of quantity returned and also you have to write the reason for returning the product.
If you have not returned the product then just click the compute option and then it will display
the litres sold by an employee and the amount collected by that employee. And then when you
click on OK button it will save the record of that employee. Also here the record will be saved to
the on the particular employee pump number. Here also you can view the information about the
target given to the employee was competed by employee or not if not then no target incentives
will be given by them. That means no bonus will be given to that employee if no target is
completed by it.
This is all about calculating the litres sold of the particular employee this all is done
automatically by just one computer. In this it will display all the information related to it just by
clicking one button compute it will automatically calculate the litres sold and the amount
collected by them.
32
33
SALARY REPORT
This the form named SALARY REPORT this will display the name and salary of the
employee. Besides this it ill also display the various information about the employee salary
like his name , age , pump number , target and the amount calculated by it. It will also
display that the number of times the employee is absent and the number of times he is
present.
Here we have provided the password facility which will ask you for the password whenever
you login in this form. And when once you enter the password it will open you the form salary
report. This is used for viewing the information about the staff salary which means that will say
how the salary is calculated and how the employee is paid. Before calculating the salary various
procedure is followed by the supervisor they are as follow. Here first the supervisor will check
whether the employee is present for whole month or not and also checks whether the employee
is absent for any of the day or not. If the employee is absent then the total number of days he is
absent that much amount of rupees will be reduced from his employee.
Also the supervisor checks whether the target given to that employee is completed or not if
yes then he will be given the bonus. If the employee fails to achieve the target then he will not be
given the bonus. Also the staff id number will be displayed in this field and also the total sales
done by that employee will be calculated by that employee is done at the end of this day.
This all is done automatically by the computers only. The supervisor does all this thing so
only the password will be given to the supervisor who will be calculating the salary of the
employee. The supervisor will calculate the salary just by clicking some information and he
don’t have to write all this information in the file and keep a risk of losing that information.
Instead of this the record will be stored in just one computer and can be viewed whenever it is
needed by the supervisor to check some information. This will not be shown to all the employee
it will be only shown to that employee whose salary is being calculated.
34
35
SELECT STAFF REPORT
This is the form called the SELECT STAFF REPORT . As by the name only you can see that
it will calculate the staff report. Here we have provided the password facility means nobody else
can access the information about the employee only the supervisor and the manager of the petrol
pump can access this . here it has various option like staff name , staff address , staff guarantor ,
his joining-date and also it contain a view report button which views the information as soon as
you click it after selecting a staff name.
Here when you enter the form it will ask you to enter the password and once you enter the
password it will open up a select staff report screen. In this it contain information all about the
staff. Here first you have to select the staff name for which you want to view the information and
as soon as you select the staff name and then click view report it will display the report of that
employee for which you wants. In this it will display the information like staff name , staff id ,
surname , first name , sex , permanent address , phone number.
This all is needed to keep the record of that employee so that at the time when you want to
view a record you don’t have to search the record in the file instead of it the record can be easily
found by just selecting the staff name and selecting the view report button. This will be easy for
the supervisor because it will save the time of him in searching a record. So this will be very
useful in petrol pumps .
This is necessary because if any of the employee is absent and the supervisor wants to call the
employee for his work or wants to find out the reason why he is absent then he can just make a
call to him and can find the information. This will be applied to all the employee but in this we
can find the information of the single employee only not multiple employee information can be
viewed in a single time. This can also be done by this but for this we have provided a link with
staff report which will display the information that the staff record will display whenever the
user wants it.
36
37
PUMPS FINAL READING
\This is the form named PUMPS FINAL READING. It is used for displaying the pumps final
value. Here also we have provided the password facility. Means this for the security purpose. It
contains various options like pump id , pump type , final reading. This all is connected to each
other thru the database.
First when the user wants to access to this form then he has to enter the password for that
field. As soon as you enter the password it will display you the PUMPS FINAL READING
SCREEN. This will contain information about this pump. First the supervisor has to go to the
report forms then there he will select the pumps final reading option. As soon as he select this
option a screen appear showing his login form and when he enters the password he will be
viewed a final readings screen in which all the pumps final reading will be showed
This means that it will display pump id and then it will display the name of the product
that the employee was working and then it displays the final readings that is the amount
calculated by the particular employee at the end of the day and also it displays the target
assigned to that employee was completed by him at the end of the week. This final reading
should be always greater then present reading. In this the same product might be available to the
different employee. Though the product given to the two employee is same but the final reading
will always be different then the other employee. It might be possible that some employee might
be absent on some day so the final readings for that employee will be less means it will have
zero final reading.
This is all about of automatically calculating the final reading of the particular employee.
Here the supervisor also don’t have to write any information it will be displayed directly as you
click on view report because this is one by the linking of ado with the ms-access. Hence this
what this module contains.
38
39
BONUS - FEMALE
Bonus is the main motive of every person earning in the world. This is an extra salary paid to the
employee working in the world. This same procedure is repeated for our project . Means
here the employee will be given the bonus if he completes the work assigned to him was
completed by him at the end of the week. There are several works to be done before getting the
bonus. Also the bonus will be reducted 50rs if the employee was absent at that day. This is bonus
form of female
This is the module of our project. It is used to calculate the bonus of the employee. Here also
we can find that whether the employee is paid the bonus or not. But before giving the bonus we
have to find that whether the target given to the employee was completed by him or not. If the
target given to that employee was completed by him at the end of the week then he will be paid
the bonus 100rs.but if he fails to achieve the target then the bonus given to him will not be
given. Also at this time the supervisor can check whether the employee was present on that day.
If he is present then he will be paid full 100rs bonus otherwise if he is absent then 50rs will be
cutted from the employee bonus even though he achieve the target given to him.
This bonus will be given at the end of the month with his salary only. Also while calculating
the bonus it is checked that in which shifts the employee was working. If he is working in night
shift he will be given the bonus according to his work done that is achieving the target. And if he
is working in morning shifts then he will be paid the bonus according to his morning target. This
bonus is for also the female staff. So this is the same procedure which is repeated in the bonus
form of module. Here also they are given some target and they have to complete this work and
then they are paid the bonus. So this is the main target but this is not for all pump only those
pump where the female work.
40
41
CUMULATIVE SHIFT DELEVERY REPORT
This is the form called CUMULATIVE SHIFT DELEVERY. It is basically a report generation
which is used for generating a report of the employee. Here we have provided the password
facility so that any other user cannot see this report or can make changes to this report. It can
contain various option like shifts , date from starting and the end. This is very useful for easily
calculating the report of the particular employee.
Here when you enter it will ask you for the password and when you enter the password it
will check inside only whether the password is correct or not if yes then it will open you the
report called cumulative shift delivery. This form is mainly used for finding the weekly report of
the employee. Suppose in some pump the payment is done weekly so there the supervisor needs
to keep the record of employee while giving the payment to check whether the employee is
present whole week or not and also check whether the target given to him was completed at the
end of the week so accordingly he will be paid the bonus for that extra work.
After then for viewing the report the user have to select the employee name from different
table and from then as he select the name from this table he has to select the shifts for which he
is working and then he has to select the date and as soon he click on the view report it will
display him the report of that employee in which it will display him the staff id staff name
amount collected and many more. This is for only one employee if the supervisor want to view
record for more than one employee than also it is possible by the help of this report here just the
supervisor has to select the shifts and the date and then the report if are present then it will give
you the message that there are 5 records or more than that record are present and it will display
him the report of that employees which he was watching for.
So this is what this module says about how it is easy to find report of the employee with the
help of just one computer. Here there is no need of maintaining the record in the file it can be
automatically created in the database and can be displayed whenever we want for this just we
have to select some option and the report is automatically generated. This all will save the time
of the supervisor and he will not be confuse in finding the record.
42
43
PUMPS DAILY REPORT
This is the next module named PUMPS DAILY REPORT this is use for viewing the report of the
employee. Here we have provided the password facility so that no employee can view the
information about this. This is only for the supervisor because this can view him the daily report
of the employee pumps what he has sold what is the expenditure of that employee. This has
various options like shifts to select the shift of the employee , date to view the report from which
date to what date the report the supervisor wants and the view report button.
Here when the user enter the field it has to enter the password and as soon as he enter the
password it checks whether the password is correct or not if the password is correct then he can
view the information. If the supervisor wants to view the information of the employee working
on the pump no 4 what is his work on the end of the day. Then for that he has to select the
employee number and then he has to select the shifts for which that employee was working and
the date from which date to what date the supervisor wants the report and then he has to click on
the view report button and then it will display him the report of that employee.
In this report it will display him the pump id , pump type , initial reading , final reading ,
returned to tank , staff name. This all are the contents that will display in the report. The staff
name will display the employee name who was present on the pump of which the supervisor
wants to view the information. The final reading will display the final value seen on the
employee pump on which he was working. The pump type will display him the name of the
product which the employee was selling. That is whether he was selling the cng or petrol. And
the initial reading will display him the initial value that was calculated before the starting of the
day and the final value will display him the final value value calculated at the end of the day.
Then there is a option called pump id this we have provided as a id of a particular employee
through which they can be identified uniquely even though the name is different. This we have
declared as a primary key in our ms-access and provided it a ADO connection through which we
can view the contents inside it and this ID will be different for different person no two employee
will have a same ID. The ID will be repeated to the employee who has been replaced for the
other employee means that the I of the employee can be given to the employee who has join in
place of that employee.
This is all we have added in our project and has been explained by us in our project report.
44
45
DELETE REPORT
This form is about deleting record. This will be use to delete the record of the employee. Here
we have provided the password facility so that no other employee can delete the record of any
other employee. This is only for the supervisor to delete the record of the employee. This will
be done if the employee has left the petrol pump. It has various option like select pump , final
reading , initial reading , pump number , date and also it has sales record form in which it has
option like pump no , date , shifts , name.
Here if the supervisor has to open the form then he has to enter the password and if the
password if correct then it will open a form called MASTER DELETE. This will delete the
record of the employee. Before deleting the record the supervisor has to enter the various value
like firstly it has to select the pump that is whether he was selling cng , gas , petrol , bulk ands
then he click on show button this will display him the whole information like it will display
him the last value of that employee that was collected by him at the end of the day before he
was closing his job. Then there is a pump record detail form in this it will display him the
number of the employee pump in which pump number he was working and the date for which
he was working. After then it will display him the initial reading of that employee that is
currently seen in his pump and also the last reading that is calculated by him at the end of the
day.
Then there is a form called sales record detail which will be useful for viewing the detail of
the sales work of the employee. In this it will display the pump number and the date as above
form only there is a change in it that it will display the staff name that is the name of the
employee who is working on that pump and the shift of that employee whether he has worked
in morning shift or night shift. After viewing all these information then we have provided the
connectivity to the ado which will be useful for storing all this information if the user wants.
This connectivity is provided so that if the record is deleted then the information is stored in
the ado table so if the supervisor wants to access the information then it can view that
information. Then finally if all the information is over then if the supervisor wants to delete the
record it has to just click on the delete button then it will delete the record of that employee.
This record will be permanently deleted from the supervisor pump list but it will not delete the
information permanently it will save the record because it might be useful whenever necessary.
Then there is all this facility that we have provided for deleting the record. And all this we
have explained in our project report. And this is all about our form delete.
46
47
DATA REPOTR 1
This a module called report. In this we have provided the information about the report . here
we also have provided the password facility so that any other user cannot access the
information this can be only viewed by the supervisor only. No employee can access this
report. Here it has various option like date , litres sold , shifts and various other reports are
generated by this form.
Here before opening this form the supervisor has to enter the password. As soon as the
password is entered it checks whether the password is correct or not and if the password is
correct it ill open him the form called report pump sales. Also it contain information like the
report of his shifts that is in which shifts he is working. The employee might be working in a
night shift or in morning shifts. Also the report of his product which he is selling is been
calculated in this report. Also the staff id of that person is been seen. This id is a unique for
only a single employee. This id will be not same for all the employee. This is provided so that
the supervisor finds it easy to calculate the record of the employee. Also the staff name is
provided because the supervisor wants to calculate the record then it can be calculated easily.
Also the final reading and the initial reading of the employee can be calculated in this report.
Also the total cost of the employee can be calculated by the supervisor easily without
maintaining the record. This total cost of the employee can be calculated just by viewing some
of the information in the table and thus table has provided the connectivity to the ado. There is
also a facility to calculate the litres sold of the employee. Means if the user wants to calculate
the amount of the product sold by the employee at the end of the day then he can view that
information in this report.
Also there is a facility to view the report of the employee called table unit cost in which the
per unit cost of the employee can be calculated and this can be viewed the report of the
employee. This will be very useful for the supervisor because if he wants to see the report of
the employee that what is his sell per unit cost then it can be calculated by the supervisor just
by clicking the information as given in the report.
48
49
ALL PUMPS REPORT
This is a form called the report which will be useful for creating the pumps report. Here we
have designed the form with the help of the mdi form. This report has database connectivity
which will be useful for entering the data in the database table. Here we have provided the
password facility so that no employee can open the form. This report can be only opened by
the supervisor.
Before entering the report form the supervisor has to enter the password as soon as he
enters the password he will wait for sometime and as soon the password is verified then if the
password is correct then it will open the report. It has various option like page header section ,
page footer section , detail section.
The page header section contain option like pump id this is a primary key of the project
which will be useful for giving each employee a different id. So that if there are two employee
with same name then the supervisor will not find it difficult to calculate the report of the
employee.
50
SPLASH LOGIN FORM
This is the main login form. That is the splash screen that we have provided in the project. This
screen will be opened at the time when you will first time open the project exe file. Here there
are login name and password facility. This form will be the only form of the viewing only.
Here as soon as you run the project it will ask you for the login name and password. In
this screen we have provided the ado connectivity so that it will be useful only if the user
wants to set it on the screen for sometimes. Here we have set the timer so that for that
particular timing the screen will be viewed for the uaser so that it can be viewed and can be
easily splash the screen. This form also has the advantage that if the person wants to make his
project more deginable then it has to use this splash screen shot.
Here we have no coding part only we have designed the form in ado. There is an image
part that we have used and it is useful entering the desing only and in the properties we have
set the timer only so that it can be not viewed at the whole time until you close the project.
Also for password we have provided the facility that if the user wants to change the passwords
then he can change the password but this can be done only by those user who knows the old
password.
CHANGE PASSWORD
51
5)ADVANTAGES:-
As each project has its advantages other-wise without advantages it will not be useful.
Because in now-a-days company are growing in rapid form because of there several new
forms. Also in our country there are several industries which are getting developed by the
software companies so for that we have to use such explanation. The motive behind having
advantage in our project is that if we want to get selected our project in industries then there
should be some features difffernt then there are in other projects. Also there are several
advantages in our project like:-
1) It is very user friendly:- This means that these project can be handled without any
much distortion. Also there is no need to have to study this software and then to use it.
2) Cost effectiveness:- This project is very cheaper as they don’t require the hardware
equipment. Means this project can be completed in the low cast. Here you have to only use the
software language like vb and ms-access.
3) Easy to backup:- The back up of this project is very easy to handle. Also the record if
deleted by mistake be deleted permanently it will store in the database files.
4) Data security:- In our project we have provided the password facility so that each
module can have their data security. Here also the report module which cannot be opened
without the password so for that we have provided the security purpose.
5) Also in our project the coding part can be easily understand by the other person. Also
the coding part of our project is totally written in visual basic language because it is very user
friendly.
6) The form of our project is also designed in full MDI form. This designing is useful for
identifying the which form is useful.
7) Finally the main advantage is that it can be used in any pump with only one pc and
there is no need of any type of the extra hardware requirements.
52
6 FUTURE EXPANSION:-
As all the project have their future expansion. All the projects may be changed in
the future by the other person. In the same way we also have our project future expansion. In
future somebody might buy this project. Also some might create a better project than
this. And this project is easy to use. Means that somebody might add some additional
features to these projects and can expand these project. But these project is not yet created in
any of the college so we decided to make these project.
Also in future some industries might be interested in buying this project. And also we will
be in future we will try to make these project more interesting by adding some features in it.
Also this is developed in visual basic language but in future it can be developed in some
other language but it is very easy to develop in this language as it is user friendly. Also in this
we have provided the ado connection so somebody in future if expanding the project then he
might use some other connectivity.
(coding of Project)
1).Views
AddPetrolPump
<!DOCTYPE html>
<html>
<head>
<style>
/* Bordered form */
form {
border: 3px solid #f1f1f1;
}
/* Full-width inputs */
input[type=text],
input[type=password],input[type=number],input[type=file],input[type=tel],input[type=e
mail] ,select{
width: 20%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
53
}
</head>
<body>
<h2 align="center">
Error In PetrolPump Creation <%= errormsg %>
</h2>
54
State <input type="text" name="State" placeholder="State">
<br>
</p>
<br>
<br>
</body>
</html>
CommonFooterScriptElements
<script>
</script>
CommonHeadElements
<title><%= title %></title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="description" content="<%= description %>">
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<%= title %>" />
<meta property="og:description" content="<%= description %>" />
55
<meta property="og:image" content="<%= metaImageUrl %>" />
<meta name="twitter:title" content=""/>
<meta name="twitter:description" content=""/>
<meta name="twitter:image:src" content=""/>
<meta name="keywords" content="">
<meta name="google-site-verification" content="" />
<link rel="canonical" href="<%= canonicalUrl %>" />
</table>
</p>
<p>
<h2>Today Product Sale</h2>
<table border="5">
<th>Product</th>
<th>Sale</th>
<% for(i in saleResult) {%>
56
<tr>
<td><%= saleResult[i].TYPE %></td>
<td><%= saleResult[i].SALE %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>Current Quantity Left</h2>
<table border="5">
<th>Product</th>
<th>Quantity Left</th>
<% for(i in quantityResult) {%>
<tr>
<td><%= quantityResult[i].TYPE %></td>
<td><%= quantityResult[i].QTY_LEFT %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>Total Cash</h2>
<table border="5">
<th>CASH</th>
<tr>
<td>
<%= cashResult.TOTAL %>
</td>
</tr>
</table>
</p>
<p>
<h2>Total Bank Balance</h2>
<table border="5">
<th>Balance</th>
<tr>
<td>
<%= bankResult.TOTAL %>
</td>
</tr>
</table>
</p>
<p>
<h2>Total Fleet Amount</h2>
<table border="5">
<th>Fleet Balance</th>
<tr>
<td>
<%= fleetResult.TOTAL %>
57
</td>
</tr>
</table>
</p>
<p>
<table border="5">
<th>Shift STartTime</th>
<th>Shift EndTime</th>
<th>SuperVisor</th>
<tr>
<td><%= shiftResult.START_TIME %></td>
<td><%= shiftResult.END_TIME %></td>
<td><%= shiftResult.SUPERVISOR %></td>
</tr>
</table>
</p>
<p>
<table border="5">
<th>DSM</th>
<th>Nozzle Number</th>
<th>Opening Reading</th>
<% for(i in shiftDetailsResult) { %>
<tr>
<td><%= shiftDetailsResult[i].DSM %></td>
<td><%= shiftDetailsResult[i].NOZZLE_NUMBER %></td>
<td><%= shiftDetailsResult[i].DOR %></td>
</tr>
<% } %>
</table>
</p>
</div>
<% include commonFooterScriptElements.html %>
</body>
</html>
Empent
<!DOCTYPE>
<html>
<head>
</head>
<body>
<center>
<form action="msg" autocomplete="on" method="post" enctype="multipart/form-data">
PID:<input type="number" name = "pid" placeholder="Enter id"><br>
FIRSTNAME:<input type="text" name = "firstname" placeholder="Enter name"><br>
LASTNAME:<input type="text" name = "lastname" placeholder="enter name"><br>
ADDRESS:<input type="text" name = "address" placeholder="enter address"><br>
EMAIL:<input type="email" name = "email" placeholder="enter name"><br>
PHONE:<input type="tel" name = "phone" placeholder="enter name" min="10"
maxlength="10"><br>
58
AADHAR:<input type="text" name = "adhar" placeholder="enter adharnumber"
min="16" maxlength="16" ><br>
Photo:<input type="file" name="pic">
<button name="submit">ADD EMPLOYEE</button>
</form>
</center>
</body>
</html>
Employee
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include commonHeadElements.html %>
</head>
<p>
<h2>ADMIN</h2>
<table border="5">
<th>FNAME</th>
<th>LNAME</th>
<% for(i in employeeResult1) {%>
<tr>
<td><%= employeeResult1[i].FNAME %></td>
<td><%= employeeResult1[i].LNAME %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>SUPERVISOR</h2>
<table border="5">
<th>FNAME</th>
<th>LNAME</th>
<% for(i in employeeResult) {%>
<tr>
<td><%= employeeResult[i].FNAME %></td>
<td><%= employeeResult[i].LNAME %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>DSM</h2>
<table border="5">
59
<th>FNAME</th>
<th>LNAME</th>
<% for(i in employeeResult2) {%>
<tr>
<td><%= employeeResult2[i].FNAME %></td>
<td><%= employeeResult2[i].LNAME %></td>
</tr>
<% } %>
</table>
</p>
</div>
<% include commonFooterScriptElements.html %>
</body>
</html>
Employee1
<!DOCTYPE HTML>
<body>
<table>
<th>Name</th>
<th>Pic</th>
<% for(i in res) { %>
<tr>
<td><%= res[i].FNAME %></td>
<td><img src="<%= '/static/uploads/'+res[i].PIC %>" alt="nahi hai"
width="30" height="30"></td>
</tr>
<% } %>
</table>
</body>
Finance
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include commonHeadElements.html %>
</head>
60
<th>Nozzle No.</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in shiftDetails) { %>
<tr>
<td><%= shiftDetails[i].SUPERVISOR %></td>
<td><%= shiftDetails[i].ASSIGNED_TO %></td>
<td><%= shiftDetails[i].TYPE %></td>
<td><%= shiftDetails[i].NOZZLE_NUMBER %></td>
<td><%= shiftDetails[i].START_TIME %></td>
<td><%= shiftDetails[i].USER_ID %></td>
<td><%= shiftDetails[i].SALE %></td>
<td><%= shiftDetails[i].ID %></td>
<td><%= shiftDetails[i].MODE %></td>
<td><%= shiftDetails[i].AMOUNT %></td>
</tr>
<% } %>
</table>
<br>
<br>
<h2>Sale details according to nozzle number</h2>
<table border="5">
<tr>
<th>Supervisor Name</th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in saleDetails) { %>
<tr>
<td><%= saleDetails[i].FNAME %></td>
<td><%= saleDetails[i].TYPE %></td>
<td><%= saleDetails[i].NOZZLE_NUMBER %></td>
61
<td><%= saleDetails[i].ID %></td>
<td><%= saleDetails[i].MODE %></td>
<td><%= saleDetails[i].AMOUNT %></td>
</tr>
<% } %>
</table>
<br>
<br>
<h2>Sale details according to particular nozzle number</h2>
<table border="5">
<tr>
<th>Supervisor Name</th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in saleDetails1) { %>
<tr>
<td><%= saleDetails1[i].FNAME %></td>
<td><%= saleDetails1[i].TYPE %></td>
<td><%= saleDetails1[i].NOZZLE_NUMBER %></td>
</tr>
<% } %>
</table>
<br>
<br>
<h2>Sale details according to a specific supervisor</h2>
<table border="5">
<tr>
<th>Supervisor Name</th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
62
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in supervisorDetails) { %>
<tr>
<td><%= supervisorDetails[i].FNAME %></td>
<td><%= supervisorDetails[i].TYPE %></td>
<td><%= supervisorDetails[i].NOZZLE_NUMBER %></td>
</tr>
<% } %>
</table>
<br>
<br>
<h2>Sale details according to all supervisors</h2>
<table border="5">
<tr>
<th>Supervisor Name</th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in supervisorDetails1) { %>
<tr>
<td><%= supervisorDetails1[i].FNAME %></td>
<td><%= supervisorDetails1[i].TYPE %></td>
<td><%= supervisorDetails1[i].NOZZLE_NUMBER %></td>
</tr>
<% } %>
</table>
63
<br>
<br>
<h2>Sale details according to particular DSM</h2>
<table border="5">
<tr>
<th>Supervisor Name</th>
<th>ASSIGNED TO </th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in dsmDetails) { %>
<tr>
<td><%= dsmDetails[i].SUPERVISOR %></td>
<td><%= dsmDetails[i].DSM %></td>
<td><%= dsmDetails[i].TYPE %></td>
<td><%= dsmDetails[i].NOZZLE_NUMBER %></td>
</tr>
<% } %>
</table>
<br>
<br>
<h2>Sale details according to all DSM</h2>
<table border="5">
<tr>
<th>Supervisor Name</th>
<th>ASSIGNED TO </th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in dsmDetails1) { %>
64
<tr>
<td><%= dsmDetails1[i].SUPERVISOR %></td>
<td><%= dsmDetails1[i].DSM %></td>
<td><%= dsmDetails1[i].TYPE %></td>
<td><%= dsmDetails1[i].NOZZLE_NUMBER %></td>
</tr>
<% } %>
</table>
<br>
<br>
</div>
<% include commonFooterScriptElements.html %>
</body>
</html>
Footer
<div class="footer">
<div class="copyright">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<p class="copyright-space">
2018 © All Rights Reserved.
</p>
</div>
</div>
</div>
</div>
</div>
Fuel Receipt
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include newheader.html %>
</head>
65
<tr>
<th>TT No.</th>
<th>Invoice_No.</th>
<th>Invoice_Date</th>
<th>Invoice_Amount</th>
<th>Invoice_Quantity</th>
<th>Invoice_Tempeature</th>
<th>RO_Temperature</th>
<th>INVOICE_DENSITY</th>
<th>RO_COMPOSITE_DENSITY</th>
<th>TVA</th>
<th>SHORT_REPORT</th>
<th>FREIGHT_INVOICE_NO</th>
<th>FREIGHT_INVOICE_AMOUNT</th>
<th>TRANSPORT NAME</th>
</tr>
<% for(i in fuelDetails) { %>
<tr>
<td><%= fuelDetails[i].TT %></td>
<td><%= fuelDetails[i].INVOICE_NO %></td>
<td><%= fuelDetails[i].INVOICE_DATE %></td>
<td><%= fuelDetails[i].INVOICE_AMOUNT %></td>
<td><%= fuelDetails[i].INVOICE_QTY %></td>
<td><%= fuelDetails[i].INVOICE_TEMP %></td>
<td><%= fuelDetails[i].RO_TEMP %></td>
<td><%= fuelDetails[i].INVOICE_DENSITY %></td>
<td><%= fuelDetails[i].RO_COMPOSITE_DENSITY %></td>
<td><%= fuelDetails[i].TVA %></td>
<td><%= fuelDetails[i].SHORT_REPORT %></td>
<td><%= fuelDetails[i].FREIGHT_INVOICE_NO %></td>
<td><%= fuelDetails[i].FREIGHT_INVOICE_AMOUNT %></td>
<td><%= fuelDetails[i].NAME %></td>
<% } %>
</tr>
</table>
</body>
</html>
Gla
<HTML>
<BODY>
Data Inserted Successfully...!!!
</BODY>
</HTML>
Header
<div class="header-v6 header-classic-white header-sticky">
<div class="navbar mega-menu" role="navigation">
<div class="container">
<div class="menu-container">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-
target=".navbar-responsive-collapse">
<span class="sr-only">Toggle navigation</span>
66
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--[if IE 8]>
<html lang="en" class="ie8">
<![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9">
<![endif]-->
<!--[if !IE]>
<!--> <html lang="en">
<!--<![endif]-->
<head>
</head>
67
<body class="header-fixed header-fixed-space">
<h1>DashBoard</h1>
<p>
<table border="5">
<tr>
<td>Name</td>
</tr>
<tr>
<td>Address</td>
</tr>
<tr>
<td>Phone</td>
</tr>
<tr>
<td>Email</td>
</tr>
</table>
</p>
<p>
68
<h2>Today Product Sale
</h2>
<table border="5">
<th>Product
</th>
<th>Sale
</th>
<tr>
</tr>
<% } %>
</table>
</p>
<p>
<h2>
Current Quantity Left
</h2>
<table border="5">
<th>Product</th>
<th>Quantity Left</th>
<tr>
<td>
<%= quantityResult[i].QTY_LEFT %>
</td>
69
</tr>
<% } %>
</table>
</p>
<p>
<h2>Total Cash</h2>
<table border="5">
<th>CASH</th>
<tr>
<td>
</td>
</tr>
</table>
</p>
<p>
<table border="5">
<th>Balance</th>
<tr>
<td>
</td>
</tr>
</table>
</p>
70
<p>
<table border="5">
<th>Fleet Balance</th>
<tr>
<td>
</td>
</tr>
</table>
</p>
<p>
<table border="5">
<th>Shift STartTime</th>
<th>Shift EndTime</th>
<th>SuperVisor</th>
<tr>
</tr>
</table>
</p>
<p>
<table border="5">
<th>DSM</th>
71
<th>Nozzle Number</th>
<th>Opening Reading</th>
<tr>
</tr>
<% } %>
</table>
</p>
</div>
</body>
</html>
I collection mode
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
<style>
input[type=text]{
width: 60%;
}
</style>
</head>
<body>
<% if(currentUser) {%>
<p align="center">
<h2 align="center">Available collection mode</h2>
<table align="center" class="table table-striped" style="width: 50%;">
<th>Mode</th>
72
</tr>
<% } %>
</table>
</p>
<p align="right">
<label for="mode"><b>Mode</b></label>
<input type="text" class="form-control" placeholder="Enter New collection
Mode" name="mode" required>
<br>
<br>
<button class="formbutton" type="submit" name="tid" value="1
1">Add</button>
<button class="cancelbtn"
onclick="document.getElementById('addmode').style.display='none'">Cancel</button>
</div>
</form>
</div>
<script type="text/javascript">
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
I credit
<!DOCTYPE html>
<html>
73
<head>
<% include newheader.html %>
<style>
input[type=text]{
width: 60%;
}
</style>
</head>
<body>
<% if(currentUser) {%>
<p align="center">
<h2 align="center">Available credit details</h2>
<table align="center" class="table table-striped">
<th>NAME</th>
<th>ADDRESS</th>
<th>PHONE</th>
<th>BALANCE</th>
<th>ACTIVE</th>>
<th>CHANGE</th>
<th>DELETE</th>
<% for(i in creditDetail) { %>
<tr>
<td><%= creditDetail[i].NAME %></td>
<td><%= creditDetail[i].ADDRESS %></td>
<td><%= creditDetail[i].PHONE %></td>
<td><%= creditDetail[i].BALANCE%></td>
<% if (creditDetail[i].ACTIVE==1) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
<td><button data-cap='<%= creditDetail[i].ID %>' class='editbtn'
id="btn-<%=creditDetail[i].ID%>" value="<%= i %>" >EDIT</td>
<% if (ScheduleResult[i].ACTIVE==1) { %>
<td><form action="/app/icredit" method="POST"><button
name="cid" value="<%= '3 0 '+creditDetail[i].ID %>">Delete</button></form>
</td>
<% } else { %>
<td><form action="/app/icredit" method="POST"><button
name="cid" value="<%= '3 1 '+creditDetail[i].ID %>">Undo</button></form>
</td>
<% } %>
</tr>
<% } %>
</table>
</p>
<p align="right">
74
<form action="icredit" class="modal-content animate" method="post">
<div class="imgcontainer">
<img src="img_avatar2.png" alt="Add Credit" class="avatar">
</div>
<label for="name"><b>Name</b></label>
<input type="text" placeholder="Enter NAME" name="name" class="form-
control" required>
<br>
<label for="address"><b>Address</b></label>
<input type="text" placeholder="Enter NAME" name="address" class="form-
control" required>
<br>
<label for="balance"><b>balance</b></label>
<input type="text" placeholder="Enter balance" name="balance"
class="form-control" required>
<br>
</div>
</form>
</div>
<label for="address"><b>Address</b></label>
75
<input type="text" placeholder="Enter NAME" name="address"
class="form-control" required>
<br>
<label for="balance"><b>balance</b></label>
<input type="text" placeholder="Enter balance" name="balance"
class="form-control" required>
<br>
</div>
</form>
</div>
<script type="text/javascript">
var editbtn = document.querySelectorAll('.editbtn');
var b;
console.log(editbtn);
for(var i=0;i<editbtn.length;++i){
editbtn[i].addEventListener('click',function(event){
a = document.querySelector('#editcredit button[name=cid]').value='2
'+event.target.getAttribute('data-cap');
console.log(a);
document.getElementById('editcredit').style.display='block';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addcredit input[name=name]').value='';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#editcredit input[name=name]').value='';
});
}
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
76
</body>
</html>
Idash
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: "Lato", sans-serif;
transition: background-color .5s;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}
.sidenav a:hover {
color: #f1f1f1;
}
.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
#main {
transition: margin-left .5s;
padding: 16px;
}
77
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
#main {
overflow: auto;
background-color: #333;
}
#main a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
#main a:hover {
background-color: #ddd;
color: black;
}
#main a.active {
background-color: #4CAF50;
color: white;
}
.dropbtn {
background-color: #333;
color: white;
padding: 16px;
font-size: 16px;
border: none;
width: 302px;
height: 84px;
}
.dropdown {
position: relative;
display: inline-block;
float: right;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
width: 300px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
78
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
</body>
</html>
I dashboard
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form action="gla" autocomplete="on">
PetrolPump Name <input type="text" name="Name" placeholder="Name"><br>
Address <input type="text" name="Address" placeholder="Address"><br>
City <input type="text" name="City" placeholder="City"><br>
Pincode <input type="text" name="Pincode" placeholder="Pincode"><br>
Registration <input type="text" name="Registration" placeholder="Registration"><br>
E-mail <input type="text" name="mail" placeholder="mail"><br>
Phone <input type="text" name="Phone" placeholder="Phone"><br>
State <input type="text" name="State" placeholder="State"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
Iemployee
<!DOCTYPE html>
<html>
<head>
<style>
input[type=text],input[type=password],input[type=number],input[type=tel],input[type=e
mail]{
width: 60%;
}
input[type=file]{
width: 35%;
}
</style>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
79
$(document).ready(function(){
$('#other').hide();
$('#sel').change(function() {
var selected = $(this).val();
if(selected == 'Other'){
$('#other').show();
$('#sel').attr('name','abc');
$('#other').attr('name','TYPE');
}
else{
$('#other').hide();
$('#sel').attr('name','TYPE');
$('#other').attr('name','abc');
}
});
/*
$('.formbutton').click(function(){
$('#other').show();
});
*/
});
</script>
<% include newheader.html %>
</head>
<body>
<% if(currentUser) {%>
<form action="/app/iemployee" method="get">
<p align="center">
<label for="etype" class="filterlabel">Filter By employee Role</label>
<select name="etype" id="myInput">
<% if(tt=='All') { %>
<option value="All" selected="selected">All</option>
<% } else { %>
<option value="All">All</option>
<% } %>
<p align="center">
80
<h2 align="center">Available Employees</h2>
<table align="center" id="myTable" class="table table-striped">
<th>Profile Pic</th>
<th>Fname</th>
<th>Lname</th>
<th>Role</th>
<th>Address</th>
<th>Phone</th>
<th>Email</th>
<th>Adhaar</th>
<th>Active</th>
<th>Change</th>
<th>Delete</th>
<% for(i in employeeResult) { %>
<tr>
<td><img src="<%= '/static/uploads/'+employeeResult[i].PIC %>"
alt="No Image" width="40" height="40"></td>
<td><%= employeeResult[i].FNAME %></td>
<td><%= employeeResult[i].LNAME %></td>
<td><%= employeeResult[i].TYPE %></td>
<td><%= employeeResult[i].ADDRESS %></td>
<td><%= employeeResult[i].PHONE %></td>
<td><%= employeeResult[i].EMAIL %></td>
<td><%= employeeResult[i].ADHAAR %></td>
<% if (employeeResult[i].ACTIVE==1) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
<td><button data-cap='<%= employeeResult[i].ID %>' class='editbtn'
id="btn-<%=employeeResult[i].ID%>" value="<%= i %>" >EDIT</td>
</tr>
<% } %>
</table>
</p>
<p align="right">
<button onclick="document.getElementById('addemployee').style.display='block'">+
Add Employee</button>
81
</p>
<div id="addemployee" class="modal">
<form action="iemployee" class="modal-content animate" method="post"
enctype="multipart/form-data">
<label for="type"><b>Role</b></label>
<div class="form-group">
<select name="TYPE" id="sel" class="form-control" style="width:
50%;">
<% for(i in employeeRole) {%>
<option value="<%= employeeRole[i].TYPE%>"><%=
employeeRole[i].TYPE %></option>
<% } %>
<option value="Other">Other</option>
</select>
</div>
<input id="other" type="text" name="abc"
placeholder="Designation" class="form-control" />
<br>
<label for="ADDRESS"><b>Address</b></label>
<input type="text" placeholder="Enter Address" name="ADDRESS"
class="form-control" required>
<br>
<label for="PHONE"><b>Phone</b></label>
<input type="tel" placeholder="Enter Phone Number" name="PHONE"
class="form-control" required>
<br>
<label for="EMAIL"><b>Email</b></label>
<input type="email" placeholder="Enter email" name="EMAIL"
class="form-control" required>
<br>
<label for="ADHAAR"><b>Adhaar</b></label>
<input type="number" placeholder="Enter Adhaar" name="ADHAAR"
class="form-control" required>
<br>
82
<label for="pwd"><b>Password</b></label>
<input type="password" name="pwd" class="form-control" required>
<br>
</div>
</form>
</div>
<label for="type"><b>Role</b></label>
<div class="form-group">
<select name="TYPE" id="sel" class="form-control" style="width:
50%;">
<% for(i in employeeRole) {%>
<option value="<%= employeeRole[i].TYPE%>"><%=
employeeRole[i].TYPE %></option>
<% } %>
<option value="Other">Other</option>
</select>
</div>
<label for="ADDRESS"><b>Address</b></label>
<input type="text" placeholder="Enter Address" name="ADDRESS"
class="form-control" required>
83
<br>
<label for="PHONE"><b>Phone</b></label>
<input type="tel" placeholder="Enter Phone Number" name="PHONE"
class="form-control" required>
<br>
<label for="EMAIL"><b>Email</b></label>
<input type="email" placeholder="Enter email" name="EMAIL"
class="form-control" required>
<br>
<label for="ADHAAR"><b>Adhaar</b></label>
<input type="number" placeholder="Enter Adhaar" name="ADHAAR"
class="form-control" required>
<br>
<label for="pwd"><b>Password</b></label>
<input type="password" name="pwd" class="form-control" required>
<br>
</div>
</form>
</div>
<script type="text/javascript">
var editbtn = document.querySelectorAll('.editbtn');
var b;
console.log(editbtn);
for(var i=0;i<editbtn.length;++i){
editbtn[i].addEventListener('click',function(event){
a = document.querySelector('#editemployee
button[name=act]').value='2 '+event.target.getAttribute('data-cap');
console.log(a);
document.getElementById('editemployee').style.display='block';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addemployee
input[name=pwd]').value='';
});
84
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#editemployee
input[name=pwd]').value='';
});
}
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Ifinance
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
</head>
<body>
<% if(currentUser) {%>
<form action="ifinance" method="get">
<p align="center" >
<label for="from">FROM</label>
<input type="date" name="from">
<label for="to">TO</label>
<input type="date" name="to">
<br>
<% if(f1) { %>
<input type="checkbox" name="f1" value="1" checked>
<% } else { %>
<input type="checkbox" name="f1" value="1">
<% } %>
<label for="f1">Nozzle-Wise</label>
<select name="nozzle">
<% for(i in nozzleCountResult) { %>
<% if(nozzle==nozzleCountResult[i].NOZZLE_NUMBER) { %>
<option value="<%= nozzleCountResult[i].NOZZLE_NUMBER %>"
selected="selected"><%= nozzleCountResult[i].NOZZLE_NUMBER %></option>
<% } else { %>
<option value="<%= nozzleCountResult[i].NOZZLE_NUMBER %>"><%=
nozzleCountResult[i].NOZZLE_NUMBER %></option>
<% } %>
<% } %>
</select>
<br>
<% if(f2) { %>
<input type="checkbox" name="f2" value="1" checked>
<% } else { %>
<input type="checkbox" name="f2" value="1">
<% } %>
85
<label for="f2">Supervisor-Wise</label>
<select name="supervisor">
<% for(i in availablePersonResult) { %>
<% if(availablePersonResult[i].TYPE=='SUPERVISOR') { %>
<% if(supervisor==availablePersonResult[i].FNAME) {%>
<option value="<%= availablePersonResult[i].FNAME %>"
selected="selected"><%= availablePersonResult[i].FNAME %></option>
<% } else { %>
<option value="<%= availablePersonResult[i].FNAME %>"><%=
availablePersonResult[i].FNAME %></option>
<% } %>
<% } %>
<% } %>
</select>
<br>
86
<br>
<% if(f5) { %>
<input type="checkbox" name="f5" value="1" checked>
<% } else { %>
<input type="checkbox" name="f5" value="1">
<% } %>
<label for="f5">Fuel Type-Wise</label>
<select name="type">
<% for(i in tankType) { %>
<% if(type==tankType[i].TYPE) {%>
<option value="<%= tankType[i].TYPE %>" selected="selected"><%=
tankType[i].TYPE %></option>
<% } else { %>
<option value="<%= tankType[i].TYPE %>"><%= tankType[i].TYPE
%></option>
<% } %>
<% } %>
</select>
<br>
<button type="submit">Filter</button>
</p>
<table border="5" align="center">
<tr>
<th>Supervisor Name</th>
<th>ASSIGNED TO </th>
<th>Type of product</th>
<th>Nozzle number</th>
<th>Shift Start_Time</th>
<th>User_ID</th>
<th>Sales</th>
<th>Shift_Collection_ID</th>
<th>Mode</th>
<th>Amount</th>
</tr>
<% for(i in dsmDetails1) { %>
<% if((f1=='1' && dsmDetails1[i].NOZZLE_NUMBER==nozzle) ||
f1==undefined) { %>
<% if((f2=='1' && dsmDetails1[i].SUPERVISOR==supervisor) || f2==undefined)
{ %>
<% if((f3=='1' && dsmDetails1[i].DSM==dsm) || f3==undefined){ %>
<% if((f4=='1' && dsmDetails1[i].MODE==mode) || f4==undefined){ %>
<% if((f5=='1' && dsmDetails1[i].TYPE==type) || f5==undefined){ %>
<tr>
<td><%= dsmDetails1[i].SUPERVISOR %></td>
<td><%= dsmDetails1[i].DSM %></td>
<td><%= dsmDetails1[i].TYPE %></td>
<td><%= dsmDetails1[i].NOZZLE_NUMBER %></td>
<td><%= dsmDetails1[i].START_TIME.toString().substring(0,24) %></td>
<td><%= dsmDetails1[i].USER_ID %></td>
<td><%= dsmDetails1[i].SALE %></td>
<td><%= dsmDetails1[i].ID %></td>
<td><%= dsmDetails1[i].MODE %></td>
<td><%= dsmDetails1[i].AMOUNT %></td>
87
</tr>
<% } %>
<% } %>
<% } %>
<% } %>
<% } %>
<% } %>
</table>
</form>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Inozzle
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
<style>
input[type=text]{
width: 60%;
}
</style>
</head>
<body>
<% if(currentUser) {%>
<form action="inozzle" method="get">
<p align="center">
<label for="ntype" class="filterlabel">Filter By Tank</label>
<select name="ntype" class="form-control" >
<% if(ntype=='All') {%>
<option value="All" selected="selected" class="form-control" >All</option>
<% } else { %>
<option value="All" class="form-control" >All</option>
<% } %>
</select>
<button type="submit">Filter</button>
</p>
</form>
88
<p align="center">
<h2 align="center">Available Nozzles</h2>
<table align="center" class="table table-striped" >
<th>Nozzle Number</th>
<th>Type</th>
<th>ACTIVE</th>
<th>Change</th>
<th>Delete</th>
<% for(i in nozzleDetails) { %>
<tr>
<td><%= nozzleDetails[i].NOZZLE_NUMBER %></td>
<td><%= nozzleDetails[i].TYPE %></td>
<% if (nozzleDetails[i].ACTIVE==1) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
<td><button data-cap='<%= nozzleDetails[i].ID %>' class='editbtn'
id="btn-<%=nozzleDetails[i].ID%>" value="<%= i %>" >EDIT</td>
<% if (nozzleDetails[i].ACTIVE==1) { %>
<td><form action="/app/inozzle" method="POST"><button
name="act" value="<%= '3 0 '+nozzleDetails[i].ID %>">Delete</button></form>
</td>
<% } else { %>
<td><form action="/app/inozzle" method="POST"><button
name="act" value="<%= '3 1 '+nozzleDetails[i].ID %>">Undo</button></form>
</td>
<% } %>
</tr>
<% } %>
</table>
</p>
<p align="right">
<label for="name"><b>Number</b></label>
<input type="text" class="form-control" placeholder="Enter Nozzle Number"
name="nno" value="<%= (parseInt(nozzleDetails.length)+1) %>"required>
<br>
<label for="type"><b>Nozzle Type</b></label>
<% for(i in tankTypes) {%>
<input type="radio" class="form-control" name="ntype" value="<%=
tankTypes[i].TYPE %>"><%= tankTypes[i].TYPE %>
<% } %>
89
<br>
<button class="formbutton" type="submit" name="act" value="1
1">Add</button>
<button class="cancelbtn"
onclick="document.getElementById('addnozzle').style.display='none'">Cancel</button>
</div>
</form>
</div>
<div id="editnozzle" class="modal">
<form action="inozzle" class="modal-content animate" method="post">
<p align="center">
<label for="name"><b>Number</b></label>
<input type="text" class="form-control" placeholder="Enter Nozzle
Number" name="nno" value="" required/>
<br>
</p>
</form>
</div>
<script type="text/javascript">
var editbtn = document.querySelectorAll('.editbtn');
var b;
console.log(editbtn);
for(var i=0;i<editbtn.length;++i){
editbtn[i].addEventListener('click',function(event){
a = document.querySelector('#editnozzle button[name=act]').value='2
'+event.target.getAttribute('data-cap');
console.log(a);
document.getElementById('editnozzle').style.display='block';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addnozzle input[name=nno]').value='';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
90
document.querySelector('#editnozzle input[name=ntype]').value='';
});
}
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Iproduct
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
<style>
input[type=text],input[type=number]{
width: 50%;
}
</style>
</head>
<body>
<% if(currentUser) {%>
<form action="iproduct" method="get">
<p align="center">
<label for="ptype" class="filterlabel">Filter By Product Type</label>
<select name="ptype" class="form-control" style="width: 50%;">
<% if(ptype=='All') {%>
<option value="All" class="form-control" selected="selected">All</option>
<% } else { %>
<option class="form-control" value="All">All</option>
<% } %>
91
<% for(i in productname) { %>
<% if(pname==productname[i].NAME) { %>
<option value="<%= productname[i].NAME %>" class="form-control"
selected="selected"><%= productname[i].NAME %></option>
<% } else { %>
<option value="<%= productname[i].NAME %>" class="form-control" ><
%= productname[i].NAME %></option>
<% } %>
<% } %>
</select>
<button type="submit" name="act" value="0 1">Filter</button>
</p>
</form>
<p align="center">
<h2 align="center">Available Products</h2>
<table align="center" class="table table-striped" >
<th>Name</th>
<th>Type</th>
<th>Price</th>
<th>Quantity</th>
<th>Change</th>
<th>Delete</th>
<th>working</th>
92
<td>NO</td>
<% } %>
</tr>
<% } %>
</table>
</p>
<p align="right">
<label for="name"><b>Name</b></label>
<input type="text" class="form-control" placeholder="Enter Product Name"
name="name" required>
<br>
<label for="type"><b>Product Type</b></label>
<input type="radio" class="form-control" name="type" value="0">Non-
Fuel
<input type="radio" class="form-control" name="type" value="1">Fuel
<br>
<label for="price"><b>Price</b></label>
<input type="text" class="form-control" name="price" placeholder="Enter
Price">
<br>
<label for="qty"><b>Quantity</b></label>
<input type="number" class="form-control" name="qty">
<br>
<button class="formbutton" type="submit" name="act" value="0
4">Add</button>
<button class="cancelbtn"
onclick="document.getElementById('addproduct').style.display='none'">Cancel</button
>
</div>
</form>
</div>
93
</div>
</div>
</form>
</div>
<script type="text/javascript">
var editbtn = document.querySelectorAll('.editbtn');
var b;
console.log(editbtn);
for(var i=0;i<editbtn.length;++i){
editbtn[i].addEventListener('click',function(event){
a = document.querySelector('#editproduct
button[name=act]').value='2 '+event.target.getAttribute('data-cap');
console.log(a);
document.getElementById('editproduct').style.display='block';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addproduct
input[name=price]').value='';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
94
document.querySelector('#editproduct
input[name=price]').value='';
});
}
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Ischedule
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
<style>
input[type=text],input[type=number]{
width: 60%;
}
</style>
</head>
<body>
<% if(currentUser) {%>
<p align="center">
<h2 align="center">Available Schedule</h2>
<table align="center" class="table table-striped">
<th>Starttime</th>
<th>Endtime</th>
<th>Shift type</th>
<th>Supervisor_id</th>
<th>First name</th>
<th>Last name</th>
<th>Active</th>
<th>Delete</th>
<th>Change</th>
<% for(i in ScheduleResult) { %>
<tr>
<td><%= ScheduleResult[i].STARTTIME.toString().substring(16,24)
%></td>
<td><%= ScheduleResult[i].ENDTIME.toString().substring(16,24)
%></td>
<td><%= ScheduleResult[i].SHIFT_TYPE %></td>
<td><%= ScheduleResult[i].SID %></td>
<td><%= ScheduleResult[i].FNAME %></td>
<td><%= ScheduleResult[i].LNAME %></td>
<% if (ScheduleResult[i].ACTIVE==1) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
95
<td><button data-cap='<%= ScheduleResult[i].ID %>' class='editbtn'
id="btn-<%=ScheduleResult[i].ID%>" value="<%= i %>" >EDIT</td>
<% if (ScheduleResult[i].ACTIVE==1) { %>
<td><form action="/app/ischedule" method="POST"><button
name="scid" value="<%= '3 0 '+ScheduleResult[i].ID %>">Delete</button></form>
</td>
<% } else { %>
<td><form action="/app/ischedule" method="POST"><button
name="scid" value="<%= '3 1 '+ScheduleResult[i].ID %>">Undo</button></form>
</td>
<% } %>
</tr>
<% } %>
</table>
</p>
<p align="right">
96
<button class="formbutton" type="submit" name="scid" value="<%= '1 1'
%>">Add</button>
<button class="cancelbtn"
onclick="document.getElementById('addschedule').style.display='none'">Cancel</button
>
</form>
</div>
</div>
<label for="sid"><b>Type</b></label>
<div class="form-group">
<select name="sid" class="form-control" style="width:50%;">
<% for(i in availableSupervisorResult) { %>
<option value="<%= availableSupervisorResult[i].ID %>"><
%= availableSupervisorResult[i].FNAME %></option>
<% } %>
</select>
</div>
<br>
</div>
</form>
</div>
<script type="text/javascript">
97
var editbtn = document.querySelectorAll('.editbtn');
var b;
console.log(editbtn);
for(var i=0;i<editbtn.length;++i){
editbtn[i].addEventListener('click',function(event){
a = document.querySelector('#editschedule
button[name=scid]').value='2 '+event.target.getAttribute('data-cap');
console.log(a);
document.getElementById('editschedule').style.display='block';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addschedule
input[name=starttime]').value='';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#editschedule
input[name=starttime]').value='';
});
}
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Ishift
<!DOCTYPE html>
<html>
<head>
<style>
tr.hover {
cursor: pointer;
/* whatever other hover styles you want */
}
input[type=text],input[type=number],input[type=date]{
width: 60%;
}
</style>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('.fuelreceipt').hide();
$('.fuelreceived').change(function(){
if($(this).is(':checked')){
$('.fuelreceipt').show();
98
}
else{
$('.fuelreceipt').hide();
}
});
$('.shift').click(function(){
window.location=$(this).find('a').attr('href');
}).hover(function(){
$(this).toggleClass('hover');
});
});
</script>
<% include newheader.html %>
<style>
/* Set height of body and the document to 100% to enable "full page tabs" */
body, html {
height: 100%;
margin: 0;
font-family: Arial;
}
.tablink:hover {
background-color: #777;
}
/* Style the tab content (and add height:100% for full page content) */
.tabcontent {
color: white;
display: none;
padding: 100px 20px;
height: 100%;
}
99
/* Full-width inputs */
input[type=text], input[type=password] ,select{
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
option{
color: red;
font-weight:400;
font-size: 15px;
}
table {
border-collapse: collapse;
width: 50%;
}
th, td {
text-align: center;
padding: 8px;
font-weight: bold;
color: black;
100
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #4CAF50;
color: white;
}
label{
color: darkgreen;
font-weight: bold;
font-style: italic;
}
</style>
<script>
// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
function openPage(pageName, elmnt, color) {
// Hide all elements with class="tabcontent" by default */
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Add the specific color to the button used to open the tab content
elmnt.style.backgroundColor = color;
}
</script>
</head>
<body>
<% if(currentUser) {%>
<button class="tablink" onclick="openPage('Home', this, 'red')">Create
Shift</button>
<button class="tablink" onclick="openPage('News', this, 'blue')"
id="defaultOpen">View Shift</button>
<button class="tablink" onclick="openPage('About', this, 'orange')">End
Shift</button>
<div class="nav nav-tabs">
<div id="Home" class="tabcontent">
<h3 align="center" >Create Shift</h3>
101
<% if(availableShiftResult.length==0) { %>
<h2 align="center" >No More Shifts To Create</h2>
<% } else { %>
<form action="ishift" method="post">
<p align="center" >
<label for="stype">Available Shifts</label>
<select name="stype" class="form-control" style="width:50%;">
<% for(i in availableShiftResult) { %>
<option value="<%= availableShiftResult[i].ID %>"><%=
availableShiftResult[i].SHIFT_TYPE+'-'+
(availableShiftResult[i].STARTTIME).toString().substring(0,24) %></option>
<% } %>
</select>
<br>
<label for="supervisor">Supervisor</label>
<select name="supervisor" class="form-control" style="width:50%;">
<% for(i in availableSupervisorResult){ %>
<% if((availableSupervisorResult[i].TYPE).toString()=='SUPERVISOR')
{ %>
<option value="<%= availableSupervisorResult[i].ID %>"><%=
availableSupervisorResult[i].FNAME+' '+availableSupervisorResult[i].LNAME
%></option>
<% } %>
<% } %>
</select>
<br>
</p>
<table border="5" align="center" class="table table-striped" >
<th>Nozzle Number</th>
<th>DSM</th>
<th>Analog Opening Reading</th>
<th>Digital Opening Reading</th>
<% for(i in availableNozzleResult) { %>
<tr>
<td><input type="text" name="" value="<%=
availableNozzleResult[i].NOZZLE_NUMBER %>" disabled></td>
<td><select name="<%= 'user'+i %>" class="form-control" >
<% for(j in availableSupervisorResult) { %>
<% if((availableSupervisorResult[j].TYPE).toString()=='DSM') { %>
<option value="<%= availableSupervisorResult[j].ID %>"><%=
availableSupervisorResult[j].FNAME+' '+availableSupervisorResult[j].LNAME
%></option>
<% } %>
<% } %>
</select></td>
<td><input type="text" name="<%= 'aor'+i %>" value="<%=
availableNozzleResult[i].AOR %>" class="form-control" ></td>
<td><input type="text" name="<%= 'dor'+i %>" value="<%=
availableNozzleResult[i].DOR %>" class="form-control" ></td>
</tr>
<% } %>
102
</table>
<table border="5" align="center" class="table table-striped" >
<tr>
<th>Tank Type</th>
<th>Opening Reading</th>
</tr>
<% for(i in tanksResult){ %>
<tr>
<td>
<input type="text" name="<%= 'ty'+i %>" value="<%=
tanksResult[i].TYPE %>" class="form-control" >
</td>
<td>
<input type="text" name="<%= 'cr'+i %>" value="<%=
tanksResult[i].CLOSE_READING %>" class="form-control" >
</td>
</tr>
<% } %>
</table>
<p align="center" >
<button type="submit" name="act" value="<%= '1
'+availableNozzleResult.length+' '+tanksResult.length %>">Add Shift</button>
</p>
</form>
<% } %>
</div>
103
<input type="checkbox" name="countactive" value="1" checked="checked"
class="form-control" >
<% } else {%>
<input type="checkbox" name="countactive" value="1" class="form-control"
>
<% } %>
<tr class='shift'>
<td><a href="<%= '/app/report?sid='+viewShiftResult[i].ID %>"></a><%=
(viewShiftResult[i].START_TIME).toString().substring(0,15) %></a></td>
<td><%= (viewShiftResult[i].START_TIME).toString().substring(16,24)
%></td>
<td><%= (viewShiftResult[i].END_TIME).toString().substring(16,24)
%></td>
<td><%= viewShiftResult[i].FNAME+' '+viewShiftResult[i].LNAME
%></td>
</tr>
<% } %>
</table>
</div>
104
<th>Digital Opening Reading</th>
<th>Digital Closing Reading</th>
<th>Pump Test</th>
<th>Self</th>
<% for(i in endShiftResult) { %>
<tr>
<td><input type="text" class="form-control" name="nozzle" value="<
%= availableNozzleResult[i].NOZZLE_NUMBER %>" disabled></td>
<td><input type="text" class="form-control" value="<%=
endShiftResult[i].FNAME+' '+endShiftResult[i].LNAME %>" disabled ></td>
<td><input type="text" class="form-control" value="<%=
endShiftResult[i].AOR %>" disabled></td>
<td><input type="text" class="form-control" name="<%= 'acr'+i
%>"></td>
<td><input type="text" class="form-control" value="<%=
endShiftResult[i].DOR %>" disabled></td>
<td><input type="text" class="form-control" name="<%= 'dcr'+i
%>"></td>
<td><input type="text" class="form-control" name="<%= 'pt'+i
%>"></td>
<td><input type="text" class="form-control" name="<%= 'self'+i
%>"></td>
</tr>
<% } %>
</table>
<br><br><br>
<table border="5" align="center" class="table table-striped" >
<th>Nozzle Number</th>
<th>Collection Mode</th>
<th>Amount</th>
<% for(i in availableNozzleResult) { %>
<% for(j in paymentModes) { %>
<tr>
<td><input type="text" class="form-control" name="" value="<%=
availableNozzleResult[i].NOZZLE_NUMBER %>" disabled></td>
<td><input type="text" class="form-control" name="" value="<%=
paymentModes[j].MODE %>" disabled></td>
<td><input type="text" class="form-control" name="<%= 'amt'+i+' '+j
%>"></td>
</tr>
<% } %>
<% } %>
</table>
<table border="5" align="center" class="table table-striped" >
<tr>
<th>TYPE</th>
<th>OPENING READING</th>
<th>CLOSING READING</th>
</tr>
<% for(i in tanksResult) {%>
<tr>
<td>
105
<input type="text" class="form-control" name="<%= 'ty'+i %>" value="<
%= tanksResult1[i].TYPE %>" disabled>
</td>
<td>
<input type="text" class="form-control" name="<%= 'or'+i %>" value="<
%= tanksResult1[i].OPEN_READING %>" disabled>
</td>
<td>
<input type="text" class="form-control" name="<%= 'cr'+i %>">
</td>
</tr>
<% } %>
</table>
<p align="center">
<input type="checkbox" class="form-control" name="fuelreceived"
class="fuelreceived">
<label for="fuel">Fuel Received</label>
</p>
<div class="fuelreceipt">
<table border="5" align="center" class="table table-striped" >
<th>Entry Type</th>
<th>Entry</th>
<tr>
<td>TT No.</td>
<td>
<input type="text" class="form-control" name="ttno" />
</td>
</tr>
<tr>
<td>Transport</td>
<td>
<select name="transport">
<% for(i in transports) {%>
<option value="<%= transports[i].ID %>" class="form-control" ><%=
transports[i].NAME %></option>
<% } %>
</select>
</td>
</tr>
<tr>
<td>Product</td>
<td>
<select name="product">
<% for(i in fuels) { %>
<option value="<%= fuels[i].ID %>" class="form-control" ><%=
fuels[i].TYPE %></option>
<% } %>
</select>
</td>
</tr>
<tr>
<td>Invoice No.</td>
<td>
106
<input type="text" name="invoiceno" class="form-control" >
</td>
</tr>
<tr>
<td>Invoice Date</td>
<td>
<input type="date" name="invoicedate" class="form-control" />
</td>
</tr>
<tr>
<td>Invoice Amount</td>
<td>
<input type="text" name="invoiceamount" class="form-control" />
</td>
</tr>
<tr>
<td>Invoice Quantity</td>
<td>
<input type="text" name="invoiceqty" class="form-control" />
</td>
</tr>
<tr>
<td>Invoice Temp</td>
<td>
<input type="text" name="invoicetemp" class="form-control" />
</td>
</tr>
<tr>
<td>RO Temp</td>
<td>
<input type="text" name="rotemp" class="form-control" />
</td>
</tr>
<tr>
<td>Invoice Density</td>
<td>
<input type="text" name="invoicedensity" class="form-control" />
</td>
</tr>
<tr>
<td>RO Composite Density</td>
<td>
<input type="text" name="rodensity" class="form-control" />
</td>
</tr>
<tr>
<td>TVA</td>
<td>
<input type="text" name="tva" class="form-control" />
</td>
</tr>
<tr>
<td>Short Transport Report</td>
107
<td>
<input type="text" name="short" class="form-control" />
</td>
</tr>
<tr>
<td>Freight Invoice No.</td>
<td>
<input type="text" name="finvoiceno" class="form-control" />
</td>
</tr>
<tr>
<td>Freight Invoice Amount</td>
<td>
<input type="text" name="finvoiceamount" class="form-control" />
</td>
</tr>
</table>
</div>
<p align="center" >
<button type="submit" name="act" class="form-control" value="<%= '2
'+endShiftResult.length+' '+endShiftResult[0].SHIFT_ID+' '+paymentModes.length
%>">End Shift</button>
</p>
</form>
<% } %>
</div>
</div>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Itank
<!DOCTYPE html>
<html>
<head>
<% include newheader.html %>
</head>
<body>
<% if(currentUser) {%>
<form action="itank" method="get">
<p align="center">
<label for="type" class="filterlabel">Filter By Tank Type</label>
<select name="ttype">
<% if((!ttype) || ttype=='All') {%>
<option value="All" selected="selected">All</option>
<% } else {%>
<option value="All">All</option>
<% } %>
<% for(i in tankType) {%>
<% if(ttype==tankType[i].TYPE) {%>
<option value="<%= tankType[i].TYPE%>" selected="selected"><%=
tankType[i].TYPE %></option>
108
<% } else {%>
<option value="<%= tankType[i].TYPE%>"><%= tankType[i].TYPE
%></option>
<% } %>
<% } %></option>
</select>
<button type="submit">Filter</button>
</p>
</form>
<p align="center">
<h2 align="center">Available Tanks</h2>
<table align="center" align="center" class="table table-striped">
<th>Capacity</th>
<th>Type</th>
<th>Working</th>
<th>Change</th>
<th>Delete</th>
<% for(i in DetailtankResult) { %>
<tr>
<td><%= DetailtankResult[i].CAPACITY %></td>
<td><%= DetailtankResult[i].TYPE %></td>
<% if (DetailtankResult[i].ACTIVE==1) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
<td><button data-cap='<%= DetailtankResult[i].ID %>' class='editbtn'
id="btn-<%=DetailtankResult[i].ID%>" value="<%= i %>" >EDIT</button></td>
<% if (DetailtankResult[i].ACTIVE==1) { %>
<td><form action="/app/itank" method="POST"><button
name="tid" value="<%= '3 0 '+DetailtankResult[i].ID %>">Delete</button></form>
</td>
<% } else { %>
<td><form action="/app/itank" method="POST"><button
name="tid" value="<%= '3 1 '+DetailtankResult[i].ID %>">Undo</button></form>
</td>
<% } %>
</tr>
<% } %>
</table>
</p>
<p align="right">
109
<div class="container" align="center">
<div class="form-group">
<label for="capacity"><b>Capacity</b></label><br>
<input type="text" placeholder="Enter Capacity" name="capacity"
class="form-control" style="width: 60%;" required>
</div>
<br>
<label for="type"><b>Type</b></label>
<div class="form-group">
<select name="type" class="form-control" style="width:50%;">
<option value="HSD">Diesel</option>
<option value="MS">Petrol</option>
</select>
</div>
<br>
<button class="formbutton" type="submit" name="tid" value="1
1">Add</button>
<button class="cancelbtn"
onclick="document.getElementById('addtank').style.display='none'">Cancel</button>
</div>
</form>
</div>
110
<button class="cancelbtn"
onclick="document.getElementById('edittank').style.display='none'">Cancel</button>
</div>
</form>
</div>
<script type="text/javascript">
var editbtn = document.querySelectorAll('.editbtn');
var b;
console.log(editbtn);
for(var i=0;i<editbtn.length;++i){
editbtn[i].addEventListener('click',function(event){
a = document.querySelector('#edittank button[name=tid]').value='2
'+event.target.getAttribute('data-cap');
console.log(a);
document.getElementById('edittank').style.display='block';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addtank
input[name=capacity]').value='';
});
}
var cancelbtn = document.querySelectorAll('.cancelbtn');
for(var i=0;i<cancelbtn.length;++i){
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#edittank
input[name=capacity]').value='';
});
}
</script>
<% } else { %>
<h2>Login First</h2>
<% } %>
</body>
</html>
Login
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
111
box-sizing: border-box;
}
button:hover {
opacity: 0.8;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
112
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
113
}
.cancelbtn {
width: 100%;
}
}
.msg{
text-align: center;
color:#FFFFFF;
background-color: #008000;
float: center;
}
</style>
</head>
<body>
<!--
<button onclick="document.getElementById('id01').style.display='block'"
style="width:auto;">Login</button>
-->
<div id="id01" >
<% if(msg) {%>
<label class="msg"><b><%= msg %></b></label>
<% } %>
<form class="modal-content animate" action="/app/getpage" method="post" >
<div class="imgcontainer">
<span onclick="document.getElementById('id01').style.display='none'" class="close"
title="Close Modal">×</span>
<img src="/static/uploads/loginphoto.jpg" alt="User Login" class="avatar">
</div>
<div class="container">
<label for="uname"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
114
<div class="container" style="background-color:#f1f1f1">
<span><a href="/app/newPetrolPump">Join Us</a></span>
<span class="psw">Forgot <a href="#">password?</a></span>
</div>
</form>
</div>
<script>
// Get the modal
var modal = document.getElementById('id01');
<% } %>
</body>
</html>
MSG
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<button id="hide">Hide</button>
<button id="show">Show</button>
</body>
</html>
Newheader
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
115
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
form {
border: 3px solid #f1f1f1;
}
/* Full-width inputs */
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=tel] ,select{
width: 20%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
116
text-align: center;
margin: 24px 0 12px 0;
}
/* Avatar image */
img.avatar {
width: 40%;
border-radius: 50%;
}
}
table {
border-collapse: collapse;
width: 50%;
}
th, td {
text-align: center;
padding: 8px;
font-weight: bold;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #4CAF50;
color: white;
}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
117
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 60px;
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 5px auto; /* 15% from the top and centered */
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
118
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
h1{
text-align: center;
color: red;
}
h2{
text-align: center;
color: red;
}
label{
color: darkgreen;
font-weight: bold;
font-style: italic;
}
body {
font-family: "Lato", sans-serif;
transition: background-color .5s;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
transition: 0.5s;
padding-top: 60px;
}
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}
.sidenav a:hover {
color: #f1f1f1;
}
119
.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
#main {
transition: margin-left .5s;
padding: 16px;
}
#main a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
#main a:hover {
background-color: #ddd;
color: black;
}
#main a.active {
background-color: #4CAF50;
color: white;
}
.dropbtn {
background-color: #333;
color: white;
padding: 16px;
font-size: 16px;
border: none;
width: 295px;
height: 84px;
}
.dropdown {
position: relative;
120
display: inline-block;
float: right;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
width: 300px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
</div>
</div>
</div>
121
<a href="/app/inozzle">Nozzle</a>
<a href="/app/icollectionmode">Collection Modes</a>
</div>
<span class="dropdown">
<button class="dropbtn"><%= 'Hi, '+currentUser[0].FNAME+' '
%>∨</button>
<span class="dropdown-content">
<a href="#">
<img src="<%= '/static/uploads/'+currentUser[0].PIC %>"
alt="No Photo" width="250" height="250">
</a>
<a href="/app/logout">Logout</a>
</span>
</span>
<script>
function openNav() {
document.getElementById("main").style.width='55%';
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
document.body.style.backgroundColor = "white";
document.getElementById("main").style.width='75%';
}
</script>
122
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include commonHeadElements.html %>
</head>
<h2>Product Details</h2>
<table border="5">
<tr>
<th>Type</th>
<th>Name</th>
<th>Price</th>
<th>Quantity_Left</th>
</tr>
<% for(i in productDetails) { %>
<tr>
<td><%= productDetails[i].TYPE %></td>
<td><%= productDetails[i].NAME %></td>
<td><%= productDetails[i].PRICE %></td>
<td><%= productDetails[i].QTY %></td>
<% } %>
</tr>
</table>
<h2>Product Details</h2>
<table border="5">
<tr>
<th>Name</th>
<th>Price</th>
<th>Quantity_Left</th>
</tr>
<% for(i in productDetails1) { %>
<tr>
<td><%= productDetails1[i].NAME %></td>
<td><%= productDetails1[i].PRICE %></td>
<td><%= productDetails1[i].QUANTITY_LEFT %></td>
<% } %>
</tr>
</table>
123
<h2>Product Details</h2>
<table border="5">
<tr>
<th>Price</th>
<th>Quantity_Left</th>
</tr>
<% for(i in productDetails2) { %>
<tr>
<td><%= productDetails2[i].PRICE %></td>
<td><%= productDetails2[i].QUANTITY_LEFT %></td>
<% } %>
</tr>
</table>
</head>
124
<td><%= shiftDetailsResult.SUPERVISOR %></td>
</table>
</p>
<br>
<p>
<h2>Electronic Totalizer</h2>
<table border="5" align="center" class="table table-striped">
<th>Nozzle</th>
<th>Product</th>
<th>Assigned To</th>
<th>Digital Opening Reading</th>
<th>Digital CLosing Reading</th>
<th>Pump Test</th>
<th>Sale</th>
<% for(i in elecTotalizerResult) { %>
<tr>
<td><%= elecTotalizerResult[i].NOZZLE %></td>
<td><%= elecTotalizerResult[i].PRODUCT %></td>
<td><%= elecTotalizerResult[i].ASSIGNTED_TO %></td>
<td><%= elecTotalizerResult[i].DOR %></td>
<td><%= elecTotalizerResult[i].DCR %></td>
<td><%= elecTotalizerResult[i].PUMP_TEST %></td>
<td><%= elecTotalizerResult[i].SALE %></td>
</tr>
<% } %>
<% for (i in elecTotalizerResult1) { %>
<tr>
<td colspan="4">TOTAL <%= elecTotalizerResult1[i].PRODUCT
%></td>
<td><%= elecTotalizerResult1[i].DISP %></td>
<td><%= elecTotalizerResult1[i].PUMPTEST %></td>
<td><%= elecTotalizerResult1[i].SALE %></td>
</tr>
<% } %>
</table>
</p>
<br>
<p>
<h2>Manual Totalizer</h2>
<table border="5" align="center" class="table table-striped">
<th>Nozzle</th>
<th>Product</th>
<th>Assigned To</th>
<th>Analog Opening Reading</th>
<th>Analog CLosing Reading</th>
<th>Pump Test</th>
<th>Sale</th>
<% for(i in manTotalizerResult) { %>
<tr>
<td><%= manTotalizerResult[i].NOZZLE %></td>
<td><%= manTotalizerResult[i].PRODUCT %></td>
<td><%= manTotalizerResult[i].ASSIGNTED_TO %></td>
125
<td><%= manTotalizerResult[i].AOR %></td>
<td><%= manTotalizerResult[i].ACR %></td>
<td><%= manTotalizerResult[i].PUMP_TEST %></td>
<td><%= manTotalizerResult[i].SALE %></td>
</tr>
<% } %>
<% for (i in manTotalizerResult1) { %>
<tr>
<td colspan="4">TOTAL <%= manTotalizerResult1[i].PRODUCT
%></td>
<td><%= manTotalizerResult1[i].DISP %></td>
<td><%= manTotalizerResult1[i].PUMPTEST %></td>
<td><%= manTotalizerResult1[i].SALE %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>Difference Between Electronic and Manual Sale</h2>
<table border="5" align="center" class="table table-striped">
<th>Product</th>
<th>Pump Test</th>
<th>Difference</th>
<% for(i in emdiffResult) {%>
<tr>
<td><%= emdiffResult[i].PRODUCT %></td>
<td><%= emdiffResult[i].PUMPTEST %></td>
<td><%= Math.abs(emdiffResult[i].DIFFERENCE) %></td>
</tr>
<% } %>
</table>
</p>
<P>
<H2>Tank Data</H2>
<table border="5" align="center" class="table table-striped" >
<th>Tank Name</th>
<th>Opening Dip</th>
<th>Opening Volume</th>
<th>Closing Dip</th>
<th>Closing Volume</th>
<th>Sold Out</th>
<% for (var i=0 ; i<tankheightResult2.length ; ++i ) { %>
<tr>
<td><%= tankheightResult2[i].TYPE %></td>
<td><%= tankheightResult2[i].OPEN_READING %></td>
<td><%= tankheightResult2[i].OPEN %></td>
<td><%= tankheightResult1[i].CLOSE_READING %></td>
<td><%= tankheightResult1[i].CLOSE %></td>
<td><%= tankheightResult2[i].OPEN-tankheightResult1[i].CLOSE %></td>
</tr>
126
<% } %>
</table>
</P>
<p>
<h2>Difference Between TANK SALE and METERED SALE </h2>
<table border="5" align="center" class="table table-striped">
<th>Tank Name</th>
<th>Qty by Totalizer</th>
<th>Qty by Tank</th>
<th>Loss(-)/Gain(+)</th>
<th>Amount</th>
<% for (var i=0;i<elecTotalizerResult1.length;i+=1) { %>
<tr>
<td><%= elecTotalizerResult1[i].PRODUCT %></td>
<td><%= elecTotalizerResult1[i].SALE %></td>
<td><%= tankheightResult2[i].OPEN-tankheightResult1[i].CLOSE %></td>
<td><%= elecTotalizerResult1[i].SALE-(tankheightResult2[i].OPEN-
tankheightResult1[i].CLOSE) %></td>
<td><%= (elecTotalizerResult1[i].SALE-(tankheightResult2[i].OPEN-
tankheightResult1[i].CLOSE))*priceResult[i].PRICE %></td>
</tr>
<% } %>
</table>
</p>
<P>
<h2>Sale Mode Wise</h2>
<table border="5" align="center" class="table table-striped">
<th>NOZZLE NUMBER</th>
<th>ASSIGNED_TO</th>
<th>Mode Of Payment</th>
<th>Amount</th>
<% for(i in actResult) { %>
<tr>
<td><%= actResult[i].NOZZLE_NUMBER %></td>
<td><%= actResult[i].FNAME %></td>
<td><%= actResult[i].MODE %></td>
<td><%= actResult[i].AMOUNT %></td>
</tr>
<% } %>
</table>
</P>
<p>
<h2>Report</h2>
<table border="5" align="center" class="table table-striped">
<th>Nozzle Number</th>
<th>Assigned to</th>
<th>Product</th>
<th>Sale</th>
<th>Estimated Collection</th>
<th>Actual Collection</th>
127
<th>Shortage</th>
<% for(var i=0;i<estResult.length;i+=1) { %>
<tr>
<td><%= estResult[i].NOZZLE_NUMBER %></td>
<td><%= estResult[i].ASSIGNED_TO %></td>
<td><%= estResult[i].TYPE %></td>
<td><%= estResult[i].SALE %></td>
<td><%= estResult[i].COLLECTION %></td>
<td><%= actResult1[i].COLLECTION %></td>
<td><%= actResult1[i].COLLECTION-estResult[i].COLLECTION
%></td>
</tr>
<% } %>
</table>
</p>
</div>
<% } %>
<% include commonFooterScriptElements.html %>
</body>
</html>
setupPetrolPump
Under Process
Shift
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include commonHeadElements.html %>
</head>
128
<th>Last Name</th>
<% for(i in availableSupervisorResult) { %>
<tr>
<td><%= availableSupervisorResult[i].FNAME %></td>
<td><%= availableSupervisorResult[i].LNAME %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>All Available Nozzle</h2>
<table border="5">
<th>Nozzle Number</th>
<% for(i in availableNozzleResult) { %>
<tr>
<td><%= availableNozzleResult[i].NOZZLE_NUMBER %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>All Available DSM(s)</h2>
<table border="5">
<th>First Name</th>
<th>Last Name</th>
<% for(i in availableDSMResult) { %>
<tr>
<td><%= availableDSMResult[i].FNAME %></td>
<td><%= availableDSMResult[i].LNAME %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>Last Shift Details</h2>
<table border="5">
<th>NOZZLE_NUMBER</th>
<th>Type</th>
<th>Supervisor</th>
<th>DSM</th>
<th>Start Time</th>
<th>End Time</th>
<th>Nozzle Opening Reading</th>
<% for(i in endShiftResult) { %>
<tr>
<td><%= endShiftResult[i].NOZZLE_NUMBER %></td>
<td><%= endShiftResult[i].TYPE %></td>
<td><%= endShiftResult[i].SUPERVISOR %></td>
<td><%= endShiftResult[i].DSM %></td>
<td><%= endShiftResult[i].START_TIME %></td>
<td><%= endShiftResult[i].END_TIME %></td>
129
<td><%= endShiftResult[i].DOR %></td>
</tr>
<% } %>
</table>
</p>
<p>
<h2>Current Shift Details</h2>
<table border="5">
<th>Shift Type</th>
<th>Supervisor</th>
<th>Start Time</th>
<th>End Time</th>
<% for(i in viewShiftResult) { %>
<tr>
<td><%= viewShiftResult[i].SHIFT_TYPE %></td>
<td><%= viewShiftResult[i].SUPERVISOR %></td>
<td><%= viewShiftResult[i].START_TIME %></td>
<td><%= viewShiftResult[i].END_TIME %></td>
</tr>
<% } %>
</table>
</p>
</div>
<% include commonFooterScriptElements.html %>
</body>
</html>
Tank
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include commonHeadElements.html %>
</head>
130
<% } %>
</table>
</p>
<h1>Details of a tank</h1>
<p>
<table border="5" align="center" class="table table-striped">
<th>Capacity</th>
<th>Type</th>
<th>Working</th>
<tr>
<td><%= AllDetailtankResult.CAPACITY %></td>
<td><%= AllDetailtankResult.TYPE %></td>
<% if (AllDetailtankResult.ACTIVE==1) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
</tr>
</table>
</p>
</div>
<% include commonFooterScriptElements.html %>
</body>
</html>
34.Transport
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<% include newheader.html %>
</head>
<tr>
<th>Transport Name</th>
<th>Exists</th>
131
</tr>
<% for(i in transportDetails) { %>
<tr>
<td><%= transportDetails[i].NAME %></td>
<% if(transportDetails[i].DEL==0) { %>
<td>YES</td>
<% } else { %>
<td>NO</td>
<% } %>
<% } %>
</tr>
</table>
<p align="right">
<button
onclick="document.getElementById('addtransport').style.display='block'">+ Add
TRANSPORT</button>
</p>
<div id="addtransport" class="modal">
<form action="/app/transport" class="modal-content animate"
method="post">
<label for="mode"><b>Mode</b></label>
<input type="text" placeholder="Enter New Transport Name"
name="name" required>
<br>
<br>
<button class="formbutton" type="submit" name="tp"
value="1">Add</button>
<button class="cancelbtn"
onclick="document.getElementById('addtransport').style.display='none'">Cancel</button
>
</div>
</form>
</div>
<script type="text/javascript">
132
cancelbtn[i].addEventListener('click',function(event){
document.querySelector('#addtransport
input[name=name]').value='';
});
}
</script>
</body>
</html>
2. Controllers
collectionCtrl
var sessionUtils = require('../utils/sessionUtils');
var util=require('util');
var databaseUtils=require('./../utils/databaseUtils');
module.exports = {
showicollectionPage: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
yield this.render('icollectionmode',{
collectiontype:collectiontype
});
},
showicollection2Page: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var mode=this.request.body.mode;
var queryString='INSERT INTO COLLECTION_MODE(PID,MODE)
VALUES(%s,"%s")';
var query=util.format(queryString,pid,mode);
var collectionresult=yield databaseUtils.executeQuery(query);
var modee=collectionresult.insertId;
var res=yield databaseUtils.executeQuery(util.format('INSERT INTO BALANCE
(CRDB,BAL,PID,MODE,SID) VALUES(%s,%s,%s,%s,0)',0,0,pid,modee));
this.redirect('icollectionmode');
},
}
detailCtrl
133
var sessionUtils = require('../utils/sessionUtils');
var util=require('util');
var databaseUtils=require('./../utils/databaseUtils');
module.exports = {
showiProductPage: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var ptype=this.request.query.ptype;
var pname=this.request.query.pname;
console.log(pid,pname,ptype);
var queryString;
var query;
if(pname && pname!='All'){
queryString='SELECT * FROM PRODUCT WHERE PID="%s" AND
NAME="%s"';
query=util.format(queryString,pid,pname);
}
else if(ptype && ptype!='All'){
queryString='SELECT * FROM PRODUCT WHERE PID="%s" AND TYPE=
%s';
query=util.format(queryString,pid,parseInt(ptype));
}
else{
queryString='SELECT * FROM PRODUCT WHERE PID="%s"';
query=util.format(queryString,pid);
}
yield this.render('iproduct',{
productDetails:productDetails,
productname:productname,
pname:pname,
ptype:ptype,
});
},
showiProduct2Page: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var queryString;
var query;
var productDetails
var ppid=this.request.body.ppid;
134
var name=this.request.body.name;
var type=this.request.body.type;
var price=this.request.body.price;
var qty=this.request.body.qty;
var act=this.request.body.act;
var ptype=this.request.body.type;
var pname=this.request.body.name;
if(ppid==undefined){
if(act=="0"){
if(pname=='all') pname="%";
if(ptype=="all"){
queryString='SELECT * FROM PRODUCT WHERE PID=%s AND
NAME LIKE "%s"';
query=util.format(queryString,pid,pname);
}
else{
queryString='SELECT * FROM PRODUCT WHERE PID=%s AND
TYPE=%s AND NAME LIKE "%s"';
query=util.format(queryString,pid,ptype,pname);
}
productDetails=yield databaseUtils.executeQuery(query);
}
else if(act=="1"){
queryString='INSERT INTO PRODUCT (PID,NAME,TYPE,PRICE,QTY) \
VALUES(%s,"%s",%s,%s,%s)';
query=util.format(queryString,pid,pname,ptype,price,qty);
var res=yield databaseUtils.executeQuery(query);
queryString='SELECT * FROM PRODUCT WHERE PID="%s"';
query=util.format(queryString,pid);
productDetails=yield databaseUtils.executeQuery(query);
}
else{
queryString='UPDATE PRODUCT SET NAME="%s",TYPE="%s",PRICE=
%s,QTY=%s WHERE ID=%s';
query=util.format(queryString,name,type,price,qty,ppid);
var r=yield databaseUtils.executeQuery(query);
}
135
this.redirect('iproduct');
},
showiTankPage: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var QueryString;
var query;
var ttype=this.request.query.ttype;
var ttype;
if((!ttype) || ttype=='All'){
QueryString='SELECT ID,CAPACITY,TYPE,ACTIVE FROM
TANK_METADATA WHERE PID=%s';
query=util.format(QueryString,pid);
}
else{
QueryString='SELECT ID,CAPACITY,TYPE,ACTIVE FROM
TANK_METADATA WHERE PID=%s AND TYPE="%s"';
query=util.format(QueryString,pid,ttype);
}
try{
var pid=this.request.body.pid;
var cap=this.request.body.capacity;
var type=this.request.body.type;
136
var queryString='INSERT INTO TANK_METADATA (PID,CAPACITY,TYPE) \
VALUES(%s,%s,"%s")';
var query=util.format(queryString,pid,cap,type);
var res=yield databaseUtils.executeQuery(query);
}
catch(e){
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
}
var DetailtankQueryString;
var DetailtankQuery;
var wf;
try{
var wf=this.request.body.ttype;
if (wf=='all'){
DetailtankQueryString='SELECT ID,CAPACITY,TYPE,ACTIVE FROM
TANK_METADATA WHERE PID=%s';
DetailtankQuery=util.format(DetailtankQueryString,pid);
}
else{
DetailtankQueryString='SELECT ID,CAPACITY,TYPE,ACTIVE FROM
TANK_METADATA WHERE PID=%s and TYPE="%s"';
DetailtankQuery=util.format(DetailtankQueryString,pid,wf);
}
}
catch(ee){
}
if(wf==undefined){
DetailtankQueryString='SELECT ID,CAPACITY,TYPE,ACTIVE FROM
TANK_METADATA WHERE PID=%s';
DetailtankQuery=util.format(DetailtankQueryString,pid);
}
this.redirect('itank');
},
showiTank3Page: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var queryString;
var query;
137
var tid;
var cap=this.request.body.capacity;
var type=this.request.body.type;
var act=this.request.body.tid.split(' ');
if(parseInt(act[0])==1){
var queryString='INSERT INTO TANK_METADATA (PID,CAPACITY,TYPE) \
VALUES(%s,%s,"%s")';
var query=util.format(queryString,pid,cap,type);
var res=yield databaseUtils.executeQuery(query);
}
else{
var tid=parseInt(act[1]);
var queryString='UPDATE TANK_METADATA SET CAPACITY=%s,TYPE="%s"
WHERE ID=%s';
var query=util.format(queryString,cap,type,tid);
var res=yield databaseUtils.executeQuery(query);
}
this.redirect('itank');
},
}
Employee Ctrl
var sessionUtils = require('../utils/sessionUtils');
var util=require('util');
var databaseUtils=require('./../utils/databaseUtils');
module.exports = {
},
showEmployee1Page : function *(next){
var queryString='SELECT FNAME,PIC FROM USER';
var query=util.format(queryString);
var res=yield databaseUtils.executeQuery(query);
yield this.render('employee1',{
res:res,
});
},
showiemployeePage: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
138
var QueryString;
var query;
var employeeResult;
var tt='All';
var etype=this.request.query.etype;
if (etype=='All'){
queryString=' SELECT USER.ID AS
ID,FNAME,LNAME,TYPE,ADDRESS,PHONE,EMAIL,ADHAAR,ACTIVE,PIC
FROM USER,ROLE,USER_ROLE WHERE USER.ID=USER_ROLE.USER_ID AND
ROLE.ID=USER_ROLE.ROLE_ID AND USER.PID=%s';
query = util.format(queryString,pid);
tt='All';
}
else{
queryString='SELECT USER.ID AS
ID,FNAME,LNAME,TYPE,ADDRESS,PHONE,EMAIL,ADHAAR,ACTIVE,PIC
FROM USER,ROLE,USER_ROLE WHERE USER.ID=USER_ROLE.USER_ID AND
ROLE.ID=USER_ROLE.ROLE_ID AND USER.PID=%s AND TYPE="%s"';
query=util.format(queryString,pid,etype);
tt=etype;
}
employeeResult=yield databaseUtils.executeQuery(query);
if(employeeResult.length==0){
QueryString='SELECT USER.ID AS
ID,FNAME,LNAME,TYPE,ADDRESS,PHONE,EMAIL,ADHAAR,ACTIVE,PIC
FROM USER,ROLE,USER_ROLE WHERE USER.ID=USER_ROLE.USER_ID AND
ROLE.ID=USER_ROLE.ROLE_ID AND USER.PID=%s';
query=util.format(QueryString,pid);
employeeResult=yield databaseUtils.executeQuery(query);
tt='All';
}
//employeeResult=yield databaseUtils.executeQuery(query);
var QueryString='SELECT DISTINCT(TYPE),ID FROM ROLE WHERE PID=%s';
var query=util.format(QueryString,pid);
var employeerole=yield databaseUtils.executeQuery(query);
yield this.render('iemployee',{
employeeResult:employeeResult,
employeeRole:employeerole,
tt:tt,
});
},
showiEmployee2Page: function* (next) {0
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var act;
var tact=this.request.body.act;
if(tact) act=tact.split(' ');
else
act=this.request.body.fields.act.split(' ');
var etype;
139
var employeeResult;
var employeeRole;
if(act[0]=="2"){
var FNAME=this.request.body.fields.FNAME;
var LNAME=this.request.body.fields.LNAME;
var TYPE=this.request.body.fields.TYPE;
var ADDRESS=this.request.body.fields.ADDRESS;
var EMAIL=this.request.body.fields.EMAIL;
var PHONE=this.request.body.fields.PHONE;
var ADHAAR=this.request.body.fields.ADHAAR;
var filee=this.request.body.files;
var pic=filee.pic.path.split('\\');
var pwd=this.request.body.fields.pwd;
console.log(FNAME,LNAME,ADDRESS,EMAIL,PHONE,ADHAAR,pwd,pic[pic.lengt
h-1],parseInt(act[1]));
console.log(TYPE);
query=util.format(queryString,FNAME,LNAME,ADDRESS,EMAIL,PHONE,ADHAA
R,pwd,pic[pic.length-1],parseInt(act[1]));
var res=yield databaseUtils.executeQuery(query);
var rid;
res=yield databaseUtils.executeQuery(util.format('SELECT ID FROM ROLE WHERE
PID=%s AND TYPE="%s"',pid,TYPE));
if(res.length==0){
var res=yield databaseUtils.executeQuery(util.format('INSERT INTO ROLE
(TYPE,PID) VALUES("%s",%s)',TYPE,pid));
rid=res.insertId;
}
else{
rid=res[0].ID;
}
console.log(rid,parseInt(act[1]));
queryString='UPDATE USER_ROLE SET ROLE_ID=%s WHERE USER_ID=%s';
query=util.format(queryString,rid,parseInt(act[1]));
res=yield databaseUtils.executeQuery(query);
}
else if(act[0]=="3"){
var FNAME=this.request.body.fields.FNAME;
var LNAME=this.request.body.fields.LNAME;
var TYPE=this.request.body.fields.TYPE;
var ADDRESS=this.request.body.fields.ADDRESS;
var EMAIL=this.request.body.fields.EMAIL;
var PHONE=this.request.body.fields.PHONE;
var ADHAAR=this.request.body.fields.ADHAAR;
var filee=this.request.body.files;
140
var pic=filee.pic.path.split('\\');
var pwd=this.request.body.fields.pwd;
query=util.format(queryString,pid,FNAME,LNAME,ADDRESS,EMAIL,PHONE,ADH
AAR,pwd,pic[pic.length-1]);
var res=yield databaseUtils.executeQuery(query);
var uid=res.insertId;
else{
console.log(act);
var eid=parseInt(act[2]);
if(parseInt(act[1])==0){
var res=yield databaseUtils.executeQuery(util.format('UPDATE USER SET
ACTIVE=0 WHERE ID=%s',eid));
}else{
var res=yield databaseUtils.executeQuery(util.format('UPDATE USER SET
ACTIVE=1 WHERE ID=%s',eid));
}
}
this.redirect('iemployee');
/*
yield this.render('iemployee',{
employeeResult:employeeResult,
employeeRole:employeeRole,
tt:tt,
});*/
}
}
141
Finance Ctrl
module.exports = {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var nozzle_number=this.request.query.no;
if (nozzle_number==undefined) {
nozzle_number=1;
}
var queryString;
var query;
queryString='SELECT USER.FNAME AS
FNAME,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM
SHIFT,SHIFT_NOZZLE_DSM,USER,NOZZLE,SHIFT_COLLECTION,COLLECTIO
N_MODE WHERE SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND
USER.ID=SHIFT.SUPERVISOR_ID AND
SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT.PID=%s AND NOZZLE_NUMBER=%s AND SHIFT.START_TIME>=\'2018-
01-01 00:00:00\' AND SHIFT.START_TIME<=\'2018-08-08 18:00:00\'';
query=util.format(queryString,pid,nozzle_number);
var SalesNozzleResult1=yield databaseUtils.executeQuery(query);
var saleDetails1=SalesNozzleResult1;
queryString='SELECT USER.FNAME AS
FNAME,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM
SHIFT,SHIFT_NOZZLE_DSM,USER,NOZZLE,SHIFT_COLLECTION,COLLECTIO
N_MODE WHERE SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND
USER.ID=SHIFT.SUPERVISOR_ID AND
SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT.PID=%s AND SHIFT.START_TIME>=\'2018-01-01 00:00:00\' AND
SHIFT.START_TIME<=\'2018-08-08 18:00:00\' AND USER.FNAME=\'AMAN\' group
by nozzle_number,mode';
query=util.format(queryString,pid);
var SalesSupervisorResult=yield databaseUtils.executeQuery(query);
var supervisorDetails=SalesSupervisorResult;
// SHOW DETAILS OF ALL SUPERVISOR
queryString='SELECT USER.FNAME AS
FNAME,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM
SHIFT,SHIFT_NOZZLE_DSM,USER,NOZZLE,SHIFT_COLLECTION,COLLECTIO
N_MODE WHERE SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND
143
USER.ID=SHIFT.SUPERVISOR_ID AND
SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT.PID=%s AND SHIFT.START_TIME>=\'2018-01-01 00:00:00\' AND
SHIFT.START_TIME<=\'2018-08-08 18:00:00\' group by user.fname,
nozzle_number,mode';
query=util.format(queryString,pid);
var SalesSupervisorResult1=yield databaseUtils.executeQuery(query);
var supervisorDetails1=SalesSupervisorResult1;
yield this.render('finance',{
shiftDetails:shiftDetails,
saleDetails:saleDetails,
144
saleDetails1:saleDetails1,
supervisorDetails:supervisorDetails,
supervisorDetails1:supervisorDetails1,
dsmDetails:dsmDetails,
dsmDetails1:dsmDetails1,
// supdsmDetails:supdsmDetails
});
},
showifinancePage: function* (next) {
var pid;
try{ pid=this.currentUser[0].PID;}
catch(e){pid=0;}
var queryString;
var query;
var from;
var to;
var nozzle;
var supervisor;
var mode;
var dsm;
var type;
var f1;
var f2;
var f3;
var f4;
var f5;
try{from=this.request.query.from;}catch(e){}
try{to=this.request.query.to;}catch(e){}
try{f1=this.request.query.f1;}catch(e){}
try{f2=this.request.query.f2;}catch(e){}
try{f3=this.request.query.f3;}catch(e){}
try{f4=this.request.query.f4;}catch(e){}
try{f5=this.request.query.f5;}catch(e){}
try{nozzle=this.request.query.nozzle;}catch(e){}
try{supervisor=this.request.query.supervisor;}catch(e){}
try{dsm=this.request.query.dsm;}catch(e){}
try{mode=this.request.query.mode;}catch(e){}
try{type=this.request.query.type;}catch(e){}
console.log(f1,f2,f3,f4,f5,nozzle,supervisor,dsm,mode,type);
/*
145
SND.ID=SC.SHIFT_NOZZLE_DSM_ID AND SND.USER_ID=U2.ID AND
CM.ID=SC.COLLECTION_MODE_ID AND SHIFT.PID=%s AND
SHIFT.END_TIME>=\'2018-01-01 00:00:00\' AND SHIFT.END_TIME<=\'2018-06-25
18:00:00\'';
query=util.format(queryString,pid);
var AllDetailfinanceResult=yield databaseUtils.executeQuery(query);
var shiftDetails=AllDetailfinanceResult;
queryString='SELECT USER.FNAME AS
FNAME,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM
SHIFT,SHIFT_NOZZLE_DSM,USER,NOZZLE,SHIFT_COLLECTION,COLLECTIO
N_MODE WHERE SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND
USER.ID=SHIFT.SUPERVISOR_ID AND
SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT.PID=%s AND NOZZLE_NUMBER=%s AND SHIFT.START_TIME>=\'2018-
01-01 00:00:00\' AND SHIFT.START_TIME<=\'2018-08-08 18:00:00\'';
query=util.format(queryString,pid,nozzle_number);
var SalesNozzleResult1=yield databaseUtils.executeQuery(query);
var saleDetails1=SalesNozzleResult1;
146
queryString='SELECT USER.FNAME AS
FNAME,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM
SHIFT,SHIFT_NOZZLE_DSM,USER,NOZZLE,SHIFT_COLLECTION,COLLECTIO
N_MODE WHERE SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND
USER.ID=SHIFT.SUPERVISOR_ID AND
SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT.PID=%s AND SHIFT.START_TIME>=\'2018-01-01 00:00:00\' AND
SHIFT.START_TIME<=\'2018-08-08 18:00:00\' AND USER.FNAME=\'AMAN\' group
by nozzle_number,mode';
query=util.format(queryString,pid);
var SalesSupervisorResult=yield databaseUtils.executeQuery(query);
var supervisorDetails=SalesSupervisorResult;
// SHOW DETAILS OF ALL SUPERVISOR
queryString='SELECT USER.FNAME AS
FNAME,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM
SHIFT,SHIFT_NOZZLE_DSM,USER,NOZZLE,SHIFT_COLLECTION,COLLECTIO
N_MODE WHERE SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND
USER.ID=SHIFT.SUPERVISOR_ID AND
SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT.PID=%s AND SHIFT.START_TIME>=\'2018-01-01 00:00:00\' AND
SHIFT.START_TIME<=\'2018-08-08 18:00:00\' group by user.fname,
nozzle_number,mode';
query=util.format(queryString,pid);
var SalesSupervisorResult1=yield databaseUtils.executeQuery(query);
var supervisorDetails1=SalesSupervisorResult1;
147
var SalesDSMResult=yield databaseUtils.executeQuery(query);
var dsmDetails=SalesDSMResult;
// TO SHOW DETAILS OF ALL DSM
*/
if(from){
queryString='SELECT U1.FNAME AS SUPERVISOR,U2.FNAME AS
DSM,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM USER U1,SHIFT,SHIFT_NOZZLE_DSM,USER
U2,NOZZLE,SHIFT_COLLECTION,COLLECTION_MODE WHERE
SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND U1.ID=SHIFT.SUPERVISOR_ID
AND SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT_NOZZLE_DSM.USER_ID=U2.ID AND SHIFT.PID=%s AND
SHIFT.START_TIME>="%s" AND SHIFT.START_TIME<="%s" GROUP BY
NOZZLE_NUMBER,START_TIME,MODE';
query=util.format(queryString,pid,from,to);
}
else{
queryString='SELECT U1.FNAME AS SUPERVISOR,U2.FNAME AS
DSM,TYPE,NOZZLE_NUMBER,SHIFT.START_TIME AS
START_TIME,SHIFT_NOZZLE_DSM.USER_ID AS USER_ID,(DOR-DCR-
PUMP_TEST-SELF) AS SALE,SHIFT_COLLECTION.ID AS ID,MODE,AMOUNT
FROM USER U1,SHIFT,SHIFT_NOZZLE_DSM,USER
U2,NOZZLE,SHIFT_COLLECTION,COLLECTION_MODE WHERE
SHIFT.ID=SHIFT_NOZZLE_DSM.SHIFT_ID AND U1.ID=SHIFT.SUPERVISOR_ID
AND SHIFT_NOZZLE_DSM.NOZZLE_ID=NOZZLE.ID AND
SHIFT_NOZZLE_DSM.ID=SHIFT_COLLECTION.SHIFT_NOZZLE_DSM_ID AND
COLLECTION_MODE.ID=SHIFT_COLLECTION.COLLECTION_MODE_ID AND
SHIFT_NOZZLE_DSM.USER_ID=U2.ID AND SHIFT.PID=%s GROUP BY
NOZZLE_NUMBER,START_TIME,MODE';
query=util.format(queryString,pid);
}
148
queryString='SELECT ID,MODE FROM COLLECTION_MODE WHERE PID=
%s ORDER BY MODE';
query=util.format(queryString,pid);
var paymentModes=yield databaseUtils.executeQuery(query);
yield this.render('ifinance',{
// shiftDetails:shiftDetails,
// saleDetails:saleDetails,
// saleDetails1:saleDetails1,
// supervisorDetails:supervisorDetails,
// supervisorDetails1:supervisorDetails1,
// dsmDetails:dsmDetails,
dsmDetails1:dsmDetails1,
nozzleCountResult:nozzleCountResult,
availablePersonResult:availablePersonResult,
paymentModes:paymentModes,
tankType:tankType,
from:from,
to:to,
f1:f1,
f2:f2,
f3:f3,
f4:f4,
f5:f5,
nozzle:nozzle,
supervisor:supervisor,
dsm:dsm,
mode:mode,
type:type,
// supdsmDetails:supdsmDetails
});
},
logout: function* (next) {
var sessionId = this.cookies.get("SESSION_ID");
if(sessionId) {
sessionUtils.deleteSession(sessionId);
}
this.cookies.set("SESSION_ID", '', {expires: new Date(1), path: '/'});
this.redirect('/');
}
}
Static
Script
Bootstrap
149
/*!
* Bootstrap v3.0.0
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and
@fat.
*/
jquery-1.12.0.min
195
utils
Data base Utils
var config = require('./../config');
var mysql = require('mysql');
var logger = require('./../logger');
var thunkify = require('thunkify');
module.exports = {
executeQuery: thunkify(executeQuery),
executePlainQuery: executeQuery
};
Redis Utils
var redis = require('redis');
var thunkify = require('thunkify');
var config = require('./../config');
var logger = require('./../logger');
function log(type) {
return function() {
196
logger.logError(arguments);
}
}
module.exports = {
try {
callback(err, JSON.parse(res));
} catch(e) {
callback(err, res);
}
});
}),
deleteItem: function(key) {
client.del(key, function(err, reply) {
197
if(err) {
logger.logError(err);
}
});
},
callback(err, res);
});
}),
callback(err, res);
})
}),
client:client,
};
7. BIBLIOGRAPHY
This is a chapter that tells the references of the project. Means that it tells that from which we
made our project. The bibliography of our project is:-
1) VB BLACK BOOK
2) VISUAL BASIC 6.0
3) WEBSITE – WWW.VBCODING.COM
198
199