0% found this document useful (0 votes)
10 views53 pages

Ashnel Project CSC

The document outlines a computer science project by Ashnel Saldanha focused on creating an Abu Dhabi Properties Management System. It includes various modules, functions, and a detailed description of the project's aim, which is to facilitate property rental and purchase online. The project utilizes technologies such as MySQL and Python, and it features a user interface built with Tkinter for managing property transactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views53 pages

Ashnel Project CSC

The document outlines a computer science project by Ashnel Saldanha focused on creating an Abu Dhabi Properties Management System. It includes various modules, functions, and a detailed description of the project's aim, which is to facilitate property rental and purchase online. The project utilizes technologies such as MySQL and Python, and it features a user interface built with Tkinter for managing property transactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

COMPUTER SCIENCE PROJECT

NAME: Ashnel Saldanha


CLASS: XII-D
CBSE REG NO:
INDEX

SR NO TOPIC PAGE NO
1 Acknowledgement 3

2 Title of the Project 4

3 Aim of the Project 5

4 Modules and Functions 6-8

5 Brief Description of the Project 9-15

6 Use of Technology 16-18

7 Source Code 19-42

8 Sample Output 43-50

9 Merits and Demerits 51

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.

Welcome to Abu Dhabi Properties Management! This


software is a system which allows you rent and buy flats,
villas, operative villages, offices and showrooms. It also
acts like a bank you can store your details like your name,
mobile no, credit in an account. You can withdraw, delete
and even deposit money into your account.

Hence, this software makes it convenient for anyone to


buy or rent the property that they are interested in.
Modules
&
Functions
MODULES
import mysql.connecter:
By importing this package, we are able to establish the connection
between SQL and Python.
import tkinter as tk:
This package provides us access to create display windows for
displaying the project on the screen.

import turtle:
This package is used to display attractive animation created using
functions and methods provided.

from PIL import Image,ImageTk:


This package is used to add support for opening, manipulating, and
saving many different images of different formats.
Import os:
This line imports the 'os' module, facilitating interaction with the
operating system for various system-related operations in Python.

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.

4. def onebedroom(), twobedroom(), threebedroom(),


fourbedroom(), fivebedroom(), sixbedroom(),
bonebedroom(), btwobedroom(), bthreebedroom(),
bfourbedroom(), bfivebedroom(), bsixbedroom(), officesss()
, showrooms() and operative_village().

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:

Provides various buttons to handle different property transactions, each associated


with a different function.
For instance, buttons for renting one to six-bedroom properties, buying one to six-
bedroom properties, offices, showrooms, and operative villages.
Each button is associated with a specific property and payment amount and triggers
the buy(ins, propert) function on click. This function will open a withdrawal window
to simulate the payment process.
Withdraw Function and Associated Property Purchase:
The buy(ins, propert) function opens a withdrawal window for simulating the purchase
process.
The property and payment amount information is passed to this function, which
initializes a withdrawal window with the specified details.
The user is prompted to enter an account number, and if valid, it processes the
purchase, updates the database, and displays success or error messages accordingly.
Quit and Event Binding:

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.

In summary, the fndisplay() function sets up a Tkinter window that displays


account-related data in a table-like structure using the Treeview widget, fetching
information from a MySQL database and handling exceptions during the database
interaction.
USE OF TECHNOLOGY
MYSQL
MySQL is a relational DBMS that can run virtually all platforms,
including Linux, Unix and Windows. Popular for web-based applications
and online publishing, MySQL is apart of open- source enterprise stack
LAMP (Linux, Apache, MySQL, PHP).
MySQL is a freely available open source RDBMS that uses Structured
Query Language(SQL). It is down-loadable from site www.mysql.org
MySQL is fast, reliable, scalable alternative to many of the commercial
RDBMs available today.
MySQL provides you with a rich set of features that support a secure
environment for storing, maintaining, and accessing data.
MySQL was created and supported by MySQL AB, a company based in
Sweden. This company is now a subsidiary of Sun Microsystems, which
holds the copyright tomost of the codebase.
On April 20th, 2009 Oracle Corp., which develops and sells the
proprietary Oracle database, announced a deal to acquire Sun
Microsystems.
PYTHON
• Python is an 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.
Often, programmers fall in love with Python because of the increased
productivity it provides. 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.
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 wayto
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.
HARDWARE AND SOFTWARE

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)

