from tkinter import *
from tkinter import messagebox
from tkinter import ttk
import sys
import tkinter as tk
import os
#from tkinter import config
from tkinter import Tk, Frame, Menu
import sqlite3
window = Tk()
#=========================================================================================================
tab_control = ttk.Notebook(window,width='1200',height='2000')
tab_control.place(x=150,y=10)

tab1 = ttk.Frame(tab_control)
tab2 = ttk.Frame(tab_control)
tab3 = ttk.Frame(tab_control)
tab4 = ttk.Frame(tab_control)
tab5 = ttk.Frame(tab_control)
tab6 = ttk.Frame(tab_control)

line1=tab_control.add(tab1, text='Home                                    ')
line1=Frame(tab1,bg='light green', width=2050, height=1000) 
line1.place(x=1, y=10)
line2=tab_control.add(tab2, text='About Us                    ')
line2=Frame(tab2,bg='light blue', width=2050, height=1000) 
line2.place(x=1, y=10)
line3=tab_control.add(tab3, text='Services Available                                 ')
line3=Frame(tab3,bg='light blue', width=2050, height=1000) 
line3.place(x=1, y=10)
line4=tab_control.add(tab4, text='Room Services                            ')
line4=Frame(tab4,bg='light blue', width=2050, height=1000) 
line4.place(x=1, y=10)
line5=tab_control.add(tab5, text='Restuarant Services                                 ')
line5=Frame(tab5,bg='light blue', width=2050, height=1000) 
line5.place(x=1, y=10)
line6=tab_control.add(tab6, text='Booking                          ')
line6=Frame(tab6,bg='light blue', width=2050, height=1000) 
line6.place(x=1, y=10)
#====================================================================tab 1 start===================================
start1=Label(tab1,text='WELCOME TO SKYLITE HOTEL!!',width="30",height=1,bg="light blue",fg="purple",font=("lucida calligraphy",30))
start1.place(x=100,y=30)

imagehome=PhotoImage(file="image8.png")
Ftab1=Label(tab1,image=imagehome)
Ftab1.place(x=100,y=100)

#=======================================tab2 start===============================================================
start2=Label(tab2,text='Welcome to Skylite Hotel \nThe ultimate place for you and your loved ones,\n come relax and have fun out of home',bg="light blue",font=("lucida calligraphy",20))
start2.place(x=100,y=10)

image2home=PhotoImage(file="image7.png")
Ftab2=Label(tab2,image=image2home)
Ftab2.place(x=100,y=120)

Htab2= Label(tab2, text="Location:",  fg='darkblue',bg="white", font=('lucida calligraphy', 14))
Htab2.place(x=100, y=530)
Htab2 = Label(tab2, text="Skylite Hotel is located opposite Centinary Bank Main Branch in Kampala",  fg='darkblue',bg="white", font=('lucida calligraphy', 12))
Htab2.place(x=250, y=530)



Htab2= Label(tab2, text="Contact Us On:",  fg='darkblue',bg="white", font=('times new roman', 14))
Htab2.place(x=100, y=610)
Htab2 = Label(tab2, text="+256 756522695", fg='black',bg="white", font=('times new roman', 12))
Htab2.place(x=225, y=610)
Htab2= Label(tab2, text="+256 786813872", fg='black',bg="white", font=('times new roman', 12))
Htab2.place(x=225, y=640)

Htab2 = Label(tab2, text="E-mail:",  fg='darkblue',bg="white", font=('times new roman', 14))
Htab2.place(x=350, y=610)

Htab2 = Label(tab2, text="skylitehotel.org.ug",  fg='black',bg="white", font=('times new roman', 12))
Htab2.place(x=420, y=610)

Htab2 =Label(tab2,text="skylitehotel@gmail.com",fg='black',bg="white",font=('times new roman',12))
Htab2.place(x=420, y=640)

Htab2 = Label(tab2, text="Media:",  fg='darkblue',bg="white", font=('times new roman', 14))
Htab2.place(x=620, y=610)

Htab2 = Label(tab2, text="YouTube",  fg='black',bg="white", font=('times new roman', 12))
Htab2.place(x=680, y=640)
Htab2= Label(tab2,text="Twitter  @skylitehotel",  fg='black',bg="white", font=('times new roman', 12))
Htab2.place(x=750, y=610)
Htab2 = Label(tab2,text="Instagram @skylitehotel",  fg='black',bg="white", font=('times new roman', 12))
Htab2.place(x=750, y=640)
imagelhome=PhotoImage(file="log.png")
Ltab2=Label(tab2,image=imagelhome)
Ltab2.place(x=920,y=520)

