You are on page 1of 48

CHAPTER 1

INTRODUCTION

The main aim of our income tax department web application is an prepare a tax summary or tax
return of an client. Our system mainly focus on the tax that need to be paid by the people who
are migrated from the all the peoples. Tax information system is a professional financial service
company established by experienced there are an effective and efficient financial and tax
planning solutions to a wide range of clients across the global you might think that taxes are a
necessary evil better left for professionals, but understanding the basics can helps you minimize
the total amount of taxes that you pay. Paying the right amounts throughout the year will save
you from having to pay penalty charges for underpayments. Electronic data processing system
for preparation of electrically files tax returns authorization data processing programs are
provided for creating an electronic tax return that is filled with a tax collecting authority. As
early as the day after completion of the tax payments, the tax filler receives initial tax payment
from the user transactions. The authorized user can pay the tax easily on the tax in easily and
securely. The every user can easily view the tax payments and they will also get an permission
for pay an tax amount for our web application.
CHAPTER 2
2. SYSTEM ANALYSIS

2.1 EXISTING SYSTEM

Tax information system is a professional’s financial services company established. Every usesr can go bto
the income tax department and submit the documents after they know about the tax payments details.
Sometimes users are did not stay on the home down they will occur an main problem for tax end date
they will come back the home down and pay the tax.

DISADVANTAGES

Data is not secure as they are not properly managed

This is a very time taking process as citizens have to wait for officials and collect the necessary bill for
payment

2.2 PROPOSED SYSTEM

The proposed methodology can overcomes all the drawbacks of the existing system. proposed
method will reduces all the paper work and human work they will made an technology level
process like an computerizes method implements for an user know the tax details and the tax
department can also tax information’s.

ADVANTAGES

It does not required to go municipal office directly

It does not required much time to pay tax. It is easy to pay tax through online

Data is secure as they are not properly managed


2.3 MODULES

 Admin
 User
 Income tax manager

Admin

Login

Admin will login using user name and password. The user name and password process is given
for security purpose.

View Details

Admin will view user and income tax manager details. Admin has authority to view the entire
details of user, manager and bill details.

User

Register & Login

User will register their details such as name,contact, address,mail id,etc., and login with user
name and password

View tax detail

User will view their tax details for payment.

Pay tax

User will pay their tax in online


Income tax manager

Register & Login

Income tax manager will register their personal details and login using user name and password

Add tax amount

Manager will add each and every citizens tax amount and update the citizens tax amount

View payment details

Manager will check and view the citizen payment details.

CHAPTER 3
SYSTEM REQUIREMENTS

3.1 Software requirements


 Front End :PYTHON
 Back End : My SQL
 Platform : Windows 7

3.2 Hardware requirements

 Processor : Dual core processor 2.6.0 GHz


 RAM : 1GB
 Hard disk : 160 GB
 Compact Disk : 650 MB
 Keyboard : Standard keyboard
 Monitor : 15 inch color monitor
3.3 SOFTWARE REQUIREMENTS

Front End (Python)


Python is a interpreted, object-oriented, high-level programming language with dynamic
semantics. Its high-level built in data structures, combined with dynamic typing and dynamic
binding; make it very attractive for Rapid Application Development, as well as for use as a
scripting or glue language to connect existing components together. Python's simple, easy to
learn syntax emphasizes readability and therefore reduces the cost of program maintenance.
Python supports modules and packages, which encourages program modularity and code reuse.
The Python interpreter and the extensive standard library are available in source or binary form
without charge for all major platforms, and can be freely distributed.

History Of Python
Python was developed by Guido van Rossum in the late eighties and early nineties at the
National Research Institute for Mathematics and Computer Science in the Netherlands.

Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol-68, SmallTalk, and Unix shell and other scripting languages.

Python is copyrighted. Like Perl, Python source code is now available under the GNU
General Public License (GPL).

Python is now maintained by a core development team at the institute, although Guido
van Rossum still holds a vital role in directing its progress.

Often, programmers fall in love with Python because of the increased productivity it
provides. Since there is no compilation step, the edit-test-debug cycle is incredibly fast.
Debugging Python programs is easy: a bug or bad input will never cause a segmentation fault.
Instead, when the interpreter discovers an error, it raises an exception. When the program doesn't
catch the exception, the interpreter prints a stack trace. A source level debugger allows
inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints,
stepping through the code a line at a time, and so on. The debugger is written in Python itself,
testifying to Python's introspective power. On the other hand, often the quickest way to debug a
program is to add a few print statements to the source: the fast edit-test-debug cycle makes this
simple approach very effective.