title = tk.Label(a1, text='Login', font=('Times', 45), fg='Blue', )


f = font.Font(title, title.cget("font"))
f.configure(underline=True)
title.config(font=f)
title.pack()

def login():
user = userEnter.get()
pas = passEnter.get()

if user=='Ashnel' and pas == 'Ashnel':


global passover
passover = True
messagebox.showinfo('Login', f'Welcome back {user}')
a1.destroy()
mainMenu()
else:
messagebox.showinfo('Login', 'Username or Password was wrong')
userEnter.delete(0, END)
passEnter.delete(0, END)

username = tk.Label(a1, text='Username:', font=('Times'))


username.place(x= 65, y = 85)
userEnter = tk.Entry(a1, width= 25, font=('Times'))
userEnter.place(x=165, y=85)

password = tk.Label(a1, text='Password:', font=('Times'))


password.place(x=65, y=145)
passEnter = tk.Entry(a1, width= 25, font=('Times'), show='*')
passEnter.place(x=165, y=145)

enter = tk.Button(a1, text='Login', padx= 30, pady= 10, font=('Times', 20),


command=login)
enter.place(x=85, y=210)

quita = tk.Button(a1, text='Quit', padx= 30, pady= 10, font=('Times', 20),


command=a1.destroy)
quita.place(x=240, y=210)

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)

my_rent.grid(row=0, column=0, columnspan=3)


button_back.grid(row=1, column=0)
button_forward.grid(row=1, column=2)

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)

my_rent.grid(row=0, column=0, columnspan=3)


button_back.grid(row=1, column=0)
button_forward.grid(row=1, column=2)

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()

rent_back=Button(rent1, text="<<",command=back1, state=DISABLED)


rent_exit=Button(rent1, text="Exit Program", command=quit_application)
rent_for=Button(rent1, text=">>",command=lambda: forward1(rent1,rentlist,2))
rent_back.grid(row=1, column=0)
rent_exit.grid(row=1,column=1)
rent_for.grid(row=1,column=2)
rent1.mainloop()

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=Button(rent2, text="<<",command=back1, state=DISABLED)


rent_exit=Button(rent2, text="Exit Program", command=quit_application)
rent_for=Button(rent2, text=">>",command=lambda: forward1(rent2,rentlist,2))

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=Button(rent3, text="<<",command=back1, state=DISABLED)


rent_exit=Button(rent3, text="Exit Program", command=quit_application)
rent_for=Button(rent3, text=">>",command=lambda: forward1(rent3,rentlist,2))

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=Button(rent4, text="<<",command=back1, state=DISABLED)


rent_exit=Button(rent4, text="Exit Program", command=quit_application)
rent_for=Button(rent4, text=">>",command=lambda: forward1(rent4,rentlist,2))

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=Button(rent5, text="<<",command=back1, state=DISABLED)


rent_exit=Button(rent5, text="Exit Program", command=quit_application)
rent_for=Button(rent5, text=">>",command=lambda: forward1(rent5,rentlist,2))

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=Button(rent6, text="<<",command=back1, state=DISABLED)


rent_exit=Button(rent6, text="Exit Program", command=quit_application)
rent_for=Button(rent6, text=">>",command=lambda: forward1(rent6,rentlist,2))

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()

one = tk.Button(ret, text='One Bedroom 35k', font=('Times', 10),command=rent1b)


one.place(x=340, y=200, width=150, height=40)

two = tk.Button(ret, text='Two Bedroom 50k', font=('Times', 10),command=rent2b)


two.place(x=510, y=200, width=150, height=40)

three = tk.Button(ret, text='Three Bedroom 70k', font=('Times',


10),command=rent3b)
three.place(x=340, y=275, width=150, height=40)

four = tk.Button(ret, text='Four Bedroom 92k', font=('Times', 10),command=rent4b)


four.place(x=510, y=275, width=150, height=40)