start3=Label(tab3,text='Services Available',bg="light blue",font=("lucida calligraphy",20))
start3.place(x=400,y=10)
Jtab3=Label(tab3,text='Room Services',font=('calbri 17 bold'),bg='light blue',fg='black',width=20)
Jtab3.place(x=90,y=50)
image5home=PhotoImage(file="room 1.png")
Jtab3=Label(tab3,image=image5home)
Jtab3.place(x=10,y=80)
image4home=PhotoImage(file="room1.png")
Jtab3=Label(tab3,image=image4home)
Jtab3.place(x=10,y=270)
image6home=PhotoImage(file="Rm1.png")
Jtab3=Label(tab3,image=image6home)
Jtab3.place(x=10,y=448)
image7home=PhotoImage(file="rm9.png")
Jtab3=Label(tab3,image=image7home)
Jtab3.place(x=285,y=80)
image8home=PhotoImage(file="rm8.png")
Jtab3=Label(tab3,image=image8home)
Jtab3.place(x=285,y=266)
image9home=PhotoImage(file="rm10.png")
Jtab3=Label(tab3,image=image9home)
Jtab3.place(x=285,y=448)

Jtab3=Label(tab3,text=' Restuarant Services',font=('calbri 15 bold'),bg='light blue',fg='black',width=20)
Jtab3.place(x=700,y=50)
image10home=PhotoImage(file="food1.png")
Jtab3=Label(tab3,image=image10home)
Jtab3.place(x=670,y=80)
image11home=PhotoImage(file="food2.png")
Jtab3=Label(tab3,image=image11home)
Jtab3.place(x=670,y=250)
image12home=PhotoImage(file="food5.png")
Jtab3=Label(tab3,image=image12home)
Jtab3.place(x=930,y=80)
image13home=PhotoImage(file="food4.png")
Jtab3=Label(tab3,image=image13home)
Jtab3.place(x=940,y=250)
image14home=PhotoImage(file="food3.png")
Jtab3=Label(tab3,image=image14home)
Jtab3.place(x=670,y=430)
image15home=PhotoImage(file="fd6.png")
Jtab3=Label(tab3,image=image15home)
Jtab3.place(x=930,y=440)
#=================================================single==================================
Mtab4=Label(tab4,text='Room Category',font=('calbri 15 bold'),bg='light blue',fg='black',width=20)
Mtab4.place(x=10,y=20)
Mtab4=Label(tab4,text='Single',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=10,y=60)
Mtab4=Label(tab4,text='No.1',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=20,y=90)
Mtab4=Label(tab4,text='No.2',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=310,y=90)
Mtab4=Label(tab4,text='No.3',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=600,y=90)
Mtab4=Label(tab4,text='No.4',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=840,y=90)
Mtab4=Label(tab4,text='Price @day',font=('calbri 15 bold'),bg='light blue',fg='black',width=20)
Mtab4.place(x=700,y=20)
Mtab4=Label(tab4,text='50,000Ugx',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=700,y=60)
image16home=PhotoImage(file="Rm1.png")
Jtab4=Label(tab4,image=image16home)
Jtab4.place(x=20,y=120)
image17home=PhotoImage(file="Rm2.png")
Jtab4=Label(tab4,image=image17home)
Jtab4.place(x=310,y=120)
image1home=PhotoImage(file="Rm3.png")
Jtab4=Label(tab4,image=image1home)
Jtab4.place(x=600,y=120)
image18home=PhotoImage(file="Rmm.png")
Jtab4=Label(tab4,image=image18home)
Jtab4.place(x=840,y=120)
#=================================================double==========================================
Mtab4=Label(tab4,text='Room Category',font=('calbri 15 bold'),bg='light blue',fg='black',width=20)
Mtab4.place(x=10,y=300)
Mtab4=Label(tab4,text='Double',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=10,y=330)
Mtab4=Label(tab4,text='Price @day',font=('calbri 15 bold'),bg='light blue',fg='black',width=20)
Mtab4.place(x=700,y=300)
Mtab4=Label(tab4,text='100,000Ugx',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=700,y=330)
Mtab4=Label(tab4,text='No.5',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=20,y=360)
Mtab4=Label(tab4,text='No.6',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=310,y=360)
Mtab4=Label(tab4,text='No.7',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=600,y=360)
Mtab4=Label(tab4,text='No.8',font=('calbri 15 bold '),bg='light blue',fg='red',width=20)
Mtab4.place(x=840,y=360)
image20home=PhotoImage(file="db1.png")
Jtab4=Label(tab4,image=image20home)
Jtab4.place(x=20,y=390)
image29home=PhotoImage(file="db2.png")
Jtab4=Label(tab4,image=image29home)
Jtab4.place(x=300,y=390)
image22home=PhotoImage(file="db3.png")
Jtab4=Label(tab4,image=image22home)
Jtab4.place(x=590,y=390)
image23home=PhotoImage(file="db4.png")
Jtab4=Label(tab4,image=image23home)
Jtab4.place(x=865,y=390)
#==============================Resturant Services============================
Mtab5=Label(tab5,text='Menu',font=('lucida calligraphy',25 ,'bold'),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=310,y=10)
Mtab5=Label(tab5,text='Item',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=10,y=50)
Mtab5=Label(tab5,text='Price',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=700,y=50)
Mtab5=Label(tab5,text='Pork',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=10,y=100)
image21home=PhotoImage(file="R1.png")
Jtab5=Label(tab5,image=image21home)
Jtab5.place(x=350,y=70)
Mtab5=Label(tab5,text='30000Ugx',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=700,y=100)
Mtab5=Label(tab5,text='Fish',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=10,y=200)
image28home=PhotoImage(file="R2.png")
Jtab5=Label(tab5,image=image28home)
Jtab5.place(x=350,y=160)
Mtab5=Label(tab5,text='25000Ugx',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=700,y=160)
Mtab5=Label(tab5,text='Goats Meat',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=10,y=300)
image26home=PhotoImage(file="R3.png")
Jtab5=Label(tab5,image=image26home)
Jtab5.place(x=350,y=265)
Mtab5=Label(tab5,text='30000Ugx',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=700,y=260)
Mtab5=Label(tab5,text='Snacks',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=10,y=400)
image27home=PhotoImage(file="R4.png")
Jtab5=Label(tab5,image=image27home)
Jtab5.place(x=350,y=370)
Mtab5=Label(tab5,text='15000Ugx',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=700,y=370)
Mtab5=Label(tab5,text='Pizza',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=10,y=500)
image25home=PhotoImage(file="R5.png")
Jtab5=Label(tab5,image=image25home)
Jtab5.place(x=350,y=470)
Mtab5=Label(tab5,text='20000Ugx',font=('calbri 15 bold' ),bg='light blue' ,fg='black',width=20)
Mtab5.place(x=700,y=470)


