-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoll.R
61 lines (53 loc) · 1.31 KB
/
poll.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
poll_ui <- function(id) {
ns <- NS(id)
tagList(
fluidRow(
column(
width = 6,
numericInput(ns("clients"), "Numer of clients:", value = 0),
dateInput(ns("date"), "Date:", format="dd-mm-yyyy")
),
column(
width = 6,
selectizeInput(
ns("LunDin"),
"Lunch vs Dinner:",
choices = c("Lunch", "Dinner")),
textAreaInput(
ns("comments"),
width = "100%",
label = "Comments"
),
actionButton(ns("submit"), "Submit")
)
)
)
}
poll_server <- function(id) {
moduleServer(
id = id,
module = function(input, output, session) {
observeEvent(input$submit, {
clients <- input$clients
date <- input$date
LunDin <- input$LunDin
comments <- input$comments
time <- Sys.time()
url <- db_url
future({
upload_row(
x = list(
"clients" = clients,
"date" = date,
"LunDin" = LunDin,
"comments" = comments,
"time" = time
),
projectURL = url,
fileName = "polls"
)
})
})
}
)
}