-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
169 lines (167 loc) · 5.72 KB
/
ui.R
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(DT)
library(leaflet)
library(plotly)
ui <- dashboardPage(
skin = "black",
dashboardHeader(
title = span(
icon("plane-departure"),
span("Trip Budget Planner", style = "margin-left: 10px; font-weight: bold")
),
titleWidth = 270
),
dashboardSidebar(
minified = TRUE, collapsed = TRUE,
width = 270,
sidebarMenu(
id = "sidebarMenu",
menuItem("Home", tabName = "home", icon = icon("home")),
menuItem("Results", tabName = "results", icon = icon("chart-bar")),
menuItem("Smart Itinerary Planner", tabName = "itinerary", icon = icon("wand-magic-sparkles")),
menuItem("Hotels", tabName = "hotels", icon = icon("hotel")),
menuItem("Recommendations", tabName = "recommendations", icon = icon("lightbulb"))
)
),
dashboardBody(
tabItems(
tabItem(
tabName = "home",
fluidRow(
column(
width = 12,
offset = 3,
box(
title = "Plan Your Trip",
solidHeader = TRUE,
textInput("location", "Your Location:", placeholder = "Enter your location"),
textInput("destination", "Travel Destination:", placeholder = "Enter your destination"),
dateInput("arrival_date", "Arrival Date:", value = Sys.Date(), min = Sys.Date()),
dateInput("departure_date", "Departure Date:", value = Sys.Date() + 1, min = Sys.Date() + 1),
numericInput("native_budget", "Total Budget (Native Currency):", value = 1000, min = 0),
# textInput("native_currency", "Native Currency Code (e.g., USD, EUR):", value = "USD"),
# numericInput("native_amount", "Amount in Native Currency:", value = 1000, min = 0),
actionButton("goToResults", strong("Go to Results"), class = "btn btn-secondary")
)
)
)
),
tabItem(
tabName = "results",
fluidRow(
column(
width = 9,
wellPanel(
h4("Overview"),
p(strong("Total Budget:"), textOutput("total_budget_display")),
p(strong("Total Expenses:"), textOutput("total_expenses_display")),
p(strong("Remaining Budget:"), textOutput("remaining_budget_display")),
p(strong("Biggest Spending Category:"), textOutput("biggest_spending_display")),
p(strong("Weather Forecast:"), textOutput("weather_display"), plotlyOutput("temp_forecast"))
)
),
column(
width = 3,
wellPanel(
h4("Currency Conversion"),
p("Native Currency Amount:"),
textOutput("native_amount_display"),
p("Converted Amount in Destination Currency:"),
textOutput("converted_amount_display")
),
wellPanel(
h4("Recommendations"),
uiOutput("overview_recommendations")
)
)
),
fluidRow(
column(
width = 12,
wellPanel(
h4("Expense Tracker"),
sidebarLayout(
sidebarPanel(
textInput("item", "Enter Item Name:", ""),
numericInput("budget", "Enter Budget:", value = 0, min = 0),
actionButton("submit_expense", "Submit Expense", class = "btn btn-secondary"),
actionButton("clear_expenses", "Clear All Expenses", class = "btn btn-danger"),
hr(),
tableOutput("expense_table")
),
mainPanel(
plotOutput("expense_pie"),
downloadButton("download", "Download Expenses")
)
)
)
)
)
),
tabItem(
tabName = "itinerary",
fluidRow(
column(
width = 4,
box(
title = "Generate Itinerary",
solidHeader = TRUE,
status = "navy",
actionButton("generate_itinerary", "Generate Itinerary", class = "btn btn-secondary")
)
),
column(
width = 8,
box(
title = "Generated Itinerary",
solidHeader = TRUE,
status = "info",
uiOutput("formatted_itinerary")
)
)
)
),
tabItem(
tabName = "hotels",
fluidRow(
column(
width = 4,
box(
title = "Find Hotels",
solidHeader = TRUE,
p("Hotels will be searched using your travel destination."),
actionButton("update_hotels", "Search Hotels", class = "btn btn-secondary")
)
),
column(
width = 8,
leafletOutput("hotel_map", height = 400),
br(),
DT::dataTableOutput("hotel_table")
)
)
),
tabItem(
tabName = "recommendations",
fluidRow(
box(
title = "Spending Breakdown",
width = 12,
plotOutput("spending_bar_chart", height = "400px")
),
box(
title = "Recommendations",
width = 12,
tabsetPanel(
tabPanel("Places to Visit", uiOutput("cheap_destinations_map")),
tabPanel("Cheaper Transport", dataTableOutput("cheap_transport_table"))
)
)
)
)
)
),
options = list(sidebarExpandOnHover = TRUE)
)