Banking System (1)
Banking System (1)
Banking System (1)
INDEX
1.CERTIFICATE
2.ACKNOWLEDGMENT
3.SYNOPSIS
4.OUTPUT SCREENSHOTS
5.PYTHON CODE
6.MYSQL CODE
7.BIBLIOGRAPHY
CERTIFICATE
Signature of
internal Examiner
Signature of
External Examiner
ACKNOWL
EDGEMEN
T
First and foremost, I would like to
thank my Computer Science Teacher
Ruchi Ma’am, who guided me in doing
this project on Banking System. She
provided us with invaluable advice and
helped us in difficult periods. Her
motivation and help contributed
tremendously to the successful
completion of the project.
I would also like to thank my Principal
Mam , Ma’am Dipinder Kaur who
always boosted our enthusiasm .
Besides, I would like to thank my project
partner who helped me with great ideas
and completed this project.
Also, I would like to thank my family and
friends for their support. Without that
support, I could not have succeeded in
completing this project.
In the end, I would like to thank everyone
who helped and motivated me to work on
this project.
SYNOPSIS
BANK MANAGEMENT SYSTEM-
This project is useful for the bank employees as
well as customers to keep a track of account
details. The emerging of digital system made
information available on finger tips. By
automating the transactions one can view the
details as and when required in no time. This
project emphasizes on creation of new customer
accounts, managing the existing account
holders in the bank, by making digital system
one can generate real time daily reports,
monthly reports and annual reports which can
enhance the system.
ADD ACCOUNT-
Menu
MODIFY ACC
CLOSE ACC
PAN MENU
Deposit Amt-
Withdraw Amt-
SEARCH MENU
Account No-
Pan Card-
Phone No-
Email-
Name-
REPORT MENU
Daily Report-
Monthly Report-
Account Details-
CLOSE APPLICATION
PYTHON CODE
import mysql.connector
from datetime import date
def clear():
for _ in range(65):
print()
def account_status(acno):
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
sql ="select status,balance from customer where acno
='"+acno+"'"
result = cursor.execute(sql)
result = cursor.fetchone()
conn.commit()
conn.close()
return result
def deposit_amount():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
clear()
acno = input('Enter account No :')
amount = input('Enter amount :')
today = date.today()
result = account_status(acno)
if result [0]== 'active':
sql1 ="update customer set balance =
balance+"+amount + ' where acno = '+acno+' and
status="active";'
sql2 = 'insert into transaction(amount,type,acno,dot)
values(' + amount +',"deposit",'+acno+',"'+str(today)+'");'
cursor.execute(sql2)
cursor.execute(sql1)
#print(sql1)
#print(sql2)
print('\n\namount deposited')
else:
print('\n\nClosed or Suspended Account....')
def withdraw_amount():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
clear()
acno = input('Enter account No :')
amount = input('Enter amount :')
today = date.today()
result = account_status(acno)
if result[0] == 'active' and int(result[1])>=int(amount):
sql1 = "update customer set balance = balance-" + \
amount + ' where acno = '+acno+' and
status="active";'
sql2 = 'insert into transaction(amount,type,acno,dot)
values(' + \
amount + ',"withdraw",'+acno+',"'+str(today)+'");'
cursor.execute(sql2)
cursor.execute(sql1)
#print(sql1)
#print(sql2)
print('\n\namount Withdrawn')
else:
print('\n\nClosed or Suspended Account.Or Insufficient
amount')
def transaction_menu():
while True:
clear()
print(' Trasaction Menu')
print("\n1. Deposit Amount")
print('\n2. WithDraw Amount')
print('\n3. Back to Main Menu')
print('\n\n')
choice = int(input('Enter your choice ...: '))
if choice == 1:
deposit_amount()
if choice == 2:
withdraw_amount()
if choice == 3:
break
def search_menu():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
while True:
clear()
print(' Search Menu')
print("\n1. Account No")
print('\n2. pan Card')
print('\n3. Phone No')
print('\n4. Email')
print('\n5. Names')
print('\n6. Back to Main Menu')
choice = int(input('Enter your choice ...: '))
field_name=''
if choice == 1:
field_name ='acno'
if choice == 2:
field_name ='pan_no'
if choice == 3:
field_name = 'phone'
if choice == 4:
field_name = 'email'
if choice == 5:
field_name = 'name'
if choice == 6:
break
msg ='Enter '+field_name+': '
value = input(msg)
if field_name=='acno':
sql = 'select * from customer where '+field_name + ' =
'+value+';'
else:
sql = 'select * from customer where '+field_name +' like
"%'+value+'%";'
#print(sql)
cursor.execute(sql)
records = cursor.fetchall()
n = len(records)
clear()
print('Search Result for ', field_name, ' ',value)
print('-'*80)
for record in records:
print(record[0], record[1], record[2], record[3],
record[4], record[5], record[6], record[7], record[8])
if(n <= 0):
print(field_name, ' ', value, ' does not exist')
wait = input('\n\n\n Press any key to continue....')
conn.commit()
conn.close()
wait=input('\n\n\n Press any key to continue....')
def daily_report():
clear()
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
today = date.today()
cursor = conn.cursor()
sql = 'select tid,dot,amount,type,acno from transaction t
where dot="'+ str(today)+'";'
cursor.execute(sql)
records = cursor.fetchall()
clear()
print('Daily Report :',today)
print('-'*120)
for record in records:
print(record[0], record[1], record[2], record[3],
record[4])
print('-'*120)
conn.commit()
conn.close()
wait = input('\n\n\n Press any key to continue....')
def monthly_report():
clear()
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
today = date.today()
cursor = conn.cursor()
sql = 'select tid,dot,amount,type,acno from transaction t
where month(dot)="' + \
str(today).split('-')[1]+'";'
cursor.execute(sql)
records = cursor.fetchall()
clear()
print(sql)
print('Monthly Report :', str(today).split(
'-')[1], '-,', str(today).split('-')[0])
print('-'*120)
for record in records:
print(record[0], record[1], record[2], record[3],
record[4])
print('-'*120)
conn.commit()
conn.close()
wait = input('\n\n\n Press any key to continue....')
def account_details():
clear()
acno = input('\nEnter account no :')
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
sql ='select * from customer where acno ='+acno+';'
sql1 = 'select tid,dot,amount,type from transaction t
where t.acno='+acno+';'
cursor.execute(sql)
result = cursor.fetchone()
clear()
print('Account Details')
print('-'*120+'|')
print('Account No : ',result[0])
print('Customer Name : ',result[1])
print('Address : ',result[2])
print('Phone NO : ',result[3])
print('Email ID : ',result[4])
print('pan No : ',result[5])
print('Account Type : ',result[6])
print('Account Status : ',result[7])
print('Current Balance : ',result[8])
print('-'*120)
cursor.execute(sql1)
results = cursor.fetchall()
print('Transaction Details')
print('TID',' ','DOT',' ', 'AMOUNT',' ',"TYPE")
for result in results:
print(result[0],' ', result[1],' ', result[2],' ', result[3],)
conn.commit()
conn.close()
wait=input('\n\n\nPress any key to continue.....')
def report_menu():
while True:
clear()
print(' Report Menu')
print("\n1. Daily Report")
print('\n2. Monthly Report')
print('\n3. Account Details')
print('\n4. Back to Main Menu')
choice = int(input('\nEnter your choice ...: '))
if choice == 1:
daily_report()
if choice == 2:
monthly_report()
if choice == 3:
account_details()
if choice == 4:
break
def validation_email():
email = input('Enter Email :')
if '@' in email and '.' in email:
return email
else:
print('incorrect mail id\n\n\n\n')
validation_email()
def validation_phno():
phone = input('Enter Phone no :')
if len(list(phone))==10:
return phone
else:
print('incorrect phone no.\n\n\n\n')
validation_phno()
def validation_pan():
pan = input('Enter pan no :')
if pan[0:5].isalpha()==True and pan[5:9].isdigit()==True
and pan[9].isalpha()==True and len(pan)==10:
return(pan)
else:
print('incorrect pan no.\n\n\n\n')
validation_pan()
def add_account():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
def close_account():
conn = mysql.connector.connect(
host='localhost', database='bankproject', user='root',
password='Hello1234%')
cursor = conn.cursor()
clear()
acno = input('Enter customer Account No :')
sql ='update customer set status="close" where acno
='+acno+';'
cursor.execute(sql)
conn.commit()
conn.close()
print('Account closed')
def main_menu():
while True:
clear()
print(' Main Menu')
print("\n1. Add Account")
print('\n2. Modify Account')
print('\n3. Close Account')
print('\n4. Transaction Menu')
print('\n5. Search Menu')
print('\n6. Report Menu')
print('\n7. Close application')
print('\n\n')
choice = int(input('Enter your choice ...: '))
if choice == 1:
add_account()
if choice == 2:
modify_account()
if choice == 3:
close_account()
if choice ==4 :
transaction_menu()
if choice ==5 :
search_menu()
if choice == 6:
report_menu()
if choice ==7 :
break
if _name_ == "_main_":
main_menu()
SQL CODE
import mysql.connector
conn= mysql.connector.connect(host='localhost',
database='bankproject', user='root', password='Y0145')
mycur=conn.cursor()
conn= mysql.connector.connect(host='localhost',
database='bankproject', user='root', password='Y0145')
mycur=conn.cursor()
mycur.execute("CREATE TABLE TRANSACTION(TID INT(11)
AUTO_INCREMENT PRIMARY KEY, DOT DATE,AMOUNT
INT(10),TYPE CHAR(20),Acno INT(10) references customer(Acno))")
import mysql.connector
conn= mysql.connector.connect(host='localhost',
database='bankproject', user='root', password='Y0145')
mycur=conn.cursor()
sql='INSERT INTO
Customer(acno,name,address,phone,email,PAN_no,acc_type,statu
s,balance) VALUES(%s,%s, %s, %s, %s,%s,%s,%s,%s);'
val=[(1,'rakesh kumar','cf-4 surya
nagar',987181818,'support@cbsetoday.com','ABCDE1234A','saving'
,'active',12200.00),
www.google.com