Login Page For Financial Calculation (Login Page For Emi and Sip Calculation)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

LOGIN PAGE FOR FINANCIAL CALCULATION

(Login page for EMI AND SIP CALCULATION)


A Micro Project report submitted in partial fulfilment of the
requirements for Diploma in Third Year in Computer Engineering

BY
SUMIT VITTHAL SHINDE (181041043)
SHAIKH ABDUL WAHID (181041041)
PRAKASH PRABHAKAR SATVI (181041039)

UNDER THE GUIDANCE OF

Prof. SHILPALI PANKAJ BANSU

                                      (Accredited by NAAC)

Department of Computer Engineering


A. C. Patil College of Engineering, Kharghar, Navi Mumbai
University of Mumbai
2019-2020
Jawahar Education Society’s

A. C. Patil College of
Engineering, Kharghar,

CERTIFICATE
LOGIN PAGE FOR FINANCIAL CALCULATION

A Micro Project report submitted in partial fulfilment of the


requirements for Diploma third Year in Computer Engineering

by

53) SUMIT VITTHAL SHINDE (181041043)


50) SHAIKH ABDUL WAHID (181041041)
47) PRAKASH PRABHAKAR SATVI (181041039)

Guide
(Mrs. S. P. Bansu)

INTRODUCTION:
Python GUI – tkinter
Python offers multiple options for developing GUI (Graphical User Interface). Out of
all the GUI methods, tkinter is the most commonly used method. It is a standard
Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the
fastest and easiest way to create the GUI applications. Creating a GUI using tkinter
is an easy task.

To create a tkinter app:


1. Importing the module – tkinter
2. Create the main window (container)
3. Add any number of widgets to the main window
4. Apply the event Trigger on the widgets.

Importing tkinter is same as importing any other module in the Python code. Note
that the name of the module in Python 2.x is ‘Tkinter’ and in Python 3.x it is ‘tkinter’.
mainloop(): There is a method known by the name mainloop() is used when your
application is ready to run. mainloop() is an infinite loop used to run the application,
wait for an event to occur and process the event as long as the window is not closed.

tkinter also offers access to the geometric configuration of the widgets which can
organize the widgets in the parent windows. There are mainly three geometry
manager classes class.
1. pack() method:It organizes the widgets in blocks before placing in the parent
widget.
2. grid() method:It organizes the widgets in grid (table-like structure) before
placing in the parent widget.
3. place() method:It organizes the widgets by placing them on specific positions
directed by the programmer.

Button:To add a button in your application, this widget is used.


The general syntax is:

w=Button(master, option=value)
master is the parameter used to represent the parent window.
There are number of options which are used to change the format of the Buttons.
Number of options can be passed as parameters separated by commas. Some of
them are listed below.
 activebackground: to set the background color when button is under the
cursor.
 activeforeground: to set the foreground color when button is under the
cursor.
 bg: to set he normal background color.
 command: to call a function.
 font: to set the font on the button label.
 image: to set the image on the button.
 width: to set the width of the button.
 height: to set the height of the button.
 
Entry:It is used to input the single line text entry from the user.. For multi-line text
input, Text widget is used.
The general syntax is:

w=Entry(master, option=value)
master is the parameter used to represent the parent window.
There are number of options which are used to change the format of the widget.
Number of options can be passed as parameters separated by commas. Some of
them are listed below.
 bd: to set the border width in pixels.
 bg: to set the normal background color.
 cursor: to set the cursor used.
 command: to call a function.
 highlightcolor: to set the color shown in the focus highlight.
 width: to set the width of the button.
 height: to set the height of the button.
 
Frame: It acts as a container to hold the widgets. It is used for grouping and
organizing the widgets. The general syntax is:

w = Frame(master, option=value)
master is the parameter used to represent the parent window.
 
Label: It refers to the display box where you can put any text or image which can be
updated any time as per the code.
The general syntax is:

w=Label(master, option=value)
master is the parameter used to represent the parent window.
 
Message: It refers to the multi-line and non-editable text. It works same as that of
Label.
The general syntax is:

w = Message(master, option=value)
master is the parameter used to represent the parent window.
 
TopLevel: This widget is directly controlled by the window manager. It don’t need
any parent window to work on.The general syntax is:
 
w = TopLevel(master, option=value)

phpMyAdmin for Data Base:


As we know that, any simple website or application needs interaction with data or
data management, so it uses databases phpMyAdmin has become one of the
popular, free, open-source software platform for administration
of MySQL and MariaDB data over the web world. This tool is primarily written in
PHP for web hosting and related services.
This GUI tool manages a lot of data related operations such as creation,
modification, deletion of data, change structure of table which are in the Databases.
It can manage multiple databases at a time. It also performs other actions like
browsing data, executing SQL queries along with managing indexes, users, and
permissions. This also provides functionality like taking backups, doing search
operations, import and export of data in different formats like SQL, CSV, XML, Excel
sheets.
phpMyAdmin is the most trusted and user-friendly database managers and mostly
used for web-based applications or programs. In the following article, we will be
learning about the importance of the phpMyAdmin tool in the web world.
 
phpMyAdmin | Pre-requisites: To install phpMyAdmin software, you need a server running
platform like Windows or Linux supports operating systems.
 
Interface of phpMyAdmin
 
 

    
Once all the credentials are entered correctly, you can see the phpMyAdmin home
page in your browser. When you are in phpMyAdmin page, the center section is the
default General Settings and Appearance Settings and in the right side, you can
see Database server and Web server information.
All the list of databases can be seen on the left-hand side of the screen. You can select the
database, you want to work with out of the list. Once it is expanded, all the tables in the
selected database can be viewed.

phpMyAdmin | Create database: A user can create a database in phpMyAdmin


server. Just click on the Databases tab, you have a Create database input option.
Give a relevant name for the database in the entry box and click the Create button.
The phpMyAdmin will create tables which will be added under the newly created
database.
You can add as many numbers of tables as required in one particular selected
database by using the section Create table and then the select number of columns
needed for any table.

For sorting the result set in a query in an ascending or descending order, you can use
the Sort dropdown. You can also enter the criteria for the search query.
The Ins and Del check boxes or Add/Delete criteria rows options are provided to add or
delete text rows for any search conditions. The logical operators And or the Or can also be
used to define relations between the fields in the Modify section. After entering all the
relevant conditions, you need to click on Update Query button for doing the SQL operation.
Next step is to select all the tables from Use Tables section used in the query and then click
on Submit Query.

MODULE USE:
Tkinter and pymysql
Tkinter for GUI purpose
Pymysql for DATA BASE Management (phpMyAdmin software use)

INPUT PROGRAM:
# _____________________________LOGIN PAGE________________________

from tkinter import *


from tkinter import messagebox
import pymysql