Features In Python
There are many features in Python, some of which are discussed below –
1.Easy to code:
Python is high level programming language. Python is very easy to learn language as compared
to other language like c, c#, java script, javaetc.It is very easy to code in python language and
anybody can learn python basic in few hours or days.It is also developer-friendly language.
2. Free and Open Source:
Python language is freely available at official website and you can download it from the given
download link below click on the Download Python keyword.
Download Python
Since, it is open-source; this means that source code is also available to the public. So you can
download it as, use it as well as share it.
3.Object-Oriented Language:
One of the key features of python is Object-Oriented programming. Python supports object
oriented language and concepts of classes, objects encapsulation etc.
4. GUI Programming Support:
Graphical Users interfaces can be made using a module such as PyQt5, PyQt4, wxPython or Tk
in python.
PyQt5 is the most popular option for creating graphical apps with Python.
5. High-Level Language:
Python is a high-level language. When we write programs in python, we do not need to
remember the system architecture, nor do we need to manage the memory.
6. Extensible feature:
Python is a Extensible language. we can write our some python code into c or c++ language and
also we can compile that code in c/c++ language.
7. Python is Portable language:
Python language is also a portable language. for example, if we have python code for windows
and if we want to run this code on other platform such as Linux, Unix and Mac then we do not
need to change it, we can run this code on any platform.
8. Python is integrated language:
Python is also an integrated language because we can easily integrated python with other
language like c, c++ etc.
9. Interpreted Language:
Python is an Interpreted Language. Because python code is executed line by line at a time. like
other language c, c++, java etc there is no need to compile python code this makes it easier to
debug our code.The source code of python is converted into an immediate form called bytecode.
10. Large Standard Library
Python has a large standard library which provides rich set of module and functions so you do
not have to write your own code for every single thing. There are many libraries present in
python for such as regular expressions, unit-testing, web browsers etc.
11. Dynamically Typed Language:
Python is dynamically-typed language. That means the type (for example- int, double, long etc)
for a variable is decided at run time not in advance. Because of this feature we don’t need to
specify the type of variable.

Apart from the above-mentioned features, Python has a big list of good features, few are listed
below −
 It supports functional and structured programming methods as well as OOP.
 It can be used as a scripting language or can be compiled to byte-code for building large
applications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.
 It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

3.5.2 Back End (MySQL)


MySQL is the world's most used open source relational database management system
(RDBMS) as of 2008 that run as a server providing multi-user access to a number of databases.
The MySQL development project has made its source code available under the terms of the
GNU General Public License, as well as under a variety of proprietary agreements. MySQL was
owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned
by Oracle Corporation.

MySQL is a popular choice of database for use in web applications, and is a central
component of the widely used LAMP open source web application software stack—LAMP is an
acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source projects
that require a full-featured database management system often use MySQL.

For commercial use, several paid editions are available, and offer additional functionality.
Applications which use MySQL databases include: TYPO3, Joomla, Word Press, phpBB,
MyBB, Drupal and other software built on the LAMP software stack. MySQL is also used in
many high-profile, large-scale World Wide Web products, including Wikipedia, Google (though
not for searches), ImagebookTwitter, Flickr, Nokia.com, and YouTube.

Inter images
MySQL is primarily an RDBMS and ships with no GUI tools to administer MySQL
databases or manage data contained within the databases. Users may use the included command
line tools, or use MySQL "front-ends", desktop software and web applications that create and
manage MySQL databases, build database structures, back up data, inspect status, and work with
data records. The official set of MySQL front-end tools, MySQL Workbench is actively
developed by Oracle, and is freely available for use.

Graphical

The official MySQL Workbench is a free integrated environment developed by MySQL


AB, which enables users to graphically administer MySQL databases and visually design
database structures. MySQL Workbench replaces the previous package of software, MySQL
GUI Tools. Similar to other third-party packages, but still considered the authoritative MySQL
frontend, MySQL Workbench lets users manage database design & modeling, SQL development
(replacing MySQL Query Browser) and Database administration (replacing MySQL
Administrator).MySQL Workbench is available in two editions, the regular free and open source
Community Edition which may be downloaded from the MySQL website, and the proprietary
Standard Edition which extends and improves the feature set of the Community Edition.