five = tk.Button(ret, text='Five Bedroom 110k', font=('Times', 10),command=rent5b)


five.place(x=340, y=350, width=150, height=40)

six = tk.Button(ret, text='Six Bedroom 140k', font=('Times', 10),command=rent6b)


six.place(x=510, y=350, width=150, height=40)

quiit = tk.Button(ret, text='Quit', font=('Times', 10),command=quit_application)


quiit.place(x=160, y=320, width=50, height=30)
ret.mainloop()

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=Button(buy1, text="<<",command=back1, state=DISABLED)


rent_exit=Button(buy1, text="Exit Program", command=quit_application)
rent_for=Button(buy1, text=">>",command=lambda: forward1(buy1,rentlist,2))

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=Button(buy1, text="<<",command=back1, state=DISABLED)


rent_exit=Button(buy1, text="Exit Program", command=quit_application)
rent_for=Button(buy1, text=">>",command=lambda: forward1(buy1,rentlist,2))

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=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 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=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 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()

title = tk.Label(buye, text='BUY', font=('Times', 55),fg='pink',bg='purple',bd=0,


highlightthickness=0)
f = font.Font(title, title.cget("font"))

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()

one = tk.Button(buye, text='One Bedroom - 600k', font=('Times',


10),fg='pink',bg='Purple',command=buy1b)
one.place(x=640, y=100, width=180, height=40)

two = tk.Button(buye, text='Two Bedroom - 750k', font=('Times',


10),fg='Pink',bg='Purple',command=buy2b)
two.place(x=790, y=200, width=180, height=40)
three = tk.Button(buye, text='Three Bedroom - 850k', font=('Times',
10),fg='Pink',bg='Purple',command=buy3b)
three.place(x=640, y=300, width=200, height=40)

four = tk.Button(buye, text='Four Bedroom - 1.7 million', font=('Times',


10),fg='Pink',bg='Purple',command=buy4b)
four.place(x=790, y=400, width=215, height=40)

five = tk.Button(buye, text='Five Bedroom - 3.4 million', font=('Times',


10),fg='Pink',bg='Purple',command=buy5b)
five.place(x=640, y=500, width=215, height=40)

six = tk.Button(buye, text='Six Bedroom - 4.8 million - 10 million ',


font=('Times', 10),fg='Pink',bg='Purple',command=buy6b)
six.place(x=790, y=600, width=215, height=40)

quiit = tk.Button(buye, text='Quit', font=('Times', 10),command=quit_application)


quiit.place(x=760, y=670, width=50, height=30)

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=Button(office4, text="<<",command=back1, state=DISABLED)


rent_exit=Button(office4, text="Exit Program", command=quit_application)
rent_for=Button(office4, text=">>",command=lambda: forward1(office4,rentlist,2))

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=Button(showrooms4, text="<<",command=back1, state=DISABLED)


rent_exit=Button(showrooms4, text="Exit Program", command=quit_application)
rent_for=Button(showrooms4, text=">>",command=lambda:
forward1(showrooms4,rentlist,2))

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")

operative_village51=ImageTk.PhotoImage(Image.open("operative villages 1-4.jpg"))


operative_village42=ImageTk.PhotoImage(Image.open("operative villages 1-3.jpg"))
operative_village43=ImageTk.PhotoImage(Image.open("operative villages 1-2.jpg"))
operative_village44=ImageTk.PhotoImage(Image.open("operative villages 1-1.jpg"))

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=Button(operative_village4, text="<<",command=back1, state=DISABLED)


rent_exit=Button(operative_village4, text="Exit Program", command=quit_application)
rent_for=Button(operative_village4, text=">>",command=lambda:
forward1(operative_village4,rentlist,2))

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()

title = tk.Label(cpe, text='Commerical Properties', font=('Times', 65),bd=0,


highlightthickness=0)
f = font.Font(title, title.cget("font"))

f.configure(underline=True)

title.config(font=f)
title.place(x=130, y=500)

Officess = tk.Button(cpe, text='Offices - 3 million', font=('Times',


20),command=offices)
Officess.place(x=50, y=220, width=400, height=60)