Ref=StringVar()
Firstname=StringVar()
Surname =StringVar()
Address =StringVar()
Mobile=StringVar()
Email=StringVar()
Nationality =StringVar()
DOB =StringVar()
IDType=StringVar()
Gender=StringVar()
CheckInDate =StringVar()
CheckOutDate=StringVar()
Meal =StringVar()
RoomCategory=StringVar()
RoomNo =StringVar()
ModeOfPayment =StringVar()

def database():
    Ref=Ref.get()
    Firstname=Firstname.get()
    Surname=Surname.get()
    number=PhoneNumber.get()
    Address =Address.get()
    Mobile=Mobile.get()
    Email=Email.get()
    Nationality=Nationality.get()
    DOB=DOB.get()
    IDType=IDType.get()
    Gender=Gender.get()
    CheckInDate=CheckInDate.get()
    CheckOutDate=CheckOutDate.get()
    Meal=Meal.get()
    RoomCategory=RoomCategory.get()
    RoomNo =RoomNo.get()
    ModeOfPayment=ModeOfPayment.get()
    conn=sqlite3.connect('Form.db')
    with conn:
        cursor=conn.cursor()
    cursor.execute('CREATE TABLE IF NOT EXISTS customers(Ref TEXT,FirstnameTEXT,Surname TEXT,Address TEXT,Mobile TEXT,Email TEXT,Nationality TEXT,DOB TEXT,Gender TEXT,IDType TEXT,CheckInDate TEXT,CheckOutDate TEXT,Meal TEXT,RoomCategory TEXT,RoomNo TEXT,ModeOfPayment TEXT)')
    cursor.execute('INSERT INTO customers(Ref,Firstname,Surname,Address,Mobile, Email,Nationality,DOB,Gender,IDType,CheckInDate,CheckOutDate,Meal,RoomCategory,RoomNo,ModeOfPayment) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',(Ref,Firstname,Surname,Address,Mobile, Email,Nationality,DOB,Gender,IDType,CheckInDate,CheckOutDate,Meal,RoomCategory,RoomNo,ModeOfPayment))
    conn.commit()

    cursor.execute('select * from customers where Mobile=Mobile')
    print(cursor.fetchall())