Command line

MySQL ships with some command line tools. Third-parties have also developed tools to
manage a MySQL server, some listed below. Maatkit - a cross-platform toolkit for MySQL,
PostgreSQL and Memcached, developed in Perl Maatkit can be used to prove replication is
working correctly, fix corrupted data, automate repetitive tasks, and speed up servers. Maatkit is
included with several GNU/Linux distributions such as CentOS and Debian and packages are
available for Programming. MySQL works on many different system platforms, including AIX,
BSDi, FreeBSD, HP-UX, eComStation, i5/OS, IRIX, Linux, Mac OS X, Microsoft Windows,
NetBSD, Novell NetWare, OpenBSD, OpenSolaris, OS/2 Warp, QNX, Solaris, Symbian,
SunOS, SCO Open Server, SCO UnixWare, Sanos and Tru64. A port of MySQL to OpenVMS
also exists.
MySQL is written in C and C++. Its SQL parser is written in yacc, and a home-brewed
lexical analyzer. Many programming languages with language-specific APIs include libraries for
accessing MySQL databases. These include MySQL Connector/Net for integration with
Microsoft's Visual Studio (languages such as C# and VB are most commonly used) and the
JDBC driver for Java. In addition, an ODBC interimage called MyODBC allows additional
programming languages that support the ODBC inter image to communicate with a MySQL
database, such as ASP or ColdFusion. The HTSQL - URL-based query method also ships with a
MySQL adapter, allowing direct interaction between a MySQL database and any web client via
structured URLs.

Features

As of April 2009, MySQL offered MySQL 5.1 in two different variants: the open source
MySQL Community Server and the commercial Enterprise Server. MySQL 5.5 is offered under
the same licenses. They have a common code base and include the following features:

 A broad subset of ANSI SQL 99, as well as extensions


 Cross-platform support
 Stored procedures
 Triggers
 Cursors
 Updatable Views
 Information schema
 Strict mode (ensures MySQL does not truncate or otherwise modify data to conform to an
underlying data type, when an incompatible value is inserted into that type)
 X/Open XAdistributed transaction processing (DTP) support; two phase commit as part
of this, using Oracle's InnoDB engine
 Transactions with the InnoDB, and Cluster storage engines
 SSL support
 Query caching
 Sub-SELECTs (i.e. nested SELECTs)
 Replication support (i.e. Master-Master Replication & Master-Slave Replication) with
one master per slave, many slaves per master, no automatic support for multiple masters per
slave.
 Full-text indexing and searching using MyISAM engine
 Embedded database library
 Partititoned tables with pruning of partitions in optimiser
 Shared-nothing clustering through MySQL Cluster
 Hot backup (via mysqlhotcopy) under certain conditions
 Multiple storage engines, allowing one to choose the one that is most effective for each
table in the application (in MySQL 5.0, storage engines must be compiled in; in MySQL 5.1,
storage engines can be dynamically loaded at run time): Native storage engines (MyISAM,
Falcon, Merge, Memory (heap), Federated, Archive, CSV, Blackhole, Cluster, EXAMPLE,
Maria, and InnoDB, which was made the default as of 5.5). Partner-developed storage engines
(solidDB, NitroEDB, ScaleDB, TokuDB, Infobright (formerly Brighthouse), Kickfire, XtraDB,
IBM DB2). InnoDB used to be a partner-developed storage engine, but with recent acquisitions,
Oracle now owns both MySQL core and InnoDB.

CHAPTER 4
FEASIBILITY STUDY

3.1 PROBLEM ANALYSIS

Depending on the results of the initial investigation the survey is now expanded to a more
detailed feasibility study. “FEASIBILITY STUDY” is a test of system proposal according to its
workability, impact of the organization, ability to meet needs and effective use of the resources.
It focuses on these major questions:

 What are the user’s demonstrable needs and how does a candidate system meet them?
 What resources are available for given candidate system?
 What are the likely impacts of the candidate system on the organization?
 Whether it is worth to solve the problem?

During feasibility analysis for this project, events and alerts are to be considered. Investigation
and generating ideas about a new system does this.