Showroomss = tk.Button(cpe, text='Showrooms - 5 million', font=('Times',


20),command=showroom4)
Showroomss.place(x=550, y=220, width=430, height=60)

Operatives = tk.Button(cpe, text='Operative Villages - 8 million', font=('Times',


20),command=operative)
Operatives.place(x=280, y=370, width=500, height=60)

quiit = tk.Button(cpe, text='Quit', font=('Times', 10),command=quit_application)


quiit.place(x=500, y=670, width=50, height=30)

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)

result_label.config(text=f"Monthly Payment: Dhs{monthly_payment:.2f}")


except ValueError:
messagebox.showerror("Error", "Please enter valid values.")

moot = tk.Tk()
moot.title("Mortgage Calculator")
moot.geometry('300x200')

# Create labels and entry widgets for user input


principal_label = tk.Label(moot, text="Loan Amount (dhs):")
principal_label.pack()
principal_entry = tk.Entry(moot)
principal_entry.pack()

interest_rate_label = tk.Label(moot, text="Interest Rate (%):")


interest_rate_label.pack()
interest_rate_entry = tk.Entry(moot)
interest_rate_entry.pack()

loan_term_label = tk.Label(moot, text="Loan Term (years):")


loan_term_label.pack()
loan_term_entry = tk.Entry(moot)
loan_term_entry.pack()

calculate_button = tk.Button(moot, text="Calculate", command=cal_mortgage)


calculate_button.pack()

result_label = tk.Label(moot, text="")


result_label.pack()

quiit = tk.Button(moot, text='Quit', font=('Times', 10),command=quit_application)


quiit.place(x=125, y=160, width=50, height=30)

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()

title = tk.Label(winV, text='View Accounts', font=('Times', 30), fg='Blue')


f = font.Font(title, title.cget("font"))
f.configure(underline=True)
title.config(font=f)
title.pack()

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()

query = "select * from account order by accno"


mycur.execute(query)
rs = mycur.fetchall()
for val in rs:
accounts.insert('', 'end', values=(val[0], val[1], val[2], val[3]))

winV.mainloop()

accounts = ttk.Treeview(winV, columns=(1, 2, 3, 4), height=20, show='headings')


accounts.pack()
accounts.heading(1, text= "Account No.")
accounts.heading(2, text='Name')
accounts.heading(3, text='Phone')
accounts.heading(4, text='Money Available')

accounts.column(1, width=130)
accounts.column(2, width=180)
accounts.column(3, width=180)
accounts.column(4, width=100)

myconn = mys.connect(host='localhost', user="root",passwd="adis",


database="property")
mycur = myconn.cursor()
query = "select * from account order by accno"
mycur.execute(query)
rs = mycur.fetchall()
for val in rs:
accounts.insert('', 'end', values=(val[0], val[1], val[2], val[3]))
tk.Button(winV, text='Delete', font=('Times', 15),
command=deletes).place(x=250, y=500, height=80, width=300)

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()

tk.Label(win0, text='Account:', font=('Times', 15)).place(x=20, y=50)


account = tk.Entry(win0, font=('Times', 15), width=18, justify='center')
account.place(x=95, y=50)
tk.Button(win0, text='Withdraw', font=('Times', 15),
command=deposit).place(x=110, y=100)

win0.mainloop()

def deposits():
winC = tk.Tk()
winC.title('Deposit')
winC.geometry('300x160')
winC.resizable(False, False)

tk.Label(winC, text='Deposit', font=('Times', 20), fg='Blue').pack()


def dep():
acc=account.get()
myconn = mys.connect(host='localhost', user="root",passwd="adis",
database="property")
mycur = myconn.cursor()
query = "select * from account where accno={}".format(account.get())
mycur.execute(query)
rs = mycur.fetchone()
if rs==None:
messagebox.showerror('Error', 'Account does not exist')

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()

tk.Label(win9, text='Deposit', 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='Deposit', font=('Times', 15),
command=inserts).place(x=20, y=240, width=260)

if enter.get() == '':
enter.insert(0, '0')

win9.mainloop()

tk.Label(winC, text='Account:', font=('Times', 15)).place(x=20, y=50)


