-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtnscript.js
25 lines (20 loc) · 1.01 KB
/
btnscript.js
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
function btnprenota(button) {
// Ottieni la cella padre del pulsante
var cella = button.parentNode;
// Estrai gli attributi slotora e slotdata
var slotOra = cella.getAttribute("slotora");
var slotData = cella.getAttribute("slotdata");
// Crea il messaggio di conferma
var messaggio = "Vuoi prenotare la " + slotOra + "ª ora del " + slotData + "?";
// Mostra il messaggio di conferma
if (confirm(messaggio)) {
// URL del deployment della tua applicazione web (modifica con il tuo URL reale)
var baseURL = "https://script.google.com/a/macros/isufol.it/s/AKfycbzw2cU0E6IBMqBw7FiBSP34Ti3nc2AsE3ZzT22FUzdsqnF7C2ewhxJIUlMprzR_Hl7S/exec";
// Aggiungi i parametri alla URL
var url = baseURL + "?slotOra=" + encodeURIComponent(slotOra) + "&slotData=" + encodeURIComponent(slotData);
// Reindirizza l'utente alla nuova pagina HTML servita da Apps Script
window.location.href = url;
} else {
alert("Prenotazione annullata.");
}
}