3.1.1 TECHNICAL FEASIBILITY

A study of resource availability that may affect the ability to achieve an acceptable
system. This evaluation determines whether the technology needed for the proposed system is
available or not.

 Can the work for the project be done with current equipment existing software
technology & available personal?
 Can the system be upgraded if developed?
 If new technology is needed then what can be developed?

3.1.2 ECONOMICAL FEASIBILITY

Economic justification is generally the “Bottom Line” consideration for most systems.
Economic justification includes a broad range of concerns that includes cost benefit analysis. In
this we weight the cost and the benefits associated with the candidate system and if it suits the
basic purpose of the organization i.e. profit making, the project is making to the analysis and
design phase. The financial and the economic questions during the preliminary investigation are
verified to estimate the following:

• The cost to conduct a full system investigation.

• The cost of hardware and software for the class of application being considered.

• The benefits in the form of reduced cost.

• The proposed system will give the minute information, as a result the performance is improved
which in turn may be expected to provide increased profits.

• This feasibility checks whether the system can be developed with events and alert monitoring
does not require the manual work. This can be done economically if planned judicially, so it is
economically feasible. The cost of project depends upon the number of man hours required.

3.1.3 OPERATIONAL FEASIBILITY

It is mainly related to human organizations and political aspects. The points to be


considered are:

 What changes will be brought with the system?


 What organization structures are disturbed?
 What new skills will be required? Do the existing staff members have these
skills? If not, can they be trained in due course of time?

The system is operationally feasible as it very easy for the End users to operate it. It only needs
basic information about Windows platform.

3.1.4 SCHEDULE FEASIBILITY

Time evaluation is the most important consideration in the development of project. The
time schedule required for the developed of this project is very important since more
development time effect machine time, cost and cause delay in the development of other
systems. A reliable VM monitoring system can be developed in the considerable amount of time.

CHAPTER 5
SYSTEM DEVELOPMENT ENVIRONMENT
5.1 DATA FLOW DIAGRAM

Income tax manager

Income tax payment processing management system

Admin Database

User

Level 0

Login
Store the data

Admin
Admin view
Retrieving the data
Register
Store the data

Login
Retrieving the data

Income tax manager


Add tax details
Store the data

View payment details

Retrieving the data

Register
Store the data

Login
Retrieving the data

User
View tax details
Retrieving the data

Transaction

Store the data


Level 1 DFD

5.2 DATA DICTIONARY

5.2.1 TABLE STRUCTURE FOR TABLE ADMIN

Field Type Null Default

username varchar(50) Yes NULL

password varchar(50) Yes NULL

5.2.2 Table structure for table pay_amount

Field Type Null Default

id int(11) Yes NULL

username varchar(100) Yes NULL

accountno varchar(100) Yes NULL

cvv varchar(100) Yes NULL


edate varchar(100) Yes NULL

pay_date varchar(100) Yes NULL

5.2.3 TABLE STRUCTURE FOR TABLE USER_REGISTER

Field Type Null Default

id int(11) Yes NULL

name varchar(100) Yes NULL

address varchar(200) Yes NULL

mobile varchar(50) Yes NULL

email varchar(50) Yes NULL

username varchar(50) Yes NULL

password varchar(50) Yes NULL

rdate varchar(50) Yes NULL


5.4 RELATIONSHIP DIAGRAM
Entity Relationship Diagram, also known as ERD, ER Diagram or ER model, is a type
of structural diagram for use in database design. An ERD contains different symbols and
connectors that visualize two important information: The major entities within the system
scope, and the inter-relationships among these entities.And that's why it's called "Entity"
"Relationship" diagram (ERD)!When we talk about entities in ERD, very often we are
referring to business objects such as people/role (e.g. Student), tangible business objects (e.g.
Product), intangible business objects (e.g. Log), etc. "Relationship" is about how these entities
relate to each other within the system.

FIG 5.1.1 ER DIAGRAM


CHAPTER 6

SYSTEM DESIGN
6.1 ARCHITECTURE DESIGN
A system architecture or systems architecture is the conceptual model that defines the
structure, behavior, and more views of a system. An architecture description is a formal
description and representation of a system, organized in a way that supports reasoning about the
structures and behaviors of the system. System architecture can comprise system components,
the externally visible properties of those components, the relationships (e.g. the behavior)
between them. It can provide a plan from which products can be procured, and systems
developed, that will work together to implement the overall system. There have been efforts to
formalize languages to describe system architecture; collectively these are called architecture
description languages (ADLs).