account = tk.Entry(winC, font=('Times', 15), width=18, justify='center')
account.place(x=95, y=50)

tk.Button(winC, text='Deposit', font=('Times', 15), command=dep).place(x=110,


y=100)

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')

title = tk.Label(winS, text='New Account', font=('Times', 30), fg='Red')


f = font.Font(title, title.cget("font"))
f.configure(underline=True)
title.config(font=f)
title.pack()

tk.Label(winS, text="Account Number:", font=('Times', 25)).place(x=20, y=90)


accEnter = tk.Entry(winS, font=('Times', 25), state='disabled')
accEnter.place(x=265, y=90)
accGen = tk.Button(winS, text='Generate account number',font=('Times', 15),
command=gen)
accGen.place(x=265, y=140)
tk.Label(winS, text='Name:', font=('Times', 25)).place(x=165, y=190)
nameEnter = tk.Entry(winS, font=('Times', 25))
nameEnter.place(x=265, y=190)

tk.Label(winS, text='Phone Number:', font=('Times', 25)).place(x=50, y=250)


phoneEnter = tk.Entry(winS, font=('Times', 25))
phoneEnter.place(x=265, y=250)

tk.Label(winS, text='Money:', font=('Times', 25)).place(x=155, y=300)


moneyEnter = tk.Entry(winS, font=('Times', 25))
moneyEnter.place(x=265, y=300)

tk.Button(winS, text='Create account', font=('Times', 25),


command=create).place(x=200, y=400, width=250)
tk.Button(winS, text='Clear', font=('Times', 10), command=clear).place(x=260,
y=480, width=100)
winS.mainloop()

def quit_application():
winE.destroy()
mainMenu()

abuimg = ImageTk.PhotoImage(Image.open("account.gif"))
my_label = tk.Label(image=abuimg)
my_label.pack()

rent = tk.Button(winE, text='Create Account', font=('Times',


15),bg='white',fg='blue',command=lambda:create_account())
rent.place(x=120, y=550, width=200, height=80)

buy = tk.Button(winE, text='Deposit', font=('Times',


15),bg='white',fg='blue',command=deposits)
buy.place(x=380, y=550, width=200, height=80)

sell = tk.Button(winE, text='Withdraw', font=('Times',


15),bg='white',fg='blue',command=withdraws)
sell.place(x=650, y=550, width=200, height=80)

viacc = tk.Button(winE, text='View Account', font=('Times',


15),bg='white',fg='blue',command=view_Account)
viacc.place(x=780, y=100, width=200, height=80)

quet = tk.Button(winE, text='Quit', font=('Times', 10),command=quit_application)


quet.place(x=450, y=680, width=50, height=30)

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)

tk.Label(win9, text='Enter:', font=('Times', 15)).place(x=20, y=130)


tk.Label(win9, text=ins, font=('Times', 15)).place(x=165, y=130)

tk.Button(win9, text='Deposit', font=('Times', 15),


command=take).place(x=20, y=240, width=260)

win9.mainloop()

tk.Label(win0, text='Account:', font=('Times', 15)).place(x=20, y=50)


account = tk.Entry(win0, font=('Times', 15), width=18, justify='center')
account.place(x=95, y=50)
tk.Button(win0, text='Withdraw', font=('Times', 15),
command=deposit).place(x=110, y=100)
win0.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()

title = tk.Label(pyt, text='Payments', font=('Times', 65),bd=0,


highlightthickness=0)
f = font.Font(title, title.cget("font"))

f.configure(underline=True)

title.config(font=f)
title.place(x=545, y=580)

rone = tk.Button(pyt, text='Rent One Bedroom 35k', font=('Times',


10),command=rent35k)
rone.place(x=140, y=100, width=150, height=40)

rtwo = tk.Button(pyt, text='Rent Two Bedroom 50k', font=('Times',


10),command=rent50k)
rtwo.place(x=140, y=200, width=150, height=40)

rthree = tk.Button(pyt, text='Rent Three Bedroom 70k', font=('Times',


10),command=rent70k)
rthree.place(x=140, y=300, width=150, height=40)

