-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
141 lines (132 loc) · 4.39 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Importing pakages
import streamlit as st
import mysql.connector
from create import create
from database import create_table
from delete import delete
from read import read
from update import update
from func import func
from join import join
from join import join2
from front_query import front_query
from count import count
mydb = mysql.connector.connect(
host="127.0.0.1",
user="root",
password="suyog1131",
port="3306",
database="TMS_PROJECT_PES1UG20CS036",
auth_plugin='mysql_native_password'
)
c = mydb.cursor()
#c.execute("CREATE DATABASE PES1UG20CS036_PROJECT")
c.execute("use TMS_PROJECT_PES1UG20CS036")
def main():
st.title("TRIP IT")
menu = ["Add", "View", "Edit", "Remove","return_due","join","join2","count_customers","front_end_query"]
he=["booking","places","information","customer","feedback","travel_agent"]
choice = st.sidebar.selectbox("action", menu)
table=st.sidebar.selectbox("table", he)
create_table(table)
if choice == "Add":
if table=='booking':
st.subheader("Enter booking Details:")
create(table)
elif table=='customer':
st.subheader("Enter Details:")
create(table)
elif table=='feedback':
st.subheader("Enter Details:")
create(table)
elif table=='places':
st.subheader("Enter Details:")
create(table)
elif table=='information':
st.subheader("Enter Details:")
create(table)
elif table=='travel_agent':
st.subheader("Enter Details:")
create(table)
elif choice == "View":
if table=='booking':
st.subheader("View created tasks")
read(table)
elif table=='customer':
st.subheader("View booking Details:")
read(table)
elif table=='feedback':
st.subheader("View booking Details:")
read(table)
elif table=='places':
st.subheader("View booking Details:")
read(table)
elif table=='information':
st.subheader("View booking Details:")
read(table)
elif table=='travel_agent':
st.subheader("View booking Details:")
read(table)
elif choice == "Edit":
if table=='booking':
st.subheader("Update created tasks")
update(table)
elif table=='customer':
st.subheader("Update created tasks:")
update(table)
elif table=='feedback':
st.subheader("Update created tasks:")
update(table)
elif table=='places':
st.subheader("Update created tasks:")
update(table)
elif table=='information':
st.subheader("Update created tasks:")
update(table)
elif table=='travel_agent':
st.subheader("Update created tasks:")
update(table)
elif choice == "Remove":
if table=='booking':
st.subheader("Delete created tasks")
delete(table)
elif table=='customer':
st.subheader("Delete created tasks:")
delete(table)
elif table=='feedback':
st.subheader("Delete created tasks:")
delete(table)
elif table=='places':
st.subheader("Delete created tasks:")
delete(table)
elif table=='information':
st.subheader("Delete created tasks:")
delete(table)
elif table=='travel_agent':
st.subheader("Delete created tasks:")
delete(table)
elif choice=='return_due':
st.subheader("calculate:")
func()
elif choice=='join':
st.subheader("join table places and information:")
join()
elif choice=='join2':
st.subheader("agent & booking :")
join2()
elif choice=='count_customers':
st.subheader("count:")
count()
# elif choice=='email_list_curs':
# st.subheader("list of emails:")
# cursor()
elif choice=='front_end_query':
st.subheader("enter query")
front_query()
# elif choice=="bookedpackages":
# st.subheader("bookedpackages")
# bookedpackages()
else:
st.subheader("About tasks")
if __name__ == '__main__':
main()