Various organizations define systems architecture in different ways, including:

 An allocated arrangement of physical elements which provides the design solution for a
consumer product or life-cycle process intended to satisfy the requirements of the
functional architecture and the requirements baseline.
 Architecture comprises the most important, pervasive, top-level, strategic inventions,
decisions, and their associated rationales about the overall structure (i.e., essential
elements and their relationships) and associated characteristics and behavior.
 If documented, it may include information such as a detailed inventory of current
hardware, software and networking capabilities; a description of long-range plans and
priorities for future purchases, and a plan for upgrading and/or replacing dated equipment
and software.

An architecture diagram is a graphical representation of a set of concepts that are part of


architecture, including their principles, elements and components. Architecture diagram can help
system designers and developers visualize the high-level, overall structure of their system or
application, in order to ensure the system meets their users' needs. Using architecture diagram,
you can also describe patterns that are used throughout the design. It's somewhat like a blueprint
that you use as a guide, so that you and your colleagues can discuss, improve and follow.

INCOME TAX DEPARTMENT

ADMIN USER TAX MANGER C

LOGIN REGISTER LOGIN

ADD MANGER LOGIN ADD TAX

VIEW TAX VIEW USER


VIEW USER

PAY TAX LOGOUT


LOGOUT
CHAPTER 7

SYSTEM TESTING

7.1 SYSTEM TESTING

Testing

Testing is a series of different tests that whose primary purpose is to fully exercise the
computer based system. Although each test has a different purpose, all work should verify that
all system element have been properly integrated and performed allocated function. Testing is
the process of checking whether the developed system works according to the actual requirement
and objectives of the system. The philosophy behind testing is to find the errors. A good test is
one that has a high probability of finding an undiscovered error. A successful test is one that
uncovers the undiscovered error. Test cases are devised with this purpose in mind. A test case is
a set of data that the system will process as an input.

5.1.1 Types of Testing:

 System testing

After a system has been verified, it needs to be thoroughly tested to ensure that every component
of the system is performing in accordance with the specific requirements and that it is operating
as it should including when the wrong functions are requested or the wrong data is introduced. 
Testing measures consist of developing a set of test criteria either for the entire system or for
specific hardware, software and communications components. For an important and sensitive
system such as an electronic voting system, a structured system testing program may be
established to ensure that all aspects of the system are thoroughly tested.

Testing measures that could be followed include: 

 Applying functional tests to determine whether the test criteria have been met
 Applying qualitative assessments to determine whether the test criteria have
been met. 
 Conducting tests in “laboratory” conditions and conducting tests in a variety of
“real life” conditions. 
 Conducting tests over an extended period of time to ensure systems can
perform consistently. 
 Conducting “load tests”, simulating as close as possible likely conditions while
using or exceeding the amounts of data that can be expected to be handled in an
actual situation. 
Test measures for hardware may include: 

 Applying “non-operating” tests to ensure that equipment can stand up to expected levels
of physical handling.
 Testing “hard wired” code in hardware (firmware) to ensure its logical correctness and
that appropriate standards are followed.

Tests for software components also include:

 Testing all programs to ensure its logical correctness and that appropriate design,
development and implementation standards have been followed.
 Conducting “load tests”, simulating as close as possible a variety of “real life” conditions
using or exceeding the amounts of data that could be expected in an actual situation.
 Verifying that integrity of data is maintained throughout its required manipulation.

 Unit testing
The first test in the development process is the unit test. The source code is normally divided into
modules, which in turn are divided into smaller units called units. These units have specific
behavior. The test done on these units of code is called unit test. Unit test depends upon the
language on which the project is developed.

Unit tests ensure that each unique path of the project performs accurately to the documented
specifications and contains clearly defined inputs and expected results. Functional and reliability
testing in an Engineering environment. Producing tests for the behavior of components (nodes
and vertices) of a product to ensure their correct behavior prior to system integration.

 System testing

