rimasalshehri commited on
Commit
65541a7
·
verified ·
1 Parent(s): 2b0df82

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +120 -0
app.py ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_option_menu import option_menu
3
+ import pandas as pd
4
+
5
+ def main():
6
+ # Custom CSS
7
+ st.markdown(
8
+ """
9
+ <style>
10
+ .stApp {
11
+ background-color: #E4ECE3;
12
+ }
13
+ header {
14
+ display: flex;
15
+ justify-content: space-between;
16
+ }
17
+ .translation {
18
+ float: right;
19
+ }
20
+ </style>
21
+ """,
22
+ unsafe_allow_html=True,
23
+ )
24
+
25
+ # Sidebar for navigation
26
+ page = option_menu(
27
+ "Navigation",
28
+ ["Login", "Info & FAQ"],
29
+ icons=["key", "info-circle"],
30
+ menu_icon="cast",
31
+ default_index=0,
32
+ orientation="horizontal",
33
+ )
34
+
35
+ if page == "Login":
36
+ login_page()
37
+ elif page == "Info & FAQ":
38
+ faq_info_page()
39
+
40
+
41
+ def login_page():
42
+ st.image("logo.png", width=200)
43
+ st.title("Login Page")
44
+
45
+ user_id = st.text_input("User ID")
46
+ password = st.text_input("Password", type="password")
47
+
48
+ if st.button("Login"):
49
+ if user_id and password:
50
+ if user_id.startswith("manager"):
51
+ manager_dashboard()
52
+ elif user_id.startswith("employee"):
53
+ employee_page()
54
+ else:
55
+ user_page()
56
+ else:
57
+ st.error("Please enter valid login credentials.")
58
+
59
+
60
+ def user_page():
61
+ st.title("User Dashboard")
62
+ action = st.radio("Choose an action:", ["Submit a Ticket", "Check Ticket Status"])
63
+
64
+ if action == "Submit a Ticket":
65
+ submit_ticket_page()
66
+ elif action == "Check Ticket Status":
67
+ check_ticket_status_page()
68
+
69
+
70
+ def manager_dashboard():
71
+ st.title("Manager Dashboard")
72
+ st.write("Here is the manager-specific content.")
73
+
74
+
75
+ def employee_page():
76
+ st.title("Employee Page")
77
+ st.write("View and respond to tickets here.")
78
+
79
+
80
+ def submit_ticket_page():
81
+ st.image("logo.png", width=200)
82
+ st.markdown("<h1>Submit a Ticket</h1>", unsafe_allow_html=True)
83
+
84
+ with st.form("submit_ticket_form"):
85
+ st.text_input("First Name")
86
+ st.text_input("Last Name")
87
+ st.text_input("National ID")
88
+ st.text_input("Email")
89
+ st.text_area("Describe your issue")
90
+ submitted = st.form_submit_button("Submit")
91
+ if submitted:
92
+ st.success("Ticket submitted successfully.")
93
+
94
+
95
+ def check_ticket_status_page():
96
+ st.image("logo.png", width=200)
97
+ st.title("Check Ticket Status")
98
+ ticket_id = st.text_input("Enter your ticket ID")
99
+ if st.button("Check Status"):
100
+ if ticket_id:
101
+ st.write(f"Status for Ticket {ticket_id}: Pending")
102
+ else:
103
+ st.error("Please enter a valid ticket ID.")
104
+
105
+
106
+ def faq_info_page():
107
+ st.title("FAQ & Information")
108
+ faqs = [
109
+ ("How to open an account?", "Visit the nearest branch or use our app."),
110
+ ("Operating hours?", "Sunday to Thursday, 9:00 AM to 4:00 PM."),
111
+ ("Update info?", "Update at a branch or through the app."),
112
+ ]
113
+
114
+ for question, answer in faqs:
115
+ st.subheader(question)
116
+ st.write(answer)
117
+
118
+
119
+ if __name__ == "__main__":
120
+ main()