class Login:
    def __init__(self, root):
        self.root = root
        self.root.title("LOGIN PAGE")
        self.root.geometry("1350x700+0+0")

        #-----------ALl VARIABLE------------
        self.username_var=StringVar()
        self.password_var=StringVar()
        self.email_var=StringVar()
        self.phone_var=StringVar()

        Out_side_frame = Frame(self.root, bd=5, relief=GROOVE, bg="blue")


        Out_side_frame.place(x=0, y=0, width=1350, height=700)

        Out_side_in_frame = Frame(self.root, bd=5, relief=GROOVE, bg="white")


        Out_side_in_frame.place(x=75, y=75, width=1350 - 150, height=700 - 150)

        F = Frame(self.root, bd=15, relief=GROOVE, bg="#1affff")


        F.place(x=350, y=150, width=750, height=350)

        # assining variable
        self.user = StringVar()
        self.password = StringVar()

        title_for_login = Label(self.root, text="LOGIN SYSTEM", font=("times new


roman", 30, "bold"), bg="white",
                                fg="#ff6600").grid(row=0, column=1, padx=600,
pady=90)

        userlabel = Label(F, text="UserName ", font=("times new roman", 20,


"bold"), bg="#1affff", fg="#1a1aff").grid(row=1,
                                                                                 
column=0,
                                                                                 
padx=50,
                                                                                 
pady=50)
        user_text = Entry(F, bd=7, relief=GROOVE, textvariable=self.username_var,
width=30, font=("arial 15 bold"))
        user_text.grid(row=1, column=1)

        passwordlabel = Label(F, text="Password ", font=("times new roman", 20,


"bold"), bg="#1affff", fg="#1a1aff").grid(
            row=2, column=0, padx=50, pady=0)
        password_text = Entry(F, bd=7, relief=GROOVE, show="*",
textvariable=self.password_var, width=30,
                              font=("arial 15 bold"))
        password_text.grid(row=2, column=1)

        Button_Login = Button(F, text="Login", font="arial 15 bold", bd=7,


bg="white", fg="blue", width=10,
                              command=self.Check_login)
        Button_Login.place(x=100, y=250)
        Button_Reset = Button(F, text="Reset", font="arial 15 bold", bd=7,
bg="white", fg="blue", width=10,
                              command=self.reset)
        Button_Reset.place(x=300, y=250)
        Button_Exit = Button(F, text="Exit", font="arial 15 bold", bd=7,
bg="white", fg="blue", width=10,
                            command=self.exit_fun)
        Button_Exit.place(x=500, y=250)

        Button_SignUp = Button(self.root, text="Sign Up", font="arial 15 bold",


bd=7, bg="#ff6600", fg="white", width=10,
                              activebackground="blue", command=self.sign_up)
        Button_SignUp.place(x=665, y=550)

    def Check_login(self):
        login=False
        con = pymysql.connect(host="localhost", user="root", password="Sumit@123",
database="stm")
        cur = con.cursor()
        cur.execute('select Username , Password from login')

        for email,password in cur:


            if(email==self.username_var.get() and
password==self.password_var.get()):
                self.logfun()
                login=True
                break

        if(login==False):
            messagebox.showinfo('InCorrect Login','YOU HAVE ENTER WRONG USERNAME
OR PASSWORD \n Please Check Once Again!!! ')

        con.commit()
        con.close()

    def sip(self):

        # _________________SIP CALCULATOR__________________________

        top2 = Toplevel()
        # title of the window
        top2.title("SIP CALCULATOR")
        # geometry of the window
        top2.geometry("1350x700+0+0")

        F1 = Frame(top2, bd=10, relief=GROOVE)


        F1.place(x=200, y=50, width=950, height=600)

        title = Label(F1, text="SIP CALCULATOR", font=("time new roman", 30,


"bold"), fg="blue").grid(row=0, column=1)

        e1 = IntVar()
        e2 = IntVar()
        e3 = IntVar()

        L1 = Label(F1, text="SIP AMOUNT ", font=("time new roman", 20,


"bold")).grid(row=1, column=0, pady=20)
        e1 = Entry(F1, bd=7, relief=GROOVE, width=25, font=("arial 15 bold"))
        e1.grid(row=1, column=1, padx=20, pady=20)

        L2 = Label(F1, text="NUMBER OF YEARS ", font=("time new roman", 20,


"bold")).grid(row=2, column=0, pady=20)
        e2 = Entry(F1, bd=7, relief=GROOVE, width=25, font=("arial 15 bold"))
        e2.grid(row=2, column=1, padx=20, pady=20)

        L3 = Label(F1, text=" RETURNS ", font=("time new roman", 20,


"bold")).grid(row=3, column=0, pady=20)
        e3 = Entry(F1, bd=7, relief=GROOVE, width=25, font=("arial 15 bold"))
        e3.grid(row=3, column=1, padx=20, pady=20)
        L4 = Label(F1, text=" % ", font=("time new roman", 20,
"bold")).grid(row=3, column=2, padx=0, pady=20)

        # noinspection PyMethodParameters
        def Sip_calculator():
            # principal amount
            investment = int(e1.get())

            print(e1.get())
            print(e2.get())
            print(e3.get())

            # Rate of Return
            annualRate = int(e3.get())
            monthlyRate = annualRate / 12 / 100  # Rate of interest

            # Time period
            years = int(e2.get())
            months = years * 12

            # Future Value of the amount invested per month


            futureValue = int(investment * (pow(1 + float(monthlyRate),
int(months)) - 1) / monthlyRate)

            print(futureValue)

            Future_value = Label(F1, text=futureValue, font=("time new roman", 50,


"bold"), bg="blue", fg="white",
                                width=10, bd=7).grid(row=10, column=1, padx=0,
pady=40)

        submit = Button(F1, text=" CALCULATE ", font="arial 15 bold", bg="blue",


fg="white", command=Sip_calculator,bd=7, width=10).grid(row=4, column=1, padx=0,
pady=20)

    def emi(self):
        # _____________________EMI CALCULATOR_____________________

        top = Toplevel()
        # title of the window
        top.title("EMI CALCULATOR")
        # geometry of the window
        top.geometry("1350x700+0+0")

        F2 = Frame(top, bd=10, relief=GROOVE)


        F2.place(x=200, y=50, width=950, height=600)

        title = Label(F2, text="EMI CALCULATOR", font=("time new roman", 30,


"bold"), fg="blue").grid(row=0, column=1)

        E1 = IntVar()
        E2 = IntVar()
        E3 = IntVar()

        L1 = Label(F2, text="PRINCIPLE AMOUNT", font=("time new roman", 20,


"bold")).grid(row=1, column=0, pady=20)
        E1 = Entry(F2, bd=7, relief=GROOVE, width=25, font=("arial 15 bold"))
        E1.grid(row=1, column=1, padx=20, pady=20)

        L2 = Label(F2, text="NUMBER OF YEARS ", font=("time new roman", 20,


"bold")).grid(row=2, column=0, pady=20)
        E2 = Entry(F2, bd=7, relief=GROOVE, width=25, font=("arial 15 bold"))
        E2.grid(row=2, column=1, padx=20, pady=20)

        L3 = Label(F2, text=" RATE ", font=("time new roman", 20,


"bold")).grid(row=3, column=0, pady=20)
        E3 = Entry(F2, bd=7, relief=GROOVE, width=25, font=("arial 15 bold"))
        E3.grid(row=3, column=1, padx=20, pady=20)
        L4 = Label(F2, text=" % ", font=("time new roman", 20,
"bold")).grid(row=3, column=2, padx=0, pady=20)

        def EMI_calculator():

            Principal = int(E1.get())
            Rate = int(E3.get())
            MonthlyRate = Rate / (12 * 100)
            Years = int(E2.get())
            Months = Years * 12

            EMI = round((Principal * MonthlyRate * (1 + MonthlyRate) ** Months) /


((1 + MonthlyRate) ** Months - 1))

            TotalInterest = (EMI * Months) - Principal

            TotalPayment = int(Principal) + int(TotalInterest)

            print("EMI To paid :", EMI)


            print("Total Interest to be Paid :", TotalInterest)
            print("Total Payment to be Done :", TotalPayment)

            EMI_Value = Label(F2, text="EMI  " + str(EMI), font=("time new roman",


30, "bold"), fg="red").grid(row=9,
                                                                                 
column=0,
                                                                                 
padx=0,
                                                                                 
pady=20)
            Interest_Value = Label(F2, text=" INTEREST AMOUNT " +
str(TotalInterest), font=("time new roman", 30, "bold"),
                                  bg="blue", fg="white").grid(row=9, column=1,
padx=0, pady=20)
            Payment_Value = Label(F2, text=" TOTAL PAYMENT " + str(TotalPayment),
font=("time new roman", 30, "bold"),
                                  bg="blue", fg="white").grid(row=10, column=1,
padx=0, pady=10)

        submit1 = Button(F2, text=" CALCULATE ", font="arial 15 bold", bg="blue",


fg="white", command=EMI_calculator, bd=7,
                        width=10).grid(row=4, column=1, padx=0, pady=20)

    def logfun(self):
        print(self.user.get(), self.password.get())
        display = messagebox.showinfo("Info", "Welcome " +
self.username_var.get())

        top1 = Toplevel()
        top1.title("Choose the Option")
        top1.geometry("1350x700+0+0")

        Option_frame = Frame(top1, bd=5, relief=GROOVE, bg="blue")


        Option_frame.place(x=0, y=0, width=1350, height=700)

        Out_side_in_frame1 = Frame(Option_frame, bd=5, relief=GROOVE, bg="white")


        Out_side_in_frame1.place(x=50, y=50, width=1350 - 100, height=700 - 100)

        Option_label = Label(Out_side_in_frame1, text=" Choose The Option? ",


font=("times new roman", 30, "bold"),
                            bg="white", fg="blue")
        Option_label.place(x=500, y=50)

        Emi_button = Button(Out_side_in_frame1, text=" EMI CALCULATION ", bd=10,


font=("times new roman", 30, "bold"),
                            bg="blue", fg="white", width=10,
activebackground="orange",command=self.emi)
        Emi_button.place(x=425, y=200, width=500, height=100)

        sip_button = Button(Out_side_in_frame1, text=" SIP CALCULATION ", bd=10,


font=("times new roman", 30, "bold"),
                            bg="blue", fg="white", width=10,
activebackground="orange", command=self.sip)
        sip_button.place(x=425, y=400, width=500, height=100)
        return

    def reset(self):

        self.user.set("")
        self.password.set("")
        self.username_var.set("")
        self.password_var.set("")
        self.email_var.set("")
        self.phone_var.set("")

    def exit_fun(self):
        option = messagebox.askyesno("Exit", "Do you really want to exit?")

        if option == 1:
            self.root.destroy()
        else:
            return

    def sign_up(self):

        top3=Toplevel()
        top3.title("Sign Up")
        top3.geometry("1350x700+0+0")

        Sign_up_frame = Frame(top3, bd=5, relief=GROOVE, bg="#ff6600")


        Sign_up_frame.place(x=0, y=0, width=1350, height=700)

        Sign_up_in_frame = Frame(Sign_up_frame, bd=5, relief=GROOVE, bg="white")


        Sign_up_in_frame.place(x=50, y=50, width=1350 - 100, height=700 - 100)

        Sign_up_inside_in_frame = Frame(Sign_up_frame, bd=5, relief=GROOVE,


bg="#ff6600")
        Sign_up_inside_in_frame.place(x=200, y=125, width=1350 - 400, height=700 -
250)

        title_label = Label(Sign_up_in_frame, text=" Sign In ", font=("times new


roman", 30, "bold"), bg="white",
                            fg="#ff0000")
        title_label.place(x=550 + 50, y=5)

        Username_label = Label(Sign_up_inside_in_frame, text=" Username ",


font=("times new roman", 25, "bold"),
                              bg="#ff6600", fg="white")
        Username_label.place(x=200, y=20)
        username_text = Entry(Sign_up_inside_in_frame,
bd=7,textvariable=self.username_var, relief=GROOVE, width=25, font=("arial 15
bold"))
        username_text.place(x=400, y=20)

        Password_label = Label(Sign_up_inside_in_frame, text=" Password",


font=("times new roman", 25, "bold"),
                              bg="#ff6600", fg="white")
        Password_label.place(x=200, y=90)
        Password_text = Entry(Sign_up_inside_in_frame,
bd=7,textvariable=self.password_var, relief=GROOVE, show="*", width=25,
font=("arial 15 bold"))
        Password_text.place(x=400, y=90)

        Email_label = Label(Sign_up_inside_in_frame, text=" Email ", font=("times


new roman", 25, "bold"), bg="#ff6600",
                            fg="white")
        Email_label.place(x=200, y=90 + 70)
        Email_text = Entry(Sign_up_inside_in_frame,
bd=7,textvariable=self.email_var, relief=GROOVE, width=25, font=("arial 15 bold"))
        Email_text.place(x=400, y=90 + 70)

        Phone_label = Label(Sign_up_inside_in_frame, text=" Phone no ",


font=("times new roman", 25, "bold"),
                            bg="#ff6600", fg="white")
        Phone_label.place(x=200, y=160 + 70)
        Phone_text = Entry(Sign_up_inside_in_frame,
bd=7,textvariable=self.phone_var, relief=GROOVE, width=25, font=("arial 15 bold"))
        Phone_text.place(x=400, y=160 + 70)
        Submit = Button(Sign_up_inside_in_frame, text=" Submit ", bd=7,
font=("times new roman", 25, "bold"),
                        bg="white", fg="#ff0000",command=self.Enter_data)
        Submit.place(x=450, y=330)

    def Enter_data(self):
       
con=pymysql.connect(host="localhost",user="root",password="Sumit@123",database="st
m")
        cur=con.cursor()
        cur.execute('insert into login values(%s,%s,%s,%s)',
(self.username_var.get(),
                                                           
self.password_var.get(),
                                                            self.email_var.get(),
                                                            self.phone_var.get()
                                                            ))

        con.commit()
        con.close()
        self.reset()

root = Tk()
ob = Login(root)
root.mainloop()
  

OUTPUT: 
A:  SIGN IN PAGE
B:  LOGIN PAGE

C:  Wrong Password ENTERED


D: Correct Password ENTERED

E: Option Page
F:  EMI CALCULATOR 

G:  SIP CALCULATOR 


H: Data Base in phpMyAdmin

REFERENCE :

Video link
https://www.youtube.com/watch?v=MmQcls0MveM
https://www.youtube.com/watch?
v=YXPyB4XeYLA&list=PLGqwrdoe132sK_ElCuA36GivE5KaTVSNq&index=2&t=14558s
https://stackoverflow.com/questions/46736319/phpmyadmin-error-mysqli-real-connect-hy000-
1045-access-denied-for-user-p
https://stackoverflow.com/questions/25174183/warning-mysqli-connect-hy000-1045-access-
denied-for-user-usernameloca
https://www.youtube.com/watch?v=kea-2yFFrl0

Online books on python GUI and Data Base 


https://www.java67.com/2017/05/top-7-free-python-programming-books-pdf-online-
download.html
http://slav0nic.org.ua/static/books/python/Python%20-%20Database%20Application
%20Programming%20Interface.pdf

software Download link


https://www.apachefriends.org/index.html
https://www.jetbrains.com/pycharm/
https://www.python.org/downloads/

CONCLUSION:
In these project Login page for Financial Calculation we had create a system which will help
User to know his Corpus Amount After a particular period of Time and a Fix Rate  .
Through our project we are making Customer Aware about it Financial Education.
Through Login Id Customer Can easly access his/her data.
If he don’t have a Login Id he Can Sign In and Create his Username and Password that he
want.
For these we have use module  tkinter and pymysql. Tkinter is use for GUI purpose and
pymysql is use for Data base Management Purpose 

You might also like