Several modules constitute a project. If the project is long-term project, several developers write
the modules. Once all the modules are integrated, several errors may arise. The testing done at
this stage is called system test. System testing ensures that the entire integrated software system
meets requirements. It tests a configuration to ensure known and predictable results. System
testing is based on process descriptions and flows, emphasizing pre-driven process links and
integration points. Testing a specific hardware/software installation. This is typically performed
on a COTS (commercial off the shelf) system or any other system comprised of disparate parts
where custom configurations and/or unique installations are the norm.

 Integration testing

Testing is which modules are combined and tested as a group. Modules are typically code
modules, individual applications, source and destination applications on a network, etc.
Integration Testing follows unit testing and precedes system testing. Testing after the product is
code complete. Betas are often widely distributed or even distributed to the public at large in
hopes that they will buy the final product when it is release.
CHAPTER 6

CONCLUSION
The system interface is very user-friendly; a person with basic computer/web skills can
easily use the system. Flexibility is another aspect of the proposed system which gives room to
add new features, modules and future enhancements as per requirement. Easy to pay tax through
this system. It consume less time. Income tax office can collects tax information from all citizens
and different authorities based on the user registration details. Easy to retrieve the user details.It
reduce paper work and energy.

6.1 SAMPLE CODING

import datetime
from random import random
import random
from datetime import date
import datetime
from flask import Flask,render_template, Response, redirect, request, session, abort, url_for
import pymysql

# db = pymysql.connect("localhost","root","","income_tax")
import mysql.connector
db = mysql.connector.connect(
host="localhost",
user="root",
password="",
charset="utf8",
database="income_tax"

port = 587
smtp_server = "smtp.gmail.com"
sender_email = "serverkey2018@gmail.com"
password ="extazee2018"

UPLOAD_FOLDER = 'D:\\python\\phishing_merchant\\QRCode'
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
app = Flask(__name__)
app.secret_key = 'abcdef'
app.config.from_object(__name__)
app.config['SECRET_KEY'] = '7d441f27d441f27567d441f2b6176a'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

@app.route('/')
def index():
value="arun"
return render_template("index.html",value=value)

@app.route('/admin_login',methods=['GET','POST'])
def admin_login():
value="arun"
msg = ""
if request.method == 'POST':
uname = request.form['username']
pwd = request.form['password']
cursor = db.cursor()
cursor.execute('SELECT * FROM admin WHERE username = %s and password = %s',
(uname,pwd))
account = cursor.fetchone()
cursor.close()
if account:
session['uname'] = uname
return redirect(url_for('admin_home'))
else:
# Account doesnt exist or username/password incorrect
msg = 'Incorrect Username And Password!'
return render_template("admin_login.html",value=value,msg=msg)

@app.route('/admin_home',methods=['POST','GET'])
def admin_home():
value="arun"
cursor = db.cursor()
cursor.execute('SELECT * FROM pay_amount')
account = cursor.fetchall()
return render_template("admin_home.html",value=value)

@app.route('/admin_view_user',methods=['POST','GET'])
def admin_view_user():
value="arun"
cursor = db.cursor()
cursor.execute('SELECT * FROM user_register')
data = cursor.fetchall()
return render_template("admin_view_user.html",value=value,data=data)

@app.route('/admin_view_tax',methods=['POST','GET'])
def admin_view_tax():
value="arun"
cursor = db.cursor()
cursor.execute('SELECT * FROM add_income_tax')
account = cursor.fetchall()
# print(account)
return render_template("admin_view_tax.html",value=value,account=account)

@app.route('/admin_add_manager',methods=['POST','GET'])
def admin_add_manager():
value = "arun"
if request.method == 'POST':
name = request.form['name']
gender = request.form['gender']
age = request.form['age']
address = request.form['address']
mobile = request.form['mobile']
email = request.form['email']
uname = request.form['uname']
pass1 = request.form['pass']
rdate = datetime.date.today()
# print(rdate)
mycursor = db.cursor()
mycursor.execute("SELECT max(id)+1 FROM add_manager")
maxid = mycursor.fetchone()[0]
if maxid is None:
maxid = 1

now = datetime.datetime.now()
rdate = now.strftime("%d-%m-%Y")
cursor = db.cursor()
sql = "INSERT INTO add_manager(id,name,age,gender,address,mobile,email,uname,pass,rdate)
VALUES ( %s,%s,%s, %s, %s, %s, %s, %s, %s, %s)"
val = (maxid, name,age, gender,address, mobile, email, uname, pass1, rdate)
cursor.execute(sql, val)
db.commit()
print(cursor.rowcount, "Registered Success")
result = "sucess"

if cursor.rowcount == 1:
act="Add Manager Success"
return redirect(url_for('admin_add_manager', act=act))
else:
act = "Failed.."
return redirect(url_for('user_register', act=act))
# msg='Already Exist'
return render_template("admin_add_manager.html",value=value)

# @app.route('/admin_view_user',methods=['POST','GET'])
# def admin_view_user():
# value="arun"
# return render_template("admin_view_user.html",value=value)
# @app.route('/admin_view_tax',methods=['POST','GET'])
# def admin_view_tax():
# value="arun"
# return render_template("admin_view_tax.html",value=value)

@app.route('/user_login',methods=['GET','POST'])
def user_login():
value="arun"
msg = ""
if request.method == 'POST':
uname = request.form['username']
pwd = request.form['password']
cursor = db.cursor()
cursor.execute('SELECT * FROM user_register WHERE username = %s and password = %s',
(uname, pwd))
account = cursor.fetchone()
cursor.close()
if account:
session['uname'] = uname
return redirect(url_for('user_home'))
else:
# Account doesnt exist or username/password incorrect
msg = 'Incorrect Username And Password!'
return render_template("user_login.html",value=value,msg=msg)

@app.route('/user_home',methods=['POST','GET'])
def user_home():
uname=session['uname']

return render_template("user_home.html",value=uname)

@app.route('/user_view_income_tax', methods=['POST', 'GET'])


def user_view_income_tax():
value = session['uname']
# print(value)
cursor = db.cursor()
cursor.execute("SELECT * FROM add_income_tax where username='"+value+"'")
data = cursor.fetchall()
cursor.close()
return render_template("user_view_income_tax.html", data=data)

@app.route('/User_payment/<string:bid>', methods=['POST', 'GET'])


def User_payment(bid):
print(bid)
cursor = db.cursor()
cursor.execute("SELECT * FROM add_income_tax where id='"+bid+"'")
account = cursor.fetchall()
if account is None:
return render_template("user_home.html")
else:
uname = session['uname']
if request.method == 'POST':
accountno = request.form['accountno']
cvvno = request.form['cvv']
edate = request.form['edate']
rdate = datetime.date.today()
# print(rdate)

mycursor = db.cursor()
mycursor.execute("SELECT max(id)+1 FROM pay_amount")
maxid = mycursor.fetchone()[0]
if maxid is None:
maxid = 1
amount=100
now = datetime.datetime.now()
rdate = now.strftime("%d-%m-%Y")
cursor = db.cursor()
sql = "INSERT INTO pay_amount(id,username,accountno,cvv,edate,pay_date) VALUES ( %s,
%s, %s, %s, %s, %s)"
val = (maxid, uname,accountno, cvvno, edate, rdate)
cursor.execute(sql, val)
db.commit()
# print(cursor.rowcount, "Payment Success")

