Ashnel Project CSC
Ashnel Project CSC
SR NO TOPIC PAGE NO
1 Acknowledgement 3
10 Bibliography 52
ACKNOWLEGMENT
I would like to express my special thanks to Mrs.
Lekshmi Sunil, my teacher who gave me this
opportunity to go forward with this Computer
Science project, which engaged me into a lot of
research, and I learnt quite a lot of new things.
Without her guidance and support it would have
been impossible to complete this project.
Secondly, I would also like to thank my friend, Joel
who helped me clear my doubts, rectify errors and
help me complete the project. I designed the
project not only for the sake of marks, but also for
applying the programming knowledge I gained at
school into practical life.
Once again thanks to all who helped me in doing
this project.
ABU DHABI PROPERTIES
MANAGEMENT SYSTEM
AIM OF THE
PROJECT
In today’s world, everything is happening online. When I
was younger, I was keen to learn about real estate so I
assumed it would be a perfect idea to make a Property
management system. Although there are a lot of property
management systems, I wanted to try to make one myself.
import turtle:
This package is used to display attractive animation created using
functions and methods provided.
import colorsys:
This line imports the 'colorsys' module, providing color manipulation
utilities, particularly for conversions between RGB and other color
systems in Python.
FUNCTIONS
connect():
This function establishes connection between Python and
MySQL.
cursor():
It is a special control structure that facilitates the row-by- row
processing of records in the result set.
The syntax is: <cursor object>=<connection object>.cursor()
execute():
This function is use to execute the sql query and retrieve records
using python.
The syntax is:
<cursor object>.execute(<sql query string>)
fetchall():
This function will return all the rows from the result set in the
form of a tuple containing the records.
commit():
This function provides changes in the database physically.
Brief Description Of The Project
The project is based on Project Management
System. The project consists of main
functions:
1. loginpage()
This function is used to display the login screen of the project.
The login screen is encrypted with a password (“Ashnel”)
committing to the username (“Ashnel”)
2. mainMenu()
This function is used for the design of the main menu
where the customer has 6 different options rent(view),buy(view),commercial
properties(view), mortgage, accounts, payment, display and quit
3. def forward1(rent,rentlist,image_number) and def
back1(rent,rentlist,image_number):
These Python functions 'forward1' and 'back1' create a GUI for navigating images
which are in rent(view), buy(view) and commercial properties(view).
'forward1' sets up forward navigation with ' >>' button, disabling at the 4th image,
and 'back1' manages backward navigation, disabling '<<' at the first image.
Both functions display images using Labels and control button states in a specified
grid layout for image viewing.
It displays images in a grid layout, allowing forward and backward navigation through
images.
Includes buttons for navigation, exit, and layout management using Tkinter library.
5. rnt():
The 'rnt' function creates a rent selection GUI with Tkinter.
It sets up buttons for various bedroom options with corresponding prices and a quit
button.
Includes image display, window configuration, and click tracking functionality for the
interface.
6. buy():
The 'buy' function constructs a Tkinter GUI for property purchase options.
It showcases buttons for various bedroom choices with their respective price ranges.
Includes an image display, window setup, and the ability to navigate through different
property options with corresponding prices.
7. cp(): #short for commercial properties
The 'cp' function creates a Tkinter-based GUI for commercial property selection.
It displays options for offices, showrooms, and operative villages with specific price
ranges.
Incorporates an image display, window setup, and button navigation to explore
different commercial property categories.
8. mortgage()
The 'mortgage' function generates a basic mortgage calculator using Tkinter.
It takes user inputs for loan amount, interest rate, and loan term, calculating the monthly
payment based on these values.
Incorporates error handling for invalid inputs and provides a 'Quit' button to exit the
application.
9. accountss()
The 'accountss' function sets up a Tkinter interface for managing accounts, enabling
various operations.
View Accounts: Opens a new window displaying existing account details, allowing
deletion of selected accounts.
Withdraw: Provides a window to perform a withdrawal from a selected account,
validating the input and updating the account balance.
Deposit: Allows depositing money into an account after validating the input and
updating the account balance.
Create Account: Opens a window to create a new account by entering necessary details
like account number, name, phone number, and initial money.
Quit: Closes the account management window, returning to the main menu.
10.py()
The py() function defines a Tkinter application window titled "Payments" that handles
different payment-related functionalities. It contains the following elements and
functionalities:
Binds a click event to the window so that the coordinates can be tracked if needed.
Provides a 'Quit' button to close the payment window and return to the main menu.
Overall, this code creates a payment management window where users can initiate
property transactions and simulates the payment process for different property
types.
11.fndisplay()
The fndisplay() function appears to create a Tkinter application window for displaying
data in a structured format using a Treeview widget. Here's a breakdown of its
functionalities:
Attempts to establish a connection to a MySQL database using the mysql.connector
library (mys.connect) by providing the required credentials (host, user, password, and
database name).
Constructs an SQL query to retrieve data from the 'account' and 'acc_property' tables.
Executes the query and fetches the results.
Populates the Treeview widget with the retrieved data in the form of rows, where
each row contains details of account numbers, names, phone numbers, available
money, and properties.
Exception Handling:
Encloses the database-related operations within a try-except block to catch and print
any exceptions that might occur during the execution of the database operations.
System
OS Name - Microsoft Windows 11 Home
Version 10.0.22621 Build 22621
System Manufacturer LENOVO
BIOS Version/Date LENOVO BGCN33WW, 24/11/2020
Processor Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz, 2400 Mhz, 4
Core(s), 8 Logical Processor(s)
System Type x64-based PC
Display Device
Device name AshnelLaptop
Processor Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz 2.40 GHz
Installed RAM 16.0 GB (15.9 GB usable)
SOURCE CODE
import tkinter as tk
from tkinter import END, font, messagebox, ttk
from PIL import Image,ImageTk
import mysql.connector as mys
from tkinter import Label
import tkinter as tk
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
import os
import tkinter.font as font
import colorsys
import turtle
from PIL import Image, ImageTk
import mysql.connector as mys
import turtle
colors = ['blue', 'white']
t= turtle.Pen()
t.speed('fastest')
turtle.bgcolor("black")
for x in range(200):
t.pencolor(colors[x%2])
t.width(x/100 + 1)
t.forward(x)
t.left(59)
import turtle
frame = turtle.Screen().bgcolor("Black")
draw = turtle.Turtle()
turtle.color('yellow')
style = ('Times New Roman', 30, 'bold')
turtle.write('WELCOME TO PROPERTY MANAGEMENT SYSTEM!', font=style, align='center')
turtle.hideturtle()
turtle.exitonclick()
def loginpage():
a1 = tk.Tk()
a1.title("Login")
a1.geometry("450x350")
a1.resizable(False, False)
def login():
user = userEnter.get()
pas = passEnter.get()
a1.mainloop()
def forward1(rent,rentlist,image_number):
my_rent = Label(image=rentlist[image_number-1])
button_forward = Button(rent, text=">>", command=lambda:
forward1(rent,rentlist,image_number+1))
button_back = Button(rent, text="<<", command=lambda:
back1(rent,rentlist,image_number-1))
if image_number == 4:
button_forward = Button(rent, text=">>", state=DISABLED)
def back1(rent,rentlist,image_number):
my_rent = Label(image=rentlist[image_number-1])
button_forward = Button(rent, text=">>", command=lambda:
forward1(rent,rentlist,image_number+1))
button_back = Button(rent, text="<<", command=lambda:
back1(rent,rentlist,image_number-1))
if image_number == 1:
button_back = Button(rent, text="<<", state=DISABLED)
def onebedroom():
rent1 = tk.Tk()
rent1.title("1 Bedroom")
rent1.iconbitmap(r"E:\Holiday_hW")
rent11=ImageTk.PhotoImage(Image.open("rent 1-1.jpg"))
rent12=ImageTk.PhotoImage(Image.open("rent 1-2.jpg"))
rent13=ImageTk.PhotoImage(Image.open("rent 1-3.jpg"))
rent14=ImageTk.PhotoImage(Image.open("rent 1-4.jpg"))
rentlist=[rent11,rent12,rent13,rent14]
my_rent= tk.Label(image=rent11)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
rent1.destroy()
mainMenu()
def twobedroom():
rent2 = tk.Tk()
rent2.title("2 Bedroom")
rent2.iconbitmap(r"E:\Holiday_hW")
rent21=ImageTk.PhotoImage(Image.open("rent 2-1.jpg"))
rent22=ImageTk.PhotoImage(Image.open("rent 2-2.jpg"))
rent23=ImageTk.PhotoImage(Image.open("rent 2-3.jpg"))
rent24=ImageTk.PhotoImage(Image.open("rent 2-4.jpg"))
rentlist=[rent21,rent22,rent23,rent24]
my_rent= tk.Label(image=rent21)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
rent2.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
rent2.mainloop()
def threebedroom():
rent3 = tk.Tk()
rent3.title("3 Bedroom")
rent3.iconbitmap(r"E:\Holiday_hW")
rent31=ImageTk.PhotoImage(Image.open("rent 3-1.jpg"))
rent32=ImageTk.PhotoImage(Image.open("rent 3-2.jpg"))
rent33=ImageTk.PhotoImage(Image.open("rent 3-3.jpg"))
rent34=ImageTk.PhotoImage(Image.open("rent 3-4.jpg"))
rentlist=[rent31,rent32,rent33,rent34]
my_rent= tk.Label(image=rent31)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
rent3.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
rent3.mainloop()
def fourbedroom():
rent4 = tk.Tk()
rent4.title("4 Bedroom")
rent4.iconbitmap(r"E:\Holiday_hW")
rent41=ImageTk.PhotoImage(Image.open("rent 4-1.jpg"))
rent42=ImageTk.PhotoImage(Image.open("rent 4-2.jpg"))
rent43=ImageTk.PhotoImage(Image.open("rent 4-3.jpg"))
rent44=ImageTk.PhotoImage(Image.open("rent 4-4.jpg"))
rentlist=[rent41,rent42,rent43,rent44]
my_rent= tk.Label(image=rent41)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
rent4.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
rent4.mainloop()
def fivebedroom():
rent5 = tk.Tk()
rent5.title("5 Bedroom")
rent5.iconbitmap(r"E:\Holiday_hW")
rent51=ImageTk.PhotoImage(Image.open("rent 5-1.jpg"))
rent52=ImageTk.PhotoImage(Image.open("rent 5-2.jpg"))
rent53=ImageTk.PhotoImage(Image.open("rent 5-3.jpg"))
rent54=ImageTk.PhotoImage(Image.open("rent 5-4.jpg"))
rentlist=[rent51,rent52,rent53,rent54]
my_rent= tk.Label(image=rent51)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
rent5.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
rent5.mainloop()
def sixbedroom():
rent6 = tk.Tk()
rent6.title("6 Bedroom")
rent6.iconbitmap(r"E:\Holiday_hW")
rent61=ImageTk.PhotoImage(Image.open("rent 6-1.jpg"))
rent62=ImageTk.PhotoImage(Image.open("rent 6-2.jpg"))
rent63=ImageTk.PhotoImage(Image.open("rent 6-3.jpg"))
rent64=ImageTk.PhotoImage(Image.open("rent 6-4.jpg"))
rentlist=[rent61,rent62,rent63,rent64]
my_rent= tk.Label(image=rent61)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
rent6.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
rent6.mainloop()
def rnt():
ret = tk.Tk()
ret.title('Rent')
ret.iconbitmap(r"E:\Holiday_hW")
ret.geometry("680x440")
ret.resizable(False, False)
def quit_application():
ret.destroy()
mainMenu()
retimg = ImageTk.PhotoImage(Image.open('for_rent.gif'))
my_label = tk.Label(image=retimg)
my_label.pack()
def rent1b():
ret.destroy()
onebedroom()
def rent2b():
ret.destroy()
twobedroom()
def rent3b():
ret.destroy()
threebedroom()
def rent4b():
ret.destroy()
fourbedroom()
def rent5b():
ret.destroy()
fivebedroom()
def rent6b():
ret.destroy()
sixbedroom()
def bonebedroom():
buy1 = tk.Tk()
buy1.title("1 Bedroom")
buy1.iconbitmap(r"E:\Holiday_hW")
buy11=ImageTk.PhotoImage(Image.open("buy 1-1.jpg"))
buy12=ImageTk.PhotoImage(Image.open("buy 1-2.jpg"))
buy13=ImageTk.PhotoImage(Image.open("buy 1-3.jpg"))
buy14=ImageTk.PhotoImage(Image.open("buy 1-4.jpg"))
rentlist=[buy11,buy12,buy13,buy14]
my_rent= tk.Label(image=buy11)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
buy1.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
buy1.mainloop()
def btwobedroom():
buy2 = tk.Tk()
buy2.title("2 Bedroom")
buy2.iconbitmap(r"E:\Holiday_hW")
buy21=ImageTk.PhotoImage(Image.open("buy 2-1.jpg"))
buy22=ImageTk.PhotoImage(Image.open("buy 2-2.jpg"))
buy23=ImageTk.PhotoImage(Image.open("buy 2-3.jpg"))
buy24=ImageTk.PhotoImage(Image.open("buy 2-4.jpg"))
rentlist=[buy21,buy22,buy23,buy24]
my_rent= tk.Label(image=buy21)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
buy2.destroy()
mainMenu()
rent_back=Button(buy2, text="<<",command=back1, state=DISABLED)
rent_exit=Button(buy2, text="Exit Program", command=quit_application)
rent_for=Button(buy2, text=">>",command=lambda: forward1(buy2,rentlist,2))
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
buy2.mainloop()
def bthreebedroom():
buy1 = tk.Tk()
buy1.title("3 Bedroom")
buy1.iconbitmap(r"E:\Holiday_hW")
buy11=ImageTk.PhotoImage(Image.open("buy 3-1.jpg"))
buy12=ImageTk.PhotoImage(Image.open("buy 3-2.jpg"))
buy13=ImageTk.PhotoImage(Image.open("buy 3-3.jpg"))
buy14=ImageTk.PhotoImage(Image.open("buy 3-4.jpg"))
rentlist=[buy11,buy12,buy13,buy14]
my_rent= tk.Label(image=buy11)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
buy1.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
buy1.mainloop()
def bfourbedroom():
buy4 = tk.Tk()
buy4.title("4 Bedroom")
buy4.iconbitmap(r"E:\Holiday_hW")
buy41=ImageTk.PhotoImage(Image.open("buy 4-1.jpg"))
buy42=ImageTk.PhotoImage(Image.open("buy 4-2.jpg"))
buy43=ImageTk.PhotoImage(Image.open("buy 4-3.jpg"))
buy44=ImageTk.PhotoImage(Image.open("buy 4-4.jpg"))
rentlist=[buy41,buy42,buy43,buy44]
my_rent= tk.Label(image=buy41)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
buy4.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
buy4.mainloop()
def bfivebedroom():
buy4 = tk.Tk()
buy4.title("5 Bedroom")
buy4.iconbitmap(r"E:\Holiday_hW")
buy51=ImageTk.PhotoImage(Image.open("buy 5-1.jpg"))
buy42=ImageTk.PhotoImage(Image.open("buy 5-2.jpg"))
buy43=ImageTk.PhotoImage(Image.open("buy 5-3.jpg"))
buy44=ImageTk.PhotoImage(Image.open("buy 5-4.jpg"))
rentlist=[buy51,buy42,buy43,buy44]
my_rent= tk.Label(image=buy51)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
buy4.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
buy4.mainloop()
def bsixbedroom():
buy4 = tk.Tk()
buy4.title("6 Bedroom")
buy4.iconbitmap(r"E:\Holiday_hW")
buy51=ImageTk.PhotoImage(Image.open("buy 6-1.jpg"))
buy42=ImageTk.PhotoImage(Image.open("buy 6-2.jpg"))
buy43=ImageTk.PhotoImage(Image.open("buy 6-3.jpg"))
buy44=ImageTk.PhotoImage(Image.open("buy 6-4.jpg"))
rentlist=[buy51,buy42,buy43,buy44]
my_rent= tk.Label(image=buy51)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
buy4.destroy()
mainMenu()
rent_back=Button(buy4, text="<<",command=back1, state=DISABLED)
rent_exit=Button(buy4, text="Exit Program", command=quit_application)
rent_for=Button(buy4, text=">>",command=lambda: forward1(buy4,rentlist,2))
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
buy4.mainloop()
def buy():
buye = tk.Tk()
buye.title('BUY')
buye.iconbitmap(r"E:\Holiday_hW")
buye.geometry("1024x724")
buye.resizable(False, False)
def quit_application():
buye.destroy()
mainMenu()
buyeimg = ImageTk.PhotoImage(Image.open('for_buy.gif'))
my_label = tk.Label(image=buyeimg)
my_label.pack()
f.configure(underline=True)
title.config(font=f)
title.place(x=60, y=60)
def buy1b():
buye.destroy()
bonebedroom()
def buy2b():
buye.destroy()
btwobedroom()
def buy3b():
buye.destroy()
bthreebedroom()
def buy4b():
buye.destroy()
bfourbedroom()
def buy5b():
buye.destroy()
bfivebedroom()
def buy6b():
buye.destroy()
bsixbedroom()
buye.mainloop()
def officesss():
office4 = tk.Tk()
office4.title("OFFICE")
office4.iconbitmap(r"E:\Holiday_hW")
office51=ImageTk.PhotoImage(Image.open("office 1-1.jpg"))
office42=ImageTk.PhotoImage(Image.open("office 1-2.jpg"))
office43=ImageTk.PhotoImage(Image.open("office 1-3.jpg"))
office44=ImageTk.PhotoImage(Image.open("office 1-4.jpg"))
rentlist=[office51,office42,office43,office44]
my_rent= tk.Label(image=office51)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
office4.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
office4.mainloop()
def showrooms():
showrooms4 = tk.Tk()
showrooms4.title("showrooms")
showrooms4.iconbitmap(r"E:\Holiday_hW")
showrooms51=ImageTk.PhotoImage(Image.open("showrooms 1-1.jpg"))
showrooms42=ImageTk.PhotoImage(Image.open("showrooms 1-2.jpg"))
showrooms43=ImageTk.PhotoImage(Image.open("showrooms 1-3.jpg"))
showrooms44=ImageTk.PhotoImage(Image.open("showrooms 1-4.jpg"))
rentlist=[showrooms51,showrooms42,showrooms43,showrooms44]
my_rent= tk.Label(image=showrooms51)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
showrooms4.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
showrooms4.mainloop()
def operative_village():
operative_village4 = tk.Tk()
operative_village4.title("operative_village")
operative_village4.iconbitmap(r"E:\Holiday_hW")
rentlist=[operative_village51,operative_village42,operative_village43,operative_village
44]
my_rent= tk.Label(image=operative_village51)
my_rent.grid(row=0, column=0, columnspan=3)
def quit_application():
operative_village4.destroy()
mainMenu()
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
operative_village4.mainloop()
def cp():
cpe = tk.Tk()
cpe.title('Commercial Properties')
cpe.iconbitmap(r"E:\Holiday_hW")
cpe.geometry("1024x724")
cpe.resizable(False, False)
cpeimg = ImageTk.PhotoImage(Image.open('for_cp.gif'))
my_label = tk.Label(image=cpeimg)
my_label.pack()
def quit_application():
cpe.destroy()
mainMenu()
def offices():
cpe.destroy()
officesss()
def showroom4():
cpe.destroy()
showrooms()
def operative():
cpe.destroy()
operative_village()
f.configure(underline=True)
title.config(font=f)
title.place(x=130, y=500)
cpe.mainloop()
def mortgage():
def quit_application():
moot.destroy()
def cal_mortgage():
try:
principal = float(principal_entry.get())
interest_rate = float(interest_rate_entry.get()) / 100
loan_term = int(loan_term_entry.get())
monthly_interest_rate = interest_rate / 12
num_payments = loan_term * 12
monthly_payment = (principal * monthly_interest_rate) / (1 - (1 +
monthly_interest_rate)**-num_payments)
moot = tk.Tk()
moot.title("Mortgage Calculator")
moot.geometry('300x200')
moot.mainloop()
def accountss():
winE = tk.Tk()
winE.title('ACCOUNT')
winE.iconbitmap(r"E:\Holiday_hW")
winE.geometry("1000x740")
winE.resizable(False, False)
def view_Account():
winV = tk.Tk()
winV.title("All accounts")
winV.geometry("800x600")
winV.resizable(False, False)
winV.lift()
def clear_all():
for item in accounts.get_children():
accounts.delete(item)
def deletes():
account = accounts.focus()
accno = accounts.item(account, 'values')
myconn=mys.connect(host='localhost',user="root",passwd="adis",database="property")
mycur=myconn.cursor()
query="delete from account where accno={}".format(accno[0])
mycur.execute(query)
myconn.commit()
clear_all()
winV.mainloop()
accounts.column(1, width=130)
accounts.column(2, width=180)
accounts.column(3, width=180)
accounts.column(4, width=100)
winV.mainloop()
def quit_application():
winE.destroy()
def withdraws():
win0 = tk.Tk()
win0.title('Withdraw')
win0.geometry('300x160')
win0.resizable(False, False)
tk.Label(win0, text='Withdraw', font=('Times', 20), fg='Blue').pack()
def deposit():
acc=account.get()
myconn = mys.connect(host='localhost', user="root",passwd="adis",
database="property")
mycur = myconn.cursor()
query = "select * from account where accno={}".format(acc)
mycur.execute(query)
rs = mycur.fetchone()
if rs==None:
messagebox.showerror('ERROR', 'Invalid account number')
else:
acc=account.get()
myconn = mys.connect(host='localhost', user="root",passwd="adis",
database="property")
mycur = myconn.cursor()
query = "select * from account where accno={}".format(acc)
mycur.execute(query)
rs = mycur.fetchone()
def take():
if rs!=None:
en=enter.get()
ins = int(en)
moni = int(rs[3])
if ins<=moni:
mone=str(moni-ins)
query="update account set money='{}' where
accno={}".format(mone,acc)
mycur.execute(query)
myconn.commit()
messagebox.showinfo('Withdraw', 'Money has been withdrawn
from this account')
win9.destroy()
else:
messagebox.showerror('Invalid', 'Not enought money
availible in this account')
else:
messagebox.showerror('Error', 'Account do not exist')
win0.destroy()
win9 = tk.Tk()
win9.title('Withdraw')
win9.geometry('300x300')
tk.Label(win9, text='Withdraw', font=('Times', 20), fg='Blue').pack()
tk.Label(win9, text= f'Availible: {rs[3]}', font=('Times',
25)).pack(pady=20)
tk.Label(win9, text='Enter:', font=('Times', 15)).place(x=20, y=130)
enter = tk.Entry(win9, text=('Text', 15), width=8, justify='center')
enter.place(x=165, y=130, height=30)
tk.Button(win9, text='Withdraw', font=('Times', 15),
command=take).place(x=20, y=240, width=260)
if enter.get() == '':
enter.insert(0, '0')
win9.mainloop()
win0.mainloop()
def deposits():
winC = tk.Tk()
winC.title('Deposit')
winC.geometry('300x160')
winC.resizable(False, False)
else:
acc = account.get()
winC.destroy()
win9 = tk.Tk()
win9.title('Deposit')
win9.geometry('300x300')
def inserts():
ins = int(enter.get())
moni = int(rs[3])
mone=str(moni+ins)
query="update account set money='{}' where
accno={}".format(mone,acc)
mycur.execute(query)
myconn.commit()
messagebox.showinfo('Deposit', 'Money has been deposited to this
account')
win9.destroy()
if enter.get() == '':
enter.insert(0, '0')
win9.mainloop()
winC.mainloop()
def create_account():
winS = tk.Tk()
winS.title('Create Account')
winS.geometry("650x530")
winS.resizable(False, False)
def gen():
import random
num = random.randint(0, 10000)
myconn=mys.connect(host='localhost',user="root",passwd="adis",database="property")
mycur=myconn.cursor()
query="select * from account where accno={}".format(num)
mycur.execute(query)
rs=mycur.fetchone()
if rs==None and num!='':
accEnter.config(state='normal')
accEnter.delete(0, END)
accEnter.insert(0, num)
accEnter.config(state='disabled')
def clear():
accEnter.config(state='normal')
accEnter.delete(0, END)
accEnter.config(state='disabled')
nameEnter.delete(0, END)
phoneEnter.delete(0, END)
moneyEnter.delete(0, END)
def create():
acc = accEnter.get()
name = nameEnter.get()
phone = phoneEnter.get()
moni = moneyEnter.get()
if acc!='' and name!='' and phone!='':
myconn=mys.connect(host='localhost',user="root",passwd="adis",database="property")
mycur=myconn.cursor()
query="select * from account where accno={}".format(acc)
mycur.execute(query)
rs=mycur.fetchone()
if rs==None:
query="insert into account values
({},'{}','{}','{}')".format(acc,name,phone,moni)
mycur.execute(query)
myconn.commit()
messagebox.showinfo('Account', 'Account has been created')
winS.lift()
clear()
else:
messagebox.showinfo('Account', 'Account no. exists')
else:
messagebox.showerror('Error', 'Please enter the necessary details')
def quit_application():
winE.destroy()
mainMenu()
abuimg = ImageTk.PhotoImage(Image.open("account.gif"))
my_label = tk.Label(image=abuimg)
my_label.pack()
winE.mainloop()
def py():
pyt = tk.Tk()
pyt.title('Payments')
pyt.iconbitmap(r"E:\Holiday_hW")
pyt.geometry("1440x700")
pyt.resizable(False, False)
pytimg = ImageTk.PhotoImage(Image.open('payyment.gif'))
my_label = tk.Label(image=pytimg)
my_label.pack()
def buy(ins,propert):
win0 = tk.Tk()
win0.title('Withdraw')
win0.geometry('300x160')
win0.resizable(False, False)
tk.Label(win0, text='Withdraw', font=('Times', 20), fg='Blue').pack()
def deposit():
acc=account.get()
myconn = mys.connect(host='localhost', user="root",passwd="adis",
database="property")
mycur = myconn.cursor()
query = "select * from account where accno={}".format(acc)
mycur.execute(query)
rs = mycur.fetchone()
if rs==None:
messagebox.showerror('ERROR', 'Invalid account number')
else:
acc=account.get()
def take():
query = "select * from acc_property where accno={}".format(acc)
mycur.execute(query)
sr = mycur.fetchone()
if sr==None:
moni = int(rs[3])
if ins<=moni:
mone=str(moni-ins)
query="update account set money='{}' where
accno={}".format(mone,acc)
mycur.execute(query)
myconn.commit()
prop=propert+", "
query="insert into acc_property
values({},'{}')".format(acc,prop)
mycur.execute(query)
myconn.commit()
messagebox.showinfo('Withdraw', 'Successfull Purchase')
win9.destroy()
else:
messagebox.showerror('Invalid', 'Not enought money
availible in this account')
else:
moni = int(rs[3])
if ins<=moni:
mone=str(moni-ins)
query="update account set money='{}' where
accno={}".format(mone,acc)
mycur.execute(query)
myconn.commit()
prop=sr[1] + ", " + propert + ', '
query="update acc_property set properties='{}' where
accno={}".format(prop,acc)
mycur.execute(query)
myconn.commit()
messagebox.showinfo('Withdraw', 'Successfull Purchase')
win9.destroy()
else:
messagebox.showerror('Invalid', 'Not enought money
availible in this account')
win0.destroy()
win9 = tk.Tk()
win9.title('Withdraw')
win9.geometry('800x800')
tk.Label(win9, text='Withdraw', font=('Times', 20), fg='Blue').pack()
tk.Label(win9, text= f'Availible: {rs[3]}', font=('Times',
25)).pack(pady=20)
win9.mainloop()
def rent35k():
ins=35000
propert='Rent One Bedroom'
buy(ins,propert)
def rent50k():
propert='Rent Two Bedroom'
ins=50000
buy(ins,propert)
def rent70k():
propert='Rent Three Bedroom'
ins=70000
buy(ins,propert)
def rent92k():
propert='Rent Four Bedroom'
ins=92000
buy(ins,propert)
def rent110k():
propert='Rent Five Bedroom'
ins=110000
buy(ins,propert)
def rent140k():
propert='Rent Six Bedroom'
ins=140000
buy(ins,propert)
def buy600k():
propert='Buy One Bedroom'
ins=600000
buy(ins,propert)
def buy750k():
propert='Buy Twe Bedroom'
ins=750000
buy(ins,propert)
def buy850k():
propert='Buy Three Bedroom'
ins=850000
buy(ins,propert)
def buy1mil():
propert='Buy Four Bedroom'
ins=1000000
buy(ins,propert)
def buy3mil():
propert='Buy Five Bedroom'
ins=3000000
buy(ins,propert)
def buy4mil():
propert='Buy Six Bedroom'
ins=4000000
buy(ins,propert)
def office():
propert='Buy Office'
ins=3000000
buy(ins,propert)
def showrooms():
propert='Buy Showrooms'
ins=5000000
buy(ins,propert)
def operativevillages():
propert='Buy Operative Villages'
ins=8000000
buy(ins,propert)
def quit_application():
pyt.destroy()
mainMenu()
f.configure(underline=True)
title.config(font=f)
title.place(x=545, y=580)
pyt.mainloop()
def fndisplay():
root = tk.Tk()
root.geometry("2000x800")
root.title("Display")
root['background'] = 'RosyBrown1'
tk.Label(root, text ="Display",font = ("Times New Roman Bold", 20)).pack()
frame = Frame(root)
frame.pack()
tree = ttk.Treeview(frame, columns = (1,2,3,4,5), height = 1000, show =
"headings")
tree.pack(side = 'right')
tree.heading(1, text = "Account no.")
tree.heading(2, text = "Name ")
tree.heading(3, text = "Phone Number")
tree.heading(4, text = "Money")
tree.heading(5, text = "Properties")
tree.column(1, width = 100)
tree.column(2, width = 100)
tree.column(3, width = 100)
tree.column(4, width = 100)
tree.column(5, width = 600)
scroll = tk.Scrollbar(frame, orient="vertical", command=tree.yview)
scroll.pack(side = 'right', fill = 'y')
scroll = tk.Scrollbar(frame, orient="horizontal", command=tree.yview)
scroll.pack(side = 'bottom', fill = 'x')
try:
myconn = mys.connect(host='localhost', user="root",passwd="adis",
database="property")
mycur = myconn.cursor()
query = "select a.accno, acc_name,phone_number,money,properties from
account a , acc_property p where a.accno=p.accno;"
mycur.execute(query)
rs = mycur.fetchall()
for val in rs:
tree.insert('', 'end', values = (val[0], val[1],val[2],val[3],val[4]))
except Exception as e:
print(e)
def mainMenu():
root = tk.Tk()
root.title('Abu Dhabi Properties')
root.iconbitmap(r"E:\Holiday_hW")
root.geometry("1000x740")
root.resizable(False, False)
def quit_application():
root.destroy()
def rntscreen():
root.destroy()
rnt()
def buyscreen():
root.destroy()
buy()
def cpscreen():
root.destroy()
cp()
def account():
root.destroy()
accountss()
def pyscreen():
root.destroy()
py()
root.mainloop()
loginpage()
SAMPLE OUTPUT
Turtle screen
Login Screen
Main Menu
Account
Create account
Deposit
Withdraw
Delete Account Ash
RENT(view)
4 bed room
Buy(view
6 Bedroom
Commercial Properties
Operative Villages
Mortgage Calculator
Payments
Buy Showrooms
Buy (Buy 6 bedrooom)
Display
Merits And Demerits
Merits
1)This project is a property management system, which
means that people looking to buy, rent properties can
do it in the comfort of their home.
2)The users also can view the properties.
3)A user has the option to insert their details and have
an easy deposit and withdraw system.
4)The users are not restricted to one property but can
buy or rent how many they want depending on their
credit in the account.
5)The user also has the option to delete their account.
6)All the properties bought by the user is displayed in
their account on a page.
Demerits
1)Limited human interaction
2)Data Security concerns
3)Technical Issues
4)If you delete your account you delete your properties
with it.
Bibliography
To develop this project many references were used
1. Lekshmi Ma’am Notebook
2. https://www.google.com
3. https://www.python.org.in
4. https://www.mysql.org
5.https://www.youtube.com/watch?v=NoTM8JciWaQ&list=PLCC
34OHNcOtoC6GglhF3ncJ5rLwQrLGnV&index=8
(Using Icons, Images, and Exit Buttons - Python Tkinter GUI
Tutorial #8)