{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from tkinter import *\n",
    "import tkinter as tk\n",
    "from tkinter import ttk\n",
    "from PIL import ImageTk,Image\n",
    "import MySQLdb\n",
    "from tkinter import messagebox\n",
    "def loanfiledetail():\n",
    "    root=Tk()\n",
    "    root.title(\"Loan File Detail\")\n",
    "    root.geometry('1450x770+30+10')\n",
    "\n",
    "    Manage_frame1= Frame(root, bd=4, relief=RIDGE, bg=\"whitesmoke\")\n",
    "    Manage_frame1.place(x=30, y=60, width=520, height=580)\n",
    "\n",
    "    #\"\"\"img = ImageTk.PhotoImage(Image.open(\"loan1.jpg\"))\n",
    "    #l = Label(root, image=img)\n",
    "    #l.place(x=600, y=0)\"\"\"\n",
    "\n",
    "    v1 = tk.IntVar()\n",
    "    v2 = tk.IntVar()\n",
    "    v3 = tk.IntVar()\n",
    "    v4 = tk.IntVar()\n",
    "\n",
    "    def add():\n",
    "        delete()\n",
    "\n",
    "    def delete1():\n",
    "        txt_name2.delete(0, END)\n",
    "        txt_name3.delete(0, END)\n",
    "        txt_name10.delete(0, END)\n",
    "        txt_name.delete(0, END)\n",
    "        txt_name4.delete(0, END)\n",
    "        txt_name9.delete(0, END)\n",
    "        name1.delete(0, END)\n",
    "        name2.delete(0, END)\n",
    "        name3.delete(0, END)\n",
    "        name4.delete(0, END)\n",
    "        name5.delete(0, END)\n",
    "\n",
    "\n",
    "    def first():\n",
    "        delete1()\n",
    "        con = MySQLdb.connect(host=\"localhost\", user=\"root\", password=\"root\", db=\"emiloancalculator\")\n",
    "        cursor = con.cursor()\n",
    "        cursor.execute(\"select * from loan_file_detail order by fileid limit 1 \")\n",
    "        rows = cursor.fetchall()\n",
    "        for row in rows:\n",
    "            txt_name.insert(0, row[0])\n",
    "            txt_name2.insert(0, row[1])\n",
    "            txt_name3.insert(0, row[2])\n",
    "            txt_name4.insert(0, row[3])\n",
    "            txt_name9.insert(0, row[8])\n",
    "            txt_name10.insert(0, row[9])\n",
    "            name1.insert(1, row[10])\n",
    "            name2.insert(0, row[11])\n",
    "            name3.insert(0, row[12])\n",
    "            name4.insert(0, row[13])\n",
    "            name5.insert(0, row[14])\n",
    "        con.close()\n",
    "\n",
    "    def previous():\n",
    "        delete1()\n",
    "        con = MySQLdb.connect(host=\"localhost\", user=\"root\", password=\"root\", db=\"emiloancalculator\")\n",
    "        cursor = con.cursor()\n",
    "        cursor.execute(\"select * from loan_file_detail order by fileid limit 1\")\n",
    "        rows = cursor.fetchall()\n",
    "        for row in rows:\n",
    "            txt_name.insert(0, row[0])\n",
    "            txt_name2.insert(0, row[1])\n",
    "            txt_name3.insert(0, row[2])\n",
    "            txt_name4.insert(0, row[3])\n",
    "            txt_name9.insert(0, row[8])\n",
    "            txt_name10.insert(0, row[9])\n",
    "            name1.insert(1, row[10])\n",
    "            name2.insert(0, row[11])\n",
    "            name3.insert(0, row[12])\n",
    "            name4.insert(0, row[13])\n",
    "            name5.insert(0, row[14])\n",
    "        con.close()\n",
    "\n",
    "    def next():\n",
    "        delete1()\n",
    "        con = MySQLdb.connect(host=\"localhost\", user=\"root\", password=\"root\", db=\"emiloancalculator\")\n",
    "        cursor = con.cursor()\n",
    "        cursor.execute(\"select * from loan_file_detail order by fileid desc limit 1\")\n",
    "        rows = cursor.fetchall()\n",
    "        for row in rows:\n",
    "            txt_name.insert(0, row[0])\n",
    "            txt_name2.insert(0, row[1])\n",
    "            txt_name3.insert(0, row[2])\n",
    "            txt_name4.insert(0, row[3])\n",
    "            txt_name9.insert(0, row[8])\n",
    "            txt_name10.insert(0, row[9])\n",
    "            name1.insert(1, row[10])\n",
    "            name2.insert(0, row[11])\n",
    "            name3.insert(0, row[12])\n",
    "            name4.insert(0, row[13])\n",
    "            name5.insert(0, row[14])\n",
    "        con.close()\n",
    "        con.close()\n",
    "\n",
    "    def last():\n",
    "        delete1()\n",
    "        con = MySQLdb.connect(host=\"localhost\", user=\"root\", password=\"root\", db=\"emiloancalculator\")\n",
    "        cursor = con.cursor()\n",
    "        cursor.execute(\"select * from loan_file_detail order by fileid desc limit 1\")\n",
    "        rows = cursor.fetchall()\n",
    "        for row in rows:\n",
    "            txt_name.insert(0, row[0])\n",
    "            txt_name2.insert(0, row[1])\n",
    "            txt_name3.insert(0, row[2])\n",
    "            txt_name4.insert(0, row[3])\n",
    "            txt_name9.insert(0, row[8])\n",
    "            txt_name10.insert(0, row[9])\n",
    "            name1.insert(1, row[10])\n",
    "            name2.insert(0, row[11])\n",
    "            name3.insert(0, row[12])\n",
    "            name4.insert(0, row[13])\n",
    "            name5.insert(0, row[14])\n",
    "        con.close()\n",
    "\n",
    "    def delete():\n",
    "        txt_name.delete(0, END)\n",
    "        txt_name4.delete(0, END)\n",
    "        txt_name9.delete(0, END)\n",
    "        name1.delete(0,END)\n",
    "        name2.delete(0,END)\n",
    "        name3.delete(0,END)\n",
    "        name4.delete(0,END)\n",
    "        name5.delete(0,END)\n",
    "\n",
    "\n",
    "\n",
    "    def cancel():\n",
    "        root.quit()\n",
    "\n",
    "\n",
    "    def update():\n",
    "\n",
    "        connection = MySQLdb.connect(host='localhost', user='root', passwd='root', db='emiloancalculator')\n",
    "        cur = connection.cursor()\n",
    "\n",
    "        pl = txt_name2.get()\n",
    "        client = txt_name3.get()\n",
    "        la = txt_name4.get()\n",
    "        idp = v1.get()\n",
    "        rp = v2.get()\n",
    "        ip = v3.get()\n",
    "        bs = v4.get()\n",
    "        r = txt_name9.get()\n",
    "        st = txt_name10.get()\n",
    "        fd = int(txt_name.get())\n",
    "        #la2 = name1.get()\n",
    "        #roi = name2.get()\n",
    "        #ci = name3.get()\n",
    "        #ce = name4.get()\n",
    "        #ny = name5.get()\n",
    "\n",
    "        sqlquery = \"UPDATE loan_file_detail SET plan=%s,client=%s,loanamount=%s,idproof=%s,rdproof=%s,inproof=%s,bankst=%s,remarks=%s,status=%s,loanamount2=%s,rateofinterest=%s,clientincome=%s,clientexpenses=%s,numberofyears=%s where fileid=%s\"\n",
    "\n",
    "        try:\n",
    "            # executing the query\n",
    "            cur.execute(sqlquery, ((str(fd)),pl, client, la, idp, rp, ip, bs, r, st,la2,roi,ci,ce,ny))\n",
    "\n",
    "            # commit the changes\n",
    "            connection.commit()\n",
    "            print(\"Record updated succesfully....!\")\n",
    "\n",
    "        except Exception as e:\n",
    "            print(e)\n",
    "            # Rollback the changes\n",
    "            connection.rollback()\n",
    "            connection.close()\n",
    "\n",
    "\n",
    "    def save():\n",
    "        connection = MySQLdb.connect(host='localhost', user='root', passwd='root', db='emiloancalculator')\n",
    "        cur = connection.cursor()\n",
    "        pl = txt_name2.get()\n",
    "        client = txt_name3.get()\n",
    "        la = txt_name4.get()\n",
    "        idp = v1.get()\n",
    "        rp = v2.get()\n",
    "        ip = v3.get()\n",
    "        bs = v4.get()\n",
    "        r = txt_name9.get()\n",
    "        st = txt_name10.get()\n",
    "        fd = int(txt_name.get())\n",
    "        la2= name1.get()\n",
    "        roi=name2.get()\n",
    "        ci=name3.get()\n",
    "        ce=name4.get()\n",
    "        ny=name5.get()\n",
    "        MsgBox = messagebox.askquestion('SAVE DETAILS..', 'Are you sure you want to save the details', icon='warning')\n",
    "        if MsgBox == 'yes':\n",
    "            query1 = (\n",
    "                \"INSERT INTO loan_file_detail(fileid,plan,client,loanamount,idproof,rdproof,inproof,bankst,remarks,status)\"\n",
    "                \"VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)\")\n",
    "            data = (str(fd), pl, client, la, idp, rp, ip, bs, r, st)\n",
    "            cur.execute(query1, data)\n",
    "\n",
    "            connection.commit()\n",
    "            connection.close()\n",
    "\n",
    "    def evaluate():\n",
    "        status = txt_name10.get()\n",
    "\n",
    "        r = float(name2.get()) / 1200\n",
    "        n = int(name5.get())\n",
    "        p = float(name1.get())\n",
    "        for i in range(1, n + 1):\n",
    "            n = i\n",
    "            monthly = float(p * r * (1 + r) * (i * 12)) / (((1 + r) * (i * 12)) - 1)\n",
    "            table.insert('', 'end', value=n)\n",
    "            table.insert('', 'end', value=monthly)\n",
    "            table.insert('', 'end', value=status)\n",
    "\n",
    "    def issue():\n",
    "        status = txt_name10.get()\n",
    "        table.insert('', 'end', value=status)\n",
    "\n",
    "\n",
    "    Manage_frame2 = Frame(root, bd=4, relief=RIDGE, bg=\"teal\")\n",
    "    Manage_frame2.place(x=150, y=10, width=270, height=45)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame2, text=\"Loan File Detail\", fg=\"white\", bg=\"teal\", font=('times new roman', 20, 'bold'))\n",
    "    lbl_name1.place(x=20, y=2)\n",
    "\n",
    "    Manage_frame3 = Frame(root, bd=4, relief=RIDGE, bg=\"darkslategray\")\n",
    "    Manage_frame3.place(x=30, y=645, width=520, height=115)\n",
    "\n",
    "    Manage_frame4 = Frame(root, bd=4, relief=RIDGE, bg=\"whitesmoke\")\n",
    "    Manage_frame4.place(x=560, y=60, width=880, height=700)\n",
    "\n",
    "    Manage_frame5 = Frame(  Manage_frame4, bd=4, relief=RIDGE, bg=\"white\")\n",
    "    Manage_frame5.place(x=20, y=220, width=830, height=450)\n",
    "\n",
    "    \"\"\"frm1 = Frame(Manage_frame5)\n",
    "    frm1.place(x=60, y=70)\n",
    "    tb1 = ttk.Treeview(frm1, column=(1), show=\"headings\", height=6)\n",
    "    tb1.pack()\n",
    "    tb1.heading(1, text=\"Number Of Years\")\n",
    "\n",
    "    frm2 = Frame(Manage_frame5)\n",
    "    frm2.place(x=260, y=70)\n",
    "    tb2 = ttk.Treeview(frm2, column=(1), show=\"headings\", height=6)\n",
    "    tb2.pack()\n",
    "    tb2.heading(1, text=\"Monthly Installment\")\n",
    "\n",
    "    frm3 = Frame(Manage_frame5)\n",
    "    frm3.place(x=460, y=70)\n",
    "    tb3 = ttk.Treeview(frm3, column=(1), show=\"headings\", height=6)\n",
    "    tb3.pack()\n",
    "    tb3.heading(1, text=\"Issue Status?\")\"\"\"\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "    scroll_x = Scrollbar(Manage_frame5, orient=HORIZONTAL)\n",
    "    scroll_y = Scrollbar(Manage_frame5, orient=VERTICAL)\n",
    "    table = ttk.Treeview(Manage_frame5,\n",
    "                                      columns=(\"Number Of Years\", \"Monthly Installment\", \"Issue Status??\"),\n",
    "                                      xscrollcommand=scroll_x.set, yscrollcommand=scroll_y.set)\n",
    "    scroll_x.pack(side=BOTTOM, fill=X)\n",
    "    scroll_y.pack(side=RIGHT, fill=Y)\n",
    "\n",
    "    scroll_x.config(command=table.xview)\n",
    "    scroll_y.config(command=table.yview)\n",
    "\n",
    "    table.heading(\"Number Of Years\", text=\"   Number Of Years   \")\n",
    "    table.heading(\"Monthly Installment\", text=\"   Monthly Installment   \")\n",
    "    table.heading(\"Issue Status??\", text=\"  Issue Status??   \")\n",
    "    table['show'] = \"headings\"\n",
    "    table.column(\"Number Of Years\", width=100)\n",
    "    table.column(\"Monthly Installment\", width=100)\n",
    "    table.column(\"Issue Status??\", width=100)\n",
    "    table.pack(fill=BOTH, expand=1)\n",
    "\n",
    "    Manage_frame6 = Frame(root, bd=4, relief=RIDGE, bg=\"teal\")\n",
    "    Manage_frame6.place(x=850, y=10, width=260, height=45)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame6, text=\"Loan Evaluation\", fg=\"white\", bg=\"teal\",\n",
    "                      font=('times new roman', 20, 'bold'))\n",
    "    lbl_name1.place(x=20, y=2)\n",
    "\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame1, text=\"File ID\", fg=\"black\", bg=\"whitesmoke\", font=('times new roman', 13, 'bold'))\n",
    "    lbl_name1.grid(row=1, column=0, pady=40, padx=30, sticky=\"W\")\n",
    "    txt_name = Entry(Manage_frame1, font=('times new roman', 13), bd=2,width=10,\n",
    "                     relief=GROOVE)\n",
    "    txt_name.grid(row=1, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "    lbl_name2 = Label(Manage_frame1, text=\"Plan\", fg=\"black\", bg=\"whitesmoke\", font=('times new roman', 13, 'bold'))\n",
    "    lbl_name2.grid(row=2, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name2 = ttk.Combobox(Manage_frame1, font=('times new roman', 13), width=20)\n",
    "    txt_name2['values'] = ('Home_Loan', 'Gold_Loan', 'Cash_Loan')\n",
    "    txt_name2.insert(0, '1. Home_Loan')\n",
    "    txt_name2.grid(row=2, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "\n",
    "    lbl_name3 = Label(Manage_frame1, text=\"Client\", fg=\"black\", bg=\"whitesmoke\", font=('times new roman', 13, 'bold'))\n",
    "    lbl_name3.grid(row=3, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name3 = ttk.Combobox(Manage_frame1, font=('times new roman', 13), width=20)\n",
    "    txt_name3['values'] = ('Shreya', 'Shivangi', 'Simran', 'Surbhi','Sonal','Sunita')\n",
    "    txt_name3.insert(0, 'Shivangi')\n",
    "    txt_name3.grid(row=3, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "\n",
    "    lbl_name4 = Label(Manage_frame1, text=\"Loan Amount\", fg=\"black\", bg=\"whitesmoke\", font=('times new roman', 13, 'bold'))\n",
    "    lbl_name4.grid(row=4, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name4 = Entry(Manage_frame1, font=('times new roman', 13), bd=2,width=20,\n",
    "                     relief=GROOVE)\n",
    "    txt_name4.grid(row=4, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "    lbl_name5 = Label(Manage_frame1, text=\"ID Proof\", fg=\"black\", bg=\"whitesmoke\", font=('times new roman', 13, 'bold'))\n",
    "    lbl_name5.grid(row=5, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name5 = tk.Checkbutton(Manage_frame1, font=('times new roman',0), bd=1,variable=v1,\n",
    "                      relief=GROOVE)\n",
    "    txt_name5.grid(row=5, pady=10, padx=30, column=1,sticky=\"W\")\n",
    "\n",
    "    lbl_name6 = Label(Manage_frame1, text=\"Residence Proof\", fg=\"black\", bg=\"whitesmoke\", font=('times new roman', 13, 'bold'))\n",
    "    lbl_name6.grid(row=6, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name6 =  tk.Checkbutton(Manage_frame1, font=('times new roman',0), bd=1,\n",
    "                      relief=GROOVE)\n",
    "    txt_name6.grid(row=6, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "    lbl_name7 = Label(Manage_frame1, text=\"Income Proof\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 13, 'bold'))\n",
    "    lbl_name7.grid(row=7, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name7 =  tk.Checkbutton(Manage_frame1, font=('times new roman',0), bd=1,variable=v3,\n",
    "                      relief=GROOVE)\n",
    "    txt_name7.grid(row=7, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "    lbl_name8 = Label(Manage_frame1, text=\"Bank Statement\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 13, 'bold'))\n",
    "    lbl_name8.grid(row=8, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "    txt_name8 = tk.Checkbutton(Manage_frame1, font=('times new roman',0), bd=1,variable=v4,\n",
    "                      relief=GROOVE)\n",
    "    txt_name8.grid(row=8, column=1, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "    lbl_name9 = Label(Manage_frame1, text=\"Remarks\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 13, 'bold'))\n",
    "    lbl_name9.grid(row=9, column=0, pady=10, padx=30, sticky=\"W\")\n",
    "\n",
    "    txt_name9 = Entry(Manage_frame1, relief=RIDGE, bg=\"white\", bd=6)\n",
    "    txt_name9.place(x=210, y=440, width=200, height=70)\n",
    "\n",
    "    lbl_name10 = Label(Manage_frame1, text=\"Status\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 13, 'bold'))\n",
    "    lbl_name10.grid(row=10, column=0, pady=30, padx=30, sticky=\"W\")\n",
    "    txt_name10 = Entry(Manage_frame1, font=('times new roman', 13), bd=2, width=13,\n",
    "                      relief=GROOVE)\n",
    "    txt_name10.insert(0,'Approved')\n",
    "    txt_name10.grid(row=10, column=1, pady=45, padx=30, sticky=\"W\")\n",
    "\n",
    "\n",
    "\n",
    "   # ===============================Manage_frame4========================================\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame4, text=\"Loan Amount\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 15, 'bold'))\n",
    "    lbl_name1.place(x=20,y=30)\n",
    "    name1 = Entry(Manage_frame4, font=('times new roman', 15, 'bold'), bd=2, width=18,\n",
    "                      relief=GROOVE)\n",
    "    name1.place(x=230,y=30)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame4, text=\"Rate Of Interest\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 15, 'bold'))\n",
    "    lbl_name1.place(x=430,y=30)\n",
    "    name2 = Entry(Manage_frame4, font=('times new roman', 15, 'bold'), bd=2, width=18,\n",
    "                      relief=GROOVE)\n",
    "    name2.place(x=660,y=30)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame4, text=\"Client Monthly Income\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                     font=('times new roman', 15, 'bold'))\n",
    "    lbl_name1.place(x=20,y=80)\n",
    "    name3 = Entry(Manage_frame4, font=('times new roman', 15, 'bold'), bd=2, width=18,\n",
    "                      relief=GROOVE)\n",
    "    name3.place(x=230,y=80)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame4, text=\"Client Monthly Expenses\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 15, 'bold'))\n",
    "    lbl_name1.place(x=430,y=80)\n",
    "    name4 = Entry(Manage_frame4, font=('times new roman', 15, 'bold'), bd=2, width=18,\n",
    "                      relief=GROOVE)\n",
    "    name4.place(x=660,y=80)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame4, text=\"Number Of years\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                     font=('times new roman', 15, 'bold'))\n",
    "    lbl_name1.place(x=20,y=130)\n",
    "    name5 = Entry(Manage_frame4, font=('times new roman', 15, 'bold'), bd=2, width=18,\n",
    "                      relief=GROOVE)\n",
    "    name5.place(x=230,y=130)\n",
    "\n",
    "    evaluate_btn = Button(Manage_frame4, text=\"Evaluate\", width=18, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                       font=('times new roman', 8, 'bold'),command=evaluate)\n",
    "    evaluate_btn.place(x=480, y=125)\n",
    "\n",
    "    issue_btn = Button(Manage_frame4, text=\"Issue\", width=18, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                          font=('times new roman', 8, 'bold'),command=issue)\n",
    "    issue_btn.place(x=700, y=125)\n",
    "\n",
    "    lbl_name1 = Label(Manage_frame4, text=\"Loan Evaluation Result :\", fg=\"black\", bg=\"whitesmoke\",\n",
    "                      font=('times new roman', 15, 'bold'))\n",
    "    lbl_name1.place(x=20, y=170)\n",
    "\n",
    "\n",
    "    first_btn = Button(Manage_frame3, text=\"First\", width=13, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                        font=('times new roman', 10, 'bold'),command=first)\n",
    "    first_btn.place(x=20, y=10)\n",
    "\n",
    "    previous_btn=Button(Manage_frame3,text=\"Previous\",width=13, pady=5,bg=\"lightcyan\",fg=\"black\",\n",
    "                        bd=5, font=('times new roman', 10, 'bold'),command=previous)\n",
    "    previous_btn.place(x=140,y=10)\n",
    "\n",
    "    next_btn = Button(Manage_frame3, text=\"Next\", width=13, pady=5,bg=\"lightcyan\",fg=\"black\",bd=5,\n",
    "                      font=('times new roman', 10, 'bold'),command=save)\n",
    "    next_btn.place(x=260, y=10)\n",
    "\n",
    "    last_btn = Button(Manage_frame3, text=\"Last\", width=13, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                        font=('times new roman', 10, 'bold'),command=last)\n",
    "    last_btn.place(x=380, y=10)\n",
    "\n",
    "\n",
    "    add_btn = Button(Manage_frame3, text=\"Add\", width=13, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                     font=('times new roman', 10, 'bold'),command=add)\n",
    "    add_btn.place(x=20, y=60)\n",
    "\n",
    "    update_btn = Button(Manage_frame3, text=\"Update\", width=13, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                        font=('times new roman', 10, 'bold'),command=update)\n",
    "    update_btn.place(x=140, y=60)\n",
    "\n",
    "    save_btn = Button(Manage_frame3, text=\"Save\", width=13, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                      font=('times new roman', 10, 'bold'),command=save)\n",
    "    save_btn.place(x=260, y=60)\n",
    "\n",
    "    cancel_btn = Button(Manage_frame3, text=\"Cancel\", width=13, pady=5, bg=\"lightcyan\", fg=\"black\", bd=5,\n",
    "                        font=('times new roman', 10, 'bold'),command=cancel)\n",
    "    cancel_btn.place(x=380, y=60)\n",
    "\n",
    "\n",
    "    mainloop()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