if cursor.rowcount == 1:
tot_amt=1
report = random.randrange(1000, 10000)
cursor1 = db.cursor()
sql = cursor1.execute('UPDATE add_income_tax SET status=%s,report=%s WHERE id=%s',
(tot_amt,report, bid))
# print(sql)
cursor1.close()
db.commit()
return redirect(url_for('user_home'))
else:
act="Failed...."
return redirect(url_for('User_payment',act=act))
return render_template("User_payment.html", value=uname)

@app.route('/user_view_bill', methods=['POST','GET'])
def user_view_bill():
uname = session['uname']
st=2
print(st)
cursor = db.cursor()
cursor.execute("SELECT * FROM add_income_tax where username='" + uname + "'")
data = cursor.fetchall()
cursor.close()
return render_template("user_view_bill.html", value=uname,data=data)

@app.route('/view_bill/<string:bid>', methods=['POST','GET'])
def view_bill(bid):
uname = session['uname']
cursor = db.cursor()
cursor.execute("SELECT * FROM add_income_tax where id='" + bid + "'")
account = cursor.fetchone()
return render_template("view_bill.html", value=uname,account=account)

@app.route('/user_register',methods=['GET','POST'])
def user_register():
value="arun"
if request.method == 'POST':
name = request.form['name']
address = request.form['address']
mobile = request.form['mobile']
email = request.form['email']
uname = request.form['uname']
pass1 = request.form['pass']
# rdate = datetime.date.today()
# print(rdate)