label1=Label(tab6,text='Ref:',width=20,bg='light blue',fg='black',font=('Calibri light',15))
label1.place(x=10,y=30)
entry1=Entry(tab6,textvar=Ref,width=20)
entry1.place(x=150,y=25)

label3=Label(tab6,text='Firstname:',width=20,bg='light blue',fg='black',font=('Calibri light',15))
label3.place(x=360,y=30)
entry3=Entry(tab6,textvar=Firstname,width=20)
entry3.place(x=460,y=25)

mlabel5=Label(tab6,text='Surname:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel5.place(x=800,y=20)
mEntry5=Entry(tab6,textvariable=Surname,width=20)
mEntry5.place(x=900,y=15)

mlabel6=Label(tab6,text='Address:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel6.place(x=10,y=90)
mEntry6=Entry(tab6,textvariable=Address,width=20)
mEntry6.place(x=150,y=85)

mlabel7=Label(tab6,text='Mobile:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel7.place(x=380,y=90)
mEntry7=Entry(tab6,textvariable=Mobile,width=20)
mEntry7.place(x=460,y=85)

mlabel8=Label(tab6,text='Email:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel8.place(x=800,y=90)
mEntry8=Entry(tab6,textvariable=Email,width=20)
mEntry8.place(x=880,y=85)

mlabel9=Label(tab6,text='Nationality:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel9.place(x=10,y=150)
mEntry9=Entry(tab6,textvariable=Nationality,width=20)
mEntry9.place(x=150,y=155)

mlabel10=Label(tab6,text='DOB:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel10.place(x=380,y=150)
mEntry10=Entry(tab6,textvariable=DOB,width=20)
mEntry10.place(x=450,y=150)

mlabel11=Label(tab3,text='IDType:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel11.place(x=800,y=150)
list1=['Student ID','Driver Licence','Passport','Pilot Licence'];
drop=OptionMenu(tab3,IDType,*list1)
drop.config(width=15)
IDType.set('Choose IDType')
drop.place(x=900,y=150)

mlabel12=Label(tab6,text='Gender:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel12.place(x=80,y=210)
mEntry12=Entry(tab6,textvariable=Gender,width=20)
mEntry12.place(x=180,y=210)

mlabel13=Label(tab6,text='CheckInDate:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel13.place(x=380,y=210)
mEntry13=Entry(tab6,textvariable=CheckInDate,width=20)
mEntry13.place(x=500,y=210)

mlabel14=Label(tab6,text='CheckOutDate:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel14.place(x=800,y=210)
mEntry14=Entry(tab6,textvariable=CheckOutDate,width=20)
mEntry14.place(x=940,y=210)

mlabel15=Label(tab6,text='Meal:',width=18,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel15.place(x=80,y=270)
mEntry15=Entry(tab6,textvariable=Meal,width=20)
mEntry15.place(x=180,y=270)

mlabel16=Label(tab6,text='RoomCategory:',width=15,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel16.place(x=380,y=270)
listh=['Single','Double'];
d=StringVar()
drop=OptionMenu(tab6,RoomCategory,*listh)
drop.config(width=20)
RoomCategory.set('Choose Room')
drop.place(x=530,y=270)

mlabel17=Label(tab6,text='RoomNo:',width=15,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel17.place(x=380,y=270)
listh=['1','2','3','4','5','6','7','8'];
d=StringVar()
drop=OptionMenu(tab6,RoomNo,*listh)
drop.config(width=20)
RoomNo.set('Choose RoomNo')
drop.place(x=530,y=270)

mlabel6=Label(tab6,text='ModeOfPayment:',width=15,height=1,bg="light blue",fg="black",font=("Calibri light",15))
mlabel6.place(x=10,y=330)
listk=['Cash','Cheque'];
d=StringVar()
drop=OptionMenu(tab6,ModeOfPayment,*listk)
drop.config(width=20)
RoomNo.set('Choose RoomNo')
drop.place(x=160,y=330)

but=Button(tab6,padx=2,pady=2,text='Submit',command=database,font=('none 13 bold'))
but.place(x=780,y=330)



mainloop()