rfour = tk.Button(pyt, text='Rent Four Bedroom 92k', font=('Times',


10),command=rent92k)
rfour.place(x=140, y=400, width=150, height=40)

rfive = tk.Button(pyt, text='Rent Five Bedroom 110k', font=('Times',


10),command=rent110k)
rfive.place(x=140, y=500, width=150, height=40)

rsix = tk.Button(pyt, text='Rent Six Bedroom 140k', font=('Times',


10),command=rent140k)
rsix.place(x=140, y=600, width=150, height=40)

bone = tk.Button(pyt, text='Buy One Bedroom 600k', font=('Times',


10),command=buy600k)
bone.place(x=1140, y=100, width=200, height=40)

btwo = tk.Button(pyt, text='Buy Two Bedroom 750k', font=('Times',


10),command=buy750k)
btwo.place(x=1140, y=200, width=200, height=40)

bthree = tk.Button(pyt, text='Buy Three Bedroom 850k', font=('Times',


10),command=buy850k)
bthree.place(x=1140, y=300, width=200, height=40)

bfour = tk.Button(pyt, text='Buy Four Bedroom 1 million', font=('Times',


10),command=buy1mil)
bfour.place(x=1140, y=400, width=200, height=40)

bfive = tk.Button(pyt, text='Buy Five Bedroom 3 million', font=('Times',


10),command=buy3mil)
bfive.place(x=1140, y=500, width=200, height=40)

bsix = tk.Button(pyt, text='Buy Six Bedroom 4 million', font=('Times',


10),command=buy4mil)
bsix.place(x=1140, y=600, width=200, height=40)

oone = tk.Button(pyt, text='Offices 3 million', font=('Times', 10),command=office)


oone.place(x=640, y=200, width=150, height=40)

stwo = tk.Button(pyt, text='Showrooms 5 million', font=('Times',


10),command=showrooms)
stwo.place(x=640, y=300, width=150, height=40)

othree = tk.Button(pyt, text='Operative Villages 8 million', font=('Times',


10),command=operativevillages)
othree.place(x=610, y=400, width=200, height=40)

quiit = tk.Button(pyt, text='Quit', font=('Times', 10),command=quit_application)


quiit.place(x=685, y=520, width=50, height=30)

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)

abuimg = ImageTk.PhotoImage(Image.open("abu dhabi cover.gif"))


my_label = tk.Label(image=abuimg)
my_label.pack()

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()

title = tk.Label(root, text='Abu Dhabi Properties Main Page', font=('Times', 30),


fg='Black',bg='Turquoise' )
f = font.Font(title, title.cget("font"))
f.configure(underline=True)
title.config(font=f)
title.place(x=250, y=60)

rent = tk.Button(root, text='Rent (View)', font=('Times',


15),bg='Turquoise',command=rntscreen)
rent.place(x=270, y=200, width=200, height=80)

buya = tk.Button(root, text='Buy (View)', font=('Times',


15),bg='Turquoise',command=buyscreen)
buya.place(x=580, y=200, width=200, height=80)
mortga = tk.Button(root, text='Mortgage', font=('Times',
15),bg='Turquoise',command=mortgage)
mortga.place(x=570, y=350, width=200, height=80)

commercial = tk.Button(root, text='Commerical Properties (View)', font=('Times',


15),bg='Turquoise',command=cpscreen)
commercial.place(x=240, y=350, width=280, height=80)

accountsss = tk.Button(root, text='Accounts', font=('Times',


15),bg='Turquoise',command=account)
accountsss.place(x=270, y=500, width=200, height=80)

payment = tk.Button(root, text='Payment', font=('Times',


15),bg='Turquoise',command=pyscreen)
payment.place(x=570, y=500, width=200, height=80)

display = tk.Button(root, text='Display', font=('Times',


15),bg='Turquoise',command=fndisplay)
display.place(x=270, y=630, width=200, height=80)

quitss = tk.Button(root, text='Quit', font=('Times',


15),bg='Turquoise',command=quit_application)
quitss.place(x=570, y=630, width=200, height=80)

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)

To help in rectifying errors


1. https://chat.openai.com/
THANK YOU

You might also like