mycursor = db.cursor()
mycursor.execute("SELECT max(id)+1 FROM user_register")
maxid = mycursor.fetchone()[0]
if maxid is None:
maxid = 1

now = datetime.datetime.now()
rdate = now.strftime("%d-%m-%Y")
cursor = db.cursor()
sql = "INSERT INTO user_register(id,name,address,mobile,email,username,password,rdate)
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s)"
val = (maxid, name, address, mobile, email, uname, pass1, rdate)
cursor.execute(sql, val)
db.commit()
# print(cursor.rowcount, "Registered Success")
result = "sucess"

if cursor.rowcount == 1:
return redirect(url_for('user_login'))
else:
act="Failed.."
return redirect(url_for('user_register',act=act))
# msg='Already Exist'
return render_template("user_register.html",value=value)

@app.route('/manager_login',methods=['GET','POST'])
def manager_login():
value="arun"
msg = ""
if request.method == 'POST':
uname = request.form['username']
pwd = request.form['password']
cursor = db.cursor()
cursor.execute('SELECT * FROM add_manager WHERE uname = %s and pass = %s', (uname,
pwd))
account = cursor.fetchone()
cursor.close()
if account:
session['uname'] = uname
return redirect(url_for('manager_home'))
else:
# Account doesnt exist or username/password incorrect
msg = 'Incorrect Username And Password!'
return render_template("manager_login.html",value=value)

@app.route('/manager_home',methods=['POST','GET'])
def manager_home():
value="arun"
username = session['uname']
return render_template("manager_home.html",value=value,username=username)
@app.route('/manager_add_tax',methods=['POST','GET'])
def manager_add_tax():

cursor = db.cursor()
cursor.execute('SELECT * FROM user_register')
values = cursor.fetchall()
username = session['uname']

if request.method == 'POST':
uname = request.form['user']
amount = request.form['amount']
tmonth = request.form['tmonth']
fdate = request.form['fdate']

rdate = datetime.date.today()
print(rdate)

mycursor = db.cursor()
mycursor.execute("SELECT max(id)+1 FROM add_income_tax")
maxid = mycursor.fetchone()[0]
if maxid is None:
maxid = 1

now = datetime.datetime.now()
rdate = now.strftime("%d-%m-%Y")
cursor = db.cursor()
sql = "INSERT INTO
add_income_tax(id,username,amount,tmonth,fmonth,status,report,m_name,rdate) VALUES (%s,
%s, %s, %s, %s, %s, %s, %s, %s)"
val = (maxid, uname, amount, tmonth, fdate, 0, 0, username,rdate)
cursor.execute(sql, val)
db.commit()
print(cursor.rowcount, "Registered Success")
result = "sucess"

if cursor.rowcount == 1:
act="SuccessFully"
return redirect(url_for('manager_add_tax',act=act))
else:
act = "Failed.."
return redirect(url_for('user_register', act=act))
# msg='Already Exist'
return render_template("manager_add_tax.html",values=values,username=username)

@app.route('/manager_view_tax',methods=['POST','GET'])
def manager_view_tax():
username = session['uname']
cursor = db.cursor()
cursor.execute("SELECT * FROM add_income_tax where m_name='"+username+"'")
account = cursor.fetchall()
return render_template("manager_view_tax.html",username=username,account=account)

@app.route('/manager_verify/<string:bid>',methods=['POST','GET'])
def manager_verify(bid):
username = session['uname']
tot_amt=2
report = random.randrange(1000, 10000)
cursor = db.cursor()
cursor.execute("SELECT * FROM add_income_tax where m_name='"+username+"'")
account = cursor.fetchall()
cursor1 = db.cursor()
sql = cursor1.execute('UPDATE add_income_tax SET status=%s,report=%s WHERE id=%s',
(tot_amt,report,bid))
print(sql)
cursor1.close()
db.commit()
if sql:
act = "SuccessFully"
return redirect(url_for('manager_add_tax', act=act))

return render_template("manager_view_tax.html",username=username,account=account)

@app.route('/logout',methods=['POST','GET'])
def logout():
return render_template("index.html")

if __name__ == '__main__':
app.debug = True
app.run()
SCREENSHOTS

You might also like